PDA

View Full Version : Please wait while loading


rjuyal
06-03-2008, 06:24 AM
Hi,
i have to implement "Please wait while loading" in my page.
For that i did,

<div id="waitID" class="titleBG">
<img src="shr/img/pleasewait.gif" alt="Please wait while loading...."/> Please wait while loading....
</div>
<div id='mainBodyID' >
<tiles:insert attribute="body" />
</div>


<script>
window.onLoad = init();
function init(){
document.getElementById('waitID').style.display='none';
document.getElementById("mainBodyID").style.display='';
}
</script>


This code is not working in IE, :mad:( it never shows the image ). though it works fine in Firefox, Safari ( showing please wait image, till the page is loading ) ... :)

Please help

rangana
06-03-2008, 06:57 AM
I'm confused, FF throws an error on my part. Try adding a type attribute in your script tag.

<script type="text/javascript">


Try to remove the brackets too:

window.onLoad = init();


Your code, couls also be simplified to:

<script type="text/javascript">
window.onload=function()
{
document.getElementById('waitID').style.display='none';
document.getElementById("mainBodyID").style.display='';
}
</script>


See if it helps.