Shop OBEX P1 Docs P2 Docs Learn Events
Not possible to access an XML-file from another server, is this true? — Parallax Forums

Not possible to access an XML-file from another server, is this true?

MoskogMoskog Posts: 554
edited 2014-08-06 14:21 in Accessories
By going through some javascript-tutorials I read the following:

For security reasons, modern browsers do not allow access across domains.

This means, that both the web page and the XML file it tries to load, must be located on the same server
( http://www.w3schools.com/xml/xml_parser.asp )

Ok, so does this mean that If I load a web page located on a remote server, this page can not access an XML-file located on my Spinneret?

No possibilities at all?

Comments

  • SRLMSRLM Posts: 5,045
    edited 2014-08-02 12:46
    By setting the appropriate headers in the HTTP response you can allow cross origin resources. There's even a whole website for the topic:

    http://enable-cors.org/

    Edit: This only applies to browsers. If you have server side code that pulls the XML file then there is no CORS to worry about.
  • MoskogMoskog Posts: 554
    edited 2014-08-06 14:21
    Thanks for reply, SLRM, I'm currently into so many projects I haven't been able to answer. But I am checking out that website and trying to figure out and fully understand this CORS-thing. Very interesting!
Sign In or Register to comment.