Click to See Complete Forum and Search --> : loading an XML file from a remote server using loadXMLdoc


peterson83
06-29-2008, 08:58 PM
Hey everyone,

To start off, I'm a noob to web development(I'm primarily an artist/designer), so if you're going to try & help me out, keep that in mind, otherwise you might just go way over my head.

So I'm trying to load this XML file from a server external to the one my files are hosted on. My code works fine when I load the XML file if it's on the same server, but if I try to access the XML file from a remote server, it doesn't work.

Here's my code:
<script>loadXMLDoc("http://globaleyes.ca/wex/news-events.xml");</script>

and this is the site I'm working on:
http://schools.tdsb.on.ca/wexfordcsa/new%2Dtest/

Thanks for any help!

bogocles
07-03-2008, 10:31 AM
I believe there is a "same-domain" policy in effect for client-side stuff like that. It might depend on your browser, though. Generally the only way to access off-site resources like that would be to use some form of server-side scripting and have it served as if it were coming from the domain that you're currently at.

Bottom line: if you're using a browser, it probably won't work.