JavaScript Random Quotes

Submitted by:Andery Smith

Date added:06 March, 2012

Category:JavaScript

An example code for JavaScript Random Quotes

Tags: random quotes

Code Snippet:

<SCRIPT>

// var ideas = new Array(4);
var ideas = new Array();

ideas[0] = "Type \"about:cache\" into your browser to find everything that is stored in your cache.";
ideas[1] = "Type \"about:mozilla\" to get an odd message from the Netscape team.";
ideas[2] = "Hold down shift when pressing reload to clear a page\'s items from cache.";
ideas[3] = "Type \"view-source:\" preceding a document\'s URL to automatically view its source.";

</SCRIPT>

Randomly Generated Idea is:

<SCRIPT>

// Where you place this is where the random object will be displayed.

var Quote = ideas[Math.round((ideas.length - 1) * Math.random())];

document.write(Quote);

</SCRIPT>

<BODY>

<FORM>
<INPUT TYPE="BUTTON" VALUE="View Source"
onClick="location = 'view-source:' + location">
</FORM>
 
 

Comments