| Author |
Xml Dom not parsing
|
Lila Fowler
Ranch Hand
Joined: Jul 31, 2009
Posts: 84
|
|
Hi All,
Im trying to get a simple example that takes data from .xml and prints titles onto the screen. I'v tried lots of different examples from different places but i cannot get any to work.
Here is the xml code:
Here is the java script &html
I have tried lots of different examples(this one is w3schools) but non of them pass my xml even though my html pg opens.
Using two different browsers(chrome & IE) both dont work.
Any ideas as to what i'm doing wrong?
Thanks a ton
*posted this in web services by mistake as well, sorry.
|
Courage is not the absence of fear but rather the judgment that something is more important then fear. ~ Ambrose Redmond
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16483
|
|
You are downloading a Javascript file from somewhere -- from the same directory as that HTML came from, anyway. And then you try to access something from the local file system. Normally Javascript can't access the local file system; but perhaps that Javascript loadXMLDoc function expects a URL to get the XML document from?
If that's the case, then you haven't given it an XML. A file path is not a URL. And even if you gave it a file:// URL, chances are that the browser would not allow the Javascript to connect to it, because that would be a cross-site scripting security violation.
|
 |
Lila Fowler
Ranch Hand
Joined: Jul 31, 2009
Posts: 84
|
|
Thanks, that explained why it wasn't working.
|
 |
 |
|
|
subject: Xml Dom not parsing
|
|
|