简体   繁体   English

如何检查任何地方是否触发了Javascript事件?

[英]How do I check if any Javascript event has been fired, anywhere?

I came across this question: How to find out which JavaScript events fired? 我遇到了一个问题: 如何找出触发了哪些JavaScript事件?

But, that method of using Firebug will help me only if I log the events of a particular element right? 但是,仅当我记录特定元素的事件时,使用Firebug的方法才对我有帮助吗?

Here's my situation: 这是我的情况:

I want to analyze a webpage. 我想分析一个网页。 It displays a list of headlines, and after you scroll down at the bottom of the page, something happens and then it fetches the next 20 headlines from the server and adds it back to the page. 它显示了一个标题列表,并在页面底部向下滚动之后,发生了一些事情,然后从服务器获取了下20个标题,并将其添加回了页面。 I would like to know exactly which event is fired and which function is called as this happens. 我想确切地知道触发了哪个事件以及在发生这种情况时调用了哪个函数。 How do I do that? 我怎么做?

Use Chrome or Firefox Developer Tools and check under the networks tab. 使用Chrome或Firefox开发者工具,然后在“网络”标签下进行检查。 For Firebug check console or scripts. 对于Firebug,请检查控制台或脚本。 It shows you all the external files that have been used in your page. 它向您显示页面中已使用的所有外部文件。

别忘了

console.log("event fired");

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

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