- //Ajax.request({
- // url:"http://localhost:8080/MYHOME/shw_provinces.html",
- // data:'',
- // success:function(meg){alert("cg"+meg.responseText)},
- // failure:function(meg){alert("sb"+meg.responseText)}
- //});
- var Ajax =
- function(){
- function request(opt){
- var xhr = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP');
- xhr.onreadystatechange = function(){
- if(xhr.readyState == 4){
- (xhr.status>=200 && xhr.status<300)? opt.success(xhr):opt.failure(xhr);
- }else{}
- } ;
- xhr.open("POST",opt.url,true);
- xhr.send(opt.data);
- return xhr;
- }
- return {request:request};
- }();
ajax
最新推荐文章于 2024-10-24 09:51:07 发布