issues with getAttributes()

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • daveyand

    issues with getAttributes()

    Guys,

    I'm having issues with getAttributes.

    I have done the following.

    attr_list = document.getEle mentById("image _id").getAttrib utes();

    I want to be able to loop around the attributes within an image so that
    i can see what is happening there.

    At the moment FF is saying getAttributes() isnt a function.

    Any help would be very much appreciated.

  • Martin Honnen

    #2
    Re: issues with getAttributes()

    daveyand wrote:
    I'm having issues with getAttributes.
    attr_list = document.getEle mentById("image _id").getAttrib utes();
    At the moment FF is saying getAttributes() isnt a function.
    Where do you think is getAttributes defined as a method of elements in
    the DOM? With JavaScript/ECMAScript there is a property named
    |attributes| e.g.
    var attr_list = document.getEle mentById('eleme ntid').attribut es;
    but no method of the name |getAttributes| is defined, that only exists
    in a Java binding of the W3C DOM.

    --

    Martin Honnen

    Comment

    • daveyand

      #3
      Re: issues with getAttributes()

      Oops,

      Sorry i knew there must be something stupid that i was doing wrong.

      Thanks for pointing that out. Where's a good DOM resource, i was
      blindly following the first one i came across when searching.

      Comment

      • Martin Honnen

        #4
        Re: issues with getAttributes()

        daveyand wrote:
        Where's a good DOM resource, i was
        blindly following the first one i came across when searching.
        In my view the W3C DOM specification has everything needed, you just
        need to understand how the ECMAScript binding looks. Thus with
        <http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1950641247>
        stating that an element has e.g.
        readonly attribute NamedNodeMap attributes;
        that translates in JavaScript/ECMAScript into element objects having a
        property named |attributes| accessed as e.g.
        elementObject.a ttributes


        --

        Martin Honnen

        Comment

        • Phrogz

          #5
          Re: issues with getAttributes()

          daveyand wrote:
          Thanks for pointing that out. Where's a good DOM resource, i was
          blindly following the first one i came across when searching.

          That includes DOM 2 HTML and DOM 2 Core methods, and no
          browser-specific extensions.

          Comment

          • nutso fasst

            #6
            Re: issues with getAttributes()


            "daveyand" <andrew.davey@g mail.comwrote in message
            news:1161188538 .820548.217440@ i3g2000cwc.goog legroups.com...
            Thanks for pointing that out. Where's a good DOM resource, i was
            blindly following the first one i came across when searching.
            The Document Object Model (DOM) connects web pages to scripts or programming languages by representing the structure of a document—such as the HTML representing a web page—in memory. Usually it refers to JavaScript, even though modeling HTML, SVG, or XML documents as objects are not part of the core JavaScript language.



            Comment

            Working...