Javascript in debug IE

Source: Internet
Author: User

The default script debugging is disabled. To enable it, you must:

Tools-> Internet Options... -> Advanced-> disable script debugging

 

On XP SP2, the options are split into two items:

Tools-> Internet Options... -> Advanced-> disable script debugging (Internet Explorer)
Tools-> Internet Options... -> Advanced-> disable script debugging (other)

 

After you enable script debugging, the menu item 'view-> script debugger' will become visible. You can use it to break the file into the debugger.

 

Generally, three types of Debugger are used: Visual Studio, Microsoft Script debugger, and Microsoft Script Editor.

 

To put it simply, the script debugging in Visual Studio.

Method 1: For example, there is a page containing JavaScript HTML.

    • Enable script debugging in IE (see image: Tools-> Internet Options-> advanced)
    • Open the HTML file in Visual Studio
    • Set a breakpoint and hit F5/start debugging or hit F10/F11 to single step

The rest is just like debugging.ProgramSame.

 

Method 2: If the application cannot be started by clicking F5 in Visual Studio, for example, the script is still on the server before the debug starts, the second method is required.

    • Open the web site in Visual Studio and open the. js file for editing
    • Set a breakpoint at a suitable place in the. js file (eg in the this. initialize function)
    • In Visual Studio go to debug-> attach to process
    • Ensure that either automatic or script is selected as the type of code to debug (see images below)
    • Select the relevant ie process from the available process and click "Attach" (see image below)
    • Return to IE and load up the gadet (or reload it) and the breakpoint shoshould fire and you'll drop back into Visual Studio as before

The only unpleasant thing is that you often need to go in and out in the "attach to process" dialog box. This disadvantage is not worth mentioning compared to the powerful functions of Visual Studio.

 

If you want to open a new browser in Visual Studio, you can select a page in Solution Explorer, right-click and choose "Browse with". Here you can change the default browser.

 

Original article:

Script debugging with Visual Studio

http://blogs.msdn.com/mikeormond/archive/2006/01/13/512496.aspx

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.