, 13 2009 . 13:51
+
ActiveXObject("Microsoft.XMLDOM");
Firefox ( Opera) document.implementation.createDocument("","",null);
_.load('__XML');
Safari Chrome.
.. ! XMLHttpRequest. !
:
function loadXMLWithHTTPRequest(lnk) {
var obj = null;
try {
// firefox/safari/chrome/etc -
obj = new XMLHttpRequest();
} catch(e) {
try {
// ie ie ie
obj = new ActiveXObject('Msxml2.XMLHTTP');
} catch(e) {
try {
// ie ie ie -
obj = new ActiveXObject('Microsoft.XMLHTTP');
} catch(e) {
//
throw "Can't load XML data! Can't create XMLHttpRequest!";
}
}
}
obj.open("GET", lnk, false);
obj.send(null);
return obj.responseXML.documentElement;
}