asp.net-000: Debugging JS Code

Source: Internet
Author: User
Asp. ENT Development Debugging Page JS code believe that even the rookie will, but I still have to wordy step. Because the use of JS on the page is too frequent, but also too prone to problems. Even if the master on the page to write long JS code, there will inevitably be bugs appear, out of the bug can only obediently debugging.
Asp. NET development, the background debugging code does not say, the direct code line breaks the point to be good. The front desk is a bit of trouble.
Pre-preparation work, generally in two kinds of situations.
One is to run the debugging directly in the project, such as visual studio2010 and the above directly in the VS to find the corresponding page to run directly.
Another is to deploy to IIS, then you have to open the app's page, then open vs project, attach to process debugging.

Either way, the key is to break the point and get the program to stop somewhere.
It is believed that many people have also used alert to display the value of a possible problem or the main sentence of a control's property. This is also a debugging method.
Of course the use of more is the following steps.

The first step is to open your default browser, or the one that your page is about to run. Settings to enable debugging,

The second step, in the suspicion of the problem of JS interrupt point, that is, add a sentence: "Debugger;",

The third step, perform the operation, the program will stop in debugger place,

Fourth step, you can F10 one step, look at the error, if you want to see a variable or an expression or the properties of the control, then use the monitoring function,



For example, this quick watch can put expressions, variables, controls, and so on to see all of its members, but you can also manually modify it here until you see the results you want.

This step is also the most used and very heavy step.


Finally, if it goes well, the problem is found. If there is something wrong, go ahead.

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.