setTimeout(): If not defined in EcmaScript spec, where can I learn how it works?

setTimeout and such aren’t in the ECMAScript specification because they’re not JavaScript features. They’re features of the browser environment’s window object. Other environments (Windows Scripting Host, NodeJS, etc.) won’t necessarily have those features. The W3C has been trying to standardize the window object and its various features (including setTimeout), the latest is in the timers … Read more

Will a recursive ‘setTimeout’ function call eventually kill the JS Engine?

There’s no actual recursion because the call to GetData is delayed and the JavaScript context is destroyed in the meantime. So it won’t crash the JS engine. For your code sample, this is basically what will happen at the JS engine level: Initialize JS engine Create GetData function context Execute GetData statements including “setTimeOut” “setTimeOut” … Read more

jQuery delay() – how to stop it?

You can break .delay() by .dequeue() function here is example //this is only for make sure that we skip ‘delay’, not other function var inDelay = false; function start() { $(‘.gfx’).animate ({ width: 100 }, function(){inDelay = true}).delay(3000).animate ({ width: 0 }, function(){inDelay = false}) } function breakTheDelay() { if(inDelay) { $(‘.gfx’).dequeue(); } } http://jsfiddle.net/wasikuss/5288z/ … Read more

Call setTimeout without delay

Very simplified: Browsers are single threaded and this single thread (The UI thread) is shared between the rendering engine and the js engine. If the thing you want to do takes alot of time (we talking cycles here but still) it could halt (paus) the rendering (flow and paint). In browsers there also exists “The … Read more