Random Quotes / Messages

Random quotes are a nice addition to a site to add a little fun content so I am including directions here to put them on your own blog.



  1. Select a list of quotes to put on your blog.

  2. Go to the templates tab on your blog customization and select add a new page element.

  3. Select the HTML / JavaScript element

  4. Paste the following code into the block



  5. <i><center><script language="JavaScript">
    //store the quotations in arrays
    //change this number to reflect the number of quotes
    quotes = new Array(2);
    //just follow this pattern to add more quotes
    quotes[0] = "Shave your head, get a wet sponge, and flip the switch, 'cause you're about to get a Truthocution!<br/>Stephen Colbert";
    quotes[1] = "I believe all God's creatures have a soul... except bears, bears are Godless killing machines!<br/>Stephen Colbert";
    //calculate a random index
    index = Math.floor(Math.random() * quotes.length);
    //display the quotation
    document.write("\n");
    document.write(quotes[index]);
    </script></center></i>
    </pre></li>

  6. You can give the element a title if you want, but it is not needed

  7. Save the element and drop in in your page where you want it.

  8. Viola, you have random quotes...


Ok.... thanks for the applause, no really, thank you... Ok. So there are variations of this script all over the net. You can find a version you like better or hack this one up. Follow the links to check out sites with great little scripts and widgets for your blog, or watch here for more.

No comments:

Post a Comment