Monday, November 17th, 2008
This is a really simple script which displays a random text string on each refresh. Great for quotations!!
Code
Insert anywhere in between the <body> tags:
<script type="text/javascript"><!--
var dropdown = document.getElementById("cat");
function onCatChange() {
if ( dropdown.options[dropdown.selectedIndex].value > 0 ) {
location.href = "/?cat="+dropdown.options[dropdown.selectedIndex].value;
}
}
dropdown.onchange…
Tags: javascript, random, text
Posted in Uncategorized | No Comments »
Monday, November 17th, 2008
Displaying the last modified date can be really useful for articles and informative blogposts - especially for people doing their research essay at the last minute *cough*
All you really need is this simple javascript:
<script type="text/javascript">document.write (document.lastModified);</script>
This will display as:
This page was last modified on:…
Tags: javascript, simple, text
Posted in Uncategorized | No Comments »