php - call a function with different parameters in setInterval -


i using setinterval function call function after particular time intervals.
code given below:

var refreshidd = setinterval(function() {       loaddata(page);    },  <?= $h; ?>); 

for example:
if time interval ie $h 1000(1 sec) have call function loaddata parameter 1. in second second have call loaddata 2.in each time interval have pass 1,2,3 etc.if $h 2000 ie 2sec,i have call loaddata after 2nd second parameter 1 , parameter 2 in 4th second , on
how can this?

this independent of $h.

set page = 1 , simple increment page++. increase value of page 1 every time called.

var page = 1; var refreshidd = setinterval(function() {     loaddata(page++); },  <?=$h?>); 

see simple demo.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -