Jump to content

Getting the XML value.


Omirion

Recommended Posts

Hey guys, new to Ajax.

I have this

 

    window.onload = function () {
        alert("loaded")
        var http = new XMLHttpRequest;
        http.onreadystatechange = function () {
            if (http.readyState == 4) {
                alert("response is ready");
                var txt = http.responseXML.getElementsByTagName("data")
                document.getElementById("myDiv").innerHTML = txt[0];
            }
        }
        http.open("GET", "a.xml", true);
        http.send();
    }

 

I get "Object" + Whateever the object is.

 

How can i get the value between the XML tags?

Link to comment
https://forums.phpfreaks.com/topic/211949-getting-the-xml-value/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.