The code below will loop through the properties in an object and alert a string. myObject is in JSON notation. The "for ( x in y)" construct does not work if the Prototype.js library is included on the page
- // output the name and value of all the objects properties
- var s = "";
- for (var property in myObject)
- s = s + "\n "+property +": " + myObject[property] ;
CommentsSubscribe to comments
You need to login to post a comment.