How often do you find javascript disabled on browsers?

后端 未结 7 755
[愿得一人]
[愿得一人] 2021-01-08 01:12

I have started using ajax/jQuery in our websites / application. There are many plugins that support degrading the javascript to browsers that dont have javascript enabled an

7条回答
  •  不要未来只要你来
    2021-01-08 01:32

    I really feel quite strongly that a well designed web site should remain functional with or without JavaScript switched on. JavaScript, in most cases, is there to enhance existing functionality.

    This can usually be achieved by following a few simple rules.

    1. Use unobtrusive JavaScript, avoid in-line (certainly) and in-page JavaScript whenever possible.
    2. Anchors should always link to somewhere, not to # or to JavaScript. If you can't get around it, the link should be created dynamically.
    3. Use forms correctly. A button should always be wrapped in form tags, this way the your functionality can always degrade to the server.

    I believe that following these rules makes for a more robust site that is more accessible across multiple platforms. Not to mention the benefits to search engine optimisation, if you rely on JavaScript, the search engine will only see half your site.

    I prefer the idea of progressively enhancing rather than planning for degradation. I'm absolutely not developing for the minority that intentionally sabotage their Internet experience by switching JavaScript off. A site built for progressive enhancement will work better on mobile platforms, screen readers and search engines.

    Rich

提交回复
热议问题