beginner

Discussion in 'Javascript' started by pag64, Jun 29, 2003.

  1. pag64

    pag64 Guest

    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
     
    pag64, Jun 29, 2003
    #1
    1. Advertisements

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

    (Although they probably mean <body onload="do_stuff();">)
     
    David Dorward, Jun 29, 2003
    #2
    1. Advertisements

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

    <body onLoad="DoFunction();">

    </body>
    </html>
     
    Richard Hockey, Jun 29, 2003
    #3
  4. 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>
     
    Richard Hockey, Jun 29, 2003
    #4
  5. pag64

    pag64 Guest

    Thanks so much for your answers.
    Have a good week.

    AG
     
    pag64, Jun 29, 2003
    #5
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.