window.onload function

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
priyanksharma
Forum Newbie
Posts: 2
Joined: Mon Oct 20, 2008 7:04 am

window.onload function

Post by priyanksharma »

how to call two javascript function on window onLoad event
can any one help me out.............
c0mrade
Forum Newbie
Posts: 19
Joined: Mon Oct 06, 2008 4:17 am

Re: window.onload function

Post by c0mrade »

<script language="JavaScript">
function function1() {
window.confirm("Confirmation window");
}
</script>

<body onload="alert('hello'); function1();">

if that is what you seek ..
User avatar
dhrosti
Forum Commoner
Posts: 90
Joined: Wed Jan 10, 2007 5:01 am
Location: Leeds, UK

Re: window.onload function

Post by dhrosti »

Code: Select all

function init() {
  function1();
  function2();
  // etc...
}
 
window.onload = init();
priyanksharma
Forum Newbie
Posts: 2
Joined: Mon Oct 20, 2008 7:04 am

Re: window.onload function

Post by priyanksharma »

i m try the same code and its working fine but "undefiend" is null or not an object error occurs javascript error occurs....Please help me out
Post Reply