How to fire multiple JavaScript functions at once -


how fire these 4 functions @ same time;

firethisnow1(); firethisnow2(); firethisnow3(); firethisnow4(); 

you mean asynchronously yes? try this:

settimeout(function(){     firethisnow1(); }, 0);  settimeout(function(){     firethisnow2(); }, 0);  settimeout(function(){     firethisnow3(); }, 0);  settimeout(function(){     firethisnow4(); }, 0); 

same (if parent object window):

for(var = 1; < 5; i++){     settimeout(function(){         window['firethisnow' + i]();     }, 0); } 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -