My JavaScript debugging environment (3)

Source: Internet
Author: User
Last Article I am very happy to hear from many netizens. I mentioned a lot of things that I didn't quite know. I would like to thank them first, and then continue my script debugging environment.

We simply use.. Net open an HTML file containing the script, and we find that we cannot debug it. Although we can set an endpoint according to F9, this breakpoint is essentially a virtual :(. This is because our browser has not entered the debugable status.CodeWhen an error occurs, select the debugger method to enable the browser to enter the debugging state. A more common method is to append the browser thread to the debugger. Example of test.html:

The additional thread goes to the browser process that runs test.html, that is, "iexplore. EXE" in the processes list ".

In this way, press F9 on the script code to set the breakpoint. the breakpoint state changes from the first unavailable state to the second available state.

In this way, our code will be stopped when it is executed at the breakpoint. This is like a nonsense. The following is where vs. NET 2005 is better than vs. NET 2003. If we have used. net compiled program debugging, all know that put the mouse on the variable name, there will soon be a tooltip to display the value of the variable, or the object type and default tostring () value. This function is also available in 2003 and 2005, but for object objects, a {...} is displayed in 2003. If you want to see {...}, what is it? You need to use add watch or quickwatch. In Whidbey, this view function has been greatly improved. We will see a scalable node to display the object value, you can view the entire object tree in the pop-up window, for example:

Does this seem very convenient for debugging? Of course, if we think that the pop-up window is too large to block the code, and now we have browsed a lot of object trees, there are a lot of pop-up windows on the screen, we do not want them to disappear, what should I do if I read the code and try again? We can press Ctrl or the middle mouse button (scroll wheel) to make these pop-up windows transparent ~~~

Is it really cool and considerate?

Problems and countermeasures that may be encountered in the debugging script (we have enabled the options that allow script debugging by default by IE ):

1. After debugging the IE Script,ProgramWhen a script error occurs, an msgbox is displayed to indicate whether to debug it, instead of displaying a warning icon in the lower left corner of IE. However, after a long period of debugging, when the script is incorrect, the debugging prompt box is no longer displayed, but the error icon is displayed in the lower left corner. It's easy to solve this problem. Just turn off the browser and re-open it for debugging.

2. When the script runs normally, we use the open and break at next statement options of IE's view-> script debugger to forcibly bring up the script debugger selection window. However, if we have enabled the popup window in the script, the two debugging options will be invalid, that is, there is no response after clicking. This may be a bug in IE. solution 1: restart ie for debugging. solution 2: Write an incorrect script call before the script statement you want to debug, such as. a; in this way, the program runs in. when Statement A is executed, it will be break and the error debugging prompt msgbox will pop up. We can select the debugger at this time. After Entering the debugging status, use the mouse to change the script execution sequence and skip the wrong statement.

Write the script debugging environment here first, and I will update it later for better debugging methods. You are welcome to provide better suggestions and suggestions for script debugging.

The end.

ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF
ASDF

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.