Call a function every second or 5 seconds in javascript

setinterval
function calling

call a javascript function every 5 seconds continously.  You can use setInterval(). The below code is working from onload.

setInterval(test,5000);
function test()
{
	alert("hi");
}

 

 

You might also like:

Convert and download html to pdf without saving file

28-10-2018 node js convert html to pdf pdf download pdf without saving

How to redirect one page to another page in php

20-03-2017 redirect php

Sample Validations in javascript

22-02-2017 validations javascript

Send Mail in Node Js

21-02-2017 node js mail npm module

Get Unique values from array/object in javascript

19-02-2017 javascript unique remove repeated values from array