简体   繁体   English

进入IE8中的JavaScript错误的确切行?

[英]Get to exact line with javascript error in IE8?

If I have an error in my javascript code, and I run the page on google chrome, I click wrench icon > tools > JavaScript console, and it shows me (in red) the exact line in my js causing the error. 如果我的JavaScript代码有错误,并且我在google chrome上运行该页面,请点击扳手图标>工具> JavaScript控制台,它会向我显示(红色)导致错误的js代码。

On IE, I click the yellow "!" 在IE上,我点击黄色的“!” icon in the status bar, and it gives me an error message, along with a line #. 状态栏中的图标,它会显示一条错误消息以及#号行。 While this is often helpful, many times it is not: (1) the line # in my source file often differs from the line # that IE gives me; 尽管这通常是有帮助的,但很多时候却无济于事:(1)我的源文件中的行号通常与IE给我的行号不同; (2) in complex systems, there might be several js files involved, and the IE message doesn't tell me which one. (2)在复杂的系统中,可能涉及多个js文件,而IE消息不会告诉我哪个。

So my question is: are there any options that get IE8 to show me the exact js line with the error -- without having to install anything? 所以我的问题是:是否有任何选项可以使IE8向我显示带有错误的确切js行-无需安装任何内容?

I know that IE8 has a built-in javascript console, and I recall using it, but I don't remember figuring out how to achieve with it the goal I've stated in this post. 我知道IE8有​​一个内置的javascript控制台,我记得使用它,但是我不记得要弄清楚如何用它实现我在这篇文章中提到的目标。

Thanks in advance. 提前致谢。

What about using "Developing Tools" on IE8? 在IE8上使用“开发工具”怎么样? I've been using for a while and works well. 我已经使用了一段时间,效果很好。 You can find it on "Tools" menu or pressing F12 key. 您可以在“工具”菜单上或按F12键找到它。

If you go to "Script" tab, you can find console, breakpoints, local variables, etc that could be useful to you. 如果转到“脚本”选项卡,则可以找到可能对您有用的控制台,断点,局部变量等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM