genisiob (AT) pilot (DOT) msu.edu (Brian) writes:
Quote:
I am working on a utility script to browse the supported objects in a
browser. I know I can get the object members, by:
for( member in eval(obj_name) ) |
.... but you shoudn't use eval like that. If obj_name contains the name
of a global variable, just write "window[obj_name]". If nothing else,
it is probably orders of magnitude faster that using eval.
Quote:
but, is there something similar for getting all of the methods? |
There is no difference between "members" and "methods" in Javascript.
They are all object properties. The for(..in..) construction iterates
throught all the *enumerable* properties. There is no easy way to find
the names of non-enumerable properties (like all the properties of
the array prototype). So, no.
/L
--
Lasse Reichstein Nielsen - lrn (AT) hotpop (DOT) com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'