即使在帖子请求完成后,Firefox也会显示等待光标并“加载...”

I have a form to upload a file.The <html> is as follows:

<div id="divModalPopup" class="ui-dialog-content" style="height: 139px; width: 268px;">
  <form method="post" action="upload.php" target="uploadframe" enctype="multipart/form-data">
    Please choose a file to upload [only zip with shape files and no folders]: 
    <input type="file" name="uploadFile"/><br/><input type="submit" value="Upload"/>      
  </form>
  <iframe style="display: none;" onload="uploadStatus();" id="uploadframe" name="uploadframe"/>
</div>

And on clicking upload, i send a post request to a php file,whose response is shown on the iframe. The javascript function for the same :

function uploadStatus(){

   var resp = document.getElementById('uploadframe').contentDocument.body.innerHTML;

   if ("" != resp){

      jQuery("#divModalPopup").html(resp);

   }

}

The issue I am facing here is that, even after i get the response(firebug shows the correct response), <firefox> shows a waiting cursor and loading.. icon in the tab.

Any idea as to why this is happening??

There's nothing but an echo statement in the php file.

Also, this doesn't happen on other browsers like Chrome and safari. A tcp packet capture shows that the transaction is complete.

Try after disabling firebug... just to eliminate one possibility.

Could it be a firefox specific bug as none of the other browsers are exhibiting it ? A tcp packet capture and "net" tab in firebug should confirm that the response was completely sent back by the php script.

Put something in your response. If you only have an echo statement in your php file, the response is empty and Firefox is known to have trouble with empty ajax response.

Try this in your php:

<?php
echo("something");
header("Content-type: text/html");
?>

This usually happen when there is no content-length header (or the headers is present but with an incorrect size)

You should look at the headers. If the header isn't there, You'll have to play a little with .htaccess

Also, make sure you don't have any strange character after the php closing tag "?>"

I was having a similar problem and I found this article which proved to be helpful.

Basically the problem is caused when removing the iframe from the DOM inside the onload handler.

If you have the firebug plugin installed in Firefox then you can see all the http requests live. So open firebug, open the "net" tab and reload the page. You will be able to see what POST/GET requests are being called and hopefully be able to solve the problem with that.

Add ';return false;' after your javascript call.

<iframe style="display: none;" onload="uploadStatus();return false;" id="uploadframe" name="uploadframe"/>