Results 1 to 6 of 6

Thread: Onload script

  1. #1
    Join Date
    Aug 2006
    Posts
    89
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Onload script

    1) Script Title: Multiple onload scripts??

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex6/clock2.htm

    3) Describe problem: <body onLoad="show_clock()">

    how many times can i load the onload in the body tag?? whats the syntax and can i use it anywhere else?

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    There can be only one onload. However, one can enter multiple statements separated by semicolons:
    Code:
    <body onload="a(); b(c); d(e, f, g);">
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Note that each statement must be unique. If you want multiple clocks on your page, that's a more complex question, in which you would need to change all the variable and function names to make them unique.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Note that each statement must be unique.
    Why so?
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #5
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Well, sure, go ahead and call the same function twice. But it won't do anything except in really rare circumstances.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  6. #6
    Join Date
    Aug 2006
    Posts
    89
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thanks all :P

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
  •