从jQuery 1.5开始,您可以使用延迟对象机制:
$.post('some.php', {name: 'John'}) .done(function(msg){ }) .fail(function(xhr, status, error) { // error handling });另一种方法是使用
.ajax:
$.ajax({ type: "POST", url: "some.php", data: "name=John&location=Boston", success: function(msg){ alert( "Data Saved: " + msg ); }, error: function(XMLHttpRequest, textStatus, errorThrown) { alert("some error"); }});


