Should you design websites that require JavaScript in this day & age?

后端 未结 30 1067
醉酒成梦
醉酒成梦 2021-01-11 11:04

It\'s fall of 2008, and I still hear developers say that you should not design a site that requires JavaScript.

I understand that you should develop sites that degra

相关标签:
30条回答
  • 2021-01-11 11:38

    You should design websites with Javascript in mind--but not implemented. Consider, build it where every click, every action, performs a round trip to the server. That's the default functionality for older browsers, and those without JS turned on.

    Then, after it's all built, and everything is working properly, add in JavaScript which hijacks the link, button and other events, and overlay their standard functionality with the Javascript functionality you're wanting.

    Building the application like this means that it will ALWAYS work, which ultimately is what you're wanting.

    0 讨论(0)
  • 2021-01-11 11:38

    As many people are saying, it's important to consider your user base, but whoever your users are there's a strong possibility that some (stats say 10%) of them will have some sort of disabilities, and screen readers don't like javascript. If you're only adding simple things, a javascript menu or something, then just make it degrade (or don't do it). If the site depends on javascript to work properly, make two versions, one for javascript and one without.

    I generally find that anything too javascript heavy is very difficult to make degrade well without just having javascript re-writing the page to a javascript version if the user can take it. Given this, it's well worth writing two pages from square one for complicated stuff.

    I would say that there are very very very few web sites that should be running without some support for users without javascript. You'd need to have a very dynamic application that completely didn't make sense as static pages,or you'd need to have a audience you could guarantee were ok with it (like on an office Intranet say).

    0 讨论(0)
  • 2021-01-11 11:39

    The received wisdom answer is that you can use JavaScript (or any other technology) providing that it 'degrades gracefully'...

    I have experience with disability organisations, so accessibility is important to me. But equally, I'm in the business of building attractive, usable websites, so javascript can be a powerful ally. It's a difficult call, but if you can build a rich, javascript-aided site, without completely alienating non-js vistors, then do so. If not, you will have to look at the context of the site and decide which way to jump.

    Regardless, there are no rights and wrongs with this question. However, in some countries, there is a requirement to build 'public' sites to be accessible, so this may be yet another factor in your decision. [In the UK, it is the Disability Discrimination Act.. though to my knowledge, no company has been prosecuted for failure to comply]

    0 讨论(0)
  • 2021-01-11 11:39

    The accessibility issue is the only important technical issue, all other issues can be socially engineered. When one says that javascript reduced accessibility and another says that Web Applications can use javascript, can we take these two together to imply that all blind people are unemployed? There has to be some kind of momentum in making javascript accessible. Maybe a Screenreader object on the javascript side which can detect the presence of a screenreader and then maybe send hints to the screenreader, Screenreaders which can hook onto the browser, and maybe it gets glued together with a screenreader toolbar.

    0 讨论(0)
  • 2021-01-11 11:40

    Just as long as you're aware of the accessibility limitations you might be introducing, ie for users of screen-reading software, etc.

    It's one thing to exclude people because they choose to turn off JS or use a browser which doesn't support it, it's entirely another to exclude them because of a disability.

    0 讨论(0)
  • 2021-01-11 11:40

    You should never design a public site to rely on ANY technology/platform. The user agent may not display colour (think screen readers), display graphics (again, think screen readers or text only browsers such as links), etc.

    Design your site for the lowest common denominator and then progressively enhance it to add support for specific technologies.

    To answer the question directly: No, you cannot assume your users have Javascript, so your site should work without it. Once it does, enhance it with Javascript.

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