User login
worst javascript of the year award
I was looking at the bottomless pit of badly-written and malformed javascript that loads on fresnobee.com the other day and noticed a peculiar filename loading multiple times (of-course) in our advertisements: DocumentDotWrite.js. Since I loathe the overuse of document.write on our site, it piqued my interest. I had to see what on earth could be in this ridiculously named script.
document.write(s);
}
It didn't take long to figure out what this does, but I still haven't figured out the why. Why in the world would anyone need this? Is it one component of a basic abstraction pattern for different implementations of document.write? It's certainly not easier to type DocumentDotWrite so it couldn't be a shorthand. This is where context comes into play. The script tag itself is written by a document.write call which is contained within an iframe which is written by a call to document.write which is loaded by another remote script whose tag is written with a call to... take a wild guess.
If you don't believe me, here's the link. I think it's most likely that the developer who wrote this fine gem was probably high on crack and shouldn't have been writing javascript in the first place. To the folks over at atdmt.com, and at doubleclick, I have nothing to say besides "I hate you" and you should maybe hire just one real developer. Also, start issuing random drug tests.
- Add new comment
- 2892 reads
bah
I write my best code when high on crack.
You can blame Eolas.
More than likely this was in part a workaround for the whole "Click to activate this control" problem.
If I remember correctly, a document.write() call from the page itself was not sufficient to work around the problem, but any document.write() call from an external script was.
As for the script tag being written by a document.write() call in an iframe written by a call to document.write yadda yadda, I can't vouch for that.
"code"
"coding"