By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,814 Members | 2,162 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,814 IT Pros & Developers. It's quick & easy.

call php usingn AJAX responseXML seems to be null

P: n/a
Following snippet is the portion of my program to get the location list in
xml with AJAX
when i alert(request.responseText) it manages to display the xml document
like the following

<? xml version="1.0" ?>
<marker lat="32.564" lng="133.212" />

However, when calling request.responseXML I have empty document
xmlDoc.documentElement is null
Why is that?

var param = "getShops.php?x1=" + bounds.minX + "&y1=" + bounds.minY + "&x2="
+ bounds.maxX + "&y2=" + bounds.maxY;

var request = GXmlHttp.create();'GET', param , true); // request XML from PHP with AJAX call
request.onreadystatechange = function () {
if (request.readyState == 4) {
//alert( request.responseText ) <--- this displays wellformed xml
var xmlDoc = request.responseXML;
locations = xmlDoc.documentElement.getElementsByTagName("marke r");

Aug 30 '06 #1
Share this Question
Share on Google+
1 Reply

P: n/a
Problem Solved
I just have to specify the text/xml in the header for getshop.php

Aug 30 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.