Webaluc Posted March 22, 2021 Share Posted March 22, 2021 Hi all! I need to read a XML file hosted on an external Web server, but I can't find the solution. I made some tests here:https://www.w3schools.com/xml/tryit.asp?filename=try_dom_xmlhttprequest_responsexml First test: Replacing the "cd_catalog.xml" file name by the file full path:https://www.w3schools.com/xml/cd_catalog.xml Since the file is on the same server, everything is working fine. Then, I tried the same file on another server and it doesn't work anymore:https://www.webaluc.com/test/cd_catalog.xml Any solution to this problem? Thank you! Link to comment Share on other sites More sharing options...
Ingolme Posted March 23, 2021 Share Posted March 23, 2021 For security reasons, Javascript is not able to read files on a different domain than the one that the page is on unless the owner of the domain sends an HTTP header allowing it. Link to comment Share on other sites More sharing options...
Webaluc Posted March 23, 2021 Author Share Posted March 23, 2021 Thank you Ingolme for your answer! I just asked the same question on the PHP forum:https://w3schools.invisionzone.com/topic/62754-unable-to-read-a-xml-file-hosted-on-an-external-web-server/ Regards! 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