Date: 09/12/06 (Javascript Community) Keywords: no keywords Where is the "undefined" in the alert coming from?
var propval;
var contactList = [{"name":"foo","locaction":"bar"}];
for (prop in contactList[0]) {
propval += prop + "=" + contactList[0][prop] + "\n";
}alert(propval);
Source: http://community.livejournal.com/javascript/111228.html
|