Skip to content
Snippets Groups Projects
Commit 3dbbf52c authored by Demian Katz's avatar Demian Katz
Browse files

Now that we have upgraded jQuery, we can use its native parseXML() function...

Now that we have upgraded jQuery, we can use its native parseXML() function instead of a local custom one.
parent fe5546f7
No related merge requests found
......@@ -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>');
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment