View Full Version : looping with for var command

12-23-2010, 08:38 PM

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 :)

12-23-2010, 08:43 PM
Try this

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

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

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum