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);
        $.ajax({
            type: "POST",
            dataType: "json",
            url: "http://15.27.0.180/cr/z0501/getconfig", //Relative or absolute path to response.php file
            data: data,
            success: function(data) {

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


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


    });


Source: ajax

Leave a Reply