Gerard-Meier

AJAX

May 23rd, 2011
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function connect() {
  2.     var temp_xmlHttp = false;
  3.     if(window.XMLHttpRequest) {
  4.             temp_xmlHttp = new XMLHttpRequest();
  5.     } else if(window.ActiveXObject) {
  6.         try {
  7.             temp_xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
  8.         } catch (e) {
  9.             try {
  10.                 temp_xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  11.             } catch (e) {
  12.                 // Stone age browser.
  13.             }
  14.         }
  15.     }
  16.     return temp_xmlHttp;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment