你如何在 Safari 中调试 javascript?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5247547/
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 do you debug javascript in Safari?
提问by code511788465541441
How do you debug javascript in Safari on Windows. I've tried google but the only thing that seems to be coming up is Safari Enhancer which is for Mac OS.
您如何在 Windows 上的 Safari 中调试 javascript。我试过谷歌,但似乎唯一出现的是适用于 Mac OS 的 Safari Enhancer。
回答by HymanJoe
not sure if in Windows is the same, but on the mac version you have a Developer menu ("Develop"), at the mac this menu is shown via the preferences > advanced > show develop menu, and there you can view items such as "Start debugging javascript".
不确定在 Windows 中是否相同,但在 mac 版本上,您有一个开发人员菜单(“开发”),在 mac 上,此菜单通过首选项 > 高级 > 显示开发菜单显示,在那里您可以查看诸如“开始调试javascript”。
EDIT: just found this: Enabling debug menu in Safari for Windows
编辑:刚刚发现这个:在 Safari for Windows 中启用调试菜单
回答by JavaKungFu
Have you tried using the develop bar?
您是否尝试过使用开发栏?
To enable, go to preferences -> Advanced -> Check show develop menu in the menu bar
要启用,请转到首选项 -> 高级 -> 检查菜单栏中的显示开发菜单
回答by gailbear
Right click on the page, and click "Inspect Element"
右键单击页面,然后单击“检查元素”
You'll get a pop-up with lots of tabs that looks kinda like firebug -- the console tab is what you want.
您会看到一个带有许多看起来有点像萤火虫的选项卡的弹出窗口——控制台选项卡正是您想要的。
回答by Shrimpy
In OSX Catalina, Safari doesn't seem to have a debug option anymore.
在 OSX Catalina 中,Safari 似乎不再有调试选项。