HTML5是否要求客户支持JavaScript? [英] Does HTML5 require clients to support JavaScript?

查看:89
本文介绍了HTML5是否要求客户支持JavaScript?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HTML 5是否需要JavaScript?

Does HTML 5 need JavaScript?

或者它是一个选项,我可以使用HTML5,CSS3和GWT代替JavaScript吗?

Or it is an option and I can use HTML5, CSS3 and GWT instead of JavaScript?

谢谢

推荐答案

不,HTML5不需要 JavaScript ,虽然它确实定义了< script> 元素,但它确实定义了 javascript:协议( HTML5 UA应该理解这些,至少足以忽略它们)。想象一下,客户端浏览器只是永远禁用所有JavaScript(通过用户选择或因为它不支持JavaScript)。

No, HTML5 does not require JavaScript, although it does define a <script> element and it does define the javascript: protocol (an HTML5 UA should understand these, at least enough to ignore them). Imagine the case where a client browser simply 'disables all JavaScript, ever' (either by user-choice or because it does not support JavaScript).

这是由#支持的 HTML 5草案中的4 dev.w3.org/html5/spec/Overview.html#running-a-script\"rel =nofollow noreferrer>运行脚本

This is backed by #4 in the HTML 5 Draft under "Running a script"


如果对脚本元素禁用脚本,或者如果用户代理不支持此脚本元素的脚本块类型给出的脚本语言,则用户代理必须在此时中止这些步骤。脚本未执行

If scripting is disabled for the script element, or if the user agent does not support the scripting language given by the script block's type for this script element, then the user agent must abort these steps at this point. The script is not executed

然而,JavaScript是草案认可的唯一脚本语言,它承担默认语言的角色,并被列为'依赖'。

JavaScript is, however, the only scripting language endorsed by the draft, assumes the role of the default language, and is listed as a 'dependency'.

这篇关于HTML5是否要求客户支持JavaScript?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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