BFG wrote:
How can I read the object's attribute's name ? I mean something like this:
x = new Object
x.myAttr = 5
and how to get the 'myAttr' string ?
myAttr is a property name, why do you need to get it if you write that
code above yourself, in that case you know about the property and its
name so I am not sure why you need code to find it.
Anyway, if you want to enumerate the property names of that object x you
have created you can use a for..in loop:
var x = new Object();
x.myAttr = 5;
for (var propertyName in x) {
alert(propertyName + ': ' + x[propertyName]);
}
--
Martin Honnen
http://JavaScript.FAQTs.com/