Monday, September 17, 2007

IE blues

Hit a snag named Internet Explorer. Seems that although IE does register global variables in the window object as it should, it does not include them in the window object when iterating over it.
Who knew? (Seriously, I searched something like ten pages deep in Google.)

I worked around the limitation by grepping the contents of all script tags on the page for variable names. IE luckily does have a document.scripts property that makes that easy.

However, we're still left with a heartbreaking compromise on the original idea: Switching variable names in all loaded javascript except in IE where only variables or their parents that are referenced in the document are switched. I'm hoping that in practice this aberration won't inconvenience developers. Of all people, they should know that IE is usually the exception to the rule!

No comments: