JS Debug Notes

Source: Internet
Author: User

JS debugging a lot of methods, today summed up the most practical breakpoint method:

Debugger Breakpoint

This is very common, but many people do not know can actually add conditions to judge

if (something) {debugger;}

SOURCE Breakpoint

This is the most common, do not do too much explanation, specifically say a few important icons:

The recovery script executes to the next breakpoint

Skip to Next line

Enter Current function

Jump out of the current function

Toggle Breakpoint on/Off

Automatic breakpoint in case of exception

Where "into the current function" and "out of the current function" is easy to confuse, in fact, in most cases, the difference is not small, the difference is: if the current breakpoint statement is a function execution statement, such as a (), the "Enter the current function" will enter its function body, jump out of the current function is not.

Dom Breakpoint

Select the DOM element and right-click on to select subtree modifications (the child node tree is changed), attribution modifications (attribute changed), node removal (nodes removed), add nodes, Can be viewed in source-->dom breakpoints or element-->dom breakpoints

Event Listener (Listener) Breakpoint

Source-->event Listener breakpoints can be viewed in the event monitoring breakpoint, in the checkbox to listen to all the corresponding events on the page

XHR Breakpoint

We can add a breakpoint condition to an asynchronous breakpoint by source-->xhr breakpoints "+" on the right, and the JS logic automatically generates a breakpoint when the URL satisfies this condition when the asynchronous request is triggered.

JS Debug Notes

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.