iLTC Home
Bookmark iLTC!
iLTC Google Boards

Categories

Perl
  • Perl Tutorials Beginners

    Javascript
  • Javascript Tutorials
  • Javascript Tutorials Beginners

    HTML
  • HTML Tutorials



  • iLoveTheCode.com
    Javascript > Javascript Tutorials How To Easy > Call your Function in Javascript

    Call your Function in Javascript



    To call your function in Javascript:

    First, create your function.

    function makeBread() {
    alert("Bread's Done!");
    }

    To call it inside of <script> tags, simply call it like so:

    makeBread();


    To call it from a link, in your <a href tag:

    <a href="http://google.com" onClick="javascript:makeBread();return false">Call function from a link.</a>

    -when this link is clicked, anything inside the function makeBread will be executed.
    -the return false statement stops the browser from loading the link, in this case, google.
    -return true would send the user's browser to google.


    Free Copy and Paste Javascript Code:

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

    function makeBread() {
    alert("Bread's Done!");
    }

    makeBread();

    -->
    </script>


    <a href="http://google.com" onClick="javascript:makeBread();return false">Call function from a link.</a>



    Resources:
    Create a Function in Javascript


    Click HERE to comment or discuss at iLoveTheCode GOOGLE Group
    Previous Article: Substitute in Javascript Using replace Method
    Next Article: Create a Function in Javascript





    HTML, XHTML, and CSS All...HTML, XHTML, and CSS All-in-One Desk...

    Andy Harris, Chris...

    New $23.09

    CSSCSS

    David McFarland

    New $23.09

    Dreamweaver CS3Dreamweaver CS3

    David McFarland

    New $29.69

    JavaScriptJavaScript

    David Flanagan

    New $31.49

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

    Elizabeth Castro

    New $23.09

    Beginning Joomla!Beginning Joomla!

    Dan Rahmel

    New $29.69

    jQuery in ActionjQuery in Action

    Bear Bibeault, Yeh...

    New $26.39

    Head First AjaxHead First Ajax

    Rebecca Riordan

    New $29.69


    Of Interest:
  • Matching at the Beginning and End
  • Getting Server Time in Perl
  • Add, Subtract, Multiply, and Divide in Perl
  • Substitute in Perl
  • Javascript Referrer
  • Opening a REMOTE WINDOW in Javascript
  • Javascript Uppercase Text
  • Javascript Reset Form
  • HTML Tables
  • HTML Codes
  • HTML Underline Text
  • HTML Color Chart

  • More Articles:
  • Matching at the Beginning and End 2
  • OPEN and WRITE a Data File in Perl
  • Getting Server Time in Perl
  • Combine, Put Two Arrays Together in Perl
  • onClick Javascript
  • Get Query String Using Javascript
  • Use onMouseOut in Javascript
  • Exit a For Loop in Javascript with Break
  • HTML Image
  • HTML Tags
  • HTML Font Code
  • 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


    581,328
    Counter by iLoveTheCode.com


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