Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
194
rated 0 times [  199] [ 5]  / answers: 1 / hits: 6193  / 10 Years ago, sun, march 23, 2014, 12:00:00

I'm submitting multipart/form-data form as shown below.
Here form is targeted to a iframe.



  <form id=upp method=post action=sample.jsp name=upform enctype=multipart/form-data target=my_iframe>
<input type=hidden name=todo value=upload>
<input id=haa type=file name=uploadfile size=50>
</form>

<iframe id=my name=my_iframe scrolling=no src=sample.jsp frameBorder=0>

</iframe>


And script I used is



     $('#haa').change(function() {

$('#upp').submit();

});


Now how can I put loading image(.gif) while file is uploading to the iframe.


More From » jquery

 Answers
6

Here is a solution with a demo: http://www.itgeared.com/articles/1508-display-gif-loading-iframe-jquery/



What you need to enable is basically some javascript like



<script>
$(document).ready(function () {
$('#iframe1').on('load', function () {
$('#loader1').hide();
});
});




and some css which you hide after the content is loaded:



#loader1 {
position:absolute;
background:#ffffff;
}


you can replace the background color by any url(image...)


[#46622] Friday, March 21, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
saulthomasb

Total Points: 326
Total Questions: 98
Total Answers: 93

Location: Jordan
Member since Sun, Dec 26, 2021
2 Years ago
;