DCScript© Random Fact Generator

This script not only intergrates Javascript and VBScript but also tells you the real facts of life:


The VBScript portion returns a random number between 1 and 12 as so:
rn=Int(12 * rnd())
The output is produced through document.write but placed inside a hidden SPAN tag. We don't need to see the number, but we need to have it.
Now the Javascript comes in. The 12 quotes are written in the tradition array fashion. For example:
qts[1] = "Styrofoam is not made from kittens";
Then there's qts[0] before it, so on, and it ends at 11.
The main action of the fact generator is this statement:
document.all["display"].innerHTML="Random Fact: <font color=\"#666666\">"+qts[number]+"</font> ";
document.all["display"].innerHTML means that the fact will be inserted into the span with the id of display. Finally qts[number] says that the fact will come from the array named qts and the number will be the vbscript random number (imported via the innerHTML of the hidden SPAN).
Example: if number=5; qts[number] would return "The other UFO was an upside down salad spinner"