Random Quote Generator

This website makes frequent use of a Javascript random quote generator to display a variety of customer testimonials like the one to the right. It's very easy to add this to your own website.

Copy the following Javascript into an empty text file and call it quoter.js.

var quotes = new Array;

quotes.push("Thank you!");

quotes.push("&quot;Here is another quote.&quot;<br><br>John Doe<br>ACME Inc.");

quotes.push("Keep adding quotes like this.");

document.write(quotes[(Math.floor(Math.random() * quotes.length))]);

Wherever you would like the quotes to appear, simply insert the following:

<script src="quoter.js" type="text/javascript"></script>

Note that you may need to adjust the path to point at quoter.js from various folders on your site, or you can place it in your site's root folder and make the value of src absolute:

<script src="http://www.mysite.com/quoter.js" type="text/javascript"></script>

Sometimes you may want to include all of your quotes on a page. You can do this with the following line of code once quoter.js has been loaded:

<script language="javascript" type="text/javascript">for (var i=0; i<quotes.length; document.write("<hr /><p>" + quotes[i++] + "</p>")) {};</script>

If you like this tool, please consider putting a link to us on your site.

Script courtesy of <a href="http://www.web1marketing.com">Web 1 Marketing, Inc.</a>

We welcome your comments.

If you like this tool, please rate it at Hotscripts.com