I am currently trying to figure out how I can find out what errors are in my php script.
I have made a small script which an error on purpose. Using the chrome console I get...
Uncaught SyntaxError: Unexpected token <
However, normally PHP errors would point you to the line in which the error occurs.
Here is my AJAX Request.
var myData = "Hello";
$.ajax({
type: "GET",
url: 'test.php',
datatype: 'json',
data: { data: myData},
success: function(output) {
var result = $.parseJSON(output);
for(var i=0; i<result.length; i++){
console.log(result[i]);
}
}
});
And my PHP script with the syntax error
$data = ($_GET['data']);
echoo boom;
echo json_encode(array($data, "test"));
As you can see, line 2 is the error but the error in my console gives me no information as such.
Thanks