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
Doctypes belong on HTML documents, not JSON.
Try something like this in your PHP file (and only this)
{"Id":0}
Given what you have posted, I can't see any reason to even involve PHP. I'm guessing you've only posted a very simple example. Should it become more complex, involving server-side processing, data retrieval, etc, use PHP's json_encode()
, for example
0,
'foo' => $someOtherComplexVariable
);
echo json_encode($data);
exit;