老是忘了,保存以備後用。ajax
$.ajax({ url: '', //請求的url地址 dataType: "json", //返回的格式爲json async: true, //請求是否異步,默認true異步,這是ajax的特性 data:inData,//參數值 type: "GET", //請求的方式 beforeSend:function(){}, //請求前的處理 success: function(data) { // 請求籤的處理 fn(data); },complete:function(){}, //請求完成的處理 error: function(errorInfo) { alert("異常信息,稍後重試"); } });