ajax驅動

  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. }  
發佈了14 篇原創文章 · 獲贊 1 · 訪問量 7萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章