JavaScript 执行超出超时 - jQuery mobile

发布于 2024-12-04 20:37:37 字数 842 浏览 0 评论 0原文

我创建了一个基于 jquery 移动框架的移动应用程序。

我使用 wordpress 作为 cms。

一切似乎都运转良好。但在应用程序中来回导航一段时间后,按钮突然变得无法点击,并出现此 JavaScript 错误。

第 16 行 JavaScript 错误
http://code.jquery.com /mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.js
JavaScript 执行超出超时

此错误大致意味着什么?为什么它不会立即发生?为什么它是 jQuery 自身的错误,以前从未见过这种情况发生?

我对 javascript 错误的经验是,如果它一开始就错误/损坏,那么你会立即收到错误。

该错误主要是在浏览包含大列表的存档页面时出现的。

我知道如果您看不到该应用程序或无法使用它,几乎不可能说出它是什么 - 但有人遇到过类似的 java 脚本错误吗?

有时出现错误时,您仍然可以使用该应用程序,但有时它会完全锁定它。

任何想法都会很有帮助 - 因为我迫切需要修复

而且我正在 iPhone 3GS 上的 Mobile Safari 上查看它
Mozilla/5.0(iPhone;U;CPU iPhone OS 4_3_5,如 Mac OS X;en-us)AppleWebKit/533.17.9(KHTML,如 Gecko)Mobile/8L1

I've created a mobile app based on the jquery mobile framework.

I'm using wordpress as cms.

All seems to work fine. But after a while of navigating backwards and forwards round the app, suddenly the buttons become unclickable with this javascript error.

JavaScript Error on Line 16
http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.js
JavaScript execution exceeded timeout

What does this error roughly mean and why does it not happen instantly? And how come its an error within jQuery it's self, never seen this happen before?

My experience with javascript errors are if it's wrong/broken in the first place then you get an error straight away.

The error kicks in mainly when navigating through archive pages that contain big lists.

I understand its almost impossible to say what it is if you can't see the app or play with it - but has any one experienced similar java script errors?

When the error sometimes appears, you can still use the app, but sometimes it locks it up completely.

Any thoughts would be most helpful - as I'm desperately needing a fix

Also I'm viewing it Mobile Safari on iPhone 3GS
Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_5 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Mobile/8L1

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

听不够的曲调 2024-12-11 20:37:37

感觉这是 Safari 移动端的 bug。

刚刚在 iOS5 上的其他几个流行的、javascript 密集型库中遇到了相同的 javascript 异常。

当我使用可滚动性库和pdf.js时,偶尔会出现异常。即使是这些库的示例页面也会导致我的 iPad 时不时地抛出此异常。

我使用的是装有第一个稳定版本 iOs 5 的 iPad 2。

用户代理:Mozilla/5.0(iPad;CPU OS 5_0,如 Mac OS X)AppleWebKit/534.46(KHTML,如 Gecko)版本/5.1 Mobile/9A334 Safari/7534.48.3

Feels like it's a Safari mobile bug.

Just been getting the same javascript exception with a couple of other popular, javascript intensive, libraries on iOS5.

The exception occurs occasionaly when I use the scrollability library and pdf.js. Even the example pages for these libraries cause my iPad every now and again to cast this exception.

I'm using an iPad 2 with the first stable iOs 5 release.

User Agent: Mozilla/5.0 (iPad; CPU OS 5_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A334 Safari/7534.48.3

眸中客 2024-12-11 20:37:37

该列表看起来处理时间太长,浏览器正在杀死它(脚本),但可能还有其他影响因素。

发布一些代码,我会尽力提供帮助。

The list looks to be taking too long to process and the browser is killing it (the scripts) off, but there could be other contributing factors.

Post some code and I'll try to help.

‘画卷フ 2024-12-11 20:37:37

只有一个指针,也许是在正确的方向:

当我启动转换而前一个转换似乎仍在进行中时,我遇到了相同的错误。如果我等待转换完成(并且屏幕“稳定”),然后进行下一个转换,则一切都很好。但是,如果我在完成最后一个转换之前触发下一个转换,我也会收到此错误。

JQM 中有一个转换队列,可能有问题。

Only a pointer, perhaps in the right direction:

I'm getting the same error, when I'm initiating a transition while the previous transition still seems in process. If I wait for the transition to finish (and the screen "to settle") and then do the next transition, everything is fine. However if I trigger the next transition before finishing the last, I'm also getting this error.

There is a transitioningqueue in JQM, maybe an issue with it.

森罗 2024-12-11 20:37:37

重新启动您的设备。另外,请考虑在脚本末尾加载 jQuery 和 jQuery mobile:

<script src="//code.jquery.com/jquery-1.7.1.min.js"></script>
<script>window.jQuery || document.write('<script src="js/jquery-1.7.1.min.js"><\/script>')</script> 

<script src="//code.jquery.com/mobile/latest/jquery.mobile.min.js"></script>
<script>window.jQuery.widget || document.write('<script src="js/jquery.mobile.min.js"><\/script>')</script> 

在 jQuery mobile 1.0 在 head 脚本元素中首次加载并运行后,我的 iPhone 4S 上收到“JavaScript 执行超出超时”消息。重新启动我的手机修复了它,所以就我而言,这似乎是 iOS5 Mobile Safari 的一个错误。

我还没有尝试过上面的方法,但也许给脚本第二次运行的机会就可以了——甚至可以尝试像 Facebook 和 Google Analytics 推荐的那样在 DOM 中注入脚本元素,而不是使用文档写入。

Restart your device. Also, consider loading jQuery and jQuery mobile at the end of your script:

<script src="//code.jquery.com/jquery-1.7.1.min.js"></script>
<script>window.jQuery || document.write('<script src="js/jquery-1.7.1.min.js"><\/script>')</script> 

<script src="//code.jquery.com/mobile/latest/jquery.mobile.min.js"></script>
<script>window.jQuery.widget || document.write('<script src="js/jquery.mobile.min.js"><\/script>')</script> 

I was getting "JavaScript execution exceeded timeout" on my iPhone 4S right after jQuery mobile 1.0 loaded and ran for the first time in a head script element. Restarting my phone fixed it, so in my case, it seemed to be a bug with iOS5 Mobile Safari.

I haven't tried the above but maybe giving the script a second chance to run would do the trick - might even try injecting the script element in the DOM like Facebook and Google Analytics recommend doing rather than using document write.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文