Search Results

Search found 27312 results on 1093 pages for 'javascript execution'.

Page 2/1093 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Web Page Execution Internals

    - by octopusgrabbus
    My question is what is the subject area that covers web page execution/loading. I am looking to purchase a book by subject area that covers when things execute or load in a web page, whether it's straight html, html and Javascript, or a PHP page. Is that topic covered by a detailed html book, or should I expect to find information like that in a JavaScript of PHP book? I understand that PHP and Perl execute on the server and that Javascript is client side, and I know there is a lot of on-line documentation describing <html>, <head>, <body>, and so on. I'm just wondering what subject area a book would be in to cover all that, not a discussion of the best book or someone's favorite book, but the subject area.

    Read the article

  • Same query, different execution plans

    - by A..
    Hi, I am trying to find a solution for a problem that is driving me mad... I have a query which runs very fast in a QA Server but it is very slow in production. I realised that they have different execution plans... so I have try recompiling, cleanning the cache for the execution plans, update statistics, check the type of collation... but I still can't find what's going on... The databases where the query is running are exactly the same and the SQL Servers have also the same configuration. Any new ideas would be much appreciated. Thanks, A.

    Read the article

  • stop javascript execution

    - by alemjerus
    When I run javascript script file in windows command line environment, and there is a free text coming after my code. How can I stop javascript interpreter to run into it? For example: var fso = new ActiveXObject("Scription.FileSystemObject"); delete fso; exit(); // some kind of WORKING exit command Lazy frog ate a big brown fox.

    Read the article

  • What should be tested in Javascript?

    - by Nathan Hoad
    At work, we've just started on a heavily Javascript based application (actually using Coffeescript, but still), of which I've been implementing an automated test system using JsTestDriver and fabric. We've never written something with this much Javascript, so up until now we've never done any Javascript testing. I'm unsure what exactly we should be testing in our unit tests. We've written JQuery plugins for various things, so it's quite obvious that they should be verified for correctness as much as possible with JsTestDriver, but everyone else in my team seems to think that we should be testing the page level Javascript as well. I don't think we should be testing page level Javascript as unit tests, but instead using a system like Selenium to verify everything works as expected. My main reasoning for this is that at the moment, page level Javascript tests are guaranteed to fail through JsTestDriver, because they're trying to access elements on the DOM that can't possibly exist. So, what should be unit tested in Javascript?

    Read the article

  • "Phased" execution of functions in javascript

    - by FK82
    Hey there! This is my first post on stackoverflow, so please don't flame me too hard if I come across like a total nitwit or if I'm unable ot make myself perfectly clear. :-) Here's my problem: I'm trying to write a javascript function that "ties" two functions to another by checking the first one's completion and then executing the second one. The easy solution to this obviously would be to write a meta function that calls both functions within it's scope. However, if the first function is asynchronous (specifically an AJAX call) and the second function requires the first one's result data, that simply won't work. My idea for a solution was to give the first function a "flag", i.e. making it create a public property "this.trigger" (initialized as "0", set to "1" upon completion) once it is called; doing that should make it possible for another function to check the flag for its value ([0,1]). If the condition is met ("trigger == 1") the second function should get called. The following is an abstract example code that I have used for testing: <script type="text/javascript" > /**/function cllFnc(tgt) { //!! first function this.trigger = 0 ; var trigger = this.trigger ; var _tgt = document.getElementById(tgt) ; //!! changes the color of the target div to signalize the function's execution _tgt.style.background = '#66f' ; alert('Calling! ...') ; setTimeout(function() { //!! in place of an AJAX call, duration 5000ms trigger = 1 ; },5000) ; } /**/function rcvFnc(tgt) { //!! second function that should get called upon the first function's completion var _tgt = document.getElementById(tgt) ; //!! changes color of the target div to signalize the function's execution _tgt.style.background = '#f63' ; alert('... Someone picked up!') ; } /**/function callCheck(obj) { //alert(obj.trigger ) ; //!! correctly returns initial "0" if(obj.trigger == 1) { //!! here's the problem: trigger never receives change from function on success and thus function two never fires alert('trigger is one') ; return true ; } else if(obj.trigger == 0) { return false ; } } /**/function tieExc(fncA,fncB,prms) { if(fncA == 'cllFnc') { var objA = new cllFnc(prms) ; alert(typeof objA + '\n' + objA.trigger) ; //!! returns expected values "object" and "0" } //room for more case definitions var myItv = window.setInterval(function() { document.getElementById(prms).innerHTML = new Date() ; //!! displays date in target div to signalize the interval increments var myCallCheck = new callCheck(objA) ; if( myCallCheck == true ) { if(fncB == 'rcvFnc') { var objB = new rcvFnc(prms) ; } //room for more case definitions window.clearInterval(myItv) ; } else if( myCallCheck == false ) { return ; } },500) ; } </script> The HTML part for testing: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/strict.dtd > <html> <head> <script type="text/javascript" > <!-- see above --> </script> <title> Test page </title> </head> <body> <!-- !! testing area --> <div id='target' style='float:left ; height:6em ; width:8em ; padding:0.1em 0 0 0; font-size:5em ; text-align:center ; font-weight:bold ; color:#eee ; background:#fff;border:0.1em solid #555 ; -webkit-border-radius:0.5em ;' > Test Div </div> <div style="float:left;" > <input type="button" value="tie calls" onmousedown="tieExc('cllFnc','rcvFnc','target') ;" /> </div> <body> </html> I'm pretty sure that this is some issue with javascript scope as I have checked whether the trigger gets set to "1" correctly and it does. Very likely the "checkCall()" function does not receive the updated object but instead only checks its old instance which obviously never flags completion by setting "this.trigger" to "1". If so I don't know how to address that issue. Anyway, hope someone has an idea or experience with this particular kind of problem. Thanks for reading! FK

    Read the article

  • Why not use JavaScript but libraries instead?

    - by shareef
    I read this article Unobtrusive JavaScript with jQuery and I noticed these points in the slide page 11 some companies strip JavaScript at the firewall some run the NoScript Firefox extension to protect themselves from common XSS and CSRF attacks many mobile devices ignore JavaScript entirely screen readers do execute JavaScript but accessibility issues mean you may not want them to I did not understand the fourth point. What does it mean? I need your comment and responses on these points. Is not using JavaScript and switching to libraries like jQuery worth it?

    Read the article

  • Value Chain Execution E-Book

    - by John Murphy
    Taking a smart approach to logistics – from streamlining transport networks and global trade management, to optimizing everyday warehouse operations – can simultaneously reduce costs and maximize competitive advantage.Download your exclusive Oracle e-book, Oracle Value Chain Execution: Reinventing Logistics Excellence, to learn why our world-leading, unified solution is relied on by market-leading companies across the planet.Discover how it can help you: Drive business agility, scalability and innovation Reduce costs and increase efficiency Enhance visibility, productivity and inventory accuracy Simplify compliance and mitigate risk Measure and boost customer satisfaction See what reinventing logistics excellence could mean for your organization.

    Read the article

  • What is JavaScript, really?

    - by Lord Loh.
    All this started when I was looking for a way to test my webpage for JavaScript conformance like the W3C HTML Validator. I have not found one yet. So let me know if you know of any... I looked for the official JavaScript page and find ECMA Script. These people have standardized a scripting language (I do not feel like calling it JavaScript anymore!) and called it ECMA-262 (Wikipedia). Their latest work is Edition 5.1 JavaScript was developed my Mozilla Corporation and their last stable version is 1.8.5 (see this) which is based on the ECMA's edition 5.1 The Wikipedia page linked mentions dialects. Mozilla's JavaScript 1.8.5 is listed as a dialect along with JScript 9 (IE) and JavaScript (Chrome's V8[Wiki]) and a lot others. Am I to understand that JavaScript 1.8.5 is a derivative of the ECMA-262 and SpiderMonkey[Wiki] is an engine that runs it? And Chrome has its own dialect and V8 engine is the program that runs it? With all these dialects based off ECMA-262, what I can no longer understand is "What is JavaScript"? Are there any truly cross browser scripting languages? Do the various implementers come together to agree on the dialect cross compatibility? Is this effort ECMA?

    Read the article

  • Table alias has an effect with execution time?

    - by RedFux227
    So I have this query : SELECT A.e_cd "INFLATE" , A.ccgpt "1" , ( SELECT J.comp FROM JBB J WHERE J.e_cd=A.e_cd AND emplo_RCD=:1 AND J.Dte = ( SELECT MAX(J1.Dte) FROM JBB J1 WHERE J.e_cd=J1.e_cd AND TO_CHAR(J1.Dte,'MM') <=A.mth_to AND TO_CHAR(J1.Dte,'YYYY') <=A.year ) AND J.seq = ( SELECT MAX(J2.seq) FROM PS_JOB J2 WHERE J2.e_cd=J.e_cd AND J2.Dte=J.Dte)) "Company" FROM PPS A WHERE orcd=:2 AND rcd=:3 AND tx_cd=:4 AND year=:5 With this one : SELECT A.e_cd "INFLATE" , A.ccgpt "1" , ( SELECT J.comp FROM JBB J WHERE J.e_cd=A.e_cd AND emplo_RCD=:1 AND J.Dte = ( SELECT MAX(J1.Dte) FROM JBB J1 WHERE J.e_cd=J1.e_cd AND TO_CHAR(J1.Dte,'MM') <=A.mth_to AND TO_CHAR(J1.Dte,'YYYY') <=A.year ) AND J.seq = ( SELECT MAX(J1.seq) **FROM PS_JOB J1 WHERE J1.e_cd=J.e_cd AND J1.Dte=J.Dte**)) "Company" FROM PPS A WHERE orcd=:2 AND rcd=:3 AND tx_cd=:4 AND year=:5 The 1st query run for about 3.20 sec with buffer gets 8,134 and for the 2nd query it run for about 1.73 sec with buffer gets 7,006. So, is the table alias somehow has an impact on the execution time / buffer gets? Thanks in advance!

    Read the article

  • Javascript Implementation Patterns for Server-side MVC Websites

    - by tmo256
    I'm looking for information on common patterns for initializing and executing Javascript page by page in a "traditional" server-side MVC website architecture. A few months ago, my development team began, but abandoned, a major re-architecture of our company's primary web app, including a full front-end redesign. In the process, there was some debate about the architecture of the Javascript in the current version of the site, and whether it fit into a clear, modern design pattern. Now I've returned to the process of overhauling the front end of this and several other MVC websites (Ruby on Rails and MVC.net) to implement a responsive framework (Bootstrap), and in the process will again need to review then revamp and update a lot of Javascript. These web applications are NOT single-page Javascript applications (in fact, we are ripping out a lot of Ajax) or designed to require a Javascript MVC pattern; these apps are basically brochure, catalog and administrative sites that follow a server-side MVC pattern. The vast majority of the Javascript required is behavioral, pre-built plugins (JQuery and Bootstrap, et al) that execute on specific DOM nodes. I'm going to give a very brief (as brief as I can be) run-down of the current architecture only in order to illustrate the scope and type of paradigm I'm talking about. Hopefully, it will help you understand the nature of the patterns I'm looking for, but I'm not looking for commentary on the specifics of this code. What I've done in the past is relatively straight-forward and easy to maintain, but, as mentioned above, some of the other developers don't like the current architecture. Currently, on document ready, I execute whatever global Javascript needs to occur on every page, and then call a page-specific init function to initialize node-specific functionality, retrieving the init method from a JS object. On each page load, something like this will happen: $(document).ready(function(){ $('header').menuAction(); App.pages.executePage('home','show'); //dynamic from framework request object }); And the main App javascript is like App = { usefulGlobalVar: 0, pages: { executePage: function(action, controller) { // if exists, App.pages[action][controller].init() }, home: { show: { init: function() { $('#tabs').tabs(); //et. al }, normalizeName: function() { // dom-specific utility function that // doesn't require a full-blown component/class/module } }, edit: ... }, user_profile: ... } } Any common features and functionality requiring modularization or compotentizing is done as needed with prototyping. For common implementation of plugins, I often extend JQuery, so I can easily initialize a plugin with the same options throughout the site. For example, $('[data-tabs]').myTabs() with this code in a utility javascript file: (function($) { $.fn.myTabs = function() { this.tabs( { //...common options }); }; }) Pointers to articles, books or other discussions would be most welcome. Again, I am looking for a site-wide implementation pattern, NOT a JS MVC framework or general how-tos on creating JS classes or components. Thanks for your help!

    Read the article

  • Advantages of using pure JavaScript over JQuery

    - by Shivan Dragon
    What are the advantages of using Javascript-only versus using JQuery-only? I have limited experience with JavaScript and JQuery coding. I've added bits and snippets of each to HTML pages but I've mostly coded server-side stuff in other languages. I've noticed that while you can theoretically do the same things using either of the two approaches (and of course you can even mix 'em up in the same project) there seems to be a tendency to always start using JQuery from the very beginning no-matter what the project demands are. So I'm simply wondering, are there any punctual benefits to not use JQuery-only but instead to just use plain old JavaScript? I know this looks like a non-question because it can be said about it that "there's no definite answer" or "it can be debated for ever", but I'm actually hoping for punctual answers such as "You can do this in one approach and you cannot do it with the other". ==EDIT== As per scrwtp's comment, I'm not referring just to the DOM Handling part. My question is rather: JQuery is a library. For Javascript. What I find strange about this library as opposed to other libraries for other languages is that in JQyery's case it seems to be designed to be able to use it exclusively and not need to touch Javascript directly. This is as opposed to let's say Hibernate and SQL, where even though the library (or rather framework in this case, but I think the analogy still applies) takes the handle on A LOT of aspects, you still get to use SQL when using it, at least for some fringe cases. However in JQuery & Javascript case, you could do anything you do with Javascript using only JQuery (or at least that's how it seems to me).

    Read the article

  • The importance of Design Patterns with Javascript, NodeJs et al

    - by Lewis
    With Javascript appearing to be the ubiquitous programming language of the web over the next few years, new frameworks popping up every five minutes and event driven programming taking a lead both server and client side: Do you as a Javascript developer consider the traditional Design Patterns as important or less important than they have been with other languages / environments?. Please name the top three design patterns you, as a Javascript developer use regularly and give an example of how they have helped in your Javascript development.

    Read the article

  • How to use javascript functions, defined in some external *.js file in browser's javascript console?

    - by Dmytro Tsiniavsky
    I would like to know is it possible to save some, for example,simplemath.js file with function ADD(a, b) { return a + b; } simple function, run opera's or some other browser's javascript console, include somehow this (simplemath.js) file, call ADD(2, 5), and get a result in console or execute javascript code on current web page and manipulate with it's content. How can I do that? How can I use javascript functions from external files in web-browser's javascript console?

    Read the article

  • Javascript click function not working

    - by Nabe
    I need to null the value in text box on click, currently I have written a code as such <div class="keyword_non"> <h1>Keywords : <a class="someClass question_off" title="Keywords "></a></h1> <h2><input type="text" name="kw1" value="one" /></h2> <h2><input type="text" name="kw2" value="two" /></h2> <h2><input type="text" name="kw3" value="three" /></h2> <h2><input type="text" name="kw4" value="four" /></h2> </div> <script type="text/javascript" src="/functions/javascript/custom/non_profit_edit.js"></script> <script type="text/javascript" src="/functions/javascript/jquery-1.7.1.min.js"></script> <script type="text/javascript" src="/functions/javascript/custom/jquery-ui-1.8.7.custom.min.js"></script> Inside non_profit_edit.js i have written as such $(document).ready(function(){ $(".kw1").click(function() { $(".kw1").val(" "); }); $(".kw2").click(function() { $(".kw2").val(" "); }); $(".kw3").click(function() { $(".kw3").val(" "); }); $(".kw4").click(function() { $(".kw4").val(" "); }); }); But write now its not working properly... Is this any browser issues or error in code..

    Read the article

  • JavaScript parser in JavaScript

    - by emk
    I need to add some lightweight syntactic sugar to JavaScript source code, and process it using a JavaScript-based build system. Are there any open source JavaScript parsers written in JavaScript? And are they reasonably fast when run on top of V8 or a similar high-performance JavaScript implementation? Thank you for any pointers you can provide!

    Read the article

  • Can google “see” this custom javascript code which displays links from an external site to mine

    - by webmasters
    I have a javascript code on my site who displays links from another site. This is what I have on my source before: <script language="JavaScript" type="text/javascript">showLink(1);</script> This is what I have copied from my source after the page has loaded: <script language="JavaScript" type="text/javascript">showLink(1);</script><a rel="nofollow" target="_blank" class="anc" href="http://x5.external_site.net/sc/out.php?s=5483&amp;o=http%3A%2F%2Fwww.bluetooth.com">Bluetooth Devices</a> Can google see this link?

    Read the article

  • extjs - 'Store is undefined'

    - by Jamie
    Hi all, I'm pretty sure this a trivial problem and i'm just being a bit stupid. Your help would be hugely appreciated. In controls/dashboard.js I have: Ext.ill.WCSS.controls.dashboard = { xtype:'portal', region:'center', margins:'35 5 5 0', items:[{ columnWidth: 1, style:'padding:10px', items:[{ title: 'My Cluster Jobs', layout:'fit', html: "test" }] },{ columnWidth: 1, style:'padding:10px', items:[{ title: 'All Cluster Jobs', iconCls: 'icon-queue', html: "test", items: new Ext.grid.GridPanel({ title: 'Cluster Job Queue', store: Ext.ill.WCSS.stores.dashboardClusterJobs, width: 791, height: 333, frame: true, loadMask: true, stateful: false, autoHeight: true, stripeRows: true, floating: false, footer: false, collapsible: false, animCollapse: false, titleCollapse: false, columns:[ { xtype: 'gridcolumn', header: 'Job ID', sortable: true, resizable: true, width: 100, dataIndex: 'JB_job_number', fixed: false }, { xtype: 'gridcolumn', header: 'Priority', sortable: true, resizable: true, width: 100, dataIndex: 'JAT_prio', fixed: false }, { xtype: 'gridcolumn', header: 'User', sortable: true, resizable: true, width: 100, dataIndex: 'JB_owner' }, { xtype: 'gridcolumn', header: 'State', sortable: true, resizable: true, width: 100, dataIndex: 'state' }, { xtype: 'gridcolumn', header: 'Date Submitted', sortable: true, resizable: true, width: 100, dataIndex: 'JAT_start_time' }, { xtype: 'gridcolumn', header: 'Queue', sortable: true, resizable: true, width: 100, dataIndex: 'queue_name' }, { xtype: 'gridcolumn', header: 'CPUs', sortable: true, resizable: true, width: 100, dataIndex: 'slots' } ], bbar: { xtype: 'paging', store: 'storeClusterQueue', displayInfo: true, refreshText: 'Retrieving queue status...', emptyMsg: 'No jobs to retrieve', id: 'clusterQueuePaging' } }) }] }] }; Simple enough, note the reference to 'Ext.ill.WCSS.stores.dashboardClusterJobs' So in stores/dashboard.js I just have this: Ext.ill.WCSS.stores.dashboardClusterJobs = new Ext.data.XmlStore({ storeId: 'storeClusterJobs', record: 'job_list', autoLoad: true, url: 'joblist.xml', idPath: 'job_info', remoteSort: false, fields: [ { name: 'JB_job_number' }, { name: 'JAT_prio' }, { name: 'JB_name' }, { name: 'JB_owner' }, { name: 'state' }, { name: 'JAT_start_time' }, { name: 'slots' }, { name: 'queue_name' } ] }); I run the code and I get 'store is undefined' :S It's confusing me a lot. All of the javascripts have been included in the correct order. i.e. <script type="text/javascript" src="/js/portal.js"></script> <script type="text/javascript" src="/js/stores/dashboard.js"></script> <script type="text/javascript" src="/js/controls/dashboard.js"></script> Thanks guys!

    Read the article

  • Focus on Javascript or Jquery?

    - by daxflame
    Hello, I am a student in college, and I notice that a lot of companies look for people who have experience with Javascript. Does this include Javascript's libraries, like JQuery? Or, are they looking for Javascript people only? It probably depends on the company, but what is the general advice for a student wanting to do some front end work? Is Javascript more powerful than JQuery? I know Jquery is a library and simplifies many tasks, but is there some reason why you would use Javascript over Jquery?

    Read the article

  • Why is HTML/Javascript minification beneficial

    - by Channel72
    Why is HTML/Javascript minification beneficial when the HTTP protocol already supports gzip data compression? I realize that Javascript/HTML minification has the potential to significantly reduce the size of Javascript/HTML files by removing unnecessary whitespace, and perhaps renaming variables to a few letters each, but doesn't the LZW algorithm do especially well when there are many repeated characters (e.g. lots of whitespace?) I realize that some Javascript minification tools do more than just reduce size. Google's closure compiler, for example, also tries to improve code performance by inlining functions and doing other analyses. But the primary purpose of Javascript minification is usually to reduce file size. I also realize there are other reasons you might want to minify aside from performace, such as code obfuscation. But again, that reason is not usually emphasized as much as performance gain and file size reduction. For example, Closure Compiler is not advertised as an obfuscation tool, but as a code size reducer and download-speed enhancer. So, how much performance do you really gain from Javascript/HTML minification when you're already significantly reducing file size with gzip compression?

    Read the article

  • How important is graceful degradation of JavaScript? [closed]

    - by Stephen
    Should web developers continue to spend effort progressively enhancing our web applications with JavaScript, ensuring that features gracefully degrade, thereby ensuring accessibility? Or should we spend that time focused on new features or other areas of development? The subtext of that question would be: How many of our customers/clients/users utilize our websites or applications with JavaScript disabled? Do you have any projects with requirements that specifically demand JavaScript functionality (almost all of mine do), and do those requirements also demand graceful degradation? For the sake of asking this question, I pulled up programmers.stackexchange.com without JavaScript enabled, and I was greeted with this message: "Programmers - Stack Exchange works best with JavaScript enabled". It was difficult to log in, albeit the site seemed to generally work okay. (I wasn't able to vote up any questions.) I think this is a satisfactory approach to development. Imagine the effort involved in making all of the site's features work with plain old HTML and server-side logic. On the other hand, I wonder how many users have been alienated by this approach. We've all been trained (at least the good developers among us) to use progressive enhancement and to ensure our web applications' dynamic features degrade gracefully. Is this progressive enhancement just pissing into the wind, or do some of our customers actually utilize certain web services without JavaScript enabled?

    Read the article

  • Javascript: Machine Constants Applicable?

    - by DavidB2013
    I write numerical routines for students of science and engineering (although they are freely available for use by anybody else as well) and am wondering how to properly use machine constants in a JavaScript program, or if they are even applicable. For example, say I am writing a program in C++ that numerically computes the roots of the following equation: exp(-0.7x) + sin(3x) - 1.2x + 0.3546 = 0 A root-finding routine should be able to compute roots to within the machine epsilon. In C++, this value is specified by the language: DBL_EPSILON. C++ also specifies the smallest and largest values that can be held by a float or double variable. However, how does this convert to JavaScript? Since a Javascript program runs in a web browser, and I don't know what kind of computer will run the program, and JavaScript does not have corresponding predefined values for these quantities, how can I implement my own version of these constants so that my programs compute results to as much accuracy as allowed on the computer running the web browser? My first draft is to simply copy over the literal constants from C++: FLT_MIN: 1.17549435082229e-038 FLT_MAX: 3.40282346638529e+038 DBL_EPSILON: 2.2204460492503131e-16 I am also willing to write small code blocks that could compute these values for each machine on which the program is run. That way, a supercomputer might compute results to a higher accuracy than an old, low-level, PC. BUT, I don't know if such a routine would actually reach the computer, in which case, I would be wasting my time. Anybody here know how to compute and use (in Javascript) values that correspond to machine constants in a compiled language? Is it worth my time to write small programs in Javascript that compute DBL_EPSILON, FLT_MIN, FLT_MIN, etc. for use in numerical routines? Or am I better off simply assigning literal constants that come straight from C++ on a standard Windows PC?

    Read the article

  • A few questions about how JavaScript works

    - by KayoticSully
    I originally posted on Stack Overflow and was told I might get some better answers here. I have been looking deeply into JavaScript lately to fully understand the language and have a few nagging questions that I can not seem to find answers to (Specifically dealing with Object Oriented programming. I know JavaScript is meant to be used in an OOP manner I just want to understand it for the sake of completeness). Assuming the following code: function TestObject() { this.fA = function() { // do stuff } this.fB = testB; function testB() { // do stuff } } TestObject.prototype = { fC : function { // do stuff } } What is the difference between functions fA and fB? Do they behave exactly the same in scope and potential ability? Is it just convention or is one way technically better or proper? If there is only ever going to be one instance of an object at any given time, would adding a function to the prototype such as fC even be worthwhile? Is there any benefit to doing so? Is the prototype only really useful when dealing with many instances of an object or inheritance? And what is technically the "proper" way to add methods to the prototype the way I have above or calling TestObject.prototype.functionName = function(){} every time? I am looking to keep my JavaScript code as clean and readable as possible but am also very interested in what the proper conventions for Objects are in the language. I come from a Java and PHP background and am trying to not make any assumptions about how JavaScript works since I know it is very different being prototype based. Also are there any definitive JavaScript style guides or documentation about how JavaScript operates at a low level? Thanks!

    Read the article

  • Listening and firing events with Javascript and maybe jQuery

    - by at
    In my Javascript and Flex applications, users often perform actions that I want other Javascript code on the page to listen for. For example, if someone adds a friend. I want my Javascript app to then call something like triggerEvent("addedFriend", name);. Then any other code that was listening for the "addedFriend" event will get called along with the name. Is there a built-in Javascript mechanism for handling events? I'm ok with using jQuery for this too and I know jQuery makes extensive use of events. But with jQuery, it seems that its event mechanism is all based around elements. As I understand, you have to tie a custom event to an element. I guess I can do that to a dummy element, but my need has nothing to do with DOM elements on a webpage. Should I just implement this event mechanism myself?

    Read the article

  • Executing Javascript without a browser?

    - by Daniel
    I am looking into Javascript programming without a browser. I want to run scripts from the Linux or Mac OS X command line, much like we run any other scripting language (ruby, php, perl, python...) $ javascript my_javascript_code.js I looked into spider monkey (Mozilla) and v8 (Google), but both of these appear to be embedded. Is anyone using Javascript as a scripting language to be executed from the command line? If anyone is curious why I am looking into this, I've been poking around node.js

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >