From 3dbbf52c5cef72389863d342a61bb526d592e678 Mon Sep 17 00:00:00 2001 From: Demian Katz <demian.katz@villanova.edu> Date: Wed, 14 Nov 2012 10:41:41 -0500 Subject: [PATCH] Now that we have upgraded jQuery, we can use its native parseXML() function instead of a local custom one. --- themes/blueprint/js/hierarchyTree_JSTree.js | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/themes/blueprint/js/hierarchyTree_JSTree.js b/themes/blueprint/js/hierarchyTree_JSTree.js index f9cb51b9ab3..c5cf88e1d28 100644 --- a/themes/blueprint/js/hierarchyTree_JSTree.js +++ b/themes/blueprint/js/hierarchyTree_JSTree.js @@ -62,7 +62,7 @@ $(document).ready(function() { "url" : path + '/Hierarchy/GetTree?' + $.param({'hierarchyID': hierarchyID, 'id': recordID, 'context': context, mode: "Tree"}), success: function(data) { // Necessary as data is a string - var dataAsXML = parseXml(data); + var dataAsXML = $.parseXML(data); if(dataAsXML) { var error = $(dataAsXML).find("error"); if (error.length > 0) { @@ -90,25 +90,6 @@ $(document).ready(function() { }); }); -// Parse XML (Feature not available in JQuery 1.4) -if (typeof window.DOMParser != "undefined") { - parseXml = function(xmlStr) { - return ( new window.DOMParser() ).parseFromString(xmlStr, "text/xml"); - }; -} else if (typeof window.ActiveXObject != "undefined" && - new window.ActiveXObject("Microsoft.XMLDOM")) { - parseXml = function(xmlStr) { - var xmlDoc = new window.ActiveXObject("Microsoft.XMLDOM"); - xmlDoc.async = "false"; - xmlDoc.loadXML(xmlStr); - return xmlDoc; - }; -} else { - parseXml = function(xmlStr) { - return false; - }; -} - function showTreeError(msg) { $("#hierarchyTreeHolder").html('<p class="error">' + msg + '</p>'); } -- GitLab