【问题标题】:How to track a javascript function?如何跟踪javascript函数?
【发布时间】:2016-10-24 13:07:03
【问题描述】:

我目前正在开发 Chrome 扩展,我需要找到一种方法来了解元素正在调用什么 javascript 函数。

<button class="yt-uix-button yt-uix-button-size-default yt-uix-button-text yt-uix-button-empty yt-uix-button-has-icon appbar-guide-toggle appbar-guide-clickable-ancestor"
        id="appbar-guide-button" type="button" onclick=";return false;"
        aria-label="Przewodnik" aria-controls="appbar-guide-menu" aria-expanded="false">
  <span class="yt-uix-button-icon-wrapper">
    <span class="yt-uix-button-icon yt-uix-button-icon-appbar-guide yt-sprite">
    </span>
  </span>
</button>

如您所见,对 javascript 函数的唯一引用是 onclick=";return false;",它什么也没给我。必须在外面调用。

当我单击它时,正在执行一个 javascript 函数,但我需要找到它是什么函数。我该怎么做?

【问题讨论】:

标签: javascript


【解决方案1】:

您可以使用 F12 开发人员工具查看响应鼠标点击而发生的所有函数调用。

【讨论】:

  • 就是这样。谢谢!我会在一秒钟内将此标记为答案
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-08-04
  • 1970-01-01
  • 2010-09-26
相关资源
最近更新 更多