简体   繁体   中英

Debug Java Script code in Visual Studio 2010

I'm writing a visual studio project template using the .vsz method(Custom Wizard) on Visual Studio 2010.

I got an auto-generated Java Script file named default.js, which some base code, and I expanded the code according to my own needs.

Now I'ld like to debug the Java Script code, and I didn't find any way to so so.

so I have the VS 2010 IDE opened on my desktop, with the default.js file opened on it. Till now I just saved the code changes I made, with ctrl+s, closed the VS, opened a new instance of VS, and saw the changes actually.

But now I got into troubles which I must debug the JS code in order to solve them.. I tried going to Internet Explorer->Tools->Internet Options->Advanced->and cleared the *Disable script debugging (Internet Explorer) and the *Disable script debugging (Other) checkboxes, then I tried to put a breakpoint in the .js code in VS, but nothing happened...

Do you know what I have to do else in order to debug this script?

You have several ways:

  1. Write debugger in your .js code wherever you want to start debugging. Upon reaching that code you'll be transferred to the VS and you'll be able to debug.
  2. You can use your browser's developer tools. For instance, in Chrome you can press F12 to bring up the developer tools, and find your code under the Sources tab. From there, you can click on your line of code and it will bring up debugging when you reach that code. Same goes for other browsers.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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