Is it worth it to code different functionality for users with javascript disabled?

后端 未结 12 913
一整个雨季
一整个雨季 2020-12-28 15:53

I\'m currently building a project and I would like to make use of some simple javascript - I know some people have it disabled to prevent XSS and other things. Should I...

12条回答
  •  情话喂你
    2020-12-28 16:28

    Consider your audience

    "Degrade gracefully" is generally the best answer. But lots of sites now depend on JS - especially AJAX.

    Consider your audience. If your site is aimed at extremely tech-savvy people, the chances of them not having javascript are small, and you can notify them to turn it on if necessary.

    If your audience may access your site with mobile devices, don't assume they have JavaScript, and don't even assume they support CSS properly. Aim to degrade gracefully all the way down to bare HTML.

提交回复
热议问题