dom3

Replacement for DOM3 getUserData/setUserData methods

旧城冷巷雨未停 提交于 2020-01-04 11:43:33
问题 So we've got some old-school Firefox extension code that uses the DOM3 methods get/setUserData() to pass around data in the DOM. Unfortunately, these have been deprecated in DOM4, so Firefox is planning to drop support for them, and Chrome never supported them in the first place. Is there a cross-browser replacement? jQuery's $.data seems to be an option, but 'pure' JavaScript would be preferable. 回答1: So in the end we decided to go with jQuery after all, the core library is only around 75k

Replacement for DOM3 getUserData/setUserData methods

帅比萌擦擦* 提交于 2020-01-04 11:43:09
问题 So we've got some old-school Firefox extension code that uses the DOM3 methods get/setUserData() to pass around data in the DOM. Unfortunately, these have been deprecated in DOM4, so Firefox is planning to drop support for them, and Chrome never supported them in the first place. Is there a cross-browser replacement? jQuery's $.data seems to be an option, but 'pure' JavaScript would be preferable. 回答1: So in the end we decided to go with jQuery after all, the core library is only around 75k

DOM Level 3 XPath in Internet Explorer

吃可爱长大的小学妹 提交于 2019-12-28 10:51:50
问题 I just installed IE10 on my Windows 7, and I've noticed that, even if I'm glad that XMLs from AJAX requests are now compatible DOM documents, a rather basic function like document.evaluate is still not supported. What's worse is that, since those XMLs are not the custom Microsoft IXMLDocument objects, the nodes don't support selectNodes and selectSingleNode anymore. In the end, it seems that IE10 does not support DOM Level 3 XPath or MSXML Xpath. Seriously, Microsoft? Is there something I'm

Implementation of a DOM listener

我的梦境 提交于 2019-12-12 09:59:29
问题 I was thinking there was no DOM listener so I implemented my own 'heavy' listener: function CvHelper(stackApi) { var that = this; // check if room is finished loading this.init = function() { if ($('#loading').length) { setTimeout(that.init, 1000); } else { console.log('Chatroom finished loading'); that.postListener(); } } } (function() { var stackApi = new StackApi(); var cvHelper = new CvHelper(stackApi); cvHelper.init(); })(); I think this just sucks. So I did a search on here on SO and

DOM mutation events replacement

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-26 17:32:24
Since DOM mutation is marked as deprecated by the w3c (see http://www.w3.org/TR/DOM-Level-3-Events/#events-mutationevents ), is there an (fast) alternative way to detect attribute modification in the DOM ? As far as I know there is no alternative (yet) so you are stuck with DOMAttrModified which is only supported in Firefox and Opera. In IE you have the onpropertychanged event but there is no way to get similar functionality in Chrome/Safari. There are a number of things you could do depending on what you are trying to accomplish and the browsers you are targetting: define getters and setters

DOM mutation events replacement

五迷三道 提交于 2019-11-26 05:27:55
问题 Since DOM mutation is marked as deprecated by the w3c (see http://www.w3.org/TR/DOM-Level-3-Events/#events-mutationevents), is there an (fast) alternative way to detect attribute modification in the DOM ? 回答1: As far as I know there is no alternative (yet) so you are stuck with DOMAttrModified which is only supported in Firefox and Opera. In IE you have the onpropertychanged event but there is no way to get similar functionality in Chrome/Safari. There are a number of things you could do

Why is the DOMSubtreeModified event deprecated in DOM level 3?

天涯浪子 提交于 2019-11-26 00:33:55
问题 Why is the DOMSubtreeModified event deprecated and what are we supposed to use instead? 回答1: If you scroll down a bit, you see: Warning! The MutationEvent interface was introduced in DOM Level 2 Events, but has not yet been completely and interoperably implemented across user agents. In addition, there have been critiques that the interface, as designed, introduces a performance and implementation challenge. A new specification is under development with the aim of addressing the use cases