iPad 版 Safari 不报告 Javascript 错误的行号

发布于 2025-01-02 03:51:15 字数 182 浏览 2 评论 0原文

我正在使用 iPad 2 和 IOs 5 来开发 Web 应用程序。

我已启用开发人员控制台来获取日志,但是当发生 javascript 错误时,它不包含相应的行号。

由于 Web 应用程序处理触摸和手势事件,因此我无法在桌面版本的浏览器上测试它们!

如有任何帮助,我们将不胜感激。

I am using iPad 2 with IOs 5 to develop a web application.

I have enabled the developer console to get logs , but when javascript error occurs it does not include corresponding line number.

Since the web application handles touch and gesture events, I cannot test them on desktop version of the browser!

Any help will be appreciated.

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

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

发布评论

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

评论(2

や三分注定 2025-01-09 03:51:15

您可以添加窗口级错误处理程序

http:// dev.opera.com/articles/view/better-error-handling-with-window-onerror/

并让该控制台记录行号。每个错误您将收到两个控制台日志,但您将对输出有更多控制。

You can add a window level error handler

http://dev.opera.com/articles/view/better-error-handling-with-window-onerror/

and have that console log the line number. You'll be getting two console logs per error, but you will have more control over the output.

哆兒滾 2025-01-09 03:51:15

您可以尝试使用常规 Safari 或 Chrome 并在使用 iPad 之前先将其写入其中,或者也可以使用 Weinre 应用程序为您提供类似 firebug / chrome 开发人员工具的控制台。

You can try using regular Safari or Chrome and write it there first before using the iPad or alternatively there is the Weinre application that provides you a console like firebug / chrome developer tools.

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