Difference between revisions of "Template:Qotd"
Jump to navigation
Jump to search
Line 4: | Line 4: | ||
function getRandomHeader(phrase, size) { | function getRandomHeader(phrase, size) { | ||
− | + | var n = (Math.round(Math.random() * 100) % size); | |
− | + | return phrase[n]; | |
} | } | ||
Revision as of 21:25, 30 August 2006
<script language="javascript" type="text/javascript">
var headers = ["a000", "b111", "c222", "d333", "e444"];
function getRandomHeader(phrase, size) { var n = (Math.round(Math.random() * 100) % size); return phrase[n]; }
var myHeader = getRandomHeader(headers, 5);
document.write("" + myHeader + "");
</script>