From 8f0dba15fe4d89daef2802a4b7d7b33c9c44b0f1 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Fri, 11 Jul 2014 16:07:02 +0000 Subject: [PATCH] No need to use Microsoft.XMLDOM for IE anymore, since IE 7+ supports XMLHttpRequest object --- etemplate/js/et2_core_xml.js | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/etemplate/js/et2_core_xml.js b/etemplate/js/et2_core_xml.js index bf6459eaca..5995a34857 100644 --- a/etemplate/js/et2_core_xml.js +++ b/etemplate/js/et2_core_xml.js @@ -24,36 +24,7 @@ function et2_loadXMLFromURL(_url, _callback, _context) _context = null; } - // Use the XMLDOM object on IE - if (window.ActiveXObject) - { - var xmldoc = new ActiveXObject("Microsoft.XMLDOM"); - - // Set the callback function - xmldoc.onreadystatechange = function() { - if (xmldoc && xmldoc.readyState == 4) - { - // Find the root node - the root node is the node which is not - // the "xml", not a text node and not a comment node - those nodes - // are marked with an "#" - for (var i = 0; i < xmldoc.childNodes.length; i++) - { - var nodeName = xmldoc.childNodes[i].nodeName; - if (nodeName != "xml" && nodeName.charAt(0) != "#") - { - // Call the callback function and pass the current node - _callback.call(_context, xmldoc.childNodes[i]); - return; - } - } - - throw("Could not find XML root node."); - } - } - - xmldoc.load(_url); - } - else if (window.XMLHttpRequest) + if (window.XMLHttpRequest) { // Otherwise make an XMLHttpRequest. Tested with Firefox 3.6, Chrome, Opera var xmlhttp = new XMLHttpRequest();