Hidden Comment Forms

I’ve been trying to get the comment form hiding on this blog to work right in IE for some time, but I think I’ve finally got it nailed down. Originally, when Javascript was enabled, it was inserting an extra <style> tag in there to hide all div.feedback. IE was decidedly unhappy with that approach, though.

The solution that was suggested to me was to have the script find all div.feedback individually and hide them, but the problem with that was that the comment forms would be briefly visible before the document finished loading and the script kicked in. Stuff appearing after the document loads (like the comment links) isn’t so bad, but stuff disappearing is quite noticable, especially if it drastically affects the document layout.

So, I finally settled on a third solution: have one stylesheet that would hide the feedback forms followed by one enclosed in a <noscript> tag that shows them. If Javascript is enabled, the first stylesheet wins, and the forms aren’t visible. If Javascript is disabled, the second wins, and the forms are visible. This is pretty much exactly what I had originally wanted, except for one problem: the document no longer validates because the XHTML 1 schema doesn’t allow <noscript> as a child of <head>, nor <style> as a child of <noscript>. I’m a bit torn, but for the moment it’s the approach I’m using.

Any suggestions out there for variations on this last approach which will validate?

hoodwink.d enhanced