今天我听说不推荐使用jQuery.ajax函数中的success-Parameter.我理解正确吗?还是我想念一些东西?
例如,这将来不会起作用:
$.ajax({
url: 'ax_comment.php',
type: 'POST',
data: 'mode=view¬e_id='+noteid+'&open='+open+'&hash='+hash,
success: function(a) {
...
}
});
Run Code Online (Sandbox Code Playgroud)
我必须使用这个吗?
$.ajax({
url: 'ax_comment.php',
type: 'POST',
data: 'mode=view¬e_id='+noteid+'&open='+open+'&hash='+hash,
success: function(a) {
...
}
}).done(function(a){.....};
Run Code Online (Sandbox Code Playgroud)
资料来源:http://api.jquery.com/jQuery.ajax/(向下滚动到弃用通知)