Saturday, May 10, 2008

Firefox's Javascript Engine-- throwing an exception

It's been a frustrating 24 hours.

I've got a series of web pages (for work, otherwise I'd show them here) that use Javascript to do the "Dynamic HTML/tabbed interface" thing. Trust me, given my lack of expertise in Javascript, I'd much have preferred to use a server technology, like ColdFusion, to do the job-- but that option wasn't available to me.

TO RECAP:

Basically, there's a series of div tags with content in them. You click on one of the tabs, and the Javascript changes the display property for all the divs on the fly. It's actually a pretty slick effect. Too bad it only works on Internet Explorer at the moment.

In Firefox, which about 20% of our visitors use, the code that analyzes all the <a> tags to see whether they are links or have anchors seems to trigger an exception in the Javascript engine. Basically, it moves through all the <a> tags and asks, "Do you have an anchor?" If it has an anchor, no problem-- it reports back as a positive, and the code moves on to the next <a> tag. If, however, the next tag doesn't have an anchor, it appears that the Firefox Javascript engine pretty much tanks.

This really isn't how I wanted to spend my weekend, you know?

No comments: