Why is there no OFFICIAL JavaScript reference? [cl

2019-01-29 21:50发布

I tried to search for a JavaScript reference, but there's none available. The best two suggested sources are MDN (Mozilla Developer Network) and W3Schools.

Why?

11条回答
仙女界的扛把子
2楼-- · 2019-01-29 22:08

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.

查看更多
We Are One
3楼-- · 2019-01-29 22:12

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.

查看更多
Juvenile、少年°
4楼-- · 2019-01-29 22:17

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.

查看更多
Rolldiameter
5楼-- · 2019-01-29 22:19

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.

查看更多
在下西门庆
6楼-- · 2019-01-29 22:22

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.

查看更多
干净又极端
7楼-- · 2019-01-29 22:23

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.

查看更多
登录 后发表回答