Reputation: 1706
I have several JSP pages that use ajax call to do the submit and I can show a loading image before the ajax call and hide it after ajax is completed. This way, the loading image works fine.
$(document).ajaxComplete(function()
{
$("#loadingimg").hide();
});
However, I have one page that doesn't use ajax call, it uses normal form action to submit the form. When the submit button is clicked, the server will do a long time processing and the loading image becomes frozen until server comes back and direct to the next page. How do I make the loading image not frozen while server is processing ? Thanks a lot!
<form:form id= "aForm" name="aForm" method="post" modelAttribute="attr"
action="submit.htm" >
Upvotes: 1
Views: 632
Reputation: 4526
Try putting your image in an iframe, the submit button makes the page stops, but iframe should continue to run. Then show/hide the iframe something like:
<iframe src="<yourimageurl>" id="loading"></iframe>
$("aForm").submit(function (){
$("#loading").show();
});
Upvotes: 1