Ajax call returning prematurily

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Simon_21

    Ajax call returning prematurily

    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,
    onreadystatecha nge=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').setTimeou ts()"
    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

    #2
    Re: Ajax call returning prematurily

    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,
    onreadystatecha nge=function() gets triggered.
    Well check the readyState property for value 4 to ensure you process the
    complete response.


    --

    Martin Honnen

    Comment

    • Simon_21

      #3
      Re: Ajax call returning prematurily

      On Mar 19, 11:23 am, Martin Honnen <mahotr...@yaho o.dewrote:
      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,
      onreadystatecha nge=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 getResponseHead ers() to see if there is a difference between
      the legitimate repsonse and invalid one and unfortunately no luck.

      Comment

      • Martin Honnen

        #4
        Re: Ajax call returning prematurily

        Simon_21 wrote:
        I did check that unfortunately in both case it is 4. I also did a dump
        of the getResponseHead ers() 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

        Comment

        • Simon_21

          #5
          Re: Ajax call returning prematurily

          On Mar 20, 8:52 am, Martin Honnen <mahotr...@yaho o.dewrote:
          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/

          Comment

          Working...