473,405 Members | 2,444 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

call php usingn AJAX responseXML seems to be null

MD
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" ?>
<markers>
<marker lat="32.564" lng="133.212" />
</markers>

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();
request.open('GET', param , true); // request XML from PHP with AJAX call
request.onreadystatechange = function () {
if (request.readyState == 4) {
//alert( request.responseText ) <--- this displays wellformed xml
document.
var xmlDoc = request.responseXML;
locations = xmlDoc.documentElement.getElementsByTagName("marke r");
}
}

Aug 30 '06 #1
1 1948
MD
Problem Solved
I just have to specify the text/xml in the header for getshop.php

MD
Aug 30 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Sanjay Dahiya | last post by:
I tried POSTing from XMLHttpRequest, i can get the XML right on server but responseXML from server is coming null. I can see the XML right in responseText. but responseXML is null. responseText to...
4
by: bobzimuta | last post by:
I'm creating a simple AJAX library. It's an object that will return an array containing the response text or xml. I'm trying to find a way to assign the response as a property of the object, but...
1
by: mflll | last post by:
I am having trouble getting my simple AJAX program to work at my current University. Here is one of the programs that is giving problems. I tried it in and Mozilla/5.0 Gecko/20050923 under...
0
by: Mathan Babu | last post by:
Hello, Once the AJAX request is fired the readystate property remain as 1. It never gets changed and the callback method is not firing as a result the ..aspx page is not being rendered. The...
1
by: danep | last post by:
Hi, I'm fairly new to AJAX, but I've been able to retrieve HTML and plain-text documents without any trouble. However, I haven't figured out how to retrieve it in XML format. Basically, here's...
1
by: trpost | last post by:
How can I accomplish the following using AJAX / PHP: I have a form with a text field and a search button next to the text field. When I type something in the text field and hit the search button...
13
by: adam | last post by:
Hey All, I'm relatively new to all this and any help would be appreciated. What I'm aiming to do is create a few requests, to 1. Search for a Student against XML created from the database 2. If...
2
by: Zeba | last post by:
Hi guys! I'm new to JS / Ajax; I've been trying to do an Ajax call to my Webservice ( I'm using C# for code-behind). I'm not using any of the libraries available. I am sending my CustID to the...
6
by: santhoskumara | last post by:
How to request to servlet from Ajax and also I got the DOM object in the servlet through Business Logic. Now how will i pass the DOM object from serlvet to Clientside. Where in the client Side i am...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.