Reputation: 6810
I know how to do a setTimeout(function(){}),xseconds}
But what I don't know is how do I make the xseconds a minute.
Basiclly what I want to do is make sure the users session gets updated on our server and the only way I know to do that is via PHP as it needs to be saved to the MYSQL, so I was going to $ajax POST send a request to the server to update the session end time in the session table.
So quick simple question is what is 1minute in jquery seconds.
Upvotes: 0
Views: 186
Reputation: 8897
setTimeout
is used as follows.
var t=setTimeout(function(){},milliseconds);
1000 milliseconds = 1 second. So 60 seconds in milliseconds...
60 * 1000 = 60000
Upvotes: 1
Reputation: 3707
it's a milisecond not second. so it you want to have 1 minute means 1x60x1000 = 60000ms
setTimeout(function(){}), 60000}
Upvotes: 3