More information about the Underscore mailing list

[_] fat javascript and flckering

tom whoojemaflip at
Thu Dec 3 11:23:01 GMT 2009

Hi Marek,

>> Is anybody seeing any obvious flaws in that case, I tested that in nonjs
browsers and IE6 +

It depends on the doctype you're using, but your method may not validate.

The solution that I'm using on a currant project is to take advantage of a
little JS helper function:

<script type='text/javascript'>$('html').addClass('js');</script>

This need to be included in the <head> of your document, immediately after
the jQuery include, which means it will execute very early in the page
rendering cycle - before your body content is loaded.

Now you can target javascript enabled markup with CSS selectors like this:

body { display:block; }
.js body { display:none; }

Easy, clean and quick.