edenwax
VIP
v5 Beta Tester[M:5000]
Posts: 1,266
|
Post by edenwax on Dec 30, 2010 9:24:22 GMT
Below is a very basic random quote feed. I originally did this when I was learning visual basic, but translated it to JS out of pure boredom. It was also my first time using arrays in js, which messed me up a bit. Google helped me figure it out.
You could probably find a ton of these on Google. But I thought it would be nice to have one on here.
<script type="text/javascript"> var word = new Array; word.push("INSERT QUOTE HERE1"); word.push("INSERT QUOTE HERE2"); word.push("INSERT QUOTE HERE3"); document.write(word[(Math.floor(Math.random() * word.length))]); </script>
Works in all the latest browsers.
|
|