Hi All of You. I am using below method for read and return xml file. But it's not working for me. Please help me. Thank you in advance.
function readAndReturnXML(filePath) {
alert(filePath);
//File Path is (Folder1/Folder2/Demo.xml)
var xml = "";
$.ajax({
type: "POST",
url: filePath,
async: false,
dataType: ($.browser.msie) ? "text" : "xml",
success: function (data) {
if (typeof data == "string") {
xml = new ActiveXObject("Microsoft.XMLDOM");
xml.async = false;
xml.loadXML(data);
} else {
xml = data;
}
},
error: function () {
setTimeout(function () {
window.location.href = "error.html?E404";
}, 50)
}
});
return xml;
}