Embedding a JavaScript Function : JavaScript in HTML : Development : JavaScript DHTML examples (example source code) Organized by topic

JavaScript DHTML
C++
PHP


JavaScript DHTML  »  Development   » [  JavaScript in HTML  ]   
 



Embedding a JavaScript Function

Please note that some example is only working under IE or Firefox.


/*
JavaScript Unleashed, Third Edition
by Richard Wagner and R. Allen Wyke 

ISBN: 067231763X
Publisher Sams CopyRight 2000

*/

<html>
<head>
  <title>JavaScript Unleashed</title>
  <script type="text/javascript">
  <!--
    function displayMessage() {
      document.write("JavaScript functions are easy to use!<br>");
   
    }
  // -->
  </script>
</head>
<body>
  <script type="text/javascript">
  <!--
    document.write("Calling a JavaScript function...<p>");
    displayMessage();
    document.write("</p>Done. ");
  // -->
  </script>
</body>
</html>


           
       
Related examples in the same category
1.  HTML comment that hides the script.
2.  JavaScript Embedded in an HTML File
3.  Using HTML Comments to Hide JavaScript Code
4.  Embedding JavaScript in HTML
5.  Inserting Source JavaScript Files
6.  Using the Head for Definitions
7.  A Basic JavaScript Starter Document
8.  JavaScript Template File
























Home| Contact Us
Copyright 2003 - 04 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.