如何在Firebug的外部JS脚本中设置断点 [英] How can I set breakpoints in an external JS script in Firebug

查看:140
本文介绍了如何在Firebug的外部JS脚本中设置断点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以轻松地在嵌入式JS函数中设置断点,但是我没有看到任何方式通过Firebug访问外部JS脚本,除非我碰巧在调试会话期间输入它们。有没有办法做到这一点,而不必探索我的方式进入脚本?



@Jason:这是一个好点,但在我的情况下,我不可以轻松访问脚本。我特别在谈论ASP.Net验证器调用的客户端脚本,我想调试。我可以通过输入函数调用在调试会话期间访问它们,但是我找不到直接访问它们的方法。

解决方案

查看和访问Firebug内的外部JavaScript文件(* .js):


  1. 点击脚本选项卡。 >
  2. 点击
    脚本代码内容窗口上方
    左上角的全部下拉菜单。

  3. 选择'显示静态脚本。

  4. 点击下拉式按钮,只需
    现在说static
    的权限(默认情况下,它应该显示名称
    您当前的网页)。您现在可以看到
    与当前网页
    相关联的文件列表
    ,包括任何外部JS文件。

  5. 选择您的$文件
    感兴趣,它的代码将
    显示在内容窗口中。从
    那里,你应该可以设置正常的
    断点。


I can easily set breakpoints in embedded JS functions, but I don't see any way of accessing external JS scripts via Firebug unless I happen to enter them during a debug session. Is there a way to do this without having to 'explore' my way into the script?

@Jason: This is a good point, but in my case I do not have easy access to the script. I am specifically talking about the client scripts which are invoked by the ASP.Net Validators that I would like to debug. I can access them during a debug session through entering the function calls, but I could not find a way to access them directly.

解决方案

To view and access external JavaScript files (*.js) from within Firebug:

  1. Click on the 'Script' tab.
  2. Click on the 'all' drop down in the upper left hand corner above the script code content window.
  3. Select 'Show Static Scripts'.
  4. Click on the dropdown button just to the right of what now says 'static' (By default, it should show the name of your current web page). You should now see a list of files associated with the current web page including any external JS files.
  5. Select the JavaScript file you are interested in and it's code will display in the content window. From there, you should be able to set breakpoints as normal.

这篇关于如何在Firebug的外部JS脚本中设置断点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆