如何使用firefox适用于javascript的debugger命令

                       

首先安装firebug,在firefox的扩展里搜索安装即可。
然后在页面中启用firebug中的脚本:

启用firebug的脚本调试

然后在网页某些位置加入debugger命令,比如如下页面代码:

<!DOCTYPE html><html><head><meta charset="utf-8" /><title>js弹出新窗口</title><script type="text/javascript">    function open_new(obj){        debugger;        window.open(obj.href,'search','width=400,height=300,left=500,top=500,scrollbars,resizable');    }</script></head><body>    <a href="http://www.baidu.com" onclick="open_new(this);return false;">    go to baidu to search!</a></body></html>
   
   
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18

在鼠标单击链接时,会执行open_new()函数,而该函数中含有debugger命令,所以会在这个地方中断下来。你可以停下来查看一些变量的值,或选择继续执行。

           

再分享一下我老师大神的人工智能教程吧。零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到我们人工智能的队伍中来!https://blog.csdn.net/jiangjunshow

猜你喜欢

转载自blog.csdn.net/qq_43678568/article/details/87725966