Error: uncaught exception: Permission denied to call method XMLHttpRequest.open
Thanks very much for the following articles as it solve my pain about ajax.
If you want to do cross-domain scripting with XMLHttpRequest, e.g. fetching data from a remote location but you’re on a local page or local XUL application (file:///), you need to tell Mozilla/Firefox about that, otherwise you get the infamous error:
Error: uncaught exception: Permission denied to call method XMLHttpRequest.open
Below is an example that can be run locally (save it to your harddisk and open the page with Mozilla/Firefox). It will fetch some RSS XML data from wunderground.com and alert it.
Always remember: XMLHttpRequest needs UniversalBrowserRead!
If the page with the XMLHttpRequest is on a http:// URI (on a webserver), it is not possible to fetch data from another domain!!! This is a security measure of Mozilla/Firefox.
Still, it comes in handy, if you can read remote data from a local application. E.g. you’ve got a local XUL application that needs to get data from other servers – Dude! Sweet!
If you’re doing some extension to the Mozilla/Firefox browser, you don’t need to care about permissions. Such an extension is installed into the core of the browser anyway, hence it has all privileges.
cross-domain-xmlhttprequest.html
onclick="javascript:updateweather();"/>
Popularity: 42% [?]