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(); } Link to comment https://forums.phpfreaks.com/topic/62643-settimeout-call-multiple-functions-after-a-dealy-not-working/ 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); } } Link to comment https://forums.phpfreaks.com/topic/62643-settimeout-call-multiple-functions-after-a-dealy-not-working/#findComment-311803 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.