Access to restricted URI denied code: 1012

后端 未结 5 1771
抹茶落季
抹茶落季 2020-12-04 15:03

How do you get around this Ajax cross site scripting problem on FireFox 3?

5条回答
  •  庸人自扰
    2020-12-04 15:18

    To update the answer (I guess, mostly for my benefit when I come looking for this answer later on), if are loading XML or something else, you can always ask the user if he will allow us to read from another site with this code:

    try {
        if (netscape.security.PrivilegeManager.enablePrivilege)
            netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
    } catch (e) { 
        alert("Sorry, browser security settings won't let this program run."); 
        return; 
    }
    

    (from the RESTful web services book) But, this only works in firefox, when the html file is loaded from local file. So, not that useful.

提交回复
热议问题