I have simple function;
setTimeout(function(){ alert('hello');
//Business stuffs..
location.reload();
eval(localStorage.getItem('mysc'))},5000)
after open in a browser(chrome or firefox) I type this;
localStorage.setItem("mysc","setTimeout(function(){
//Business stuffs...
location.reload();
eval(localStorage.getItem('mysc'))
},5000)");
After that once I type;
eval(localStorage.getItem('mysc'))
I want this function executes in same browser window forever.. or till close the browser.. but as you guess, it only works once. How can I achieve this ?
setInterval(function() { eval(localStorage.getItem('mysc')) })