锘??xml version="1.0" encoding="utf-8" standalone="yes"?> 鐢╦avascript鐨勫啓鐨勶細 濡備綍娣誨姞select鐨刼ption鍛紵 鏈夊涓嬩袱縐嶆柟娉曪紝褰撶劧榪樻湁鍏跺畠鐨勬柟娉曪紝涓嬮潰鐨勫彧鏄粡甯哥敤鍒幫細 ①JS浠g爜錛?/p>
②JQuery浠g爜錛?/p>
鏂囩珷鏉ヨ嚜錛?a >http://sh2015yao.iteye.com/blog/859678
]]>
]]>
1.ajaxStart(鍏ㄥ眬浜嬩歡)
2.beforeSend
3.ajaxSend(鍏ㄥ眬浜嬩歡)
4.success
5.ajaxSuccess(鍏ㄥ眬浜嬩歡)
6.error
7.ajaxError (鍏ㄥ眬浜嬩歡)
8.complete
9.ajaxComplete(鍏ㄥ眬浜嬩歡)
10.ajaxStop(鍏ㄥ眬浜嬩歡)
鍏朵腑錛屽叏灞浜嬩歡鍙互鍦╝jax鐩稿叧鏂規硶澶栧紩鐢紙姣斿錛岄氳繃璇ユ柟寮忓皢ajax鎵ц鍚勪釜闃舵鐨勪俊鎭樉紺哄湪欏甸潰鏌愪釜鍦版柟錛夈?/p>
涓嬩緥婕旂ず涓嬈jax璇鋒眰榪囩▼涓悇涓簨浠舵墽琛岀殑欏哄簭錛屼互鍙婂叏灞ajax鐨勪嬌鐢ㄦ柟娉晇iew plaincopy to clipboardprint?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<mce:script src="http://code.jquery.com/jquery-latest.js" mce_src="http://code.jquery.com/jquery-latest.js"></mce:script>
<mce:script type="text/javascript"><!--
$(function(){
//鐐瑰嚮鎸夐挳錛屽茍鎵цajax璇鋒眰
$("#ajaxReuqestID").click(function(){
$.ajax({
url: "http://blog.csdn.net/gaoyusi4964238",
beforeSend:function(){
$("#ajaxStateID").text("berforeSend");
alert("berforeSend");
},
success: function(){
$("#ajaxStateID").text("success");
alert("success");
},
error:function(){
$("#ajaxStateID").text("error");
alert("error");
},
complete:function(){
$("#ajaxStateID").text("complete");
alert("complete");
}
});
});
$("#ajaxStateID").ajaxStart(function(){
$(this).text("ajaxStart");
alert("ajaxStart");
}).ajaxSend(function(){
$(this).text("ajaxSend");
alert("ajaxSend");
}).ajaxSuccess(function(){
$(this).text("ajaxSuccess");
alert("ajaxSuccess");
}).ajaxError(function(){
$(this).text("ajaxError");
alert("ajaxError");
}).ajaxComplete(function(){
$(this).text("ajaxComplete");
alert("ajaxComplete");
}).ajaxStop(function(){
$(this).text("ajaxStop");
alert("ajaxStop");
});
})
// --></mce:script>
</head>
<body>
<input type="button" value="鐐瑰嚮瑙﹀彂ajax璇鋒眰" id="ajaxReuqestID"/>
<div id="ajaxStateID"></div>
</body>
</html>
鏈枃鏉ヨ嚜CSDN鍗氬錛岋細http://blog.csdn.net/gaoyusi4964238/archive/2009/08/13/4443401.aspx
1.ajaxStart(鍏ㄥ眬浜嬩歡)
2.beforeSend
3.ajaxSend(鍏ㄥ眬浜嬩歡)
4.success
5.ajaxSuccess(鍏ㄥ眬浜嬩歡)
6.error
7.ajaxError (鍏ㄥ眬浜嬩歡)
8.complete
9.ajaxComplete(鍏ㄥ眬浜嬩歡)
10.ajaxStop(鍏ㄥ眬浜嬩歡)
鍏朵腑錛屽叏灞浜嬩歡鍙互鍦╝jax鐩稿叧鏂規硶澶栧紩鐢紙姣斿錛岄氳繃璇ユ柟寮忓皢ajax鎵ц鍚勪釜闃舵鐨勪俊鎭樉紺哄湪欏甸潰鏌愪釜鍦版柟錛夈?/p>
涓嬩緥婕旂ず涓嬈jax璇鋒眰榪囩▼涓悇涓簨浠舵墽琛岀殑欏哄簭錛屼互鍙婂叏灞ajax鐨勪嬌鐢ㄦ柟娉晇iew plaincopy to clipboardprint?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<mce:script src="http://code.jquery.com/jquery-latest.js" mce_src="http://code.jquery.com/jquery-latest.js"></mce:script>
<mce:script type="text/javascript"><!--
$(function(){
//鐐瑰嚮鎸夐挳錛屽茍鎵цajax璇鋒眰
$("#ajaxReuqestID").click(function(){
$.ajax({
url: "http://blog.csdn.net/gaoyusi4964238",
beforeSend:function(){
$("#ajaxStateID").text("berforeSend");
alert("berforeSend");
},
success: function(){
$("#ajaxStateID").text("success");
alert("success");
},
error:function(){
$("#ajaxStateID").text("error");
alert("error");
},
complete:function(){
$("#ajaxStateID").text("complete");
alert("complete");
}
});
});
$("#ajaxStateID").ajaxStart(function(){
$(this).text("ajaxStart");
alert("ajaxStart");
}).ajaxSend(function(){
$(this).text("ajaxSend");
alert("ajaxSend");
}).ajaxSuccess(function(){
$(this).text("ajaxSuccess");
alert("ajaxSuccess");
}).ajaxError(function(){
$(this).text("ajaxError");
alert("ajaxError");
}).ajaxComplete(function(){
$(this).text("ajaxComplete");
alert("ajaxComplete");
}).ajaxStop(function(){
$(this).text("ajaxStop");
alert("ajaxStop");
});
})
// --></mce:script>
</head>
<body>
<input type="button" value="鐐瑰嚮瑙﹀彂ajax璇鋒眰" id="ajaxReuqestID"/>
<div id="ajaxStateID"></div>
</body>
</html>
鏈枃鏉ヨ嚜CSDN鍗氬錛岋細http://blog.csdn.net/gaoyusi4964238/archive/2009/08/13/4443401.aspx