dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: load XML from an external domain - How to

  1. #1
    Join Date
    Sep 2004
    Posts
    1

    load XML from an external domain - How to

    Hey...

    I try to load an external XML file from server www.aaa.com via JavaScript into a file on www.bbb.com. Unfortunately this has to be since the server from www.aaa.com does not support php with which I am edditing the xml file.

    Please help!

    Here is the code it isn't working with:

    <html>
    <head>
    <script
    type="text/javascript"
    for="window"
    event="onload">

    var xmlDoc=new ActiveXObject("Microsoft.XMLDOM")
    xmlDoc.async="false"
    xmlDoc.load("http://www.aaa.com/test.xml")

    nodes=xmlDoc.documentElement.childNodes
    a1.innerText=nodes.item(0).text
    a2.innerText=nodes.item(1).text
    a3.innerText=nodes.item(2).text
    a4.innerText=nodes.item(3).text

    </script>
    </head>

    <body bgcolor="yellow">

    <h1>W3Schools Internal Note</h1>

    <b>To:</b>
    <span id="a1"></span>
    <br />

    <b>From:</b>
    <span id="a2"></span>
    <hr />

    <b><span id="a3"></span></b>

    <hr />
    <span id="a4"></span>

    </body>
    </html>

    Thanks

  2. #2
    Join Date
    Dec 2002
    Location
    Calgary, Canada
    Posts
    6,136
    you won't be able to do that...becuase of its being an out of domain resource.(always will get Access Denied error) as far as I know..:-)
    Cheers

    Khalid

    Message Posting Guidelines In These Forums, Please read these before posting any question.
    Web site: webapplikations.com
    Web Resources Page:Web Resources

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles