什么时候可以使用Javascript,而不是? [英] When is it OK to use Javascript and when not?

查看:104
本文介绍了什么时候可以使用Javascript,而不是?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是不是很好的使用javascript / jquery?我们应该尽可能避免它(为了良好的可访问性)?



什么时候可以使用JavaScript,什么时候不在网页设计和开发?在什么情况下以及使用什么条件?



更新:



解决方案

我必须尊重不同意你不应该使用JavaScript的海报,



原因是,现在绝大多数人都启用了JavaScript,并且喜欢从网站提供的类似桌面的体验。真的,谁没有启用JavaScript?人们表现得好像这是一个具有统计意义的群体。它不是。



不使用JavaScript是有点像关于变量大小(哦,我可以使用16位整数,而不是32位保存一些内存)。除非你为成千上万的人做一些怪物项目,那么你花在使你的网站优雅地降级的时间的投资回报实际上是积极的,你应该使用JavaScript随意。因为他们禁用它,所以无法访问它的两个人是偏执的,可能不是你想要作为客户的那种人。



只是我的2美分。 p>

Is it good practice not to use much javascript/jquery? Should we avoid it as much as possible (for good accessibility)?

When is it OK to use JavaScript and when is it not in web design and development? In what scenarios and with what conditions?

Update:

I'm asking regarding public websites.

解决方案

I have to respectfully disagree with the posters that say that you shouldn't use JavaScript, or use it sparingly, or have it degrade gracefully.

The reason is that the vast majority of people nowadays has JavaScript enabled and appreciates the desktop-like experience it can provide from a website. Really, who doesn't have JavaScript enabled? People act as if this is a statistically significant group. It is not.

Not using JavaScript is a little bit like nitpicking about variable sizes (oh, I can use a 16-bit integer here instead of 32-bit to save some memory). Unless you are doing some monster project for hundreds of thousands of people, where the ROI of the time you spend on making your website degrade gracefully is actually positive, you should use JavaScript as freely as you like. The two people that can't access it because they disabled it are paranoid and probably not the kind of people you want as customers anyways.

Just my 2 cents.

这篇关于什么时候可以使用Javascript,而不是?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆