Is graceful degradation in the absence of JavaScript still useful?

后端 未结 15 3674
南方客
南方客 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:56

    I would argue that you shouldn't go significantly out of your way to accommodate for non-JS users for the following reasons:

    • All Modern Browsers Support JS

      This is a snapshot of browser usage today:

      http://www.w3schools.com/browsers/browsers_stats.asp

      Even the oldest common browser, IE6, supports basic JavaScript and AJAX. If you decide not to integrate certain features b/c of a JS dependence, this proves that you are essentially doing it for people who started with JavaScript enabled and explicitly chose to disable it. I think these people should expect for some features, and perhaps even entire sites, not to work as a consequence.

    • Few People Willingly Disable JS

      Building on my point above, average web users don't know or don't care that JS can be disabled in browsers. It's largely a tech savvy crowd who knows how to do this (myself included), and as tech savvy users we should know when to turn it back on as well.

    • Cost of Support

      In light of the above, consider that choosing to accomodate users who have primarily willingly disabled JS comes with a very real cost. If you are managing a large project with heavy UI requirements, you can easily burn a lot of developer hours accommodating for what is a very small user preference. Check your budget. If it is going to take 2 devs working 40 extra hours each on the project to accomplish this feat, you are easily going to burn a few thousand dollars on what is essentially a non-issue for the vast majority of your users. How about using that time and investment to further buff up your core competency?

    • Precedence

      I may very well be wrong on this, but I think it would be difficult to find major media or social sites that
      don't rely on JavaScript for some
      portion of their functionality to
      work. If major businesses that rely
      on the operation and accessibility of their site to stay in business aren't doing it, there's a good chance it's because it isn't needed.

    CAVEATS:

    Know your market. Continue to build XHTML/CSS that is semantic (preferably by using the RDFa W3C recommendation). Still strive to make your sites accessible to the visually impaired. Don't believe everything you read. ;)

    DISCLAIMER:

    My argument above is largely dependent on how you define "graceful degradation." If you mean all the links still work, that's one thing, but if you mean all the links still work and so does the wombats game, that's another. I'm not trying to argue for making your site so JS dependent that non-JS users can't access any portion of it. I am trying to make an argument for the acceptability of certain features, even some core features, being reliant on JS.

    0 讨论(0)
  • 2021-02-20 02:57

    I for one always have NoScript turned on unless I trust the site for a number of reasons including cross-site-scripting, click jacking, and HTML injection. It's not me being paranoid, it's because I know a lot of developers, and know most of them have no idea what web security is, never mind how to avoid vulnerabilities.

    So until I trust a site there's no chance I'd let it do anything fancy.

    For the unfamiliar, there are some interesting blog entries on the subject:

    • Protecting Your Cookies: HttpOnly
    • Cross-Site Request Forgeries and You
    • Sins of Software Security
    • Top 25 Most Dangerous Programming Mistakes
    0 讨论(0)
  • 2021-02-20 02:58

    I use JavaScript. I always keep my browser up-to-date. But sometimes, my Internet connection is so bad that scripts just don't load.

    There are also cases when:

    • Some scripts load, but others fail, in which case parts of a website stop functioning
    • Scripts are loading, but I want to hit "submit" without waiting for that fancy frilly menu
    • A script malfunctions because it was partially loaded and then cached at that half-stage
    • I'm in such a hurry that I just decide to use Lynx.

    Now, I'm not saying my Internet is bad all the time, or even most of the time, but it does happen. With the Internet expanding rapidly to many rural areas across the world, I'm sure I'm not the only one. So apart from bots as Nelson mentioned above, it's another thing to keep in mind. (Hint: check your demographics).

    0 讨论(0)
  • 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...

    0 讨论(0)
  • 2021-02-20 03:01

    graceful degadation / progressive enhancement / unobstusive javascript is absolutely relevant!

    as with all accessability issues: just imagine for one second what it's like to be the one on the outside who can't use the page.

    imagine you're travelling around the world, you're in some hotel or internet café with really old computers, old software, old browsers, you want to look up your flight and you realize you can't because of some javascript incompatability in the old browser you're using. (try 'old mobile phone' or 'stuck behind a corporate firewall' for different scenarios)

    image what a world of possibilities opend up to blind people with screen readers and the web, and image what it's like to find these possibilties closed again because of javascript.

    so much for appealing to your better nature.

    you might also want to do it to keep your site accessibly for search engines.

    0 讨论(0)
  • 2021-02-20 03:04

    I'm actually in an interesting position when it comes to graceful degradation of JS. I'm working on a web application that bots and crawlers have absolutely no business looking into. There's nothing they can gleam that should be indexed.

    The informational site accompanying the web application, however, should be indexed, and therefore JS degrades gracefully there.

    In the web application, if you don't have JavaScript enabled, you're probably not supposed to be there. It's intended to be a rich interactive experience. The web application actually requires JS to be enabled, and for you not to be sitting behind a corporate firewall.

    We're not serving anything malicious, its just our intent and purpose for the web application that's different. The goals of our web application and those of our informational site are completely different.

    0 讨论(0)
提交回复
热议问题