I'm trying to display an image (.gif) for "page loading" in html page until the output from my_script.py gets displayed, and I've no idea how to do that. This is what I've got so far. Many thanks in advance.
HTML:
<div id="loading">
<p><img src="./images/loading.gif" /> Please Wait</p>
</div>
<form action="./cgi-bin/my_script.py" method="post" enctype="multipart/form-data" name="fname">
<input type="submit" id="submit" value="Submit" />
</form>
js:
$(document).ready(function() {
$("form").submit(function() {
showLoading();
$('#content').load('./cgi-bin/my_script.py', null, showResponse);
});
function showResponse() {
hideLoading();
}
function showLoading() {
$("#loading").show();
}
function hideLoading() {
$("#loading").hide();
}
});