get methods of DOM objects

O

oeyvind toft

I`m writing a script (for IE6) that scans a html file for all kind of
properties. Selecting
an object or an object id causes its propertynames and values to be written
to a textarea.

To get a list of functions supported by the object I use an array of
functionnames to test against.
However, while this works fine it is not very practical.

Is there a way to get the names of the methods of various DOM objects ?
Or are all marked as not enumerable and not accessable in any way?


Oeyvind
 
M

Martin Honnen

oeyvind said:
I`m writing a script (for IE6) that scans a html file for all kind of
properties. Selecting
an object or an object id causes its propertynames and values to be written
to a textarea.

Is there a way to get the names of the methods of various DOM objects ?
Or are all marked as not enumerable and not accessable in any way?

That depends on the browser, try to enumerate e.g.

function getObjectProperties (object) {
var result = '';
for (var property in object) {
result += property + ': ' + object[property] + '\r\n';
}
return result;
}

getObjectProperties(document.body)

and check the result, here with IE 6 on Windows XP some event handler
attributes are listed but other methods not.
 
O

oeyvind toft

and check the result, here with IE 6 on Windows XP some event handler
attributes are listed but other methods not.

Thanks for your reply Martin.

I`ve done the basic object scanning in about the same way as you do. And I
get the same result:
some handlers.

However, what I`m interested in is the
addBehavior, applyElement, appendChild etc...methods.

Its easy to set up an array and test for those methods, but as I said,
a bit inpractical.

(Allthou I`m currently looking for a complete list (not info, just a simple
list) of all the IE6 DOM object methods that could
be useful when setting up a complete function names array)


Oeyvind


http://home.online.no/~oeyvtoft/ToftWeb/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top