[ACCEPTED]-How to do JavaScript object introspection?-introspection
Your question is a bit vague, so maybe you 9 can provide more details?
As for finding 8 out about an object and the values of its 7 properties, there are many ways to do it, including 6 using Firebug or some other debug tools, etc. Here 5 is a quick and dirty function that might 4 help get you started until you can provide 3 more details:
function listProperties(obj) {
var propList = "";
for(var propName in obj) {
if(typeof(obj[propName]) != "undefined") {
propList += (propName + ", ");
}
}
alert(propList);
}
That will display a list of 2 the properties of the object that you pass 1 it that are not undefined
.
Hope that helps...
Is selector
the name of the element? If so then 3 you should reference it as:
$('area#selector')
or
$('#selector')
otherwise it 2 will attempt to look for the (non-existent) "selector" HTML 1 tag and, obviously, not find it.
Though this answer is a bit late, I'd still 1 recommend checking out these links:
http://www.webweavertech.com/ovidiu/weblog/archives/000317.html
http://www.syger.it/Tutorials/JavaScriptIntrospector.html
More Related questions
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.