Access to restricted URI denied" code: "1012
I am using jsGantt chart. To fill chart I am using xml file.
Problem is that xml file is outside project(root directory). so when jsgantt.js try to load xml file to fill cha开发者_如何转开发rt it gives error likejsGantt.js' code is below which throws error.
JSGantt.parseXML = function(ThisFile,pGanttVar){
var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1; // Is this Chrome
try { //Internet Explorer
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
}
catch(e) {
try { //Firefox, Mozilla, Opera, Chrome etc.
if (is_chrome==false) { xmlDoc=document.implementation.createDocument("","",null); }
}
catch(e) {
alert(e.message);
return;
}
}
if (is_chrome==false) { // can't use xmlDoc.load in chrome at the moment
xmlDoc.async=false;
xmlDoc.load(ThisFile); // we can use loadxml
JSGantt.AddXMLTask(pGanttVar);
xmlDoc=null; // a little tidying
Task = null;
}
else {
JSGantt.ChromeLoadXML(ThisFile,pGanttVar);
ta=null; // a little tidying
}
};
error in xmlDoc.load(ThisFile); line where argument ThisFile is file path.
Well, IIS isn't going to serve files outside the directory of the website. That would be a pretty big security hole.
You could try making the directory containing the file into another virtual directory, and allow anonymous access.
Or just move the file.
精彩评论