如何在java脚本中设置15分钟的时间间隔?

编程入门 行业动态 更新时间:2024-10-19 01:24:18
本文介绍了如何在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分钟的时间间隔?

本文发布于:2023-06-06 01:38:30,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/531185.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:间隔   脚本   时间   如何在   java

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!