I am trying to parse xml stored locally on systemit is working fine in Firefox as well as IE but when I am trying in chrome it is giving error:XMLHttpRequest cannot load file(path of file in desktop) Received an invalid response. Origin 'null' is therefore not allowed access.I tried to run chrome from cmd but still getting same error.
Code:
$( document ).delegate("#splash", "pageinit", function()
{
$("#xmlvalue").click(function() {
$.ajax({
type: "GET",
url: "third.xml",
dataType: "xml",
success: xmlParser
});
});
function xmlParser(data) {
xml = data;
$(xml).find('EMPLOYEE_DETAILS').each(function(){
var srate = $(this).find('RATE_DISP_FLG').text();
var sname = $(this).find('FULL_NAME').text();
var orgid = $(this).find('ORGANIZATION_ID').text();
var natid = $(this).find('NATIONAL_IDENTIFIER').text();
$("<li></li>").html("RATE_DISP_FLG:"+srate +",FULL_NAME:"+
sname+","+orgid+",ORGANIZATION_ID"+",NATIONAL_IDENTIFIER"+natid)
.appendTo("#dvContent");
});
}
});
Any suggestion will be helpful.
Thanks
No comments:
Post a Comment