最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

jquery - is it possible to set a "watch" on an HTML element such that it hits a javascript debugger breakpoint

programmeradmin0浏览0评论

Is it possible to set up a "listener" of some sort on an HTML element such that when this element is changed (perhaps by javascript / jQuery) the javascript debugger breaks on the line of code that changed it?

When my web page loads I see a list of "li" list item of text. Initially the text is legible,however, at some point there is some javascript/ jquery code that changes the list items to scrunch up together thus no longer making as easy to read.

is it possible to sort of "guard" these list items or make them read-only so that anything that tries to change them throws an exception?

Is it possible to set up a "listener" of some sort on an HTML element such that when this element is changed (perhaps by javascript / jQuery) the javascript debugger breaks on the line of code that changed it?

When my web page loads I see a list of "li" list item of text. Initially the text is legible,however, at some point there is some javascript/ jquery code that changes the list items to scrunch up together thus no longer making as easy to read.

is it possible to sort of "guard" these list items or make them read-only so that anything that tries to change them throws an exception?

Share Improve this question asked May 13, 2013 at 23:35 user1068636user1068636 1,9497 gold badges36 silver badges63 bronze badges 1
  • Some browsers (notably Opera) are prone to giving a "FOUC" (Flash Of Unstyled Content) before the CSS kicks in, so the effect you're seeing may be caused by CSS, not Javascript. Try eliminating CSS before looking for a Javascript cause. – Beetroot-Beetroot Commented May 14, 2013 at 1:11
Add a ment  | 

1 Answer 1

Reset to default 9

In Chrome, you can do this by inspecting an element, and then in the Elements view, right click the DOM node you want to break on and select the desired behavior from the "Break on" menu.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论