Hi all,
Pretty simple question today. I'm trying to create a new property/value pair in an Object from a couple variables (which are strings), but this is the result I'm getting:
var oObject = new Object();
var oName = "someProperty";
var oValue = "someValue";
oObject.oName = oValue;
for (var i in oObject){
alert(i); // Alerts "oName"
alert(oObject[i]); // Alerts "someValue"
}
How can I get the first alert to show "someProperty" instead of "oName"?
Thanks a ton guys.



Reply With Quote

Bookmarks