开发者

Access to restricted URI denied" code: "1012

开发者 https://www.devze.com 2023-04-01 15:36 出处:网络
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 give

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 like

Access to restricted URI denied" code: "1012

jsGantt.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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号