只是想知道为什么这段代码有效:
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(......);
我试图从here找到有用的东西,但我从中得不到多少。有人能告诉我为什么好吗?