473,394 Members | 1,867 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,394 software developers and data experts.

New Question on Simple XML DOM Problem in AJAX Implementation

I have an application that uses a popular but simple set of JavaScript
routines that implement an AJAX call used to populate a drop-down. It
works for thousands of user but I have one customer where it does not
work. It was working but quit over the weekend. I suspect their XML DOM
was either changed, removed or disabled somehow. My assumptions are
that the XMLHTTPRequest object used by the browser to make the http
request is different from the object that is used to parse the XML once
it is returned to the client (XML DOM?).

My question is how can they reinstall the XML DOM and are my
assumptions correct. They are on IE 5.5 and 6.0 under XP SP2. Here is
why I suspect the XML DOM...

After debugging, we verified the XMLHTTP object is working and getting
back our simple XML (verified by displaying the XML from the
http.responseText in an alert window).

var xmlDocument = http.responseXML; <--- pretty sure this works

However, when we parse the incoming XML, the nodelist in their browser
returns 0 elements.

var nodelist = xmlDocument.getElementsByTagName('user'); <---
nodelist is empty??
alert(nodelist.length) <--- this is returning 0 and our list box is
empty after completion.

Any idea why the XMLHTTPRequest can make the http call and get back the
XML but the as we parse it fails. We are sure the <user> tags are in
the XML and this is verified even this client when we displayed the XML
as text using responseText to view it.

Does this line....

var xmlDocument = http.responseXML;

....create an XML DOM object and if yes, it is using a different object
that the XMLHTTPRequest object. Is there anyway my customer can
reinstall something to get this functionality working again? How to
check version? Any advise would be appreciated.

TIA

Jan 26 '06 #1
2 1736


dondraper wrote:

After debugging, we verified the XMLHTTP object is working and getting
back our simple XML (verified by displaying the XML from the
http.responseText in an alert window).

var xmlDocument = http.responseXML; <--- pretty sure this works

However, when we parse the incoming XML, the nodelist in their browser
returns 0 elements.

var nodelist = xmlDocument.getElementsByTagName('user'); <---
nodelist is empty??


Check
xmlDocument.parseError.reason
xmlDocument.parseError.errorCode
and other properties of the parseError object documented here
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/fdc6ff87-3cfb-4aa0-8bb6-d8c1acf9684e.asp>
to find out whether there might be simply a parse error.

Also check
http.status
http.statusText
http.getAllResponseHeaders()
to find out details about the particular response so that we can check
what might go wrong?
Has the response been sent with Content-Type text/xml or application/xml?

And then show us the XML sent, does it use any namespaces for instance?

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jan 27 '06 #2
Martin,

Great advice. We are sending it as text/xml. No special namespaces and
they are getting the XML in perfect form like everyone else.

We added xmlDocument.parseError.reason and other error attributes to a
test page and checked them right when the xmlDocument was created and
on the very next line where we create the nodelist object. We also
checked that the http.status was 200 and outputted the raw XML so we
could see (using responseText()) that it was all there. We finally
tested this code by sending back compromised XML and it the error
checking displayed the problem in great detail.

Unfortunately, when the customer calls the page, no errors are detected
and nodelist.length still comes back as 0. Not sure what has happened
to their machines but it appears the code is not going to give us a
clue.

Since we are desparate here, we are asking them to:
- reinstall IE 6.0 SP1
- next, reinstall the XMLDOM Core Services

If that does not help, we are writing alternate pages that will encode
our simple data into an delimited string and then parse it out using
raw JavaScript. This will get this one customer back up and running and
then if once proven, we will probably use this for all others. It will
still be doing an AJAX call but not need the XML DOM to parse.

Will post any new information here if we find it. Thanks so much for
your assistance as it would have surely caught any problems when the
xmlDocument object was created.

-Don

Jan 27 '06 #3

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

Similar topics

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...
2
by: needin4mation | last post by:
What is .NET remoting versus Ajax? Any links are appreciated. I didn't find a straight forward answer. Thanks for any help.
5
by: dougwig | last post by:
I'm trying to handle the scenario where a user's session times out and and their ajax request triggers a redirection by the webserver (302 error?). I'm using Prototype 1.4 and the my works great...
7
by: Ivan Marsh | last post by:
Hey Folks, I'm having a heck of a time wrapping mind around AJAX. Anyone know of a simple, straight-forward example for pulling a simple query from mysql with PHP using AJAX? As I...
3
by: caston | last post by:
Well, everybody can now agree with the fact that the Ajax hype is over. Still multiple Ajax Frameworks are flourishing, aren't they? So, last night I questioned myself with the following: "When...
1
by: www.web20developers.com | last post by:
http://www.web20developers.com http://www.web20developers.com/index.php?option=com_content&task=view... Ajallerix : AJAX, simple, fast Web image gallery demo ; at Novell AJAX -...
10
by: =?Utf-8?B?WWFua2VlIEltcGVyaWFsaXN0IERvZw==?= | last post by:
controlsPlease could some of you here post some of your live examples of AJAX (esp drag panels, collapsable panels, and popup menu.) (It's one thing to talk about how great something is, but it's...
1
by: =?Utf-8?B?T2xlZw==?= | last post by:
Hi, I'm wondering if anybody using ajax extensions where UpdatePanel tag is used in addition to existing ajax implementation where UpdatePanel wasn't used yet. So, there is already a web project...
22
by: sheldonlg | last post by:
I am looking for a clean solution to a problem that I solved in, what I call, a "dirty" way. Here is what I want to do. I have a dropdown list. Clicking on an item in the dropdown list invokes...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.