I absolutely despise Javascript errors. When I enable script debugging in Internet Explorer, I usually have to turn it off immediately because of how quickly I get annoyed. It's pretty hard to justify the ridiculous amount of script errors scattered across the web, even on some of the most prestige web sites. It is actually quite funny, and I think they should be embarassed. Anyways, I accidentally left script debugging on in Internet Explorer last night and today I came to my blog and was greeted by a nasty script error...

Ahh, an object was expected. Of course. This was rather appalling because I generally go to great lengths to make sure my code is free of any potential errors. On top of that, I have not made any recent changes. As it turns out, Google Analytics provoked this one, which was also surprising...
I love Google Analytics, but I hate script errors. Why in the world can't it locate the urchinTracker function? I went a step deeper and as it turns out, the Google Analytics script URL gives me a 404 error. What's up with that?! C'mon Google, get your DNS straightened out or do something. Since I hate script errors so much, I decided to modify the code to prevent the error from happening again. It is pretty simple, really. All you have to do is check to see if the urchinTracker function exists before invoking it. I simply changed my Google Analytics script to this...
if(urchinTracker)
urchinTracker();
No more script errors, but Analytics still is not working. A compromise, I guess.
I would not consider that a compromise, though. If it doesn't work, it appears that Google has won.
I wonder what happened to the Urchin...
Thanks for the comment!
Guess What?
There are a few basic guidelines you should be aware of before leaving a comment…
- If you choose to display your email address, it will not be detected by spam bots
- Comments are limited to 3,000 characters; so far you have used none of them
- HTML will be encoded; links and line breaks will be converted automatically
- Comments containing five or more links will be subject to moderation
