Jump to content

XML DOM load function


atisman

Recommended Posts

Hi, this might sound a basic question but...Can the XML DOM object load an xml file in any arbitray URL? I have a Javascript that creates a DOM object and I'd like to use load function with a URL that indicates an XML file... For example, using Firefox......xmlDoc=document.implementation.createDocument("","",null);xmlDoc.load("http://www.w3schools.com/xml/xml_note.xml");...I'm running a WEBrick webserver in my local PC and running the script but it doesn't seem to work. But it can load any XML files in my local PC. Any explanation why this happens would be appreciated.Thank you.

Link to comment
Share on other sites

I think there was an equivalent topic about this in the JS forum, where jesh (I believe) answered what I was planning to say too: you can't fetch remote files with JavaScript. JavaScript has a security feature preventing it from reading and manipulating files from other domains.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...