Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
953 views
in Technique[技术] by (71.8m points)

debugging - Programmatically stop JavaScript execution in Firebug

I am currently debugging complex JavaScript code with Firebug. I am looking for a way to stop the JavaScript execution as if it was a breakpoint programmatically.

Example:

instructions ...
degugger.breakpoint(); // the execution stops here as if a breakpoint was
                       // manually set
other instructions ...
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can use the debugger statement:

// your JS code
...
// break here
debugger;

It works in all major browsers.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...