javascript - How to register setInterval without the delay without using any function as I need it to run 1st time -


var interval = setinterval(function(){alert("i alive.")},delay) 

i want register setinterval explicitly want run interval after every delay time if page in have written destroyed. works fine if delay 5 minutes , wait till setinterval registered first time if change page alerts. if change page before delay time dont alert never registered @ all. there way can directly register setinterval load page.

have tried putting document ready? when page loads itll run straight away;

var interval;  $(document).ready(function) {     interval = setinterval(function(){alert("i alive.")},delay);     }); 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -