Jump to content

saila.com

Online media matters

Living Can Kill You

DOM nightmares

Lately I’ve been remembering my dreams more than usual, and those who’ve seen Waking Life will understand the following a bit better. Mostly they've been lucid dreams—I know I’m dreaming even as I dream. Problem is I actually want to enjoy my dreams but my (sub?)conscious keeps pulling me out of them.

My waking life this past week, has been like that, too, in a Bizarro-way: I know I'm in a bad place, and want to get out, but somehow I keep get pulled deeper in.

A perfect example is the problems Mozilla 0.9.6 was having with this site.

I spent a good few hours last night tweaking code trying to find the error with no luck.

Finally, I stumbled across something simple: this version wanted a certain instance of a style to be declared inline before being manipulated by a DOM function. This runs contrary to previous behaviour, and in fact contrary to other instances where that same DOM function is used.

Today, I discovered Mozilla was evening handling expiry dates in Mozilla differently. Where before:

var time = new Date();
time.setTime(time.getTime());
document.cookie = name + "=" + escape(value) + "; path=/; expires=" + time;

was perfectly valid, it now requires the time to be converted to GMT (in bold):

var time = new Date();
time.setTime(time.getTime());
document.cookie = name + "=" + escape(value) + "; path=/; expires=" + time.toGMTString();

A perfectly valid requirement, but an undocumented change that wasted a lot of my time as I tried to find where to even begin understanding why a site I was working on wasn’t detecting Flash anymore.

No doubt it makes my code better, but amount of frustration these things caused me is not normal. Things are getting to me more.

In the end, like my code, all the stuff going on will make me a better person, but that is just too big a cliché for me to accept right now.