如何在java脚本中设置15分钟的时间间隔? [英] How to set 15 mins time interval in java script ?

查看:557
本文介绍了如何在java脚本中设置15分钟的时间间隔?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



如何在javascript中设置15分钟的时间间隔,我将使用(var logouTimeInterval = 3000; //三秒钟来回3秒)它会工作,我可以设置为10秒,但我可以设置1,2,3 ......分钟,

请回复我如何在javascript中设置15分钟的时间间隔。



问候

Aravind

解决方案

参考 - Javascript settimeout [ ^ ]。

Quote:

如果你想让它重复运行你可以使用setInterval函数:

 setInterval( function (){
alert(' hello world');
}, 15 * 60 * 1000 );



此外,您可以查看jquery idleTimer插件,它允许您检测用户不活动的时间段并采取一些操作。



所以,请执行以下操作。

  var  logouTimeInterval =  15  *  60  *  1000 ; 


Hi
How set time interval for 15 mins in javascript,i will use (var logouTimeInterval = 3000; // Three Second fro 3 sec) and it will work,i can set upto 10 secs,but i can set 1,2,3... mins,
pls reply me how to set 15 mins time interval in javascript.

Regards
Aravind

解决方案

Refer - Javascript settimeout[^].

Quote:

You could use the setInterval function if you want it to run repeatedly:

setInterval(function() {
    alert('hello world');
}, 15 * 60 * 1000);


Also you might take a look at the jquery idleTimer plugin which allows you to detect periods of user inactivity and take some actions.


So, do like below.

var logouTimeInterval = 15 * 60 * 1000;


这篇关于如何在java脚本中设置15分钟的时间间隔?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆