1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- var xmlHttpVersions = [
- "Msxml2.XMLHTTP.6.0",
- "Msxml2.XMLHTTP.3.0",
- "Msxml2.XMLHTTP",
- "Microsoft.XMLHTTP"
- ];
- function findXMLHttpActiveXVersion() {
- if (window.ActiveXObject) {
- var i, l = this.xmlHttpVersions.length;
- for (i = 0; i < l; i++) {
- try {
-
- var xmlhttp = new ActiveXObject(this.xmlHttpVersions[i]);
- if (xmlhttp)
- return this.xmlHttpVersions[i];
- } catch (e) {
-
- }
- }
- }
-
- return null;
- }
- var xmlHttpDefault = findXMLHttpActiveXVersion();
- function getXMLHttpRequest() {
- if (xmlHttpDefault != null)
- return new ActiveXObject(xmlHttpDefault);
-
- if (typeof XMLHttpRequest != 'undefined') {
- try {
- return new XMLHttpRequest();
- } catch (e) {
- alert(e);
- }
- }
-
- throw "No XMLHttpRequest object is available";
- }
|