Monday, 2 March 2015

How do i get a local XML to be used in HTML page?



My requirement is to get a local XML file and use its contents to upload it further to the server. But i am unable to access the XML file through this code.



$(document).ready(function() {
$("#btnUpload").click(function(e) {
//e.preventDefault();
$.ajax({
type: "GET",
url: "C:\AnonymousLocation\XMLTransactionEmp.xml",
dataType: "xml",
async: false,
success: parseXml
});

function parseXml()
alert("Here");
}
});
});


Now what I want is to get the XMLTransactionEmp.xml file to display its contents in my page but the control is not going in to the parseXml method. How do I do it?


No comments:

Post a Comment