16Dec/13

jQuery loop over Java JSON string

Review a simple jQuery example to loop over a JavaScript array object. var json = [ {“id”:”1″,”tagName”:”apple”}, {“id”:”2″,”tagName”:”orange”}, {“id”:”3″,”tagName”:”banana”}, {“id”:”4″,”tagName”:”watermelon”}, {“id”:”5″,”tagName”:”pineapple”} ]; $.each(json, function(idx, obj) { alert(obj.tagName); }); Above code snippet isRead More…