View Full Version : Permission denied to call method XMLDocument.load
05-09-2007, 04:21 PM
I'm trying to load an XML file using DOM via JS however having some problems. Works in all browsers other than firefox.
The problem is, if I try to access a XML file on remote machine firefox says "Error: uncaught exception: Permission denied to call method XMLDocument.load"
Works on IE and Opera as I said. The code Im using ..
Thanks very much,
Sir P :D
05-09-2007, 04:24 PM
It is my understanding of the security model that you cannot give full absolute URLs to load(). You can only load from your own same-origin server so have to use a relative path like
I'm surprised it works in the other browsers.
05-09-2007, 04:28 PM
Thanks for you reply.
If that is the case, how do RSS feeds and so forth work ? :s
05-09-2007, 05:37 PM
I've never written one myself but my understanding is they can be done in a number of ways. One way is to use the xml.load() function but proxy the rss feed on your own server so it doesn't violate the same-origin security policy (http://en.wikipedia.org/wiki/Same_origin_policy).
var textResponse = "<books><book><title>...";
Then when the parsing is finished that xml text will be available for parsing into an xml dom object. Usually this system uses a callback function to say when the <script> tag has been loaded and parsed. I suspect this is how Google does it (although I haven't looked at the source to find out).
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.