当我单击一个元素时,如何找出运行什么javascript? [英] How do I find out what javascript runs when I click an element?

查看:42
本文介绍了当我单击一个元素时,如何找出运行什么javascript?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在查看 Bing Maps 网站.我正在打开我的位置编辑器,然后单击图形工具栏中的折线工具.

I am looking at the Bing Maps site. I am opening up the my places editor and clicking the polyline tool in the drawing toolbar.

当我单击绘图工具栏中的工具时,我想发现运行什么javascript.

I would like to discover what javascript runs when I click on tools in the drawing toolbar.

我看过html,并且元素上没有声明 onclick 事件.

I have looked at the html and there is no onclick event declared on the element.

我已经对页面引用的所有脚本进行了文本搜索,以获取折线工具元素的ID.这是为了尝试找到将click事件附加到元素上的javascript,但我根本没有找到匹配项.

I have done text searches on all of the scripts referenced by the page, for the ID of the polyline tool element. This was to try to find javascript that attaches a click event to the element, but I got no matches at all.

单击工具时,必须运行一些脚本.单击工具栏中的工具div时,如何找出正在执行的脚本?

There must be some script running when I click on a tool. How do I find out what script is executing when I click the tool divs in the toolbar?

如果我不首先知道设置断点的脚本,我认为无论如何我都无法设置断点.无论如何,无论是在IE F12开发人员工具中还是在Firebug中,我都可以捕获运行的JavaScript来发现它是什么?

I don't think there is anyway I can set breakpoints if I don't first know what script to set them on. Is there anyway I can trap the javascript that runs to discover what it is, either in IE F12 developer tools or in firebug?

推荐答案

您可以查看Chrome中的事件监听器"面板,其中包含有关附加到元素的每个监听器的详细信息.

You can have a look at the "Event Listeners" panel in Chrome, it has detailed information about each listener attached to an element.

这篇关于当我单击一个元素时,如何找出运行什么javascript?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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