I want to auto refresh a page after every certain period of time which will be provided by the user.I have made the code which is reloading the page only once.what may be the problem?
Here is my code:
function refreshmethod(){ var myvalue = document.getElementById('mytextBox').value; if(myvalue <= 0){ alert('Please enter a positive value in the input'); return; } setInterval(function(){ window.location.reload(); }, myvalue * 1000); }
refreshMethod?setTimeoutwould be better suited. What would you like to have refreshed? ajax is invented for this kind of stuff.