在jQuery中,我如何每5秒创建一次警报? [英] In jQuery how do I create alert every 5 seconds?
本文介绍了在jQuery中,我如何每5秒创建一次警报?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我可以使用jQuery执行此操作,还是应该使用其他内容?
Can I do this using jQuery or should I be looking at using something else?
推荐答案
jQuery.delay()
函数旨在延迟jQuery队列中函数的执行。
已经有一个用于处理间隔功能的内置Javascript函数,你不会使用jQuery来实现它。
The jQuery.delay()
function is designed to delay execution of functions in the jQuery queue.
There is already a built-in Javascript function for handling interval functionality, you wouldn't use jQuery to achieve that.
setInterval(function() {
alert("Message to alert every 5 seconds");
}, 5000);
这篇关于在jQuery中,我如何每5秒创建一次警报?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文