如何调试在 iPad 上的 webview 中运行的 Javascript?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5335491/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to debug Javascript running in a webview on an iPad?
提问by Jason
I have an iPad running some Javascript in a webview, but sometimes it just refuses to work. Does anyone have a way to debug this kind of issue?
我有一台在 web 视图中运行一些 Javascript 的 iPad,但有时它只是拒绝工作。有没有人有办法调试这种问题?
采纳答案by Kelly Anderson
You can use bookmarklets to run things like firebug lite: Check the following article for links to how to make bookmarklets installable on mobile safari as well as links to firebug lite. http://community.godaddy.com/library/setting-up-a-debugging-environment-on-the-ipad/
您可以使用 bookmarklets 来运行 firebug lite 之类的东西:查看以下文章,获取有关如何使 bookmarklets 可安装在移动 Safari 上的链接以及 firebug lite 的链接。 http://community.godaddy.com/library/setting-up-a-debugging-environment-on-the-ipad/
回答by franzlorenzon
Recently with the new iOS 6 you can turn on remote debugging and analyze your project with Webkit Inspector on Safari (but only with a Mac, because you must have safari 6.x).
最近在新的 iOS 6 中,您可以打开远程调试并使用 Safari 上的 Webkit Inspector 分析您的项目(但只能使用 Mac,因为您必须有 safari 6.x)。
This method would not work on the first generation of iPad too, because they're not upgradeable to iOS 6.
这种方法也不适用于第一代 iPad,因为它们无法升级到 iOS 6。
The question is one year old and obviously it wasn't available at the moment. I'm posting it so that someone who come up here could know it.
这个问题已经有一年了,显然目前不可用。我把它贴出来是为了让来这里的人知道它。
Info: http://www.mobilexweb.com/blog/iphone-5-ios-6-html5-developers
信息:http: //www.mobilexweb.com/blog/iphone-5-ios-6-html5-developers
回答by Sorskoot
Another tool you could try is adobe shadow.
您可以尝试的另一个工具是adobe shadow。
回答by Andrei
Simply enable js console