可以这样来:var jqxhr = $.post("example.php", function(){alert("成功");}).error(function(){alert("出错");});要注意,这种用法适用于 jQuery 1.5另外,也可以通过调用全局的 .ajaxError() 方法来处理错误