Web Development Standard-developer tools-js Debugging

Source: Internet
Author: User

Like the focus of the profession, seven points of study attitude.

JS: The full name Javascript,web, JS mainly in two places:

    • HTML <script type= "Text/javascript" ></script>.
    • JS script file, page reference js:<script src= "Js/***.js" ></script>
      JS debugging is generally in the browser developer tool "debugger" tab page.

F12 Open the Browser developer tool.


Developer Tools

The main focus is on the left-hand code box and the right-side monitoring area.

Key points: breakpoints, monitoring, debugging tools.

A simple summary of the debugger is the breakpoint + monitoring + debugging tool.

Breakpoint

The debugger first adds breakpoints before running, letting the program stop at the breakpoint before monitoring and debugging.
Add a breakpoint: The line number left click, the breakpoint flag appears after the breakpoint is added, and the program is stopped at the breakpoint.


Breakpoint Monitoring

When the program stops at the program debugging interface, you can add objects that you want to monitor, including objects and formulas.
Add monitoring: Select an object or formula, right-click, add Monitoring.

    • Object Monitoring
      Select Object---Right-click---add monitoring, and the right side gets the value of the object.


      Object Monitoring
    • Formula Monitoring

Select the formula-right----add monitoring, and the right side gets the value of the object.


Formula Monitoring Debugging Tools

When the program pauses at the breakpoint can use debugging tools, step by step to observe the direction of the program.


Debugging Tools

Use the Step debugging tool to perform one line at a time, observe the program running steps, observe the running steps using "Enter debugging" into the calling method when encountering the calling method, and when the call hierarchy is deep, use "jump out" back to the outer layer of the method and use "Run" to finish debugging.

Code Search

In the debugging interface there is an input box to retrieve the current code content, content positioning, you can enter the direct positioning.


Code Search

Development tools for everyone has some of their own habits, the most suitable, most accustomed to their own groping, is the best.

Step by step, adhere to the accumulation, persist in learning.

Web Development Standard-developer tools-js Debugging

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.