20 questions
0 votes
1 answer
91 views
Will ReactJs app benefit in any way if I will include dom4 polyfill? do i need dom4 with ReactJs?
My app is fully done with ReactJs and there are no DOM manipulations outside React. Will ReactJs app benefit in any way if I will include dom4 polyfill? https://github.com/WebReflection/dom4
1 vote
1 answer
1k views
How to know, where exactly MutationRecord happened (multiple targets)?
I trying to observe a group of elements. Quantity of elements can be various : from 1 to 10. $observedElements = document.querySelectorAll('em.price'); // in that time length will be 3. // $...
0 votes
1 answer
150 views
Create Xpath Manually
I want to create xpath which must contain word "Asia" //div[@id='destination-loadLevel0']/div/ul/li/div/div/span *for Asia //div[@id='destination-loadLevel0']/div/ul/li[2]/div/div/span *for ...
1 vote
1 answer
1k views
javascript cloneNode deep but change parent nodeType/nodeName
How to cloneNode and then convert that nodeName, cuz I want the attributes copied and children deeply (https://developer.mozilla.org/en-US/docs/Web/API/Node.cloneNode?redirectlocale=en-US&...
2 votes
3 answers
2k views
Require minimum browser versions for a web application
I have a web application in PHP which in the frontend requires some more modern browser features like the MutationObserver. As stated on the site only very new browsers support this feature. The same ...
0 votes
1 answer
1k views
Avoiding DOMSubtreeModified event to be fired on adding ID to a tag
I am using DOMSubtreeModified to get all DOM changes in a div. var stoppedTyping=""; $(".jqte_editor").on("DOMSubtreeModified", function(e) { if (stoppedTyping) clearTimeout(stoppedTyping); ...
0 votes
1 answer
358 views
Is there a way to detect which MutationObserver a callback was called from?
If I have a single callback function and two MutationObservers for two different dom nodes, is there a way to tell which observer triggered the callback when it is called? The work the callback needs ...
20 votes
1 answer
4k views
To what degree can the Shadow DOM be emulated using a polyfill?
Can the Shadow DOM W3C draft be polyfilled in JavaScript by providing custom functions for searching and traversing the DOM? Has this been done? The attempts I've found have been rather meek shims and ...
53 votes
2 answers
12k views
When are MutationObserver callbacks fired?
I know that MutationObservers callbacks may get called sometime after the DOM change. But the question is: What is the timing of these callbacks? Do the callbacks enter the event queue of the browsers?...
41 votes
3 answers
39k views
Mutation Observer for creating new elements
I am trying to make a function go off when a particular div is created. In the simplest of terms, I have something like this: <a href="" id="foo">Click me!</a> <script> $("#foo")....
7 votes
1 answer
5k views
DOM4: Deprecated properties and methods, what does it mean?
"Warning: In DOM Core 1, 2 and 3, Attr inherited from Node. This is no longer the case in DOM4. In order to bring the implementation of Attr up to specification, work is underway to change it to no ...
5 votes
5 answers
3k views
hasChildNodes vs firstChild
while (div.hasChildNodes()) { fragment.appendChild(div.firstChild) } while (div.firstChild) { fragment.appendChild(div.firstChild) } Comparing the two pieces of pseudo code above, they both ...
1 vote
2 answers
2k views
Why is event.timeStamp 0 in firefox?
http://jsfiddle.net/wDddR/3/ var input = document.createElement("input"); input.onclick = function (ev) { console.log(ev.timeStamp === 0 ? "WHY IS IT ZERO" : "It's not broken"); }; input.click() ...
13 votes
2 answers
2k views
How to emulate Event.timeStamp
Event.timeStamp The timeStamp attribute must return the value it was initialized to. When an event is created the attribute must be initialized to the number of milliseconds that has passed since 00:...
6 votes
3 answers
1k views
What throws DOMErrors
Introduction DOMError is an interface defined by the DOM. I would like to check whether a browser supports it. A naive check is window.DOMError !== undefined A better check would be to use an ...