为什么没有官方 JavaScript 参考?

发布于 2024-08-08 08:45:00 字数 1539 浏览 4 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(11

月亮邮递员 2024-08-15 08:45:00

好像没有官方的 JavaScript 版本。所有浏览器都制作了自己的 JavaScript 引擎 - 但有些浏览器使用相同的引擎。但尤其是 Internet Explorer 有自己的版本,它不支持其他浏览器支持的很多功能,因此很难进行一般的 JavaScript 参考。

编辑:
虽然我知道有一个官方的 ECMA 标准和开发团队,但我的观点是,只要浏览器(Internet Explorer)不符合它,这并不重要。归根结底,客户希望 JavaScript 也适用于 Internet Explorer。他们不会关心 ECMA 标准,他们只是希望它能够发挥作用。这就是 JavaScript 库发挥作用的地方,但那是另一个故事了。

HTML 和 CSS 也存在同样的问题,我们不能使用这些工具进行主动开发,直到:

  • 所有浏览器都支持它们。
  • 我们为浏览器提供代码以使它们支持它。
  • 没关系,它并不适用于所有浏览器。

编辑2:
随着 Microsoft 的新浏览器项目 Edge 的出现,Internet Explorer 已接近坟墓。然而,这并没有真正改变整体情况。我们仍然需要支持很多不同的浏览器。开发人员不断尝试突破可能的界限。这意味着我们经常遇到这个问题,我们想要支持的某些浏览器版本不支持标准的某些功能(通常有点不稳定),这意味着我们需要采取一些解决方法或使用实现缺少的内置功能的框架。

It's not like there is an official JavaScript release. All the browsers have made their own JavaScript engine - some are using the same though. But especially Internet Explorer has its own version that doesn't support a lot of what the other browsers support, making it very difficult to make a general JavaScript reference.

Edit:
While I know there is an official ECMA standard and development team, my point is that it doesn't really matter as long as browsers (Internet Explorer) doesn't live up to it. At the end of the day, clients want JavaScript to work for Internet Explorer too. They won't care about the ECMA standards, they just want it to work. This is where JavaScript libraries come into the picture, but that's another story.

It's the same issues with HTML and CSS, we can't use these tools for active development until:

  • All browsers support them.
  • We supply the browsers with code to make them support it.
  • It's okay it doesn't work in all browsers.

Edit2:
Internet Explorer is getting close to the grave with the new browser project from Microsoft: Edge. This, however, doesn't really change the overall picture. We still have a lot if different browsers we need to support. Developers are constantly trying to push the boundaries of what's possible. This means that we often have this issue, some browser version we want to support doesn't support some feature of the standard (which usually is a bit fluid), which means we need to make some workaround or use frameworks that implement the missing built in features.

黯淡〆 2024-08-15 08:45:00

您可以尝试使用官方 ECMAscript 网站

http://www.ecmascript.org/

但有用的是实际上每个浏览器的实现。

我非常喜欢 Danny Goodman 的 JavaScript Bible 中的备忘单:

http://media .wiley.com/product_ancillary/12/04705269/DOWNLOAD/9780470526910_Appendix_A.pdf

You can try with the official ECMAscript site,

http://www.ecmascript.org/

but the useful thing is actually the implementation of each browser.

I like this cheatsheet from Danny Goodman's JavaScript Bible a lot:

http://media.wiley.com/product_ancillary/12/04705269/DOWNLOAD/9780470526910_Appendix_A.pdf

浅暮の光 2024-08-15 08:45:00

我想说这是“官方”的: https://developer.mozilla.org/en/JavaScript< /a>

您还拥有 ECMAScript 语言规范,5.1 版 (或作为 PDF,最终规范)< /em>。

来自 Microsoft:JavaScript 语言参考 :“本文档解释了 JavaScript 的 Microsoft 实现,它符合 ECMAScript 第 5 版语言规范。它还提供了 Ecma 标准中未包含的其他功能。 ”

I would say this one is the "official": https://developer.mozilla.org/en/JavaScript

You also have the ECMAScript Language Specification, 5.1 Edition (or as a PDF, the definitive specification).

And from Microsoft: JavaScript Language Reference: "This documentation explains the Microsoft implementation of JavaScript, which is compliant with the ECMAScript 5th Edition language specification. It also provides additional features that are not included in the Ecma Standards."

新雨望断虹 2024-08-15 08:45:00

如果您在网络上使用 ECMAScript(99.9% 的人都是这样),那么除了该语言的基本语法(在上面提到的 ECMA-262 规范中介绍)之外,您可能正在寻找 DOM 参考 -这是用于与 Web 文档交互的 ECMAScript API。

我很惊讶到目前为止还没有人提到 DOM api。当前的 W3C DOM 标准位于:http://www.w3.org/TR /DOM-Level-2-Core/

(顺便说一句,至于命名混乱 - ECMAScript 是官方标准的名称,“Javascript”和“JScript”是 Netscape 和 Microsoft 专有的“分叉”)

If you're using ECMAScript for the web (which 99.9% of people are), then beyond the basics syntactics of the language (covered in the ECMA-262 spec mentioned above), what you're probably looking for is a DOM reference - which is the ECMAScript API that's used to interact with web documents.

I'm very surprised noone has mentioned the DOM api sofar. Current W3C DOM standard is here: http://www.w3.org/TR/DOM-Level-2-Core/

(btw, as for the naming confusion - ECMAScript is the name of the official standard, and "Javascript" and "JScript" are Netscape and Microsoft's proprietary "forks")

水溶 2024-08-15 08:45:00

维基百科的引述:

在 Netscape 的起步

1996 年 11 月,Netscape 向 Ecma 提交了 JavaScript
国际
...

JavaScript 由 Mozilla 基金会 正式管理 ...

因此,在我看来, ECMA 是标准,Mozilla 是官方标准。

Wikipedia's quotation:

Beginnings at Netscape

In November 1996, Netscape submitted JavaScript to Ecma
International
...

JavaScript is officially managed by Mozilla Foundation ...

So, in my opinion, the ECMA is the standard and Mozilla is the official one.

心碎的声音 2024-08-15 08:45:00

只要有实现(在所有浏览器中)并且有规范(ECMAScript),但没有针对规范的实现的一致性测试,就很难拥有“官方”参考。

现在,我们在 http://es5conform.codeplex.com/ 上提供了 EMCAScript 5 一致性套件 - 并且似乎存在一些共识,即 ECMAScript 实现将更加接近,使得 ECMAScript 更有可能成为该语言的官方参考。

It is very difficult to have an "official" reference as long as there are implementations (in all browsers) and there is a specification (ECMAScript) but no conformance tests of implementations against the specifications.

Now though, we have the EMCAScript 5 conformance suite at http://es5conform.codeplex.com/ - and there seems some consensus that ECMAScript implementations will come closer together, making ECMAScript more likely to be the official reference for the language.

只怪假的太真实 2024-08-15 08:45:00

有一个官方参考,只是格式不太方便。它是 ECMA-262 规范。它是一个非常大的 PDF 文档,而不是一组可搜索的 HTML 页面。

There is an official reference, it just isn't in a very convenient format. It is the ECMA-262 specification. It is a single, very large PDF document, instead of a searchable set of HTML pages.

小清晰的声音 2024-08-15 08:45:00

Mozilla 文档团队成员 (像 Eric Shepherd)是官方的。 JavaScript 由 Mozilla 官方维护,因此只有 Mozilla 的文档才是官方的。目前唯一支持 JavaScript 的引擎是 Mozilla 制作的,其他所有引擎都实现了 ECMAScript。 JavaScript 和 ECMAScript 有相当多的差异(例如,很棒的 let 语句)。

Any revisions of JavaScript pages on MDC by a member of the Mozilla Documentation team (like Eric Shepherd) is official. JavaScript is officially maintained by Mozilla so only documentation by Mozilla is official. The only engines that support JavaScript are currently made by Mozilla and every other engine implements ECMAScript. JavaScript and ECMAScript have quite a few differences (for example, the awesome let statement).

始终不够爱げ你 2024-08-15 08:45:00

我发现老派的 Netscape 4 JavaScript 文档 非常有用为此目的。尽管它们显然已经完全过时了,并且其中的一些 DOM 功能(例如图层)早已不复存在,但对于语言基础知识而言,它们确实非常可靠。

这是因为在 IE 霸主地位和 ECMA 标准化之前,Netscape 的 JavaScript 是权威的 JavaScript。其他浏览器几乎必须完全实现您在那些旧文档中看到的内容。

它们也比 ECMA-262 文档更容易阅读,即使按照标准文档的标准来看,ECMA-262 文档也是绝对恐怖的。

I find the old-school Netscape 4 JavaScript docs very useful for this purpose. Although they're obviously totally outdated, and some of the DOM features in them like Layers are long gone, for the language basics they're really solid.

That's because before the days of IE supremacy and ECMA standardisation, Netscape's JavaScript was the definitive JavaScript. Other browsers pretty much had to implement exactly what you see in those old docs.

They're also much easier to read than the ECMA-262 document, which even by the standards of standards documents is an absolute horror.

享受孤独 2024-08-15 08:45:00

我认为“官方”的意思是“由负责 JavaScript 的人编写”。

只是在这里猜测,但负责 JavaScript(ECMA)的人并没有直接从中赚钱,而且可能没有任何编写参考文档的特殊技能。所以他们既没有动力也没有能力写出好的参考文献。

就我个人而言,我喜欢 O'Reilly 的 JavaScript:权威指南。十一月将推出第六版。

By “official”, I think you mean “written by the people responsible for JavaScript”.

Just speculating here really, but the people responsible for JavaScript (the ECMA) don’t directly make any money out of it, and probably don’t have any particular skills in writing reference documentation. So they have neither the incentive nor the ability to write a good reference.

Personally, I like JavaScript: the Definitive Guide from O’Reilly. There’s a sixth edition coming out in November.

怼怹恏 2024-08-15 08:45:00

我真的很喜欢 Daniel Krook 的 apidoc,尽管它可以使用一些解释和示例。我真的很想看到 krook w3school 的混搭。

I really like Daniel Krook's apidoc, even though it could use some explanations and examples. I would really like to see a krook w3school mashup.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文