Answer the question
In order to leave comments, you need to log in
How to disable xdebug in PHP?
When sending an AJAX request, the server returns text with Xdevug styles, so js cannot parse this and an error pops up. How to disable xdebug for a given script?
php:
header('Content-Type: application/json');
return json_encode(1);
$.ajax({
url: '/ajax.php',
method: 'post',
dataType: 'json',
data: {type: 'test'},
success: function(data) {
console.log(data);
console.log('OK');
},
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question