$(document).ready(function() { $.ajax({ url : "/AjaxAction/LoginArea.ashx", data : {username:user,password:pwd}, type : "POST", //dataType:"json", beforeSend: function(XMLHttpRequest){alert("开始请求")}, //加载过程 success : function(data){alert(data);}, complete: function(XMLHttpRequest, textStatus){alert("加载结束")},//HideLoading()加载完成; error:function(){alert("error occured!!!");} //请求出错处理 });});