Questions tagged [mutation-events]

Mutation Events have been deprecated in favor of Mutation Observers.

Mutation Events provided a way to notify javascript of changes to the DOM. It didn't go so well: http://lists.w3.org/Archives/Public/public-webapps/2011JulSep/0779.html

Mutation Events is not performant, and has many issues. Use instead.

68 questions
9
votes
2 answers

Are DOM Mutation Observers slower than DOM Mutation Events?

The following code utilize DOM Mutation Event DOMNodeInserted to detect the existence of the body element and wrap its innerHTML into a wrapper.
Ian Y.
  • 2,293
  • 6
  • 39
  • 55
8
votes
3 answers

Feature-detect: mutation-event availability in JavaScript?

How can my JavaScript detect if an event is available? I'm aware of some great event-compatibility tables, but I need to use feature detection, not browser-sniffing plus a lookup table. Specifically, my JS makes great use of the DOM mutation…
8
votes
1 answer

Why doesn't MutationObserver code run on Chrome 30?

From http://updates.html5rocks.com/2012/02/Detect-DOM-changes-with-Mutation-Observers I got the following code: var insertedNodes = []; var observer = new WebKitMutationObserver(function(mutations) { alert('run'); …
weilou
  • 4,419
  • 10
  • 43
  • 56
7
votes
4 answers

Does Disqus have public events to attach to?

I need to perform some re-calculations after disqus form gets an update. A new comment, error message just to name a few. In essence any event that causes the Disqus iframe to expand vertically. Checked the API, but didn't find any public events.…
spliter
  • 12,321
  • 4
  • 33
  • 36
4
votes
1 answer

Mutation Observer does not detect nodes added through innerHTML, appendChild

When we try to add nested nodes in DOM using appendChild or innerHTML, the nested nodes do not come in the addedNodes of a mutation. Initial HTML setUp:
Here is my…
skjindal93
  • 706
  • 1
  • 16
  • 34
4
votes
2 answers

DOMNodeInserted or hashchange

I am trying to write a JavaScript script that is "overlayed" on top of a Facebook page. It uses DOMContentLoaded to detect when content is loaded, then adds some extra stuff in. However, because Facebook doesn't actually "reload" the page when going…
jakey
  • 41
  • 2
4
votes
4 answers

Library for DOM mutation events?

I need to trigger an action when content is added to a Web page. The updates can be of different nature (AJAX, delayed scripts, user action for example) and are not under my control. I wanted to use DOM mutation events, but they are not available in…
Christophe
  • 27,383
  • 28
  • 97
  • 140
3
votes
4 answers

onpropertychange for a textbox in Firefox?

How to handle the onpropertychange for a textbox in Firefox using JavaScript? Below is an example: var headerBGColorTextBox = document.getElementById('<%= tbHeaderBGColor.ClientID %>'); if (headerBGColorTextBox != null) { …
Tushar Maru
  • 3,347
  • 10
  • 34
  • 53
3
votes
1 answer

DOMSubtreeModified not working in chrome

I have this code working perfectly in firefox.