建议的矛盾? [英] Contradiction of Advice?

查看:75
本文介绍了建议的矛盾?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



他们说不要将JavaScript用于重要的事情,但不是吗?
意味着将JavaScript用法降级为无聊的效果?

据说考虑是否真的有必要使用JavaScript,

是否有一些非脚本方式可用于实现相同的
$ b $结果。一方面,良好的做法决定了网站在JavaScript方面优雅地降低了优惠价格......但另一方面,

意味着JavaScript仅用于非关键效果。


说到效果,这不是JavaScript的全部意义 -

行为,这意味着产生某些行为影响??

解决方案

战争中的囚徒写道:


他们说不要将JavaScript用于重要的事情,但不是吗?
意味着将JavaScript用法降级为无聊的效果?



最好说不要依赖JavaScript来获取必要的东西。


创建一些东西在没有JavaScript的情况下工作(即使它很慢并且

笨拙),然后在顶层编写脚本以提高可用性(删除

用户的笨拙客户支持JS)。

-

David Dorward
http://dorward.me.uk/
http://blog.dorward.me.uk/


战争中的囚犯:


他们说不要将JavaScript用于重要的事情,但不是吗?
意味着将JavaScript的使用降级为无聊的效果?



我会说建议是:不要冒险使用

多余的JavaScript来破坏基本功能。


示例:我厌倦了用诸如

< a href =" javascript 之类的东西取代常规链接的网站:makeLink( ''/pages/products.php?id=666'')"></aand

设法打破:


- 搜寻引擎

- 在新标签页中打开链接

- 目标另存为

- 复制链接位置

- 书签链接


....虽然根本没有提供任何新功能。更不用说表格

你不能提交,因为他们没有提交按钮或URL,而且页面上有一个

JavaScript错误。
< br $> b $ b -

- http://alvaro.es - álvaroG。Vicario - 西班牙布尔戈斯

- Mi sitiosobreprogramaciónweb: http://bits.demogracia.com

- Mi web de humor al ba?oMaría: http://www.demogracia.com

-


< blockquote> 2008年5月14日星期三19:21:01 -0700,战争中的囚徒写道:


[...]

一方面,良好的做法决定了网站在JavaScript方面优雅地降低了优惠价格......但另一方面,

意味着JavaScript仅用于非关键效应。



完全正确。至少如果您关心您的用户(包括屏幕阅读器,

盲文键盘,带有过滤JS的防火墙浏览器,以及出于安全原因故意禁用JS的所有那些
)你'我想要

使用JS(如果有的话)只是为了增强页面的可用性。


和说话效果,并不是JavaScript的全部意义 -

行为,这意味着产生某些影响的行为?



当然。但这是一个插件。不能代替工作的东西

很好用JS(比如链接或表格)。一个不错的行为(例如

用于支持表单输入和验证它)绝对没有ersatz

(替换)服务器端验证。只有这种情况经常发生这种行为

更像是天真的而不是有用的。

-

Matthias

/" \

\ / ASCII RIBBON CAMPAIGN - 反对HTML邮件

X - 反对M



They say not to use JavaScript for important things, but doesn''t that
mean relegating JavaScript usage to frivolous effects?

It''s said to consider whether it''s truly necessary to use JavaScript,
whether some non-script way is available for achieving the same
result. On the one hand, good practice dictates that a site degrade
gracefully where JavaScript is concerned...but on the other, that
means that JavaScript will be used only for non-critical effects.

And speaking of effects, isn''t that what JavaScript is all about --
behavior, which means actions that produce certain effects??

解决方案

Prisoner at War wrote:

They say not to use JavaScript for important things, but doesn''t that
mean relegating JavaScript usage to frivolous effects?

It would be better to say "Don''t depend on JavaScript for essential things".

Create something that works without JavaScript (even if it is slow and
clumky), and then layer scripting on top to improve the usability (removing
the clunkyness for users who''s client support the the JS).
--
David Dorward
http://dorward.me.uk/
http://blog.dorward.me.uk/


Prisoner at War escribió:

They say not to use JavaScript for important things, but doesn''t that
mean relegating JavaScript usage to frivolous effects?

I''d say the advice is: don''t risk breaking basic functionality by using
superfluous JavaScript.

Example: I''m tired of sites that replace regular links with stuff like
<a href="javascript:makeLink(''/pages/products.php?id=666'')"></aand
manage to break:

- Search engines
- Open link in new tab
- Save target as
- Copy link location
- Bookmark link

.... while providing no new functionality at all. Not to mention forms
you can''t submit because they have no submit button or URL and there''s a
JavaScript error on the page.

--
-- http://alvaro.es - álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://bits.demogracia.com
-- Mi web de humor al ba?o María: http://www.demogracia.com
--


On Wed, 14 May 2008 19:21:01 -0700, Prisoner at War wrote:

[...]
On the one hand, good practice dictates that a site degrade
gracefully where JavaScript is concerned...but on the other, that
means that JavaScript will be used only for non-critical effects.

Exactly. At least if you care for your users (including screenreaders,
braille keyboards, firewalled browsers with filtered JS, and all those
people who intentionally disable JS for security reasons) you''ll want
to use JS (if at all) only to _enhance_ the usuablity of your page(s).

And speaking of effects, isn''t that what JavaScript is all about --
behavior, which means actions that produce certain effects??

Sure. But that''s an "addon" not a replacement for something that works
very well w/o JS (like links or forms). And a nice behaviour (e.g.
for supporting form input and validating it) is definitely no ersatz
(replacement) for server side validation. Only too often the behaviour
is more like infantilizing than helpful.
--
Matthias
/"\
\ / ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
X - AGAINST M


这篇关于建议的矛盾?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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