确定哪些JS文件/行正在修改页面上的元素 [英] Determine which JS file/line is modifying an element on my page

查看:90
本文介绍了确定哪些JS文件/行正在修改页面上的元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要确定哪个JS文件/行正在修改页面上的一个元素。我想在这里找到一个干草堆。例如,我正在挖掘35个.js文件,找出哪个文件负责更改网页上的某些文字。对于这样一个简单的任务来说,似乎太多的工作。

I need to determine which JS file/line is modifying an element on my page. I'm trying to find a needle in a haystack here. For example, I'm digging through 35 .js files to find out which file is responsible for a change to some text on a webpage. It seems like too much work for such a simple task.

它可能会以许多不同的方式使用jQuery或只是javascript进行更改。方法是未知的。但是它会在页面加载中发生。

It could be changing it in many many different ways using jQuery, or just javascript. Method is unknown. But it happens on page load.

可以在Chrome(开发工具)中看到这些信息吗?

Is it possible to see this information in Chrome (Developer Tools)?

推荐答案

在Google Chrome中:

In Google Chrome:


  1. 右键单击要检测更改的元素。

  2. 在显示的开发工具的元素窗格中,再次单击该元素(在本例中为< label> 元素

  3. 选择断开... 属性修改(或 Subtree修改

  4. 重新加载Voila!你被停止在修改的JavaScript代码。

  1. Right-click on the element you want to detect changes to.
  2. In the Elements pane of the Developer Tools that shows up, right click on the element again (in this case a <label> element.
  3. Choose Break on…Attributes Modifications (or Subtree Modifications)
  4. Reload. Voila! You are stopped at the JavaScript code making the modification.

这篇关于确定哪些JS文件/行正在修改页面上的元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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