Site hosted by Angelfire.com: Build your free website today!

LinkExchange Member

Jordan's Javascript Page

Netscape Now!

Welcome to my Javascript page! This has only been around for a little while, so there isn't much here yet. Your browser needs to support at least Javascript 1.0 for most of it, but some parts need your browser to support Javascript 1.2. Click here to see what your browser supports.

Scripts that require your browser to support only minimal Javascript (NN2 or higher) have a 1.0 beside them. beside them. Scripts that use Javascript 1.1 (NN3, IE4 or higher) are shown with a 1.1. A few of the scripts utilize Javascript 1.2, which was released with Netscape Communicator 4, and have a 1.2 beside them.

Piglatin Converter 1.2

Type something into the form below, then press enter to convert it to Piglatin. This script was taken from here.

This only works if your browser supports Javascript 1.2

Miscellaneous Programs

1.1Click here for a program that tells you all the factors of a number

1.1I wrote a quiz engine for multiple choice quizzes. Email me if you want to use it on your site customized with your own questions, etc.

Javascript Games

These two guessing games were my first games in Javascript that I made.
1.1A guessing game where the computer picks a number and you try to guess it
1.1Another guessing game where you pick a number and the computer tries to guess it
Click here to view them both at the same time with frames

1.2Wheel of Fortune

1.2I am working on a mini arcade-style game with layers, but it isn't quite presentable yet.

Resources

The JavaScript page of the DevEdge library
Netscape's View Source
Dynamic HTML in Netscape Communicator
The NEW Netscape Javascript Guide

Useful Functions (Snippets)

DateFormat

DateFormat is a set of JavaScript functions that allow you to "feed" DateFormat a format code and a date object (such as new Date() for the current date or document.lastModified for the current pages last modified date). DateFormat then parses the format code with the date object and returns a string representing the date in the format that was specified. DateFormat is complex enough that it has its own page, right here.

Random number between

This function returns a random number between two specified numbers, either with zillions of decimal places, or rounded to a whole number.

The code:

function randomBetween(low,high,rounded){
if(rounded)
	return Math.round((high - low) * Math.random() + 1);
return ((high - low) * Math.random() + 1);
};

Use:
randomBetween(low,high,rounded)
Where the random number is between low and high, and rounded is true or false, meaing whether or not the random number is a whole number (rounded).

Example:
<A HREF="javascript:alert(randomBetween(1,1000,true))">Display a random whole number between 1 and 1000</A>

Display a random whole number between 1 and 1000

Number ending

This function returns the "number ending" of a number, such as "th", "rd" or "st".

The code:

function numberEnding(num){
if(num >= 4 && num <= 20)
  {
  return "th";
  }

lastDigit = num.toString().charAt(num.toString().length-1);
switch(lastDigit)
  {
  case "1":
  return "st";
  case "2":
  return "nd";
  case "3":
  return "rd";
  case "0":
  return "th";
  }

return "th";
}

Use:
numberEnding(number)
Where number is the number to find an ending for.

Example:

<SCRIPT>
function alertEnding(number){
alert(number + numberEnding(number));
}
</SCRIPT>

<A HREF="javascript:alertEnding(prompt('Enter any whole number.',''))">Click for example</A>

Click for example

Submit Scripts

If you have a Javascript script or webpage, you can submit it here and it will be put on this site. We also appreciate bug reports for any of out scripts.

This form uses mailto, so it may not work with IE!

Type of submission

Email address

Comments

I have a model rocket page too!

Email: lhiller@compupartner-edm.com