且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何设置在Visual Studio 2008或Visual Studio 2010中的JavaScript断点

更新时间:2023-02-27 15:12:32

如果你的脚本是在一个单独的脚本文件(.js文件),那么你可以只用F9就行设置一个断点。

If your script is in a separate script file (.js), then you can just use F9 to set a breakpoint on a line.

您不能设置一个断点,如果脚本是像一个aspx文件的另一个文件中。对于这样的情况下,使用调试器。 JavaScript语句强行突破在一定的点

You can't set a breakpoint if the script is incorporated in another file like an aspx file. For cases like that, use the debugger; javascript statement to force a break at a certain spot.

另外,还要确保你正在使用你的JavaScript文件的最新版本,如果有必要做一个按Ctrl-F5在IE中强制文件的一个新的重载。

Also make sure that you are working with the latest version of your javascript file, do a Ctrl-F5 in IE if necessary to force a fresh reload of the file.