简体   繁体   English

在 Mobile Safari 上执行操作(经过一段时间后)

[英]Perform an action on Mobile Safari (after some time has passed)

I'm working with HTML5 in Mobile Safari (iOS 6).我正在 Mobile Safari (iOS 6) 中使用 HTML5。 I want to execute a JavaScript code after some time has passed.我想在一段时间后执行一段 JavaScript 代码。 For example to redirect to another page after 60 seconds.例如在 60 秒后重定向到另一个页面。

Is it possible?是否有可能?

This will execute your code one time only, after 60 seconds:这将在 60 秒后仅执行一次您的代码:

setTimeout(function() {
        /* your code here */
},60000);​

While this虽然这

setInterval(function() {
        /* your code here */
},60000);​

Will execute your code every 60 seconds60 秒执行一次您的代码

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM