I want to call a function for every half minute. i am using the following code. The function is not getting triggered.
Code:
window.setInterval('progress()', 10000);
Geetha.
I want to call a function for every half minute. i am using the following code. The function is not getting triggered.
Code:
window.setInterval('progress()', 10000);
Geetha.
Every half min would be 30,000 miliseconds
Example ...
refreshId = setInterval(myfunction(), 30000);
In jQuery you'd do something like ...
$(document).ready(function(){
var refreshId = setInterval(myfunction(), 30000);
});
Or if you want to put your function within your refresh code ...
$(document).ready(function(){
var refreshId = setInterval(function() {
$("#myid").load('/mypage.html?update='+ Math.random());
}, 30000);
});
myfunction() as part of the setup of the interval, and use the return value. It should be providing a reference to myfunction instead: setInterval(myfunction,30000);