By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,635 Members | 1,781 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,635 IT Pros & Developers. It's quick & easy.

issues with getAttributes()

P: n/a
Guys,

I'm having issues with getAttributes.

I have done the following.

attr_list = document.getElementById("image_id").getAttributes( );

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.

Oct 18 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
daveyand wrote:
I'm having issues with getAttributes.
attr_list = document.getElementById("image_id").getAttributes( );
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.getElementById('elementid').attributes;
but no method of the name |getAttributes| is defined, that only exists
in a Java binding of the W3C DOM.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Oct 18 '06 #2

P: n/a
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.

Oct 18 '06 #3

P: n/a
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.attributes
--

Martin Honnen
http://JavaScript.FAQTs.com/
Oct 18 '06 #4

P: n/a
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.
http://phrogz.net/ObjJob/object.asp?id=258
That includes DOM 2 HTML and DOM 2 Core methods, and no
browser-specific extensions.

Oct 18 '06 #5

P: n/a

"daveyand" <an**********@gmail.comwrote in message
news:11**********************@i3g2000cwc.googlegro ups.com...
Thanks for pointing that out. Where's a good DOM resource, i was
blindly following the first one i came across when searching.
http://developer.mozilla.org/en/docs/DOM
Oct 18 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.