简体   繁体   English

睡眠后停止SetInterval / SetTimeout

[英]SetInterval/SetTimeout halted after sleep

The refresh cycle of my script with either Interval or Timeout is only firing arbitrarily after coming back from sleep. 我的脚本具有“间隔”或“超时”的刷新周期仅在从睡眠状态恢复后才任意触发。 How would I fix this? 我该如何解决?

Consider debug your app using $.ajaxSetup - you need discover the error code and implement some routine to re-gain your session! 考虑使用$.ajaxSetup调试应用程序-您需要发现错误代码并实现一些例程以重新获得会​​话!

$.ajaxSetup({
    error: function(e, x, settings, exception) {
        console.warn(e, 'e');
        console.warn(x, 'x');
        console.warn(settings, 'settings');
        console.warn(exception, 'exception');
    }
});

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

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