Christian Heilmann has been busy making lists; six JavaScript features we do not need any longer and DOM scripting health and safety tips. There’s a lot of bad practice out there. Readers of this weblog, being the sensitive and handsome people that you are, will no doubt know about these bad practices and be assiduously avoiding them. (If not, I can, er, recommend SitePoint’s DHTML Utopia, written by, er, me. Heh. :)) I’d be interested to hear firstly what you think are the current “bad practices” which should be abolished as soon as possible, what you think they should be replaced with, and what obstacles you’re finding (or falling over) in your respective quests to both implement modern DOM scripting and to update all that old stuff to work the right way. Follow up with your comments!

  • Andy

    Use of ‘onEvent’ handlers in the page, rather than registering a listener.

    Tables everywhere – but equally, doing it through CSS is so hard compared.

  • One of the most common bad practices, especially when it comes to Web applications, is trying to make a Web application look and behave like desktop app, especially when it’s done with horrible JS solutions.

  • CorporateSlacker

    My current employer has been known to pass out screenshots of MS Access and say “build this.” In HTML and javascript….there is some fugly code running around this office….

  • sil

    BerislavLopec: that’s interesting. I wouldn’t necessarily call that an example of bad practice; trying to make a web app look like a desktop app isn’t inherently a bad thing. People understand how to use desktop apps; if there is such a thing as a UI standard, that’s where it’s to be found. There are no human interface guidelines for the web, and only a set of de facto rules which are violated so regularly that they aren’t rules at all. Perhaps you could explain in more detail why looking like a desktop app is so bad?

  • messclf


  • bad practice… mmm… long procedural looping, conditionals, discrete elements of logic not abstracted as functions… treating js like c, just because the syntax is similar… I learned this the hard way :( hopefully new people starting out these days will have a much better perspective to begin with.

  • CorporateSlacker

    maetl – given the low level of proficiency my IT professors exhibited with JavaScript (“just learn to adapt other people’s code…hardly anyone actually writes JavaScript from scratch”), I doubt it.

  • Personally, I think the danger of making a web app look like a desktop app is that you don’t have the same controlled environment and you have to deliver the app through a third party product – namely the browser. This is especially obvious when it comes to keyboard testing. Accesskeys fail because the operating system and the browser already use a lot of shortcuts themselves.

    One example that always bugs the hell out of me are Eric Meyer’s slides, as used by almost everyone at @media.
    Dunno about MSIE, but in Firefox typing something in the address bar to go away and hitting enter shows the next slide instead :-)

  • Adrian

    IE only scripting. The countless sites (particularly banks!) that prevent a form from being submitted when a piece of javascript fails.

  • Adrian — “IE Scripting” is the same as requiring JS. It shouldn’t be, especially for something like banking. JS should be an addon, not the only thing.

  • Using the really, really stupid “click here” for links is extremely annoying and clearly indicates that the offenders don’t have educated content editors.

    Adobe Australia, Australia Post, Australian Taxation Office, Ericsson, Foxtel, Health Insurance Australia, Herald Sun, National Australia Bank, Optus, Netguide Magazine, Teds Camera Store, Westpac are just some examples.

Get the latest in JavaScript, once a week, for free.