简体   繁体   中英

Finding syntax errors in large javascript file in Visual Studio

Is there a way to tell Visual Studio to compile a particular javascript file and highlight any syntax errors, or to tell VS to include javascript syntax errors with line numbers the Errors listing? At the moment I have VS2010, but would like to know if this is possible in 2012 too.

Visual Studio doesn't compile Javascript. It is executed in your broswer. If anything crashes, your browsers console will tell you so in most of the cases. You could access the browsers console (dev-tools) with a keyboardshortcut (eg Chrome/Firefox CMD+ALT+i on MAC or CTRL+SHIFT+i on Windows).

In some cases (jquery with wrong selector) there is no error message; but if you really have syntax errors like missing brackets or something like that, you will find an error message at the console.

Perhaps you are looking for an extension like: http://visualstudiogallery.msdn.microsoft.com/288a2b0f-1357-47b4-8215-1134c36bdf30

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