JavaScript!

Here are some examples I created while learning JavaScript. The most useful one is Example 7 which estimates the download time for different size files and different internet connection speeds.  You should really check out this JavaScript Hang Man game I made too.

Feel free to use/borrow them for your own site if you like any of them. If you do, please include a link to www.JessLilly.com. The source for all of the examples is available for download. Also, you may want to choose View->Source in your browser to see embedded JavaScript.

Example 1
This script uses onmouseover and onmouseout to animate the link. When clicked, it pops up a new window.
Pop up a new Window.



Example 2
A simple script that shows when the page was last updated.

<!--
document.write("Last Updated ")
document.write(document.lastModified)
// -->





Example 3
Another simple script that pops up an alert message.

<input type="button" name="AlertButton" value="Pop up an Alert Message"
onclick="alert('Hi.  I\'m an annoying warning message.')">



Example 4
A more complicated script that converts numbers from different systems. One tricky thing is that I have to declare my function, convertBase() before I run this script. I am declaring the function in the HEAD portion of my HTML document.
Try choosing Base 2 and enter 101010101010. You should get 2730 for a result.
Try choosing Base 16 and enter A. You will get 10 as a result.

1. Select a number system for your entry:

2. Enter an integer in that system:

3.
4. Your number converted to Base 10.


Example 5
A simple script to change the background color of this page.  When the background is black, the text color changes too!  


Example 6
I know something about you... This script shows your browser properties.





Example 7
A more complicated script that calculates the download time of a file. See how long it will take you to download an MP3 music file... ( average 3 MegaBytes per song )



Example 99
This is the last script. It is a back button so you can go back where you came from. Bye!