Categories
Etc

Object cannot be created in this context, Code: 9

We’d been running into this wonderfully informative error message from Firefox recently and finally found some time to track it down. If you’re running into it, check your code to see if you’re trying to grab a reference to the computed style on a null reference. So code like this:

function foo() {
  var n = dojo.byId("a-bad-id");
  console.log(dojo.getComputedStyle(n));
}

Here’s a simple repro case. If you’re using dojo, you can tickle this a number of ways as a bunch of functions use dojo.getComputedStyle under the hood, like marginBox, contentBox, style when used as a getter, and others.

So the moral of the story: make sure you’re passing a valid node reference or a valid node id to functions that work with computedStyle objects.

Categories
Etc

Finding those damn trailing commas

Internet Explorer has this wonderful behavior where it completely refuses to load a JavaScript file when it encounters a trailing comma. That is, something that looks like this:

var f = { foo: "bar", baz: { go: "yes" }, };

I got sick of trying to find these beasties and came up with this regex instead:

}[\s\n]*,[\s\n]*[^\[{\w\n\s/\*\"]

Works like a charm in TextMate. Might work in grep too? Anyway, it’s a good way to find your headache quickly. :)

Categories
Etc

Grand Valley State’s New Music Ensemble

Today I stumbled into something new. On NPR (via Dave Winer), I found a wonderful recording of Steve Reich’s Music for 18 Musicians by the Grand Valley State New Music Ensemble.

GVSU is on west side of Michigan and not that well known for their music program, but this recording and the amount of time they put into perfecting it is rather astounding. It’s a bit like listening to live ambient, but amazingly rich and textured. I’m not usually into this kind of thing, but this particular composition is just wonderful. There’s also a much higher quality Quicktime of the trailer available if you’re interested.

Categories
Etc

Noise

In an attempt to cut down on the noise on this blog, I’m starting another one based on Chyrp for all the random crap I find.

Update: I pulled noise back down. Everything is back to living right here in the main blog.

Categories
Etc

Yes Virginia, there is a Faraday Cage

I saw one of these repair and inspection guys while cruising through Vermont one day. It looks even crazier in person.

via kottke