Random Message JavaScript

Back to BuildingBlocks Index or press "h"

Step 1 of 2: Add the following style sheet to the head section of your page:
<!-- START of RANDOM JOKE --> <SCRIPT>
   <!-- Hide from old browsers
   function random(limit) {
     today = new Date();
     return(today.getSeconds() % limit);
   }
   function tagline() {
     tagLines = new Array(10);
     tagLines[0] = "<b>Hit any person to continue....</b>";
     tagLines[1] = "<b>Ben & Jerry's CoffeeCoffeeBuzzBuzzBuzz icecream is not a good bedtime snack.</b>";
     tagLines[2] = "<b>RAM DISK is not an installation procedure!</b>";
     tagLines[3] = "<b>Documentation, the worst part of programming.</b>";
     tagLines[4] = "<b>A feature is a bug with seniority.</b>";
     tagLines[5] = "<b>I haven't lost my mind! It's backed up on tape somewhere!</b>";
     tagLines[6] = "<b>I call things as I see them, if I didn't see them, I make them up!</b>";
     tagLines[7] = "<b>Press CTRL-ALT-DEL now to access the pirate software.</b>";
     tagLines[8] = "<b>Two most common thing in the universe: Hydrogen & Stupidity.</b>";
     tagLines[9] = "<b>This tagline is SHAREWARE! To register, send me $10</b>";
     document.write("<FONT FACE='Verdana' SIZE='1'>" + tagLines[random(10)] + "</FONT>");
   }
   // Unhide -->
  </SCRIPT>
<!-- END of RANDOM JOKE -->
Step 2 of 2:
Insert the below code into the <body> section of your page where you wish the message to appear:
<SCRIPT>
   <!-- Hide
     tagline();
   // Unhide -->
</SCRIPT>

Back to BuildingBlocks Index or press "h"