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

window.onload <body onload=""> together they will not work.

Status
Not open for further replies.

johno5

IS-IT--Management
Aug 3, 2001
16
0
0
GB
I have two pieces of javascript that I am trying to that I want to work on the same page the only problem is that one or the other will work not both together.

One uses a window.onload function to call a bouncing popup page and the other uses a onload function placed in the HTML <body> tag.

I’ve tried calling the scripts separately, merging the 2 scripts but nothing seams to work. I am a beginner using JS and the 2 source codes were taken form JS provider sites
- -
Please help me with this problem.
 
It may be that the two functions are somehow interfering with each other. If that's not the case, you could try writing a function which calls the other two, and call that function from either onload method. Here's an example of what I mean:
Code:
function onLoader() {
   yourFunction1();
   yourFunction2();
}
Note that I called the function onLoader, not onLoad. Never use the same name for something of yours as a javascript reserved word. Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top