简体   繁体   English

如何使用 Firebug 调试实际事件/侦听器?

[英]How to use Firebug for debugging ACTUAL events/listeners?

I'd like inspect especially Drupal's Javascript/AJAX events so that I could "hook" into them with own Javascript.我想特别检查 Drupal 的 Javascript/AJAX 事件,以便我可以使用自己的 Javascript 来“挂钩”它们。

For instance how to hook into Add another module's Javascript events when it fires and when it is ready?例如,如何在触发和准备就绪时挂钩添加另一个模块的 Javascript 事件? How to acquire name of the event and other relevant definitions?如何获取事件名称及其他相关定义? Submit buttons has to be the one for this.提交按钮必须是用于此的按钮。

Firefox developer tool must be a great tool - if you know how to use it. Firefox 开发者工具一定是一个很棒的工具——如果你知道如何使用它。 Also Chromes developer tool and if I take a look at for example a submit button on a form on Drupal site it lists 30-40 events/listeners under devtools Events tab.还有 Chromes 开发人员工具,如果我查看例如 Drupal 站点上表单上的提交按钮,它会在 devtools 事件选项卡下列出 30-40 个事件/侦听器。

Too much, too fast太多,太快
There are multiple mentions of jquery.js, ajax.js, form.js, different js includes from modules etc. Are these all really used for one button?多次提到jquery.js、ajax.js、form.js、不同的js包含来自模块等。这些都是真的用于一个按钮吗? Or are these just as "for your information" and "scraped" from all those included Javascript files?或者这些只是“供您参考”并从所有包含的 Javascript 文件中“删除”? Like a documentation that hey, this can do this and that and you can use these and those properties etc...就像一个文档,嘿,这可以做这个和那个,你可以使用这些和那些属性等等......

What is actually relevant and what is just FYI?什么是实际相关的,什么只是仅供参考?
How to find just the right ones from there?如何从那里找到合适的? Now this 30-40 listeners/events/whatever seem quite overwhelming... And if there's something that is only for informative purpose then can it be filtered to show only valid things that are actually used?现在这 30-40 个听众/事件/任何看起来都非常令人难以抗拒的东西......如果有些东西仅用于提供信息,那么是否可以对其进行过滤以仅显示实际使用的有效内容?

What comes from which Javascript file?什么来自哪个 Javascript 文件?
By using unmodified Javascript files it makes more sense since all parameters are exposed in complete sensible names and not as a, b and c etc. However, the Scripts tab with Watch functionality offers quite a number of variables and there's no connection to Javascript files so one can't know what is actually defined in which Javascript file?通过使用未修改的 Javascript 文件更有意义,因为所有参数都以完整的合理名称公开,而不是作为 a、b 和 c 等。但是,具有监视功能的脚本选项卡提供了相当多的变量,并且与 Javascript 文件没有任何联系不知道在哪个 Javascript 文件中实际定义了什么? And is something browser based?是基于浏览器的吗?

I'd like inspect especially Drupal's Javascript/AJAX events so that I could "hook" into them with own Javascript.我想特别检查 Drupal 的 Javascript/AJAX 事件,以便我可以使用自己的 Javascript 来“挂钩”它们。

For instance how to hook into Add another module's Javascript events when it fires and when it is ready?例如,如何在触发和准备就绪时挂钩添加另一个模块的 Javascript 事件? How to acquire name of the event and other relevant definitions?如何获取事件名称及其他相关定义? Submit buttons has to be the one for this.提交按钮必须是用于此的按钮。

Firefox developer tool must be a great tool - if you know how to use it. Firefox 开发者工具一定是一个很棒的工具——如果你知道如何使用它。 Also Chromes developer tool and if I take a look at for example a submit button on a form on Drupal site it lists 30-40 events/listeners under devtools Events tab.还有 Chromes 开发人员工具,如果我查看例如 Drupal 站点上表单上的提交按钮,它会在 devtools 事件选项卡下列出 30-40 个事件/侦听器。

Too much, too fast太多,太快
There are multiple mentions of jquery.js, ajax.js, form.js, different js includes from modules etc. Are these all really used for one button?多次提到jquery.js、ajax.js、form.js、不同的js包含来自模块等。这些都是真的用于一个按钮吗? Or are these just as "for your information" and "scraped" from all those included Javascript files?或者这些只是“供您参考”并从所有包含的 Javascript 文件中“删除”? Like a documentation that hey, this can do this and that and you can use these and those properties etc...就像一个文档,嘿,这可以做这个和那个,你可以使用这些和那些属性等等......

What is actually relevant and what is just FYI?什么是实际相关的,什么只是仅供参考?
How to find just the right ones from there?如何从那里找到合适的? Now this 30-40 listeners/events/whatever seem quite overwhelming... And if there's something that is only for informative purpose then can it be filtered to show only valid things that are actually used?现在这 30-40 个听众/事件/任何看起来都非常令人难以抗拒的东西......如果有些东西仅用于提供信息,那么是否可以对其进行过滤以仅显示实际使用的有效内容?

What comes from which Javascript file?什么来自哪个 Javascript 文件?
By using unmodified Javascript files it makes more sense since all parameters are exposed in complete sensible names and not as a, b and c etc. However, the Scripts tab with Watch functionality offers quite a number of variables and there's no connection to Javascript files so one can't know what is actually defined in which Javascript file?通过使用未修改的 Javascript 文件更有意义,因为所有参数都以完整的合理名称公开,而不是作为 a、b 和 c 等。但是,具有监视功能的脚本选项卡提供了相当多的变量,并且与 Javascript 文件没有任何联系不知道在哪个 Javascript 文件中实际定义了什么? And is something browser based?是基于浏览器的吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM