I am working on a page that makes an ajax request to a php page, the php returns some xml.
like:
<?php
header("Content-type:text/xml");
header("Cache-Control: no-cache, must-revalidate");
//A date in the past
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
$q=$_GET["q"];
include_once("dbconnect.php");
$sql="SELECT * FROM user WHERE id = ".$q."";
and the stateChanged function of javascript code is
function stateChanged()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
alert(xmlHttp.responseText);
//here i am checking the responseText and it comes fine....
var xmlDoc=xmlHttp.responseXML.documentElement;
//Here responseXML not works. IE shows javascript error Object required
I don't know much about ajax and i am just learning. i had the same problem and had to pass each element through an array I hope this helps, maybe somebody will give a better answer or explain the correct way of doing this.
Bookmarks