¡@

Home 

2014/10/16 ¤W¤È 12:05:38

jquery Programming Glossary: myinterval

Do something every 5 seconds and the code to stop it. (JQuery)

http://stackoverflow.com/questions/1542280/do-something-every-5-seconds-and-the-code-to-stop-it-jquery

launch the command once. In this case setInterval is your friend. var iFrequency 5000 expressed in miliseconds var myInterval 0 STARTS and Resets the loop if any function startLoop if myInterval 0 clearInterval myInterval stop myInterval setInterval.. var iFrequency 5000 expressed in miliseconds var myInterval 0 STARTS and Resets the loop if any function startLoop if myInterval 0 clearInterval myInterval stop myInterval setInterval doSomething iFrequency run function doSomething do something here.. in miliseconds var myInterval 0 STARTS and Resets the loop if any function startLoop if myInterval 0 clearInterval myInterval stop myInterval setInterval doSomething iFrequency run function doSomething do something here from code... input type button..

jQuery AJAX loop to refresh jQueryUI ProgressBar

http://stackoverflow.com/questions/9540957/jquery-ajax-loop-to-refresh-jqueryui-progressbar

3 seconds. Instead you want 0 3000 6000 9000 etc. i.e. 3000 i Better you could use setInterval and clearInterval var myInterval setInterval GetProgress 3000 and in the callback do .ajax url query.aspx GetProgress success function msg var data .parseJSON.. msg var data .parseJSON msg.d #pbrQuery .progressbar value data.value if data.value 100 isDone true clearInterval myInterval clearInterval will stop it from calling GetProgress again. Using the setInterval method means you don't have to know how..