aspose file tools*
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
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "problem with XMLHttpRequestObject." Watch "problem with XMLHttpRequestObject." New topic
Author

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
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
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.

Eric
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.
-thanks
prakash
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: problem with XMLHttpRequestObject.