$.ajax({method: "POST",url: "some.php",data: { name: "John", location: "Boston" }}).done(function( msg ) {alert( "Data Saved: " + msg ); // 1}).fail(function() {
alert( "error" );});//其中 1 那一列可改成$( "#results" ).append( msg );或$( "#results" ).innerHTML( msg );等格式,依照需要去變化完全做完之後,及done 或 error完成後,可以用.always 持續下一個動作。基本上我喜歡用 setTimeout 去接續
沒有留言:
張貼留言