Currently I have the code:
<!-- More html code above -->
<div id="loading" style="display: none;">
<div align="center">
<img src="/loading.gif" style="padding:10px;" />
<div id="lmessage"></div>
</div>
</div>
<!-- More html code below -->
<!-- ...... -->
<script>
$("#buttonSubmit").click(function () {
$("#loading").show();
window.location = "/cgi-bin/somscript.py?value="+$('[name=someelement]').val();
});
</script>
</body>
</html>
So basically, I want the div to appear upon the button being clicked. This works, but the .gif (normally animated) only displays the first frame and freezes. The image is properly animated in Safari, but on Firefox it is not. Does anyone know why?
EDIT: Updated the code. If I remove the window.location
, the gif works.... why? Do I need to use .delegate
or something?
Try window.location.href = url
instead of window.location = url
(w3Schools reference)