How to Use js for breakpoint debugging?

Source: Internet
Author: User
Although there have been countless debugging tutorials on the internet, I still have not found any article that is easy to understand. I simply try to write my own usage habits or experiences, I hope it will be helpful for children who are not very familiar with breakpoint debugging (please ignore it ~). 1. What is breakpoint debugging? Difficult? Breakpoint debugging is not really a complicated task. A simple understanding of non-outbound calls means opening the callback


Although there have been countless debugging tutorials on the internet, I still have not found any article that is easy to understand. I simply try to write my own usage habits or experiences, I hope it will be helpful for children who are not very familiar with breakpoint debugging (please ignore it ~).


1. What is breakpoint debugging? Difficult?

Breakpoint debugging is not a complicated task. To simply understand it, open a browser, open sources, find the js file, and click it on the line number. The operation seems very simple. In fact, many people are entangled in where to break the breakpoint? (Let's first look at a breakpoint, taking the breakpoint of chrome as an example)

The procedure is as follows:

1. still hitting the breakpoint on Line 1 → 2. click "load more"> 3. click the "Statement-by-statement execution" button, and the js code is executed to 228 rows → 4. use the mouse to select I ++? Is it because you want to copy something, do you want to select it? Yes, that is, this option) → 5. After the selection, move the cursor over the target and you will see the result.

Second:

This method is similar to the first one, but only outputs the I value on the console. You only need to follow the first method to Step 3 → 4. open console → 5. enter I → 6 in the input column below the console. press enter.

In the second method above, we mentioned the console. We can call it the console or anything else. This is not important ~ The console is very powerful. In the debugging process, we often need to know the output of some variable values, or we use the selector [$ ". "p")] whether or not the elements we want are selected can be printed on the console. Of course, you can use the first method directly.

We will show you how to print the elements we want to select in the console .~

Therefore, I personally think that the idea of debugging Bugs should be like this: first, whether js is successfully executed; second, whether js has logic problems, variable problems, parameter problems, and so on; finally, if there is no problem with the above, please carefully check the various symbols...

OK ~ Here is the breakpoint ~ If you have any questions, you can leave a message below ~ If you have any unknown knowledge points or are confused about the front-end, you can leave a message below. When you are free, I will continue to write some documents for your messages ~

The above is how to use js for breakpoint debugging? For more information, see other related articles in the first PHP community!

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.