It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming HTML Forum

body onload

body onload

Postby anyonewannaspud on Mon Oct 01, 2007 5:10 pm

hello,

is there a way of putting more than one onload function in the body tag?

i want to put:

Code: Select all
<BODY onLoad="popup('index.html', 'ad')" >


and

Code: Select all
setTimeout(window.close, 5000)"


but when i've tried it hasn't worked.

Cheers
anyonewannaspud
 
Posts: 8
Joined: Mon Oct 01, 2007 5:05 pm

Postby bobbyblades on Mon Oct 01, 2007 7:07 pm

separate the function calls with commas

<body onload="alert('1'), alert('2')">
User avatar
bobbyblades
50+ Club
 
Posts: 85
Joined: Fri Aug 24, 2007 8:38 pm
Location: hawaii or bust

Postby Ezdo on Tue Oct 02, 2007 8:24 am

You can specify a function to call when the page is unLoaded -

Code: Select all
<body onUnload="popupandclose()">
<script>
function popupandclose() {
  popup('index.html', 'ad');
  setTimeout("window.close", 5000);
}
</script>


Hope this helps,

Ezdo
Ezdo
50+ Club
 
Posts: 51
Joined: Thu Apr 19, 2007 12:07 am

Postby anyonewannaspud on Thu Dec 06, 2007 12:02 pm

thanks, thats perfect!
anyonewannaspud
 
Posts: 8
Joined: Mon Oct 01, 2007 5:05 pm


Who is online

Users browsing this forum: No registered users and 9 guests