Jump to content

Unable to read a XML file hosted on an external Web server


Recommended Posts

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 post
Share on other sites

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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...