comparison BoosterPack/logintets/.svn/text-base/xml_http_request.js.svn-base @ 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
comparison
equal deleted inserted replaced
-1:000000000000 0:0d795f02a8bb
1 // method that sets up a cross-browser XMLHttpRequest object
2 function getHTTPObject() {
3 var http_object;
4
5 // MSIE Proprietary method
6
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 @*/
23
24
25 // Mozilla and others method
26
27 if (!http_object && typeof XMLHttpRequest != 'undefined') {
28 try {
29 http_object = new XMLHttpRequest();
30 }
31 catch (e) {
32 http_object = false;
33 }
34 }
35
36 return http_object;
37 }