I have lots of scenarios on a pretty content-heavy and js-dependent
site.  I'm using jquery, and I'm trying to think of an effect way to
serve unique styles to non-js users.

Ideally, I would use javascript to link to a new external sheet.  My
development environment is not allowing a creation of a new sheet to
maintain, so I'm going to have CSS rules specific for JS disabled vs.
JS enabled users.

I was curious about the approach below, and wondered if putting this
script block immediately following the body tag would help minimize
any flicker for js-enabled users.  Would the actions here happen
faster than if I put this same line within a $(document).ready(function
() block (which already has LOTS of lines of code.

Here's my proposed HTML with the jquery script tag:
<body class="jsDisabled">
<script type="text/javascript">$('body').removeClass
('jsDisabled').addClass('jsEnabled');</script>


then in my css I have rules for
.jsDisabled .submit { display:none; }
.jsEnabled .submit { color: yellow; }

That kind of thing.

Reply via email to