Error retrieving json information with ajax

0

I'm doing a JSON request, which returns me the results, but not the date, but rather the ajax error.

 var url = window.location;
var id = url.toString().split("=")[1];
var msg = '';
$.ajax({
    type: 'POST',
    url: 'load-data.php?id='+id,
    dataType: 'json',
    success: function(data) {
         msg = data;
         alert(msg)

    },
    error:function(e){
        console.log(e)
    }
});

How can you repair underneath

I just do not understand why the result appears in the ajax error.

    
asked by anonymous 15.12.2016 / 13:03

0 answers