How to build or find an object browser for javascript?
E.g. Delphi integrated developement environment ('ide') offers a very
practical object browser for Pascal language. When typing a name with a
dot you get a list of objects,propert ies and methods to select from.
When you select or type a methodname or function and the left
parenthesis , the system writes the possible argument types. With key
F1 one gets thorough description of the object, property, method.
In javascript it is easy to get a list of object properties and its
contained objects t e.g. with this code:
function listObjectProp( obj){
var s='';
o=eval(obj);
for (var x in o){ s=s+typeof o[x]+":"+x+":"+o[x]+"\n";}
return s;
}
alert(listObjec tProp('window.d ocument.locatio n')); // any object name
possible as an argument
We get numbers, strings, booleans, objects and some user defined
functions to this list, but not all functions of objects.
How to get functions also? And their parameter lists? Is the only way to
make manually list of all those and fetch from that list with a script?
Venkman and Dom browser in Mozilla might be a way to go but they look a
bit heavy, when here a major part of the work might be done on those 6
code lines above :).
If using mailing address, remove XXXX
E.g. Delphi integrated developement environment ('ide') offers a very
practical object browser for Pascal language. When typing a name with a
dot you get a list of objects,propert ies and methods to select from.
When you select or type a methodname or function and the left
parenthesis , the system writes the possible argument types. With key
F1 one gets thorough description of the object, property, method.
In javascript it is easy to get a list of object properties and its
contained objects t e.g. with this code:
function listObjectProp( obj){
var s='';
o=eval(obj);
for (var x in o){ s=s+typeof o[x]+":"+x+":"+o[x]+"\n";}
return s;
}
alert(listObjec tProp('window.d ocument.locatio n')); // any object name
possible as an argument
We get numbers, strings, booleans, objects and some user defined
functions to this list, but not all functions of objects.
How to get functions also? And their parameter lists? Is the only way to
make manually list of all those and fetch from that list with a script?
Venkman and Dom browser in Mozilla might be a way to go but they look a
bit heavy, when here a major part of the work might be done on those 6
code lines above :).
If using mailing address, remove XXXX
Comment