joecool2005 Posted November 21, 2006 Share Posted November 21, 2006 Hi,How do you load an xml file from a URL?I tried this and it did not work.var xmlDoc=new ActiveXObject("Microsoft.XMLDOM");xmlDoc.async="false";xmlDoc.load("http://www.w3schools.com/xml/note.xml"); ThxJoe Link to comment Share on other sites More sharing options...
aalbetski Posted November 21, 2006 Share Posted November 21, 2006 Its probably working fine. You just need to do something with the response. Try this: var xmlSource=new ActiveXObject("Microsoft.XMLDOM")xmlSource.async=falsexmlSource.load("http://www.w3schools.com/xml/note.xml")document.write("<textarea style='height:90%;width:100%'>" + xmlSource.xml + "</textarea>"); Link to comment Share on other sites More sharing options...
joecool2005 Posted November 21, 2006 Author Share Posted November 21, 2006 I've tried it and it did not load. It returned me an error on the load function. Link to comment Share on other sites More sharing options...
aalbetski Posted November 21, 2006 Share Posted November 21, 2006 then you have a security issue or a firewall blocking. It renders fine for me <?xml version="1.0"?><!-- Edited with XML Spy v2006 (http://www.altova.com) --><note> <to>Tove</to> <from>Jani</from> <heading>Reminder</heading> <body>Don't forget me this weekend!</body></note> Link to comment Share on other sites More sharing options...
boen_robot Posted November 22, 2006 Share Posted November 22, 2006 I've always tought that JavaScript has a security measure that forbids access to remote files. Try downloading the file and inserting it into the same folder the script is in. Link to comment Share on other sites More sharing options...
aalbetski Posted November 22, 2006 Share Posted November 22, 2006 Another approach would be just to type this into the address bar and see what errors you get:http://www.w3schools.com/xml/note.xmlWhen I do this using IE 6.0, I see the contents of the file. If get an error and are refused access, then you need to find out why your browser is not able to access the file. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now