一次比一次更加简化,提高代码利用率~
1 function ajax() 2 { 3 var null; 4 if(windows. 5 new 6 } 7 else{ 8 if(windows.ActiveXObject){ 9 new ActiveXObject("Microsoft.);10 }11 }12 var handler=null;13 this.fun=function(url,mode.synchro,_handler){14 handler=_handler;15 16 null);17 };18 this.callback=function(){19 if(){20 if(){21 handler(22 }else{23 alert("请求失败");24 }25 }26 }27 28 function ajaxPost(url,postStr,onsuccess)29 {30 var new ActiveXObject('Microsoft.);31 true);32 function()33 {34 if(){35 if(){36 onsuccess(37 }38 else{39 alert('Ajax服务器返回错误!');40 }41 42 }43 }44 );45 46 }47
Ajax的封装
原标题:Ajax的封装
关键词:ajax