How to get data value using this code?

I used this below code to post data to server,its working fine,but How do I get values of data.Suppose server will send name and surname of a persion alert message showing these values but how do I get in variable…please help…

        var data = {"data":{"app_name":"hansel","device_id":"123456"}};
        //data = $(this).serialize() + "&" + $.param(data);
            type: "POST",
            dataType: "json",
            url: "", //Relative or absolute path to response.php file
            data: data,
            success: function(data) {

                $.each(data, function(key, value){
                $.each(value, function(key, value){

                    alert("key" +key +""+value)
                    var servervalues=value;
        return false;


Source: ajax

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.