|
Posted by Toby Inkster on 03/13/06 20:43
Jose wrote:
> Some browsers will reload the page. With HTML that's the only way to do
> it (that I know of).
Then you don't know of very much:
<p>
<b>No reloads:</b>
<input id="foo" style="width:100%">
</p>
<script type="text/javascript">
quote = new Array(4);
quote[0] = "I came, I saw, I conquered";
quote[1] = "Men believe that willingly which they wish to be true.";
quote[2] = "All bad precedents begin as justifiable measures.";
quote[3] = "Et tu, Brute.";
function randquote ()
{
var f = document.getElementById("foo");
var q = Math.round(Math.random()*4);
f.value = quote[q];
setTimeout("randquote();", 15000);
}
randquote();
</script>
Ideally, you probably don't want an <INPUT> element, but want to use <Q>
or such. Done easily enough though.
--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Navigation:
[Reply to this message]
|