Map browser DOM using Javascript

Posted by EddyR on Stack Overflow See other posts from Stack Overflow or by EddyR
Published on 2010-06-13T09:34:17Z Indexed on 2010/06/13 9:42 UTC
Read the original article Hit count: 222

Filed under:
|
|

I'm trying to map a browsers DOM using javascript. It should list all the functions and attributes associated with it and it should also recurse through any object attributes.

Now as I understand it 'window' is the most top-level node (although I've see a reference to 'top' as well in Chrome.) then 'document', etc. However I've never seen 'Node' under 'window' and yet I can call it. So where is 'Node' located? Is there a level above 'window' or is it a separate object (W3C says it's supposed to be inherited by 'document' only.)?

I've been playing with a function to do this but I keep getting weird results so I'm not post it here.

Alternatively - is it possible to get the properties from the object types instead of the object reference itself? for example 'DOMWindow' instead of 'window'. I think this would stop duplicating data from inherited objects.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about dom