ajax驱动

来源:互联网 发布:网络拓扑层级 编辑:程序博客网 时间:2024/04/30 01:38
  1. function ajax_driv(){    
  2.  var xmlhttp;    
  3.  if (window.ActiveXObject){    
  4.   /* 不要删除以下注释,这部分不是注释 */   
  5.   /*@cc_on @*/   
  6.   /*@if (@_jscript_version >= 5)    try {    
  7.     xmlhttp = new ActiveXObject("Msxml2.xmlhttp");    
  8.   } catch (e) {    
  9.     try {    
  10.    xmlhttp = new ActiveXObject("Microsoft.xmlhttp");    
  11.     } catch (e) {    
  12.    xmlhttp = false;    
  13.     }    
  14.   }    
  15.   @end @*/   
  16.  }else{    
  17.   xmlhttp=new XMLHttpRequest();    
  18.  }    
  19.    
  20.  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {    
  21.    xmlhttp = new XMLHttpRequest();    
  22.  }    
  23.  return xmlhttp;    
  24. }  
原创粉丝点击