This is the javascript:
var r;
function runjs(e)
{
r = new XMLHttpRequest();
r.open( "POST","back.php");
r.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
r.onreadystatechange = next;
r.send("text=" + e.value);
}
function next()
{
if(r.readyState == 4)
{
if(r.status == 200){
//var xm = r.responseXML;
alert(r.responseXML);
alert(r.responseText);
}
}
}
And this is the php
<?PHP
header('Content-Type: text/xml');
echo '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' . "\n";
?>
<response>
<command method="setcontent">
<target>example3</target>
<content>"!"</content>
</command>
</response>
I have checked the response headers and it is correctly being set, also directly visiting the php page displays the xml, although it does say "This XML file does not appear to have any style information associated with it. The document tree is shown below." Any help would be much appreciated, this is getting frustrating
This post has been edited by ianian112: 28 January 2012 - 03:01 PM

New Topic/Question
Reply



MultiQuote





|