I am using a PHP script to create JSON data. It looks like this:
{\"Id\":0}
Now if I put that into a file and then load it using ajax it\'s
In your error function use this and check what data is being returned from the server.
error: function(jqXHR, textStatus, errorThrown) {
$('#result').html(textStatus + ' | ' + errorThrown + ' | ' + jqXHR.responseText);
alert(jqXHR.responseText);
}
You will know where exactly it is going wrong. The data type and the special characters. Set the content type to application/json and encode your json string using json_encode(). Also, you don't need the doctypes.