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
3
votes
1 answer

How can I detect AJAX node insertion without using DOM mutation events?

I'm trying to write a Greasemonkey script that alters keywords in Twitter posts. Trouble is, the content is "late loading" and is added to at the users request. If I were adding event listeners to the added elements, I could use JQuery's delegate().…
Tom Wright
  • 11,278
  • 15
  • 74
  • 148
2
votes
1 answer

Detecting DOM change events

Is there a way to detect DOM change events? whether it be text replacement, moving a node, removing or adding a new node, etc.
Kar
  • 6,063
  • 7
  • 53
  • 82
2
votes
2 answers

Event listener for html5 details node state change

I am trying to add an event listener to detect a change in the state of an HTML5 details node. Initially I tried attaching a listener to the open and close events as it makes logical sense to me for a details node to have those listeners, but it…
Alice Wonder
  • 896
  • 2
  • 9
  • 17
2
votes
4 answers

Jquery - run function when DOM element is added

I have a website with jQuery and jQuery UI. I have a Javascript function: function ToButton() { $(".ToButton").button(); } This function runing after the page load and change all elements with class "ToButton". Also I change HTML code when user…
2
votes
1 answer

MutationObserver and querySelectorAll

I am currently learning Javascript and one of my chapters is "Mutation Observer". I am trying to create a simple function which detects if a new div was added to the page and display it in the console. However, I am getting this message and I…
2
votes
3 answers

How can I find where a javascript event is initiated?

I have a JS script which created a new Node and inserts it to the HTML page. I am handling DOM mutation events and can capture DOMNodeInserted event. Inside that function I want to find out the source (i.e. in which part of the HTML has the script…
Praveen
  • 49
  • 6
2
votes
2 answers

DOMNodeInserted and DOMNodeRemoved events

The code below is working fine, apart from the counter. When I add an item to the list, the counter is accurate, though when I remove an item from the list, it doesn't subtract one from the counter. Any ideas? HTML
2
votes
1 answer

XUL attaching events to anchors added with javascript

I'm writing a firefox extension that adds event listeners to all the anchor tags on a page. Essentially I have: window.addEventListener("load", function() { myExtension.init(); }, false); var myExtension = { init: function() { var…
2
votes
1 answer

jQuery/XML: synchronizing data and representations using DOM-Mutation-Events

I'm creating a web application which uses jQuery to modify and HTML to represent the data. There can be several representations in the document related to a single data node. The user can dynamically create them. For example, data will be…
user144490
1
vote
2 answers

Which HTMLElement property change generates DOMAttrModified?

I have a question about DOMAttrModified. Which changes to an HTML Element properties triggers the DOMAttrModified event (specifically interested in Firefox, but an answer that applies to other browsers might suffice too)? I have the following test…
Sunil Agrawal
  • 679
  • 4
  • 14
1
vote
1 answer

Mutating Nuxt Component

I've been trying to learn vuex for weeks now (I've seen dozens of tutorials and they only go over the counter example). I'm slow and still can't grasp how to do this. My idea is to be able to switch tabs between components. I know that I'm supposed…
1
vote
0 answers

Trigger event when a css class appear

I've a problem coding an addons for firefox browser. The addons is supposed to make sound when a CSS class appear "error-class" or "warn-class". I use the mutation observer to check if my class appear and to store the fact that I played the sound.…
1
vote
1 answer

How can I detect with JavaScript when an element's styles change in Webkit? (Since DomAttrModified doesn't appear to be supported)

Possible Duplicate: is there an alternative to DOMAttrModified that will work in webkit I'm trying to detect with JavaScript when an element's styles have been changed. If this change is detected (.NET validators becoming visible when triggered),…
CSSquirrel
  • 11
  • 1
1
vote
1 answer

mirror a html section

I would like to create an html page with a div that will contain the same content as another div. i want that any change in the origin will be reflected in the destination. Can you please help with: 1 - Which DOM events do I need to listen to? 2 -…
1
vote
1 answer

Radio button unchecked after clicked in AJAX-like scenario

I have a textfield for which change events are bound to a function that validates the textfield's value and may splice a corresponding validation error message into the DOM above the textfield. If the change event is triggered by clicking one of a…