First Scripts

Note: The scripts shown here are demonstrations of code. They are neither the best not the only solutions and may not run everywhere. We'll see better examples as we go along.

  1. The Obligatory "Hello world!"

    To see the "Hello world" scripts, click the link and run them. Then, look at the source code of the page displayed. (If you can't see the <script> ... </script> tags in the source, try a different browser.)

    1. <script> in <head>
    2. <script>s in <head> and <body>
    3. Importing an external script
    4. Delayed execution
    5. Inline Scripts
  2. Event Handlers
    1. onmouseover / window title
    2. Image Rollovers
  3. Simple Validation
    1. Check text string length
  4. Simple Computation
    1. Add or subtract numbers