Jump to content

Outputting Xml Response


beanymanuk

Recommended Posts

Hi I'm trying to output a response which is xml but its only displaying in the alert box and not in the div and I'm not sure what I'm doing wrong any idea's

 

var request;
function callback() {
  if (request.readyState == 4) {
 try {
   if (request.status != 200) {
	   alert('error');
   } else {
	  // ok, process...
         document.getElementById("myDiv").innerHTML= request.responseText;
         alert("got data: "+request.responseText);
   }
 } catch(e) {
	 alert('error');
 }
  }
}
function test_get() {
 request = new CrossXHR();
 request.onreadystatechange = callback;
 request.open('GET', 'http://www.gamerservices.co.uk/jackpot_obs_xml.xml');
 request.send();
}

Link to comment
https://forums.phpfreaks.com/topic/271947-outputting-xml-response/
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.