Is graceful degradation in the absence of JavaScript still useful?

后端 未结 15 3670
南方客
南方客 2021-02-20 02:45

When even mobile browsers have JavaScript, is it really necessary to consider potential script-free users?

15条回答
  •  礼貌的吻别
    2021-02-20 02:59

    It's generally much faster to browse with Javascript disabled (digg.com is lightning without JS), which is why it's popular.

    In Opera it's really easy: you simply press F12 and untick the javascript option. I always browse without Flash, Java (not javascript), animated images and sound. I enable Flash on a per-site basis, eg YouTube. Sometimes I turn off JS temporarily if my system is slowing down.

    And don't forget about:

    • Screen readers (I think they mostly have JS disabled)
    • Text browsers or other very old systems
    • Ad blockers (if your filename happens lands under their radar)
    • Any old browser that either doesn't support JS at all or the JS breaks (e.g. IE6 doesn't support some modern JS stuff).

    The solution is to use progressive enhancement rather than graceful degradation, i.e. start with the basic HTML and add CSS. Then add Javascript and/or AJAX to parts of the site.

    For example, if you had a site like Stack Overflow, voting up an answer could submit a form normally. If JS is enabled, it would do an AJAX request, update the vote count and cancel the form submission, without leaving the page. SO doesn't do this though...

提交回复
热议问题