[英]Safari for Ipad not reporting line numbers on Javascript errors
I am using iPad 2 with IOs 5 to develop a web application. 我正在使用带有IO 5的iPad 2来开发Web应用程序。
I have enabled the developer console to get logs , but when javascript error occurs it does not include corresponding line number. 我已启用开发人员控制台来获取日志,但是当发生javascript错误时,它不包含相应的行号。
Since the web application handles touch and gesture events, I cannot test them on desktop version of the browser! 由于Web应用程序处理触摸和手势事件,我无法在桌面版浏览器上测试它们!
Any help will be appreciated. 任何帮助将不胜感激。
You can add a window level error handler 您可以添加窗口级错误处理程序
http://dev.opera.com/articles/view/better-error-handling-with-window-onerror/ 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.
每个错误您将获得两个控制台日志,但您可以更好地控制输出。
您可以尝试使用常规Safari或Chrome,然后在使用iPad之前先将其写入,或者使用Weinre应用程序为您提供类似firebug / chrome开发人员工具的控制台。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.