FireBug Debugging JS Primer-How to debug JS

Source: Internet
Author: User


Installation is needless to say, very simple, in Firefox plugin library to find Firebug on the OK. The following figure is the Firebug Debug window.

Firebug Art use is very common, the company art sister with very skilled oh, and for our developers, mainly with it to debug JS. Look at the official introduction to the Debug feature.
Firebug includes a powerful JavaScript debugger that lets your pause execution at the any time and the what each variable Looke d like at that moment. If your code is a little sluggish, use the JavaScript Profiler to measure performance and find bottlenecks fast.
In short, FireBug allows us to debugjs and view variables at any time, and to find out the performance bottlenecks in JS.
The figure below is how to find the Web application JS, activate the Firebug, click Script, and then select the JS you want to debug next to all.

The following figure is how to break the point basically like Eclipse, click on the line number to OK.
The following figure is how to set a condition on a breakpoint and enter a breakpoint if the condition fits, especially when debug is a complex function.
The following figure is how to step through, as F11 as Eclipse, single step
The following figure is a stack for viewing calls, which is helpful for complex JS Debug.

The following figure is to view the variable basically the same as Eclipsedebug.


The following figure looks at the variable at the breakpoint.


There is a very useful function, the code line between the rapid switch, so that thousands of lines of JS debugging is easy.
The following figure is the performance test results, using a very simple point profile

There is also a log function is more practical, look at the figure if you do not want to enter the breakpoint every time, use this is the best.
The basic usage is this, hope to be helpful to everybody.

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.