SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Member
    Join Date
    Apr 2004
    Location
    singapore
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation Need 'body OnLoad' help urgently!

    this is what i have in my source...


    <body OnLoad="initMouseEvents()">
    <body onload="type_text()">

    the first one creates fireworks from your cursor, the second one is for the scrolling text in my status bar..

    i know i can only have one onload command, according to the validator i use.


    how do i combine these two commands so that both scripts work??

    i have tried <body OnLoad="initMouseEvents()" onload="type_text()">

    but it doesnt work.. or <body OnLoad="initMouseEvents()" "type_text()">

    that doesnt work too. be glad if u could help asap! thanks in advance.

  2. #2
    SitePoint Zealot tss68nl's Avatar
    Join Date
    Nov 2002
    Location
    Netherlands
    Posts
    165
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    doh

    Code:
    <html>
    <head>
    <script>
      function init() {
    	initMouseEvents();
    	type_text();
      }
     
       // Insert the rest of your scripts here....
    </script>
    </head>
    <body onload="init();">
     
     
     
    </body>
    </html>

  3. #3
    Tranceoholic lilleman's Avatar
    Join Date
    Feb 2004
    Location
    Írebro, Sweden
    Posts
    2,716
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here's another way of doing it.

    Code:
    <html>
    <head>
    <script type="text/javascript">
      window.onload = function() {
        initMouseEvents();
        type_text();
      }
    </script>
    </head>
    <body>
     
    </body>
    </html>
    -- lilleman

  4. #4
    SitePoint Member
    Join Date
    Apr 2004
    Location
    singapore
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    so i can just leave out the <body unload..> tags?

  5. #5
    SitePoint Member
    Join Date
    Apr 2004
    Location
    singapore
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    erm i've tried both solutions... but both scripts still don't run at the same time.

    what do i do now?

  6. #6
    SitePoint Member
    Join Date
    Apr 2004
    Location
    singapore
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nevermind i found ianglass's solution here >> http://www.sitepoint.com/forums/showthread.php?t=43459 >> works wonderfully. hehe.

  7. #7
    SitePoint Zealot tss68nl's Avatar
    Join Date
    Nov 2002
    Location
    Netherlands
    Posts
    165
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Both solutions there are exactly the same Glad it works for you though


Bookmarks

Posting Permissions

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