views:

751

answers:

11

I tried to search for a JavaScript reference, but there's none available. The best two suggested sources are MDC and W3Schools.

Why?

+8  A: 

I would say this one is the "official":

https://developer.mozilla.org/en/JavaScript

You also have the ECMAScript Language Specification

Espo
Also for IE? :)
Victor
IE doesn't have a JavaScript engine - it implements JScript instead (which is largely compatible). http://msdn.microsoft.com/en-us/library/yek4tbz0%28VS.85%29.aspx looks like the official reference for that.
David Dorward
Hmm... https://developer.mozilla/ is very helpful, but I wouldn't call it "official". The ECMAScript Language Specification is closer to "official".
Steve Harrison
The ECMAScript Language Specification is the official reference for ECMAScript. JavaScript is a superset of ECMAScript, was created by Netscape, and Mozilla inherited MDC from Netscape (although the name has changed since then)
David Dorward
+1 for the ECMAScript standard.
Jason S
+16  A: 

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 very much:

http://www.dannyg.com/ref/jsquickref.html

Victor
+1  A: 

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.

Michael Aaron Safyan
+18  A: 

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 developement 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 here 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 that it doesn't work in all browsers.
googletorp
I see, so different browsers have its own implementation according to the ECMA-262 standard that Michael mentioned above?
huy
@huy: yes - with varying levels of support for/varying interpretations of that standard, sadly...
Andrzej Doyle
-1, There *is* an official Javascript standard: it's called ECMAscript and there's an official body behind it: http://en.wikipedia.org/wiki/Ecma_International
hasen j
I'm not sure why you singled out Internet Explorer as being any worse at supporting the ECMA "standard" as any other browser.
ראובן
+1  A: 

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.

bobince
+1  A: 

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

Eli Grey
+1  A: 

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.

+2  A: 

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

lucideer
A: 

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.

Ben
A: 

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.

Paul D. Waite