0

I am using a DIV to load pages that must be refreshed every so often however due to the delay in each load, it takes that amount of time to load the first preview. So what I want to do is while the page loads it up is there a possibility of placing some sort of loading icon/image/message until it gets the page contents.

The code I am currently using is:

<script>
var refreshId = setInterval(function()
{
$('#bprofile').load('Bupdate.php');
}, 10000);
</script>

<div id="bprofile"></div>

So the above loads onto the page if the page is refreshed or loaded and will load the external page every 10 seconds and every 10 seconds after that, during which time I would like to place some sort of loading image or message until it loads the external page...
Is this possible?

Thanks in advance! :)

Edited by public-image: n/a

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by public-image
0

try the idea, maybe it help

<script>
var refreshId = setInterval(function() {
document.getElementById('loading').style.display="block";
$('#bprofile').load('Bupdate.php');
document.getElementById('loading').style.display="none";
}, 10000);

</script>
<div id="loading" style="display:none;"><img src="sample_loading_icon.gif" ></div>
<div id="bprofile"></div>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.