javascript - Accessing xml file in local system -
this question has reply here:
cannot read xml file using javascript other firefox 2 answersi have xml file in local system(not on server). want access javascript parse it,how can it? tried giving local file location.
if (window.xmlhttprequest) { xmlhttp=new xmlhttprequest(); } xmlhttp.open("get","c:\users\amit.m2\desktop\metrics.xml",false); xmlhttp.send(); xmldoc=xmlhttp.responsexml;
$.ajax({ url: 'input.xml', // name of file in local datatype: "xml", // input file type success: parse, // phone call parse function on success`enter code here` response error: function(){ alert("unable load or wrong !!!"); } }); function parse(document){ $(document).find("inputdata").each(function(){ // business logic goes here }); }
javascript xml xml-parsing
No comments:
Post a Comment