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



  • I bookmarked this site...
    123,732

    iLoveTheCode.com
    Javascript > Javascript Tutorials How To Easy > Opening an Alert Box in Javascript

    Opening an Alert Box in Javascript



    alert() is a built-in Javascript method.

    A little tricky here with the quotation marks.

    Put what you want the alert to say in double quotation marks if you are using in a script.

    alert("Don't Leave My Site!");

    Use single quotes if using in a link.


    Copy and Paste Javascript (two ways to use):

    In a link:

    <a href="http://google.com" onClick="alert('You are going to Google!');return true">Google</a>

    In a script:

    <script type=text/javascript>
    <!--
    alert("Don't Leave My Site!");
    -->
    </script>


    When using in a link, the "return true" means go to the link that is being clicked on. "return false" would stop from going to the link.


    Alert Box - See in Action (new window)


    Click HERE to comment or discuss at iLoveTheCode GOOGLE Group
    Previous Article: Opening a REMOTE WINDOW in Javascript
    Next Article: Passing an Argument or Variable to a Javascript





    Learning Web DesignLearning Web Design

    Jennifer Niederst ...

    New $26.99

    jQuery in ActionjQuery in Action

    Bear Bibeault, Yeh...

    New $26.39

    HTML & XHTMLHTML & XHTML

    Chuck Musciano, Bi...

    New $29.99

    Bulletproof Web DesignBulletproof Web Design

    Dan Cederholm

    New $23.99

    CSSCSS

    Eric Meyer

    New $29.69

    CSS MasteryCSS Mastery

    Andy Budd, Simon C...

    New $23.85

    Creating Web SitesCreating Web Sites

    Matthew MacDonald

    New $19.77

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

    Partrick Carey

    New $67.45

    Dreamweaver CS3Dreamweaver CS3

    David McFarland

    New $29.69


    Of Interest:
  • Create a Subroutine in Perl
  • Undefine an Array in Perl
  • Getting Server Time in Perl
  • Matching at the Beginning and End
  • Increment a Variable in Javascript
  • Select All or Highlight Text Fields and Textareas Using Javascript
  • Get String Length with Javascript
  • Substitute in Javascript Using replace Method
  • HTML Background
  • HTML Color Chart
  • Make Italic Text Using HTML
  • HTML Body Tag

  • More Articles:
  • Get the Length of a Word or String in Perl
  • Add to the Beginning of an Array with Unshift in Perl
  • Exit a Loop with Last
  • OPEN and READ a Data File in Perl
  • onClick Javascript
  • Get Formatted Time in Javascript
  • Getting Epoch Time in Javascript
  • Formatting Time in Javascript
  • Reading Cookies using Javascript
  • HTML Tables
  • HTML Font Code
  • HTML Title Tag
  • HTML Codes

  • 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,493
    Counter by iLoveTheCode.com


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