admin管理员组文章数量:1201647
I have a very complex website and I know that somewhere is an alert()
with a description. Is there a way to set a breakpoint on the alert()
call? The HTML is generated, so I cannot just grep for the message.
I have a very complex website and I know that somewhere is an alert()
with a description. Is there a way to set a breakpoint on the alert()
call? The HTML is generated, so I cannot just grep for the message.
2 Answers
Reset to default 28You can use the console to replace the alert
function:
window.alert = function() { debugger; };
Firebug's Script panel allows you to search for code throughout all your JavaScript sources.
So you can simply search for alert(
or search for the message that the alert box shows and set a breakpoint on the line where it's called.
Another way is to use the Break On Next button ( ) to stop at the next JavaScript statement that gets executed. So, click the button and then do the action that causes the alert box to be displaced.
Note: This only works if there are no other event handlers called before the event showing the alert box.
本文标签: javascriptHow to set breakpoint in Firebug on alert()Stack Overflow
版权声明:本文标题:javascript - How to set breakpoint in Firebug on alert()? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738597679a2101880.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论