how to manipulate with Json responce like a object?

Posted by loviji on Stack Overflow See other posts from Stack Overflow or by loviji
Published on 2010-03-16T14:06:59Z Indexed on 2010/03/16 14:16 UTC
Read the original article Hit count: 345

Filed under:
|
|

Hello, my jQuery.ajax return JSon object. I firstly read other articles. but their response text not likes mine. My Response content: from firebug response

{"item":"[{\"country\":\"USA\",\"lan\":\"EN\"},{\"country\":\"Turkiye\",\"lan\":\"TR\"}]"}

Now i trying to alert countryName:

$('#loadData').click(function() {
            $.ajax({
                type: "POST",
                url: "WS/myWS.asmx/getDaa",
                data: "{}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function(msg) {
                $("#jsonResponse").html(msg);
                    $.each(msg.item, function(i, d) {
                        alert(this.country);
                        debugger;
                    });
                },
            });
        });

but it is alerting "undefined"

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about AJAX