Reading JSON string in Jquery

Posted by Bala on Stack Overflow See other posts from Stack Overflow or by Bala
Published on 2010-03-26T15:38:46Z Indexed on 2010/03/26 15:43 UTC
Read the original article Hit count: 157

Filed under:
|

Hi All

When i try to read a JSON string like below it goes to endless loop.

<script language="javascript">
           $(document).ready(function() {

               $("#Button1").click(function() {
                   var json = "[{'City':'Lucknow','ID':'1'},{'City':'Mumbai','ID':'2'}]";
                   $.each(json, function() {
                       alert(this['City']);
                  });


           });
    </script>

Not sure what i am doing wrong? Please helpme out!

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about JSON