This one creates a flashing background to annoy anyone visiting the web page:
<script type="text/javascript">
function changeB(){
var rnd = Math.random() * 10;
var r = Math.floor(rnd);
var colors = new Array("red", "green", "blue", "yellow", "purple", "white", "black", "indigo", "gold", "teal");
document.getElementById('thebody').style.backgroundColor = colors[r];
window.setTimeout("changeB()", 1);
}
</script>
This one pops up an annoying alert box every time the user does something:
<script type="text/javascript">
function annoy(){
alert("Are you sure you want to do that?");
}
document.onkeydown = annoy;
document.onkeyup = annoy;
document.onkeypress = annoy;
document.onmousedown = annoy;
document.onmouseup = annoy;
document.getElementById('thebody').onload = annoy;
document.getElementById('thebody').onunload = annoy;
</script>
Please do not actually try these. The first one is really bad for the eyes and the second one may make it impossible to close the browser window. Needless to say, you probably won't like the results.
So, what are yours?


Sign In
Create Account


Back to top










