| 3 | | return Try.these( |
|---|
| 4 | | function() {return new XMLHttpRequest()}, |
|---|
| 5 | | function() {return new ActiveXObject('Msxml2.XMLHTTP')}, |
|---|
| 6 | | function() {return new ActiveXObject('Microsoft.XMLHTTP')} |
|---|
| 7 | | ) || false; |
|---|
| | 3 | var transport = false; |
|---|
| | 4 | Ajax.getTransport = Try.these( |
|---|
| | 5 | function() { |
|---|
| | 6 | /* fallback on activex xmlhttp to avoid IE7 local file-system read error */ |
|---|
| | 7 | if(Prototype.Browser.IE && window.location.href.indexOf('file://') == 0) throw 'skip'; |
|---|
| | 8 | transport = new XMLHttpRequest(); |
|---|
| | 9 | return function(){ return new XMLHttpRequest()} |
|---|
| | 10 | }, |
|---|
| | 11 | function() { |
|---|
| | 12 | transport = new ActiveXObject('Msxml2.XMLHTTP'); |
|---|
| | 13 | return function(){ return new ActiveXObject('Msxml2.XMLHTTP')} |
|---|
| | 14 | }, |
|---|
| | 15 | function() { |
|---|
| | 16 | transport = new ActiveXObject('Microsoft.XMLHTTP'); |
|---|
| | 17 | return function(){ return new ActiveXObject('Microsoft.XMLHTTP')} |
|---|
| | 18 | } |
|---|
| | 19 | ) || false; |
|---|
| | 20 | |
|---|
| | 21 | return transport; |
|---|