AJAX&禁用JavaScript。你担心吗? [英] AJAX & Disabled JavaScript. Do you worry?

查看:48
本文介绍了AJAX&禁用JavaScript。你担心吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是PHP,AJAX和数据库的新手。

I'm new to PHP, AJAX, and databases.

但我想知道程序员的想法和行为的经验。

But I want to know what experiences programmers think and do.

使用AJAX时,您是否担心禁用JavaScript的用户?

When using AJAX, do you worry about users who have JavaScript disabled?

您是否有备份解决方案? ?或者那些禁用JavaScript的人数如此之小以至于不是一个问题?

Do you have a backup solution? Or is the number of those who have JavaScript disabled so small that it isn't a concern?

哇我有一个很多意见,这很好,但我认为对我来说澄清一点很重要。

Wow I got a lot of opinions, which is good, but I think it's important for me to clarify a bit.

我在网站上特别询问AJAX。

I'm asking specifically in terms of AJAX in websites.

在我的网站中使用JavaScript时,我的目标是使用它来增强用户的体验,但确保网站的核心仍然适用于禁用JavaScript的用户。
但是根据我对AJAX的理解,它的核心功能是不是?它以PHP的方式与服务器或数据库通信。那你怎么做一个后备呢?或者你呢?

When it comes to JavaScript in my websites, I work with the goal of using it to ENHANCE the experience of the user, but ensure that the core of the site will still function for users with JavaScript disabled. But from my understanding of AJAX, it IS the core functionality is it not? It communicates with the server or database the way PHP does. So how do you make a fallback for that? Or do you?

同样,如果我误解了AJAX的作用,请原谅并启发我。

Again, if I'm mistaken about the role of AJAX, please forgive and enlighten me.

推荐答案

他们的关键是了解您所定位的观众。如果您的网站在没有javascript的情况下非常有用,那么在禁用javascript时获得合理体验可能是值得的。您必须了解您网站的功能和目标收视率,才能知道这些额外的努力是否值得。这里没有一个正确的答案。

They key is to understand the viewers you are targeting. If your site is plenty useful without javascript, then it may be worth the extra effort to make a reasonable experience when javascript is disabled. You would have to understand the functionality of your site and targetted viewership to know whether that extra effort was worth it or not. There is no single correct answer here.

如果您的网站在禁用javascript时不是很有用,那么尝试做任何事情可能都不值得额外的努力超出告诉用户需要javascript。如果这些观众不忠于您的网站并且无论如何都是常规访问者,为什么要付出额外的努力(以及大量的额外测试),因为用户体验非常不合适。

If your site isn't very useful when javascript is disabled, then it may not be worth the extra effort to try to do anything beyond tell the users that javascript is required. Why put in a bunch of extra effort (and a lot of extra testing) if those viewers won't be loyal to your site and be regular visitors anyway because the user experience will be fairly undesirable.

所以,答案是,这很大程度上取决于你的网站做什么,你的竞争对手是谁以及你的观众是谁。虽然SO上的人喜欢在这方面与我争论(出于每个网站的纯度应该适用于所有人 - 我认为),但要使许多网站工作的额外工作的商业案例越来越难以证明这些天没有javascript。当然,这取决于您的网站,竞赛和观众的具体情况。在我的书中,绝不是你应该在没有启用javascript的情况下让每个网站都能正常工作。

So, the answer is it depends a lot on what your site does, who your competition is and who your viewers are. Though people on SO like to argue with me in this regard (out of the purity of every web site should work for all - I think), it is getting harder and harder to justify the business case for the extra work for making many sites work without javascript these days. It, of course, depends upon the specifics of your site, competition and viewers. In my book, it is by no means a given that you should make every site work without javascript enabled.

如果你是谷歌,你可以找到讨论有多少用户的文章禁用Javascript。 雅虎文章从2010年中期开始,他们看到他们看到.25% - 2%的用户已停用JS。

If you Google, you can find articles that discuss how many users have Javascript disabled. This Yahoo article from mid 2010 says that they saw .25% - 2% of users with JS disabled.

至于具体的Ajax,没有Javascript就没有替换或后备。如果您的设计依赖于使用Ajax与服务器通信,那么该设计将需要Javascript - period。您唯一的选择是使用非Ajax设计(来自服务器的更传统的页面请求,一个静态页面的URL),而不是使用Ajax。如果你的其他设计使用并依赖于Ajax,那么这种非Ajax设计将是一个截然不同的设计和实现。

As for Ajax specifically, there is no like replacement or fallback without Javascript. If you have a design that depends upon using Ajax for communicating with your server, then that design will require Javascript - period. Your only alternative would be to have a non-Ajax design (a more traditional page request from your server with one URL for one static page) that could be served instead that did not use Ajax. If your other design used and depended upon Ajax, this non-Ajax design would be a significantly different design and implementation.

这篇关于AJAX&禁用JavaScript。你担心吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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