Tips for JS firebug
In fact, the development and progress of the front-end are also inseparable from the support of browsers. for developers, the best support for browsers is the good support for debug, and even in some subsequent projects, front-end debugging can even solve many problems ...... No, it's all tears! Let's talk about firebug in firefox. Although ff has a built-in debugging function, it does not feel perfect. for developers, it is not enough. So it is recommended to use firebug and the old front-end debug tool. It is easy to use! Both IE and Chrome have good tool support, which is basically enough, but I am used to ff and it is still strong under firebug.
1. Use the "debugger" keyword for fast breakpoint debugging
Normally, if we want to debugger the js Code, first go to the "script" Panel, find the js file to be debugged, and then click the breakpoint in the line you need to debug, and finally refresh the page, for example:
Example/7 MvZts + example + c/example/C0rPD5qGjts + example/example + ct2139hl97/yyc/example + CjxzdHJvbmc + M6Gi1rvP1Mq + example + PGJyPgo8L3A + upper/lower/gsMmjoTwvcD4KPHA + lower/lower + cq9u + lower/lower + m/9qOpoaM8YnI + lower = "http://www.2cto.com/uploadfile/Collfiles/20140809/20140809090531150.jpg" alt =" \ ">
4. How to view hover css attributes
If you move the mouse over a container with the hover attribute, the hover attribute will appear on the right side of the HTML panel, but if you want to keep the hover attribute in the panel, see:
Select ": hover.
5. Special debugging of the loop body
Debug the loop body. There is a cup of cake. You can set a breakpoint inside the loop. If you cycle 20 times, 20 breakpoints will be triggered ...... This is very sad and affects debugging efficiency. In fact, we only need to debug the situation of 2nd cycles.
Right-click the breakpoint and a blue pop-up layer will pop up, asking you to enter the monitoring expression. At this time, enter I = 2, and then press "F8 ", you will find that you have jumped directly to the second loop.
6. output the log message to the console.
Output "36ria.com" in your code, as shown below:
1. console. log ("36ria.com ');
2. console. error ('36ria. com ');
The efficiency of using console. log is higher than that of the original alert (). The key is that console. log () will not interrupt program execution.
7. Use the nameline tool to quickly locate objects
I personally think this is one of the most useful functions. In many cases, you can immediately see the content you want to view.
Enter the variable name of a variable in the command line. The detailed information is displayed on the console.