Connecting Tech Pros Worldwide Forums | Help | Site Map

Ajax call returning prematurily

Simon_21
Guest
 
Posts: n/a
#1: Mar 19 '08
Hi All,

Browser - IE 6.0
Server - Jboss 4.2.1 (Tomcat 6.0)

We are making call to the server using ajax to get some data. In a
worst case scenario the backend thread may take as long as 1 minute to
return. But sometimes what happens is I get the callback prematurily
saying that data is available. In other words,
onreadystatechange=function() gets triggered.

I debugged from the server side to see if the servlet (processing the
original request) is calling back and I don't see that happening.

I tried to use "new ActiveXObject('Msxml2.XMLHTTP.5.0').setTimeouts()"
to increase the timeout but it seems that call is not valid for the
client object.

Is there a way I can increase the time out.

Thanks
Rajesh

Martin Honnen
Guest
 
Posts: n/a
#2: Mar 19 '08

re: Ajax call returning prematurily


Simon_21 wrote:
Quote:
We are making call to the server using ajax to get some data. In a
worst case scenario the backend thread may take as long as 1 minute to
return. But sometimes what happens is I get the callback prematurily
saying that data is available. In other words,
onreadystatechange=function() gets triggered.
Well check the readyState property for value 4 to ensure you process the
complete response.


--

Martin Honnen
http://JavaScript.FAQTs.com/
Simon_21
Guest
 
Posts: n/a
#3: Mar 19 '08

re: Ajax call returning prematurily


On Mar 19, 11:23*am, Martin Honnen <mahotr...@yahoo.dewrote:
Quote:
Simon_21 wrote:
Quote:
We are making call to the server using ajax to get some data. In a
worst case scenario the backend thread may take as long as 1 minute to
return. But sometimes what happens is I get the callback prematurily
saying that data is available. In other words,
onreadystatechange=function() gets triggered.
>
Well check the readyState property for value 4 to ensure you process the
complete response.
>
--
>
* * * * Martin Honnen
* * * *http://JavaScript.FAQTs.com/
Thanks for the reply.
I did check that unfortunately in both case it is 4. I also did a dump
of the getResponseHeaders() to see if there is a difference between
the legitimate repsonse and invalid one and unfortunately no luck.

Martin Honnen
Guest
 
Posts: n/a
#4: Mar 20 '08

re: Ajax call returning prematurily


Simon_21 wrote:
Quote:
I did check that unfortunately in both case it is 4. I also did a dump
of the getResponseHeaders() to see if there is a difference between
the legitimate repsonse and invalid one and unfortunately no luck.
Does that happen with different browsers? Or just one particular browser?

--

Martin Honnen
http://JavaScript.FAQTs.com/
Simon_21
Guest
 
Posts: n/a
#5: Mar 20 '08

re: Ajax call returning prematurily


On Mar 20, 8:52*am, Martin Honnen <mahotr...@yahoo.dewrote:
Quote:
Simon_21 wrote:
[....]>
Quote:
Does that happen with different browsers? Or just one particular browser?
It only happens with IE (actually 6.0 (tried with different
subversions and service packs), didn't try 7.0 as that is not a viable
option).

On Firefox, I was not able to reproduce this. If that is the case was
planning to use 'Firebug' to see what was actually going on. With IE
MS Script Editor doesn't seem to help much.

Thanks
Rajesh
Quote:
>
--
>
* * * * Martin Honnen
* * * *http://JavaScript.FAQTs.com/
Closed Thread