function test(){
$.ajax({
//提交數據的類型 POST GET
type:"POST",
//提交的網址
url:"testLogin.aspx",
//提交的數據
data:{Name:"sanmao",Password:"sanmaoword"},
//返回數據的格式
datatype: "html",//"xml", "html", "script", "json", "jsonp", "text".
//在請求之前調用的函數
beforeSend:function(){$("#msg").html("logining");},
//成功返回之后調用的函數
success:function(data){
$("#msg").html(decodeURI(data));
} ,
//調用執行后調用的函數
complete: function(XMLHttpRequest, textStatus){
alert(XMLHttpRequest.responseText);
alert(textStatus);
//HideLoading();
},
//調用出錯執行的函數
error: function(){
//請求出錯處理
}
});
}
posted on 2010-04-08 10:28
sanmao 閱讀(602)
評論(0) 編輯 收藏