Archive for April, 2008

10
Apr

Maximum DIV ID Length in IE

103 views 237 words.

So I just found yet another IE bug. This time the length of characters when definining a DIV’s ID is involved.

For the nFront Security website I developed a "theater" page so people can watch all the videos in one place. I’m using an open source flash media player (I forgot the name, but I’ll update this in a minute) and it works by writing out the player to a div. You must, obviously, define the div it is going to write to. No problem right….

WRONG! Being the descriptive coder I like to try to be, I named the DIV "nFrontPasswordFilterConfiguration" . Since I always use Firefox (until debugging time comes around) I didn’t notice this error. What would happen is that all the movies would appear, except this one. The only thing that was different was that the id name was longer. Since I’ve got a knack it seems for doing things that cause these bugs appear I decided to shorten the name to "nFrontPasswordFilterConfig"

VOILA! Works like a charm now. Therefore, the maximum length a DIV ID can be in IE is somewhere in the range of 26 - 33. I would guess it’s 30, but don’t quote me. I’ll find out an exact number for ya.

Hope this helps someone.

Sphere: Related Content