view BoosterPack/logintets/xml_http_request.js @ 0:0d795f02a8bb tip

initial committ. what was I thinking?
author Robert McIntyre <rlm@mit.edu>
date Mon, 27 Sep 2010 16:57:26 -0400
parents
children
line wrap: on
line source
1 // method that sets up a cross-browser XMLHttpRequest object
2 function getHTTPObject() {
3 var http_object;
5 // MSIE Proprietary method
7 /*@cc_on
8 @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 @else
21 xmlhttp = http_object;
22 @end @*/
25 // Mozilla and others method
27 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 }