...

View Full Version : Use of getAttributeNodeNS() is deprecated. Use getAttributeNS() instead.



xelawho
09-29-2011, 06:29 PM
hello. A simple example:



<!DOCTYPE html>
<html>
<head>
<title>blank</title>
<meta charset="UTF-8">
</head>
<body>
<style>
.hide{
display:none;
}
</style>
<input type="button" value="show div 1" onclick="showDiv('div1')">
<div class="hide" id="div1">Hi there!</div>
<script type="text/javascript">
function showDiv(divID){
document.getElementById(divID).style.display="block";
}
</script>
</body>
</html>

I have been using this technique for a while, but my version of firefox just updated itself and now it pops a warning that:
"Use of getAttributeNodeNS() is deprecated. Use getAttributeNS() instead."

I've googled and I can't make head or tail of what I'm supposed to be doing. Can somebody show me how the above code "should" be?

VIPStephan
09-29-2011, 10:33 PM
That sounds more like a Firefox internal error. Does it say in which file and which place the error occurs?

xelawho
09-29-2011, 11:57 PM
Does it say in which file and which place the error occurs?
No. The posted code is the entire file, and that's the entire message. It's not signalled as an error, just as a warning

I'm guessing it's got something to do with style.display=

because I don't get any messages with this:



<!DOCTYPE html>
<html>
<head>
<title>blank</title>
<meta charset="UTF-8">
</head>
<body>
<input type="button" value="show div 1" onclick="showDiv('div1')">
<div id="div1">Hi there!</div>
<script type="text/javascript">
function showDiv(divID){
document.getElementById(divID).innerHTML="Bye, then"
}
</script>
</body>
</html>

this: "In DOM Core 1, 2 and 3, Attr inherited from Node. This is no longer the case in DOM4." from here (https://developer.mozilla.org/en/DOM/Attr) seemed to be relevant... not that I actually understand what that means...

Dormilich
09-30-2011, 08:11 AM
this: "In DOM Core 1, 2 and 3, Attr inherited from Node. This is no longer the case in DOM4." from here (https://developer.mozilla.org/en/DOM/Attr) seemed to be relevant... not that I actually understand what that means...

in the DOM API up to version 3 (DOM-3) the Attr Interface (for attribute nodes) inherited from the Node Interface (general DOM object), i.e. it inherited all of Node’s properties and methods. in version 4 (DOM-4) this has been changed so now neither of Node’s properties and methods are available. with this change the Attr Interface has been reworked and some of the old properties/methods are removed.
Since DOM-4 got a clean-up, other Interfaces have been changed, too. like the Element Interface, which held the getAttributeNodeNS() method. since an attribute is not a Node anymore (does not inherit from that interface), the method name is incorrect and has been changed to getAttributeNS().

mrhoo
09-30-2011, 01:32 PM
Ignore it- it has been reported in bugzilla, perhaps the next version will have different bugs,

This one is responding (as vip stephen said) to its internal workings. The existing about: pages and profiles use getAttributeNode and getAttributeNodeNS, even if you don not.

The only way to remove it is to uninstall firefox, including your profilles, and install version 7 clean- it isn't worth it.

Kor
09-30-2011, 02:07 PM
In fact FF 7 shows no error. It is the FireBug which alerts that, but not as an error. As a warning. At least my FF 7.01 with FireBug 1.8.3 / win 7 behave like that. And it is certainly a bug, as it occurs even on the most usual actions, like opening a new Thread on this Forum :)

coiner
09-30-2011, 03:42 PM
Am I missing something here? I'm pretty sure that getAttributeNodeNS is deprecated, so why not just use getAttributeNS??

Kor
09-30-2011, 04:45 PM
Am I missing something here? I'm pretty sure that getAttributeNodeNS is deprecated, so why not just use getAttributeNS??

So why not getAttributeNode(). Never heard to have failed in any browser, new or old :)

You miss the point: A browser (in fact a plug-in : FireBug) like FF 7 signals an alert message like that for no reason, as the code above does not use getAttributeNodeNS nor getAttributeNode() anywhere. A bug, perhaps.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum