Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Do you still use

  • This topic is empty.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #32908
    StephBertha
    Participant

    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

    #74991
    jamygolden
    Member

    You 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.

    #74984
    fjorko
    Member

    Hi

    For a newby – can you explain this feature a bit more ?

    Thanks

    #74983
    jamygolden
    Member

    @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.

    #74981
    TT_Mark
    Member

    Obviously @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

    #74639
    OniLinkCR
    Member

    How big is the percentage of people with JS turned off ? I thought it was around 1%?

    #74640
    TheDoc
    Member

    Correct. On top of that, users with JS turned off are guaranteed to understand that some things will not work properly.

    #74558
    OniLinkCR
    Member

    I 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

    #74416
    wolfcry911
    Participant

    Its 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.

    #74425
    OniLinkCR
    Member

    All I see is Java…I must be looking at the wrong place.

Viewing 10 posts - 1 through 10 (of 10 total)
  • The forum ‘CSS’ is closed to new topics and replies.