Mercurial > boosterpack
annotate 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 |
rev | line source |
---|---|
robert@0 | 1 // method that sets up a cross-browser XMLHttpRequest object |
robert@0 | 2 function getHTTPObject() { |
robert@0 | 3 var http_object; |
robert@0 | 4 |
robert@0 | 5 // MSIE Proprietary method |
robert@0 | 6 |
robert@0 | 7 /*@cc_on |
robert@0 | 8 @if (@_jscript_version >= 5) |
robert@0 | 9 try { |
robert@0 | 10 http_object = new ActiveXObject("Msxml2.XMLHTTP"); |
robert@0 | 11 } |
robert@0 | 12 catch (e) { |
robert@0 | 13 try { |
robert@0 | 14 http_object = new ActiveXObject("Microsoft.XMLHTTP"); |
robert@0 | 15 } |
robert@0 | 16 catch (E) { |
robert@0 | 17 http_object = false; |
robert@0 | 18 } |
robert@0 | 19 } |
robert@0 | 20 @else |
robert@0 | 21 xmlhttp = http_object; |
robert@0 | 22 @end @*/ |
robert@0 | 23 |
robert@0 | 24 |
robert@0 | 25 // Mozilla and others method |
robert@0 | 26 |
robert@0 | 27 if (!http_object && typeof XMLHttpRequest != 'undefined') { |
robert@0 | 28 try { |
robert@0 | 29 http_object = new XMLHttpRequest(); |
robert@0 | 30 } |
robert@0 | 31 catch (e) { |
robert@0 | 32 http_object = false; |
robert@0 | 33 } |
robert@0 | 34 } |
robert@0 | 35 |
robert@0 | 36 return http_object; |
robert@0 | 37 } |