July 13th, 2003, 01:18 PM
I know I've seen code that dumps (at least it seemed!) all the objects in a window and shows their properties--presumably using a for..in loop or nested for..in loops.
But, alas, when I tried to do same myself, I don't seem to get far because I can't list them without knowing what they are first. (That is, I can list user-defined properties of Object or Array or whatever well enough, but I haven't figured out how to list automatically everything pertaining to classes deriving from Object and so on.) I'm not concerned about listing (or just assigning to a variable) DOM objects in a web page--I think I can handle that.
But how do I retrieve a tree or similar object that contains all user-defined classes and functions? Obtaining the core or built-in classes and functions is also desirable. (I realize the function code won't appear, but it's nice to know what's there.)
For example, in Venkman we can view loaded scripts and open windows. Selecting an open script permits dropping down a list of functions in that script, which in turn can highlight that function in a source code window.
Can anybody help? Thanks in advance.
July 15th, 2003, 03:09 PM
So no one knows a way--via the prototype object or whatever--the derive a tree or list of objects, classes, or functions on the page?
July 24th, 2003, 11:22 AM
i know that IE and opera will list properties with the following:
i've not tried it with NN though.
give it a bash. bear in mind that this example only does it for the event, you could do all sorts of things and it's unlikely to reveal anything but browser specific stuff which means it's not that portable.
July 31st, 2003, 12:00 PM
Thanks so much for your response. I've been away for a while, or I would have responded sooner. I'd been trying similar things, and your answer triggered me to come back to the problem.
Seem to be making some progress this time around. Thanks again.
July 31st, 2003, 01:29 PM
you mentioned not needing a DOM tree, but you might still be interested in this page.