Does HTML5 require clients to support JavaScript?

2020-04-12 07:13发布

Does HTML 5 need JavaScript?

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

Thanks

3条回答
Explosion°爆炸
2楼-- · 2020-04-12 07:55

You can read this to get idea of HTML 5.

查看更多
Deceive 欺骗
3楼-- · 2020-04-12 08:03

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).

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 is, however, the only scripting language endorsed by the draft, assumes the role of the default language, and is listed as a 'dependency'.

查看更多
够拽才男人
4楼-- · 2020-04-12 08:05

GWT is a toolkit that allows you to write your code in Java and then debug. When it deploys it translates to JavaScript. So even though you really do not know you are writing Javascript the tool is generating it for you. GWT generated code runs on the browser.

HTML5 and CSS3 are tools for static web sites. If you add Javascript or GWT (Which is Javascript) then you can do more.

查看更多
登录 后发表回答