Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Top 10 Guide to being annoying with JavaScript
Old 10-26-2008, 04:12 PM Top 10 Guide to being annoying with JavaScript
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
10.
HTML Code:
<script>
window.onclick=function() {alert("you clicked!");}
</script>
9.
HTML Code:
<script>
window.onblur=self.focus;
</script>
8.
HTML Code:
<script>
window.onload=function() {
    var h1=document.getElementsByTagName("h1")[0];
    setInterval(function() {
        h1.style.display=(h1.style.display=="block")?"none":"block";
    }, 500);
}
</script>
</head>
<body>
<h1>Announcement</h1>
7.
HTML Code:
<!--[if IE]>
 <script>
alert("Please switch to Firefox");
</script>
<![endif]-->
6.
HTML Code:
<!--[if !IE]><!-->
<script>
alert("Please switch to Internet Explorer");
</script>
<!--<![endif]-->
5.
HTML Code:
<script>
window.onunload=function() {
function dontLeave() {
    if(confirm("Are you sure you want to leave?")) {
        dontLeave();
    } else {
        dontLeave();
    }
}
dontLeave();
}
</script>
4.
HTML Code:
<script>
window.onload=function() {
    var bobble=document.getElementsByTagName("body")[0];
    setInterval(function() {
        bobble.style.marginTop=(bobble.style.marginTop=="40px")?"-40px":"40px";
    }, 500);
}
</script>
</head>
<body>
<h1>Hey!</h1>
<p>Is there something wrong with your monitor?</p>
3.
HTML Code:
<script>
while(true) {alert("hello, visitor!");}
</script>
2. (Paste this into the address bar): Courtesy of veign.com
Code:
javascript:R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=200; DI=document.getElementsByTagName("img"); DIL=DI.length; function A(){for(i=0; i-DIL; i++){DIS=DI[ i ].style; DIS.position='absolute'; DIS.left=(Math.sin(R*x1+i*x2+x3)*x4+x5)+"px"; DIS.top=(Math.cos(R*y1+i*y2+y3)*y4+y5)+"px"}R++}setInterval('A()',5); void(0);
And, the #1 most annoying javascript trick is (drumroll please):


Disabling right-click:
HTML Code:
<script>
var message="Best Site Security Ever!";

function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(message);return false")
</script>
__________________
Join me on
Please login or register to view this content. Registration is FREE
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
 
Register now for full access!
Reply     « Reply to Top 10 Guide to being annoying with JavaScript
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.27467 seconds with 12 queries