Safari for Ipad not reporting line numbers on Javascript errors

余生长醉 提交于 2020-12-05 05:09:19

问题


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.


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/9120000/safari-for-ipad-not-reporting-line-numbers-on-javascript-errors

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!