现在不推荐使用小程序吗? [英] Are applets now deprecated?

查看:23
本文介绍了现在不推荐使用小程序吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在浏览一个名为 在 HTML 4 中被声明为弃用,取而代之的是 object 元素.在 HTML 4 中,弃用意味着该元素仍然是语言的一部分, 推荐浏览器支持(虽然在实践中并不是所有浏览器都支持,有些浏览器不能支持),但是有推荐使用别的东西(在这种情况下,object) 而不是它.

在 HTML5 CR 中,不使用已弃用"一词.它使用术语过时",这意味着原则上相当不同,但在实践中非常接近.在 HTML5 CR 中,applet 元素被声明为完全过时且不符合标准",并注明作者不得使用".然而,HTML5 包含 applet 在实施要求"下.并且 HTML5 一致性要求指定普通浏览器必须(不仅仅是应该)支持它.

HTML 4 概念已弃用"和 HTML5 概念过时"之间的少数真正区别之一在于验证:当针对 HTML 4 DTD 进行验证时,applet 在过渡 DTD 时被接受被使用(但在针对严格 DTD 进行验证时被标记为错误);在 HTML5 验证中,applet 报错.

附言W3schools 不应被用作任何类型的权威或参考,请参阅 http://w3fools.com


UPDATE 2021 - Applet 已正式弃用 Oracle 在 Java 9 中.因此,虽然 W3Schools 在撰写本文时并不严格正确,但他们当时所说的是正确的......现在.

Oracle 弃用 Applet 的主要原因是大多数现代 Web 浏览器已停止支持它们.截至目前,(AFAIK)只有 Internet Explorer 仍支持小程序,IE 将于 2022 年中期停产.

I was reading through a website named w3schools and was taking the HTML5 lesson. There I saw a number of deprecated tags in HTML5 that were before accepted by HTML4. One of its tag were <applet>! So are now applets of no use?

You can see it here: HTML5 New Elements(at the end) or here:

解决方案

Applets (as applications written in Java and intended to run inside a browser) are not deprecated in any way in HTML specifications or drafts. There is decreasing interest in them, due to many other alternatives being available, but that’s a different issue.

The applet element was declared deprecated in HTML 4, in favor of the object element. In HTML 4, deprecation means that element is still part of the language, browsers are recommended to support it (though in practice, not all browsers support it, and some browsers could not support it), but there is a recommendation to use something else (in this case, object) instead of it.

In HTML5 CR, the word "deprecated" is not used. It uses the term "obsolete", which means in principle something quite different but comes very close in practice. In HTML5 CR, the applet element is declared "entirely obsolete and non-conforming", with the note that it "must not be used by authors". Yet, HTML5 contains a definition of applet under "Requirements for implementations". And HTML5 conformance requirements specify that normal browsers must (not just should) support it.

One of the few real differences between the HTML 4 concept "deprecated" and the HTML5 concept "obsolete" is in validation: when validating against an HTML 4 DTD, applet is accepted when the Transitional DTD is used (but flagged as an error when validating against the Strict DTD); in HTML5 validation, applet is reported as an error.

P.S. W3schools should not be used as any kind of authority or reference, see http://w3fools.com


UPDATE 2021 - Applets were officially deprecated by Oracle in Java 9. So while W3Schools were not strictly correct at the time that this article was written, what they said then is correct ... now.

The main reason that Oracle gave for deprecating Applets was that most modern web browsers have stopped supporting them. As of right now, (AFAIK) only Internet Explorer still supports Applets, and IE is due to go EOL in mid 2022.

这篇关于现在不推荐使用小程序吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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