Safari for Ipad不会报告有关Javascript错误的行号 [英] Safari for Ipad not reporting line numbers on Javascript errors

查看:53
本文介绍了Safari for Ipad不会报告有关Javascript错误的行号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用具有IO 5的iPad 2开发Web应用程序.

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

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

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

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

任何帮助将不胜感激.

推荐答案

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

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.

这篇关于Safari for Ipad不会报告有关Javascript错误的行号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆