...

View Full Version : looping with for var command



Deayts
12-23-2010, 09:38 PM
Hi,

I have this code..


javascript:function showMore() {ProfileStream.getInstance().showMore(); setTimeout(showMore, 2000)}; showMore();

i want to loop it 10 times, but do not know how to do it. I have been told that the for var command is what I want, but I cannot get it to work.

Any help would be appreciated.
Thanks :)

DJCMBear
12-23-2010, 09:43 PM
Try this



javascript:var i=0,showMore=function(){if(i<10){ProfileStream.getInstance().showMore();i=i+1;setTimeout(showMore,2000);}};showMore();

Deayts
12-23-2010, 09:46 PM
Perfect! Thank you! :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum