Log in

View Full Version : Script used on lol.com



Turnip
20-01-2007, 07:59 PM
On www.lol.com what is the script used to refresh the joke and make it come up with another?

+rep for those who reply.
i kno im not the best repper but heyy :]

Call
20-01-2007, 08:09 PM
Im guessing a random text display
and the button is just refreshing the frame

Have a go with this javascript i quickly whipped up
Ok call the file anything and it will work now


<SCRIPT LANGUAGE="JAVASCRIPT">
<!--
var r_text = new Array ();
r_text[0] = "What do you get if you cross a snowman and a vampire?<br> <b>Frostbite</b>";
r_text[1] = "These two canibals are eating a clown. The first canibal asks 'Do you taste something <b>funny?</b>'";
r_text[2] = "Joke 2";
r_text[3] = "Joke 3";
r_text[4] = "Joke 4";
r_text[5] = "Joke 5";
r_text[6] = "Joke 6";
var i = Math.round(6*Math.random());
document.write(r_text[i]);
//-->
</SCRIPT>
<br>
<form>
<INPUT TYPE="button" VALUE="Another joke!" onclick='location.reload()'>
</form>


Now features form button that reloads wherewever and whatever the file is named.

Turnip
20-01-2007, 08:31 PM
Ok, thanks alot.
I cant try it at the moment, but i will later.
+rep for trying and helping. :)

Call
21-01-2007, 06:57 PM
Ok with tht just add new r_text
for new jokes if you need more works fine for me :D

Want to hide these adverts? Register an account for free!