- This topic is empty.
-
AuthorPosts
-
May 29, 2011 at 3:36 pm #32908StephBerthaParticipant
Hi there,
Do you guys still use
for people who have JS turned off? I haven’t seen anybody using it, just wondering if there’s a reason to continue doing so.
– Steph
May 30, 2011 at 3:13 am #74991jamygoldenMemberYou should check out Modernizr.
Add class=”no-js” to your <html> element and it will be removed if JS is loaded. This isn’t the only way to do it but it seems to be a very popular method at the moment. I make use of it.
May 30, 2011 at 6:28 am #74984fjorkoMemberHi
For a newby – can you explain this feature a bit more ?
Thanks
May 30, 2011 at 6:56 am #74983jamygoldenMember@fjorko are you asking StephBertha or me?
I’ll explain both:
The <noscript>:
Wrap anything within <noscript /> and it will only load if javascript has not loaded. For example:
<noscript>Please turn on javascript!</noscript><html class=”no-js”> & Modernizr:
Modernizr is very useful. Very basically, it provides feature detection along with some other cool features, such as HTML5 tag support for older browsers.
Very simply, Modernizr checks to see if <html> has a class of “no-js”. If so, it removes it. This way, you could do something like:
.no-js #slider{display: none;}
and have the CSS hide a javascript slider or maybe something like
.no-js #slider li{display: none;}
.no-js #slider li:first-child{display: block;}That would hide all slides except the first.
Those are just very small examples of how you could use the no-js class.
May 30, 2011 at 10:11 am #74981TT_MarkMemberObviously @fjorko Modernizr is JavaScript and so would only remove the no-js class if JavaScript was enabled. Just thought I would clear that up incase of confusion
June 1, 2011 at 1:46 pm #74639OniLinkCRMemberHow big is the percentage of people with JS turned off ? I thought it was around 1%?
June 1, 2011 at 1:55 pm #74640TheDocMemberCorrect. On top of that, users with JS turned off are guaranteed to understand that some things will not work properly.
June 2, 2011 at 2:00 am #74558OniLinkCRMemberI just checked Google Analytics and it doesn’t say anything about JS support, which I guess is kind of stupid to look as Google also uses a script to monitor stuff? lol
June 2, 2011 at 6:07 pm #74416wolfcry911ParticipantIts not stupid – Google Analytics requires javascript to work, so those without it aren’t being tracked. It would be redundant to show a javascript statistic showing 100% of trackable users having javascript enabled.
June 2, 2011 at 9:59 pm #74425OniLinkCRMemberAll I see is Java…I must be looking at the wrong place.
-
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.