Status bar says, "Transferring data ..." even if Ajax response is complete.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hsriat
    Recognized Expert Top Contributor
    • Jan 2008
    • 1653

    Status bar says, "Transferring data ..." even if Ajax response is complete.

    I have a page working on Ajax. The problem is, after doing many changes using Ajax (like uploading, changing name, adding to favorites etc), the status bar starts behaving unexpectedly. Even when nothing is being transfered, it displays Transferring data from localhost... and that too continuously. The progress bar also shows that its working, and its all green (filled).
    It doesn't even occur on a particular action. Its just random.

    This is not at all causing any problem to the working of the page, but it doesn't look good.

    Is there any solution for this?

    Thanks,
    Harpreet
  • mrhoo
    Contributor
    • Jun 2006
    • 428

    #2
    Try returning document.close( ) when the request has completed(ready state==4)

    Often when you script an http request(with AJAX or a script or image or iframe src change, or an object data call) , and you handle the default onload or readystatechang e, the browser leaves it to the handling script to flush the buffer.

    Calling document.close( ) has no penalty, unless you are in the middle of a transfer.

    Another posibility is that some of your requests are expected to return a value to the server, like a receipt. This can be added by the server the ajax is talking to. You may need to explicitly destroy the AJAX instance after it returns a response, and create a new object for the next request to these resources.

    Comment

    • hsriat
      Recognized Expert Top Contributor
      • Jan 2008
      • 1653

      #3
      I think I missed this...

      xmlHttp.setRequ estHeader("Conn ection", "close");

      Comment

      Working...