Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Ajax call returning prematurily

Reply
Thread Tools

Ajax call returning prematurily

 
 
Simon_21
Guest
Posts: n/a
 
      03-19-2008
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
 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      03-19-2008
Simon_21 wrote:

> 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/
 
Reply With Quote
 
 
 
 
Simon_21
Guest
Posts: n/a
 
      03-19-2008
On Mar 19, 11:23*am, Martin Honnen <(E-Mail Removed)> wrote:
> Simon_21 wrote:
> > 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.

 
Reply With Quote
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      03-19-2008
Simon_21 wrote:
> On Mar 19, 11:23 am, Martin Honnen <(E-Mail Removed)> wrote:
>> Simon_21 wrote:
>>> 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.
>> [...]


Please trim your quotes, and don't quote signatures unless you refer
explicitly to them.

> 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.


Without your posting the relevant code snippet or the URL of a test case it
is impossible to say whether your assessment of the situation is correct.

http://www.jibbering.com/faq/faq_notes/clj_posts.html


PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
 
Reply With Quote
 
Martin Honnen
Guest
Posts: n/a
 
      03-20-2008
Simon_21 wrote:

> 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/
 
Reply With Quote
 
Simon_21
Guest
Posts: n/a
 
      03-20-2008
On Mar 20, 8:52*am, Martin Honnen <(E-Mail Removed)> wrote:
> Simon_21 wrote:

[....]>
> 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

>
> --
>
> * * * * Martin Honnen
> * * * *http://JavaScript.FAQTs.com/


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
AJAX Modal Popup Not Returning Current Control Values Mike C. ASP .Net 0 09-19-2008 07:46 PM
AJAX UpdatePanel - IsInAsyncPostBack and IsPostBack returning false PSY ASP .Net 3 02-04-2008 02:06 PM
AJAX UpdatePanel - IsInAsyncPostBack and IsPostBack returning false PSY ASP .Net Web Controls 1 02-01-2008 03:56 PM
AJAX IDE and AJAX TOOL--The Release of JoyiStar AJAX WebShop 3 Beta minnie Java 1 12-13-2006 06:29 AM
returning none when it should be returning a list? randomtalk@gmail.com Python 11 05-02-2006 10:26 AM



Advertisments