jquery parse json

Posted by Eeyore on Stack Overflow See other posts from Stack Overflow or by Eeyore
Published on 2010-04-23T20:55:15Z Indexed on 2010/04/23 21:03 UTC
Read the original article Hit count: 372

Filed under:
|

I can't parse the JSON that I have no control of. What am I doing wrong here?

data.json

{
  "img": "img1.jpg",
  "img": "img2.jpg",
  "size": [52, 97]
}

{

  "img": "img3.jpg",
  "img": "img4.jpg",
  "size": [52, 97]
}

jquery

$.getJSON("data.json",
    function(data){
      $.each(data, function(i,item){
        alert(item.img[i]);
      });
    });

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about JSON