Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Dec 2003
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    double "on loads" in body tag

    Hey,
    I would simply like to know when you have 2 java scripts that both need to have the "on load" tag in the <body> section how do you code it? i've tried doin git several ways and none have worked as of yet. Thanks in advance

  • #2
    Regular Coder
    Join Date
    Jul 2003
    Location
    Massachusetts
    Posts
    472
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I would assume each one looks something like this:
    Code:
    <body onload="foo();">
    Or inside the JavaScript like this:
    Code:
    onload = foo;
    If you want two functions to execute when the document is done loading, you could use the first method like this:
    Code:
    <body onload="foo(); bar();">
    Or the second method like this:
    Code:
    onload = function()
    {
    	foo();
    	bar();
    }
    Last edited by fredmv; 12-25-2003 at 07:54 PM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •