日期:2014-05-16  浏览次数:20646 次

ajax发送异步请求 请求结果函数归类

发送请求的请求结果函数有:

?onSuccess: function(transport){
??? ??? ??? ??? var response = transport.responseText || "no response text";
??? ??? ??? ??? $("result").innerHTML = response;
??? ??? ??? ??? //alert("Success! \n\n" + response);
??? ??? ????? },
??? ??? ????? onCreate: function(){
??? ??? ??? ??? //alert("Create! \n\n" + "create!");
??? ??? ????? },
??? ??? ????? onException: function(){
??? ??? ??? ??? //alert("Exception! \n\n" + "出错了!");
??? ??? ????? },
??? ??? ?????? onInteractive: function(){
??? ??? ??? ?? // alert("Interactive! \n\n" + "收到服务器部分请求!");
??? ??? ????? },
??? ??? ?????? onLoaded: function(){
??? ??? ??? ??? //alert("Loaded! \n\n" + "开始向服务器发送请求!");
??? ??? ????? },
??? ??? ?????? on500: function(){
??? ??? ??? ??? //alert("错误! \n\n" + "服务器内部错误!");
??? ??? ????? },
??? ??? ?????? on304: function(){
??? ??? ??? ??? //alert("错误! \n\n" + "缓存出现问题!");
??? ??? ????? },
??? ??? ????? on404: function(){
??? ??? ??? ??? alert("错误! \n\n" + "不存在此类资源!");
??? ??? ????? },
??? ??????? onFailure: function(transport){ alert('Something went wrong...'+transport.status) }
………………………………