Mercurial > boosterpack
view logintets/xml_http_request.js @ 10:3b52ac950753 boosterpack tip
going to try to fix this thing
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Mon, 27 Sep 2010 17:24:06 -0400 |
parents | 477258d09353 |
children |
line wrap: on
line source
1 // method that sets up a cross-browser XMLHttpRequest object2 function getHTTPObject() {3 var http_object;5 // MSIE Proprietary method7 /*@cc_on8 @if (@_jscript_version >= 5)9 try {10 http_object = new ActiveXObject("Msxml2.XMLHTTP");11 }12 catch (e) {13 try {14 http_object = new ActiveXObject("Microsoft.XMLHTTP");15 }16 catch (E) {17 http_object = false;18 }19 }20 @else21 xmlhttp = http_object;22 @end @*/25 // Mozilla and others method27 if (!http_object && typeof XMLHttpRequest != 'undefined') {28 try {29 http_object = new XMLHttpRequest();30 }31 catch (e) {32 http_object = false;33 }34 }36 return http_object;37 }