sayedsohail Posted July 31, 2007 Share Posted July 31, 2007 Hi everyone, I am working on a settimeout function, where i can call functions in serialized form. i.e, execute function 1 and after that execute 2 function .... so on. here is my code, it just performing parallel way, i wish to perform in serial way. var timer = null; var delay = 500; function startTimerGet(a) { window.clearTimeout(timer); // function 1 timer=window.setTimeout('MyAjaxRequest()',delay); // execute function 2 after completion of function 1 one or atleast after a small delay of function 1. removeinner('titlegrid'); // execute function 3 after completion of function 2 one or atleast after a small delay of function 2. refreshparentdiv(); } Quote Link to comment Share on other sites More sharing options...
sayedsohail Posted July 31, 2007 Author Share Posted July 31, 2007 i was able to worked it out in way, by adding function 2 next to function1, but this is not exactly i want i wish to send each function after a the set of delay. timer=window.setTimeout('function1(); function2();',delay); The other method, am I close but somewhere lost? var counter = 1; function delayedCall(){ this["function"+counter++](); if(counter<4){ setTimeout("delayedCall()", 1000); } } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.