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...
    142,984

    iLoveTheCode.com
    Javascript > Javascript Tutorials How To Easy > Javascript SetTimeout

    Javascript SetTimeout



    NOTE: If you have pop-ups blocked, the code below won't work, but luckily, the setTimeout tutorial works either way.

    function yup() {
    setTimeout("window.open('http://google.com')", 3000);
    }

    <body onLoad=yup()>

    -We create a function and name it yup because we like the name yup.
    -We call Javascript's built-in setTimeout method which takes two arguments.
    ---Our first argument is what we want to happen. (Open a window and go to google.)
    ---Our second argument is how long in milliseconds should the browser wait before executing our first argument. (example: 3000 is 3 seconds.)
    -We call our yup function in the HTML body tag with Javascript onLoad.


    NOTE: Since we called Javascript's built-in window.open method, which gets an argument too, we enclosed our entire first argument in double quotes, and then put our google URL in single quotes.



    Free Copy and Paste Javascript Code:

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

    function yup() {
    setTimeout("window.open('http://google.com')", 3000);
    }

    -->
    </script>

    <body onLoad=yup()>

    Resources:
    Javascript Create a Function
    Javascript Call a Function
    HTML Tutorials
    Javascript Open Window
    Javascript onLoad


    Click HERE to comment or discuss at iLoveTheCode GOOGLE Group
    Previous Article: Javascript Concat Use Concat to Join Two Arrays in Javascript
    Next Article: Javascript Status Bar





    New Perspectives on HTML...New Perspectives on HTML, XHTML, and...

    Patrick Carey

    New $69.26

    CSSCSS

    Eric Meyer

    New $29.69

    CSSCSS

    David McFarland

    New $23.09

    Learning Web DesignLearning Web Design

    Jennifer Niederst ...

    New $26.99

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

    Eric Freeman, Elis...

    New $23.99

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

    Elizabeth Castro

    New $23.09

    New Perspectives on Crea...New Perspectives on Creating Web Pag...

    Patrick Carey

    New $69.26

    Bulletproof Web DesignBulletproof Web Design

    Dan Cederholm

    New $23.99

    Information Architecture...Information Architecture for the Wor...

    Louis Rosenfeld, P...

    New $26.39


    Of Interest:
  • Making a Directory Using mkdir in Perl
  • Write a FOREACH LOOP in Perl
  • Matching at the Beginning and End
  • OPEN and WRITE a Data File in Perl
  • Formatting Time in Javascript
  • Opening a REMOTE WINDOW in Javascript
  • Change a Form Field with Javascript
  • Close Window with window.close in Javascript
  • HTML Forms
  • Make Italic Text Using HTML
  • HTML Color Chart
  • HTML Font Code

  • More Articles:
  • Opening and Reading a Directory in Perl
  • Making a Directory Using mkdir in Perl
  • Add, Subtract, Multiply, and Divide in Perl
  • To Sort an Array in Perl
  • Javascript Change Background Colors
  • onClick Javascript
  • Javascript Change Fonts
  • Javascript Alert
  • Get String Length with Javascript
  • Javascript Push - Use Push on an Array in Javascript
  • Create a Function in Javascript
  • Use OnMouseOver in Javascript
  • Make a Line Return Using HTML
  • Make Strikethrough Text Using HTML
  • Make Text Bold Using HTML
  • HTML Image

  • 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


    439,749
    Counter by iLoveTheCode.com


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