It turns out that string indexing (such as str[index]) doesn’t work in IE. You need to do this:
From Mozilla’s reference:
So there you go – charAt from now on!
Now if you’ll excuse me, I’m off to grep for ‘[‘. 😦
Update: The square-bracket indexing feature is included in ECMAScript 5 so should become a standard feature. From Mozilla’s reference:
Also, it appears to be supported in Internet Explorer 8 and above (although I haven’t tested it). Thanks to Jean-Marc Desperrier and Chris Donnelly (in the comments) for pointing these out.