/Ugly/ + 'JavaScript'

A place for ugly, silly, or just-plain-crap JavaScript.

Dangerous globals

This is a common, maybe the first, bad practice but some people are really not afraid about using a lot of globals. IKEA’s devs are those kind of guys. No literals, no namespace, no scope, it works today, why would it fail tomorrow?

<script type="text/javascript" language="JavaScript">
[]
var width = "Width:";
var height = "Height:";
var length = "Length:"
var cm = "cm";
var kg = "kg";
[]

This code is from any product page, look at this page for instance, from line 983.

Posted by Julien on 15 Sep 2011 | linky

Subscribe or follow @UglyJS!
.........
Fork then send a pull request to contribute.