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:

How to search text in string using php ?

29-10-2017 php search string search

How To Get Your Blogs Posts Using Blogger API

30-07-2017 blogger api json php

Time Sorting Ascending or Descending Order in Javascript

19-07-2017 Javascript ascending order descending order

How to remove last / value from url in javascript

27-02-2017 array javascript last value

Send Mail in Node Js

21-02-2017 node js mail npm module