Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Posts
    2,981
    Thanks
    56
    Thanked 557 Times in 554 Posts

    Use of getAttributeNodeNS() is deprecated. Use getAttributeNS() instead.

    hello. A simple example:

    Code:
    <!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?

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,724
    Thanks
    6
    Thanked 1,013 Times in 986 Posts
    That sounds more like a Firefox internal error. Does it say in which file and which place the error occurs?

  • #3
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Posts
    2,981
    Thanks
    56
    Thanked 557 Times in 554 Posts
    Quote Originally Posted by VIPStephan
    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:

    Code:
    <!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 seemed to be relevant... not that I actually understand what that means...

  • #4
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    3,350
    Thanks
    13
    Thanked 349 Times in 345 Posts
    Quote Originally Posted by xelawho View Post
    this: "In DOM Core 1, 2 and 3, Attr inherited from Node. This is no longer the case in DOM4." from here 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().
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer

  • #5
    Regular Coder
    Join Date
    Mar 2006
    Posts
    728
    Thanks
    35
    Thanked 132 Times in 123 Posts
    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.

  • #6
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    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
    Last edited by Kor; 09-30-2011 at 01:11 PM.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #7
    New Coder
    Join Date
    Mar 2010
    Posts
    30
    Thanks
    0
    Thanked 1 Time in 1 Post
    Am I missing something here? I'm pretty sure that getAttributeNodeNS is deprecated, so why not just use getAttributeNS??

  • #8
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    Quote Originally Posted by coiner View Post
    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.
    Last edited by Kor; 09-30-2011 at 03:47 PM.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •