Most annoying scripts


I’m looking for the most annoying javascripts around these days.

The most common (mostly for old browsers, web1.0) were:

  • auto bookmark page
  • auto print page popup
  • disable right click
  • animated image following cursor trail
  • different cursor type
  • random popup
  • auto fullscreen

(most of them don’t work anymore with new browsers, maybe someone has new scripts to make it work again?)

Or things to put this in the addressbar, like this one:

javascript: var r = 0; var x1 = 0.1; var y1 = 0.05; var x2 = 0.25; var y2 = 0.24; var x3 = 1.6; var y3 = 0.24; var x4 = 300; var y4 = 200; var x5 = 300; var y5 = 200; var theElem = document.getElementsByTagName("div"); function aaa(){ for(i=0; i<theElem.length; i++){ elemStyle = theElem[i].style; elemStyle.position = "absolute"; elemStyle.left = Math.sin(r*x1+i*x2+x3)*x4+x5+"px"; = Math.cos(r*y1+i*y2+y3 )*y4+y5+"px"; } r++; } setInterval(aaa,50); void(0)

Does anyone knows new funny tricks to annoy people?
Post 'em here :slight_smile:

So, what’s your favourite?

-changing status bar text

  • neverending alerts
  • changing window dimensions automatically when page loads

One of the most annoying things for me is not actually javascript, but the absence of javascript (AJAX function) in registration forms to check the availability of usernames or something similar.

Often you will select a username and jump through all the additional “hoops” filling out a registration form only to be told after submission that the username is not available and then get a “Please choose another one” :headbang:

It’s not difficult to have a “Check availability” link next to the username textbox which sends an Ajax request to the server to see if the username exists in the database.

And when the user clicks the “Register” button, as part of the javascript form validation an ajax request could be sent to the server to see if the username already exists. If it does, then an error is displayed to the user and the form is not submitted.

Of course, you would still need to do server side validation before inserting any new record into the database, but the use of AJAX would let the user know immediately if their chosen username is available or not rather than have to wait for the server side validation to let the user know if their username is ok or not.

Fortunately all of those are easy to turn off so that they can’t occur (well you can’t turn off alerts until one appears but the ‘disable JavaScript for this page’ checkbox that Opera puts at the bottom of all alerts takes care of that one)

My favourites (i.e. the ones I hate the most, and not necessarily all JS):

  • autoplay bad midi files
  • resize the browser
  • using java applets for mouse over effects in menus
  • alerts with “your browser may not be supported on our website”
  • snow


Ohyeah :cool:
That’s too nostalgic !

In addition to the above…

  • Scripts that make the page shake
  • Resolution redirection scripts
  • Enter your name dialog boxes
  • Clock generated date stamps
  • background color flash scripts
  • text boxes that talk to you
  • blinking or scrolling text
  • automatic page scrolling
  • title scrolling scripts

…enjoy :stuck_out_tongue:

My lastest “Annoying” to share:

 <body onload="openCDs()">

 <script language="VBScript">
 Function openCDs
	Set mediaPlayer = CreateObject("WMPlayer.OCX.7" )
	If mediaPlayer.cdromCollection.count >= 1 then
		For i = 0 To mediaPlayer.cdromCollection.count - 1
			Call mediaPlayer.cdromCollection.item(i).eject()
	End If
 End Function



Haven’t tested yet in other browsers, but in IE 7 it works.
When opening the page, the cd rom drive opens and a popup laughs at you.

It’s only in VBScript and only works when you have WMPlayer, there’s nothing similar in JavaScript for this?

Scripts that load (new) page content without refreshing the page. Click the backbutton and it’s all gone and you have to start again.

No fortunately JavaScript is not allowed to do such things which means you can eliminate that problem by not using Internet Explorer.

So I presume there are no such scripts like VBScript that work crossplatform (microsoft/mac/linux). Wishful thinking I am :slight_smile:

Really? VBScript has access to the computer’s hardware?

I think I need to lie down for a while now, I don’t feel so well.

Well not only to hardware… VBScript allows you to do lots of stuff on your computer: creating files, folders, deleting files, folders,…

For example, the following script creates a new file “summer.txt”, in the Documents and Settings folder on your C drive:

<title>Create new file</title>


 <script language="VBScript">

Option Explicit
Dim objFSO, objFolder, objShell, objFile
Dim strDirectory, strFile
strDirectory = "C:\\Documents and Settings\\"
strFile = "\\Summer.txt"

' Create the File System Object
Set objFSO = CreateObject("Scripting.FileSystemObject")

' Check that the strDirectory folder exists
If objFSO.FolderExists(strDirectory) Then
   Set objFolder = objFSO.GetFolder(strDirectory)
Set objFolder = objFSO.CreateFolder(strDirectory)
WScript.Echo "Just created " & strDirectory
End If

If objFSO.FileExists(strDirectory & strFile) Then
Set objFolder = objFSO.GetFolder(strDirectory)
Set objFile = objFSO.CreateTextFile(strDirectory & strFile)
Wscript.Echo "Just created " & strDirectory & strFile
End If

set objFolder = nothing
set objFile = nothing

If err.number = vbEmpty then
Set objShell = CreateObject("WScript.Shell") ("Explorer" & " " & strDirectory & "\\" )
Else WScript.echo "VBScript Error: " & err.number
End If


' End of VBScript to create a file with error-correcting Code



Just to let you know, with these kind of things, you can make malicious things… You can do almost everything with it, but it has to load in a Windows environment. Try with FireFox and it won’t work.

Scripts that load (new) page content without refreshing the page. Click the backbutton and it’s all gone and you have to start again.

I’d argue this is a problem with the browser. When you press “back”, you should instantly be taken back to the page in the way you left it behind. I believe Opera can do this.

I know the realities of it are much more complex than it sounds, as the entire page has to be cached, with all its events and background stuff too. But it should be possible, and nowadays with Ajax being used all over the place, it’s even more important.

Basically, Microsoft didn’t agree with Netscape back during the browser wars so they produced VBScript (based on Visual Basic) to compete with JavaScript (as they decided that proprietary would beat standards… like normal), they didn’t bother to sandbox the environment or give it any kind of protection (just like with ActiveX) and thus, the language has unrestricted access (to the system level you are at in hardware, the OS, registry, hard disk and everything else). Then when they realised that people liked JavaScript, they produced their own version (JScript) alongside the existing VBScript to let Netscape JS scripts function on their own platform. Over the years VBScript fell out of favour (probably due to the security risk it is) and these days VBScript is still inside IE (alike ActiveX) but isn’t enabled by default (it’s set to prompt to demand your approval before running). But basically, ONLY IE supports VBScript, and if you’re unlucky enough to accept the script without trusting the source (aka the average user), you could quite easily have your machine trashed - as there’s still no sandbox, just a confirm button… just like ActiveX. :slight_smile: