iLTC Home
Bookmark iLTC!
iLTC Google Boards

Google Groups
Receive The Code in Email!



Categories

Perl
  • Perl Tutorials Beginners

    Javascript
  • Javascript Tutorials
  • Javascript Tutorials Beginners

    HTML
  • HTML Tutorials



  • Perl with cheese...
    123,707

    iLoveTheCode.com
    Javascript > Javascript Tutorials How To Easy > Use onLoad in Body Tag with Javascript

    Use onLoad in Body Tag with Javascript



    To use onLoad in the body tag to call a Javascript:

    <body onLoad="alert('The page is loading... now!')">

    -We enclose Javascript's built-in event handler onLoad in the body tag.
    -We call Javascript's built-in alert method.
    -We enclose our text in single quotes because it's already inside double quotes.


    We could also call a script with onLoad:


    function coolAl() {
    alert("The page is loading... now!");
    }

    <body onLoad="coolAl()">

    -We created a function and named it coolAl.
    -We called that function in the onLoad event handler.



    Free Copy and Paste Javascript Code:

    <script type="text/javascript">
    <!--

    function coolAl() {
    alert("The page is loading... now!");
    }

    -->
    </script>

    <body onLoad="coolAl()">
    My home page


    Resources:
    Opening an Alert Box in Javascript
    Call your Function in Javascript
    Create a Function in Javascript



    Click HERE to comment or discuss at iLoveTheCode GOOGLE Group
    Previous Article: Change a Form Field with Javascript
    Next Article: Use onLoad to Call More than One Function with Javascript





    HTML & XHTMLHTML & XHTML

    Chuck Musciano, Bi...

    New $29.99

    HTMLHTML

    Gary B. Shelly, Th...

    New $84.55

    New Perspectives on HTML...New Perspectives on HTML and XHTML 5...

    Partrick Carey

    New $67.45

    CSS MasteryCSS Mastery

    Andy Budd, Simon C...

    New $23.85

    Head First HTML with CSS...Head First HTML with CSS & XHTML

    Eric Freeman, Elis...

    New $23.99

    jQuery in ActionjQuery in Action

    Bear Bibeault, Yeh...

    New $26.39

    Learning Web DesignLearning Web Design

    Jennifer Niederst ...

    New $26.99

    Creating Web SitesCreating Web Sites

    Matthew MacDonald

    New $19.77

    HTML, XHTML, and CSS, Si...HTML, XHTML, and CSS, Sixth Edition ...

    Elizabeth Castro

    New $23.09


    Of Interest:
  • Use chmod in Perl
  • Add to End of an Array with Push in Perl
  • Use the Perl PRINT FUNCTION
  • Add to the Beginning of an Array with Unshift in Perl
  • Javascript Concat - Use Concat to Join Two Arrays in Javascript
  • Javascript Uppercase Text
  • Javascript Superscript Text
  • Javascript Reverse - Use Reverse on Items in an Array in Javascript
  • HTML Frames
  • HTML Image
  • HTML Tags
  • HTML Body Tag

  • More Articles:
  • INCREMENT and DECREMENT a Variable in Perl
  • Write a FOREACH LOOP in Perl
  • OPEN and READ a Data File in Perl
  • Create a Subroutine in Perl
  • onClick Javascript
  • Select All or Highlight Text Fields and Textareas Using Javascript
  • Focus a Window with self.focus in Javascript
  • Use onLoad to Call More than One Function with Javascript
  • Write a For Loop in Javascript
  • HTML Tables
  • HTML Space
  • HTML Superscript Text
  • HTML Title Tag

  • Search iLTC w/ Google





    Recent Articles

  • Javascript Focus Form Field
  • Javascript Lowercase Text
  • Javascript Uppercase Text
  • Javascript Superscript Text
  • Javascript Subscript Text
  • Make Text Blink Using Javascript
  • Make a String into a Link in Javascript
  • Javascript Italics Text
  • Javascript Bold Text
  • Javascript Redirect
  • HTML Frames
  • HTML Color Chart
  • HTML Link
  • Javascript Status Bar








  • Perl Programming - Javascript Programming - Maybe Some PHP - Free Scripts - ILoveTheCode
    All Content © 2006 iLoveTheCode.com


    Contact Chris | About this Site


    420,468
    Counter by iLoveTheCode.com


    Last Modified: Friday, 23-Jun-2006 07:23:17 EDT