Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

display page after load

Status
Not open for further replies.

whiteadi

Programmer
Apr 8, 2003
11
NL
Hi,

I want to display a page only after it is loaded.

I know that if I put in body style = "display=none" then

nothing is shown but I do not know hot to unset it.

I made this:

<div id="y" style="display=none">text and stuff</div>
<script language="JavaScript">
if(document.layers){
document.y.display="";
}
if(document.all){
document.all.y.style.display="";
}
if(!document.all && document.getElementById){
document.getElementById("y").style.display="";
}
</script>

but must be a better way.

regards
 

This one line might work:

Code:
<body style="display:none;" onload="this.style.display='block';">

although I've not tried it ;o)

Dan
 
this.style" is null or not an object - IE :)

thanks anyway :)
 

Try this instead:

Code:
<body style="display:none;" onload="document.getElementsByTagName('body')[0].style.display = 'block';">

Dan

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top