beginner

P

pag64

I have the following message when I have to insert the
j. code into my html page :

Add the onLoad event handler into the BODY tag

The BODY part ok
The Head part ok
but the body tag ??


Can you tell me what I have to do and where
I have to insert the code
Thanking you in advance.

AG
 
D

David Dorward

pag64 said:
I have the following message when I have to insert the
j. code into my html page :

Add the onLoad event handler into the BODY tag

The BODY part ok
The Head part ok
but the body tag ??

<script type="text/javascript">
window.onload = fuction() {
do_stuff();
}
</script>

(Although they probably mean <body onload="do_stuff();">)
 
R

Richard Hockey

<html>
<head>
<title></title>
<script type="text/javascript">
DoFunction()
{
alert('Hello World');
}
</script>
</head>

<body onLoad="DoFunction();">

</body>
</html>
 
R

Richard Hockey

A rather trivial example of how to use the onLoad event in the body tag:

<html>
<head>
<title>OnLoad example</title>
<script type="text/javascript">
DoFunction()
{
alert('Hello World');
}
</script>
</head>

<body onLoad="DoFunction();">

</body>
</html>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top