I have an ajax request sending some data to a php file:
Ext.Ajax.request({
url: 'update.php',
method: 'POST',
success: function (){ alert("saved"); },
failure: function (){ alert("not saved"); },
params: { data: someData }
})
and update.php that has only two lines:
<?php
$res = array('success' => false);
echo json_encode($res);
?>
The success function is always executed.
What can be the problem?
For me, the function failure should be called when there is a problem with the request. e.g. If the server is down or the page update.php do not exist anymore.