如何在 IE8 上调试 JavaScript 错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5334637/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-23 16:43:44  来源:igfitidea点击:

how to debug javascript errors on IE8

javascriptjquerydebugginginternet-explorer-8

提问by leora

I am getting an error, when running a webpage on IE8. When I click on the error found, it says:

在 IE8 上运行网页时出现错误。当我点击发现的错误时,它说:

enter image description here

在此处输入图片说明

How can I go to this line to see where the error is happening?

我怎样才能转到这一行查看错误发生的位置?

I can't see this error on any other browser.

我在任何其他浏览器上都看不到此错误。

Also, it says:

此外,它说:

line 109213803.

第 109213803 行。

I don't understand this, as obviously I don't have so many lines of code.

我不明白这一点,因为显然我没有那么多行代码。

Can someone explain what IE8 is telling me here?

有人可以解释一下 IE8 在这里告诉我什么吗?

回答by BrokenGlass

Make sure script debugging is not disabled for IE, otherwise it should allow you to debug the script directly:

确保 IE 没有禁用脚本调试,否则它应该允许您直接调试脚本:

enter image description here

在此处输入图片说明

enter image description here

在此处输入图片说明

回答by rob waminal

IE8 has a default built-in IE Developer tool, you can use that to debug that. Hit F12 it will open the Dev Toolbar then click the Script Tab and Start Debugging, then refresh your page. That's it!

IE8 有一个默认的内置 IE Developer 工具,您可以使用它来调试它。按 F12 它将打开开发工具栏,然后单击脚本选项卡并开始调试,然后刷新您的页面。就是这样!

IE8 Developer Toolbar

IE8 开发工具栏

回答by panky sharma

In case you want to hide all js errors in IE the use this code

如果您想隐藏 IE 中的所有 js 错误,请使用此代码

window.onerror = function(){return true;}

回答by New Guy

Try using the Developer tools found under the tools menu. There is a script tab that will allow you to debug. You can also get there by hitting the F12 key.

尝试使用工具菜单下的开发工具。有一个脚本选项卡可让您进行调试。您也可以通过按 F12 键到达那里。

回答by Mike Lewis

You may want to try using the Javascript Debugger that is built in to IE8. You can access it by going to Tools > Developer Tools and click script and start to debug.

您可能想尝试使用 IE8 内置的 Javascript 调试器。您可以通过转到 Tools > Developer Tools 并单击 script 并开始调试来访问它。

To see more, check this out.

要查看更多信息,请查看此内容

回答by It Grunt

Microsoft has also made available a free toolkit called Visual Web Developer Expressthat's a pretty comprehensive IDE for web development.

Microsoft 还提供了一个名为Visual Web Developer Express的免费工具包,它是一个非常全面的 Web 开发 IDE。