SitePoint Sponsor

User Tag List

Results 1 to 15 of 15
  1. #1
    SitePoint Addict
    Join Date
    Dec 2008
    Location
    Brussels
    Posts
    377
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Most annoying scripts

    Hi,

    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:
    Code JavaScript:
    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"; elemStyle.top = 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

    So, what's your favourite?

  2. #2
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    -changing status bar text
    - neverending alerts
    - changing window dimensions automatically when page loads

  3. #3
    Non-Member Kalon's Avatar
    Join Date
    Aug 2010
    Location
    At my computer
    Posts
    2,012
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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"

    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.
    Last edited by Kalon; Sep 2, 2010 at 20:00. Reason: typos

  4. #4
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,799
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Raffles View Post
    -changing status bar text
    - neverending alerts
    - changing window dimensions automatically when page loads
    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)
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  5. #5
    SitePoint Wizard bronze trophy Immerse's Avatar
    Join Date
    Mar 2006
    Location
    Netherlands
    Posts
    1,661
    Mentioned
    7 Post(s)
    Tagged
    1 Thread(s)
    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


  6. #6
    SitePoint Addict
    Join Date
    Dec 2008
    Location
    Brussels
    Posts
    377
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Immerse View Post
    - autoplay bad midi files
    Ohyeah
    That's too nostalgic !

  7. #7
    Follow: @AlexDawsonUK silver trophybronze trophy AlexDawson's Avatar
    Join Date
    Feb 2009
    Location
    England, UK
    Posts
    8,111
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    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

  8. #8
    SitePoint Addict
    Join Date
    Dec 2008
    Location
    Brussels
    Posts
    377
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My lastest "Annoying" to share:

    Code:
    
     <html> 
     <head>
     <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()
    		Next
    	End If
     End Function
     -->
     </script>
    
    <script>alert('LOL');</script>
     
     </body>
     </html>
    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?

  9. #9
    SitePoint Wizard bronze trophy bluedreamer's Avatar
    Join Date
    Jul 2005
    Location
    Middle England
    Posts
    3,357
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Scripts that load (new) page content without refreshing the page. Click the backbutton and it's all gone and you have to start again.

  10. #10
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,799
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by bulevardi View Post
    It's only in VBScript and only works when you have WMPlayer, there's nothing similar in JavaScript for this?
    No fortunately JavaScript is not allowed to do such things which means you can eliminate that problem by not using Internet Explorer.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  11. #11
    SitePoint Addict
    Join Date
    Dec 2008
    Location
    Brussels
    Posts
    377
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So I presume there are no such scripts like VBScript that work crossplatform (microsoft/mac/linux). Wishful thinking I am

  12. #12
    SitePoint Wizard bronze trophy Immerse's Avatar
    Join Date
    Mar 2006
    Location
    Netherlands
    Posts
    1,661
    Mentioned
    7 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by bulevardi View Post
    My lastest "Annoying" to share:

    Code:
    
     <html> 
     <head>
     <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()
    		Next
    	End If
     End Function
     -->
     </script>
    
    <script>alert('LOL');</script>
     
     </body>
     </html>
    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.

  13. #13
    SitePoint Addict
    Join Date
    Dec 2008
    Location
    Brussels
    Posts
    377
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Immerse View Post
    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:
    HTML Code:
    <html>
    <head>
    <title>Create new file</title>
    
    </head>
    <body>
    
     <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)
    Else
    Set objFolder = objFSO.CreateFolder(strDirectory)
    WScript.Echo "Just created " & strDirectory
    End If
    
    If objFSO.FileExists(strDirectory & strFile) Then
    Set objFolder = objFSO.GetFolder(strDirectory)
    Else
    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")
    objShell.run ("Explorer" & " " & strDirectory & "\" )
    Else WScript.echo "VBScript Error: " & err.number
    End If
    
    WScript.Quit
    
    ' End of VBScript to create a file with error-correcting Code
    
    </script>
    
    </body>
    </html>
    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.
    Last edited by bulevardi; Sep 19, 2010 at 10:31. Reason: none

  14. #14
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    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.

  15. #15
    Follow: @AlexDawsonUK silver trophybronze trophy AlexDawson's Avatar
    Join Date
    Feb 2009
    Location
    England, UK
    Posts
    8,111
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Immerse View Post
    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.
    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.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •