First open the Firefox plug-in: firebug, check the script "enable", and check"Interrupt at all errorsAnd then refresh the running website. If a JS error or exception occurs, firebug automatically loads the error JS and stops it in the wrong row. At this time, you need to view the value of the variable (you can see the value of the variable in the "Monitor" on the right side, you can also see the value of the variable through the mouse, you can also establish a monitoring expression ). If the value of the variable is null or undefined, it is generally that the value passed by the caller is null, so find the Caller: You can see the call tree on the "stack" page on the right, click on the caller layer to find out which level of passed parameters are faulty. After locating the real error source, you can set a breakpoint before it and run the website again to locate the error. Note:
Single-step debugging: Enter (F11), skip (F10), and exit in one step,
Monitoring: Variable value and monitoring expression
Stack: Call tree
Breakpoint: List all breakpoints and cancel a breakpoint.
Set breakpoints: Click Set breakpoint on the leftmost side and right-click to set the expression:"Stops at the breakpoint only when the expression is true.".
Refer:
Firebug advanced usage-powerful web development tool