Just wondering why this code is working:
var response = $.ajax({
data: {'my data here'},
url: 'myurl.php',
type: 'POST',
dataType: 'JSON'
});
response.done(success_callback_here,
// watch this below:
// this snippet will execute if myurl.php echo something.
// otherwise, it doesn't
function () {
removeOverLayer();
}
);
response.always('always_fun_here');
response.fail(......);
I've tried to find something useful from here, but I didn't get much from it. Can someone tell me why please?