This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes problem with XMLHttpRequestObject. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "problem with XMLHttpRequestObject." Watch "problem with XMLHttpRequestObject." New topic

problem with XMLHttpRequestObject.

prakash chauhan
Ranch Hand

Joined: Jun 22, 2007
Posts: 81
Hi All ,
I am trying to use Ajax but getting stuck at one point in my code.
Please consider the following code, and assume that XMLHttpRequestObject
has been created and that this method will be called.
The problem is that when this function is called , its not displaying the output. After doing some troubleshooting i figured out that the code will display that data (which here is a text from a text file) if i remove the code which checks for ( XMLHttpRequestObject.status == 200 ) and moreover if i just try to output this status in my html , it gives some unknown error in the internet explorer. Wanted to confirm if this property
(status ) is supported by IE 6.0? and if it is what am i doing wrong.

Eric Pascarello

Joined: Nov 08, 2001
Posts: 15376
Well not all status codes will be 200. So put a check after it and look to see what the statusCode and statusText are.

In reality I would not recommend you coding something like this since there is a lot of quirks. You might want to look at JQuery, Prototye.js, or YUI connection manager.

prakash chauhan
Ranch Hand

Joined: Jun 22, 2007
Posts: 81
thanks for the suggestion, actually i am just beginning to learn AJAX ,
i ll try to find more on JQuery and other suggested options.
It is sorta covered in the JavaRanch Style Guide.
subject: problem with XMLHttpRequestObject.
Similar Threads
passing xml to jsp/java
ajax status code 0
Execute JavaScript function present in HTML fragment loaded using AJAX
AJAX XMLHttpRequestObject Question?
Internet Explorer XMLHTTPRequest problem