JavaScript abuses

In general I like JavaScript. You can do some really cool and useful things with it, especially in combination with CSS and DOM scripting (aka “Dynamic HTML“). Learning more of that is on my things-to-do list for this year (that’s not a new year’s resolution!). What I don’t like is that it’s so easy to abuse.

Kenn’s Top Five JavaScript Abuses

  1. Unrequested pop-up windows (eg, pop-up ads). No explanation necessary.
  2. Moving or resizing my browser window. My browser is at a certain size and position for a reason. Changing it is only going to piss me off. If I need to see what’s going on in another window and you move my browser window to cover it, the window displaying your web site is the one that’s going to be closed.
  3. Disabling right-click context menus. Thankfully most people who try this use a broken script they found on the web somewhere that doesn’t work in Mozilla, but once in a while they’ll get it working. This doesn’t really prevent anyone copying your images or reading your HTML source or whatever you’re trying to accomplish. Rather, it interferes with normal browser operation and annoys people who use context menus to go ‘Back’, etc.
  4. Changing status bar text. I sometimes like to see where I’m going before I click a link. It can be useful to know if a link I’m following is pointing to a page on the same site or some off-site information.
  5. Using JavaScript for things that should be done with plain HTML. For example, displaying your entire site inside a smaller, non-resizable pop-up window (usually sans toolbar, status bar, scrollbars, etc, as well). Bonus points are taken away for not knowing how to direct off-site links back to the parent browser window so that any external links are also displayed in the smaller window. Also included here are people who use JS for nothing more than printing HTML and people who use JS for all their links (ie, <a href="#" onclick="window.location();">).

Mozilla lets me avoid numbers 1, 2, and 4, so I don’t usually have to deal with these, but once in a while I’ll have to fire up IE or NS4 to look at someone’s broken site that doesn’t work in Mozilla and I’m reminded why I sometimes hate JavaScript (or rather, why I hate clueless web designers).