Are you talking about code within <script>
tags, or in the HTML tag attributes, like this?
<a href="#" onclick="alert('this is inline JS');return false;">Click</a>
Either way, the debugger
keyword like this will work:
<a href="#" onclick="debugger; alert('this is inline JS');return false;">Click</a>
N.B. Chrome won't pause at debugger
s if the dev tools are not open.
You can also set property breakpoints in JS files and <script>
tags:
- Click the Sources tab
- Click the Show Navigator icon and select the a file
- Double-click the a line number in the left-hand margin. A corresponding row is added to the Breakpoints panel (4).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…