Wednesday, 21 December 2016

How to alert ajax response

$.ajax({
    url:"myscript.php",
    dataType: "json",
    success:function(data){
       var obj = jQuery.parseJSON(data);
       alert(obj.filename);
    }
});
$('#alertMessage').html(data.msg);

No comments:

Post a Comment