The problem is most likely related to the attribute dataType
. You wrote json
, but repeat the line.
You have two options:
1) Either return json like this (in php)
echo json_encode(array('result' => 1));
And then in javascript get a value like this
if (parseInt(response.result) === 1) {
2) - dataType
html
, javascript :
if (parseInt(response) === 0) {
===
(, , ..). parseInt
, , , , .