views:

144

answers:

2

The JS script:

function ShowUploadingAnimation()
{
    $('#info_msg').html("<div style=\"padding-top: 15px; height: 50px;\" align=\"center\"><img id=\"uploading-img\" /></div>");
    $("#uploading-img").attr({ src: "images/uploading.gif", alt: "Uploading" });
}

And the html usage:

<input type="submit" value="Upload" onclick="ShowUploadingAnimation();">
<div id="info_msg"></div>

So my issue is the following: This method works ok in Firefox, but in Internet Explorer the gif file is loaded, but it's not animated, just static... showing only a random frame each time the button is clicked. Any suggestions?

+1  A: 

This is a well known issue with ie and animated gif's when showing/hiding images whilst during xhr calls & file uploads. There are lots of solutions given here on a Ricks Strahl blog post in the comments. Maybe one of them will work for you.

redsquare
A: 

Easy trick would be put this into iframe. Instead of <img src=''> use <iframe src=''></iframe>.

Thinker
That's using a bazooka to kill a fly
Philippe Leybaert
That's solving the problem without getting mad ;)
Thinker
True, but it's still a very bad solution to the problem
Philippe Leybaert