JavaScript

Code Examples

Click here for info about the page.

A solid bottom border.


Click here for time and date.

Click here to go back 2 pages.

Location objects

Back and Forward buttons:

Location info:


Links and Anchors

Variable ops

Playing with Strings

The President Game

First, in numeric order:












Next, sorted alphabetically by first name:


Now, put the names in a form box using the join function on the sorted array:


Objects

Create and print a customer object



String object used in a Method

if statements


Loops






Some Math

N.B. For class="classname" use .classname in the CSS

For id="idname" use #idname in the CSS

Round up

Round down

Round to nearest integer

Gen a random number between 1 and whatever you enter

Gen sin from whatever you enter

Gen cos from whatever you enter

Let's see just how random a random number is. Enter the number of tests to run.

Date handling

My birthday.


Current date and time info


Julian day


Lilian date


Effects

Testing Effects

This section is in a div. script.aculo.uslibrary is used. Click on the buttons to see the effects.

Now, fun with events

VG

Click Me!

Dagbladet

No, Click Me!

Display Event Properties and go to CNN

Oh, oh, oh. Click Me! Click Me!

BT

Click moi

Display the key pressed

Here

Window Objects