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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Body onLoad=

Status
Not open for further replies.

bmdev

Programmer
May 13, 2003
29
US
We have a shared module that gets called from all our pages that has a BODY onLoad= statement in it. I need to put a BODY onLoad= in my main page. The 2 seem to conflict with each other and the main page's onLoad doesn't get executed. Is there some way I can get both onLoad's to work? Changing the shared module isn't an option.

Thanks
 
bmdev, on your page place the onload statement b/w scripttags, with no function name. That should get it work.

EX:
<script>
alert("HI");
</script>

Doing the above will have the ALERT initiated as soon as the page is loaded.


____________________________________
Just Imagine.
 
so, you have two onload statements in the body of one page?

___________________________________
[morse]--... ...--[/morse], Eric.
 
I don't think you're going to find an easy way around this one...

But you could try putting your onload script at the very end of your HTML... so, the LAST thing that get's loaded on the page is the your javascript call.

It's not quite as definite as the onload event, but it's at least in the ballpark.

Code:
<body>
your page stuff STARTs here...
More of your page stuff up here...
your page stuff ENDs here...
<script type="text/css">
  alert('this is sorta like an \'onload\' event, isn\'t it?');
</script>
</body>
</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top