dom元素上添加斷點(使用dom breakpoint找到修改屬性的javascript代碼)

使用dom breakpoint能快速找到修改了某一個dom element的JavaScript code位於何處。
在Chrome development tool裏,選中想要inspect的dom element,右鍵選擇Break on->Attributes modifications:

 

 

之後在DOM Breakpoint裏能看到對應的entry:

 

 

點擊Resume script execution,自動在dom attribute發生變化的地方停下來:

 

 

從callstack能得知是jQuery的hide方法設置了display:none的屬性。

 

 轉自:https://blog.csdn.net/i042416/article/details/93310709

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章