views:

76

answers:

3

For example, if you want information of PHP functions, you can go to http://www.php.net/ . If you want information of Perl functions you can to to http://www.cpan.org/ and/or use perldoc. If you want information on Java you can go to http://java.sun.com and/or use javadoc. However, if you want information on Javascript methods/functions and their attributes, return values, etc. where do you go? The reason I ask is I was playing with the "focus()" method and wondering if it could be passed any values or if it returned anything when called. I have done a cursory Google search but haven't found much. Does such a beast exist or am I out of luck?

Thanks for reading, and have a good day.

+8  A: 

There is no real one-stop shop, because there are various implementations of ECMAScript specific to the various browsers.

Important resources:

  • MSDN section on JScript (IE implementation) and the IE implementation of the DOM (Thanks @David)
  • Mozilla Developer Center: JavaScript (Firefox implementation)
  • The w3C DOM Specification
  • W3Schools has half-decent cross-browser reference material, cheers for reminding me @Dalin. In my experience, their stuff is okay and reliable for the basics (@bobince disagrees, though, and points out security holes in their examples. So be careful.) on complex reference questions, they often fail to properly point out cross browser issues, and you end up looking on MDC and MSDN to find deeper information. Still, worth noting and a useful source.

  • ECMAScript itself - this is the basic language "behind" JavaScript without the browser-specific parts like the Document Object Model that make it a "real world language". Cheers for the link @Bobince.

See also this question on reference sites and materials.

Pekka
This is a good list +1. FYI, the Jscript reference link you provided above is Microsoft's link for the core Javascript language, it has no browser DOM/DHTML implementation information, the page for IE's DOM implementation (including the .focus method) is at http://msdn.microsoft.com/en-us/library/ms533050(VS.85).aspx
David
@David cheers, edited your link in.
Pekka
I think W3Schools usually has half-decent documentation on stuff like this. They have examples, the DOM and other stuff to get you through it. http://w3schools.com/js/default.asp
Dalin Seivewright
@Dalin you're right. Their content is mostly half-decent and still the best "cross browser" reference out there. (Makes you think it's time for a better one :) I'll add w3schools to the list, cheers
Pekka
I think w3schools usually has half-baked documentation on stuff like this. They have examples with security holes in and other errors to trip you up. @Pekka: The ‘proper’ link for the ECMAScript standard would be http://www.ecma-international.org/publications/standards/Ecma-262.htm, although there's not much useful there, only the unreadable spec doc. ecmascript.org is not an official site.
bobince
Cheers @bobince.
Pekka
+1  A: 

The site you are looking for would be the EMAScript.org, however as Pekka indicated it is not as helpful as other language documentation sites since many browser deviate from the specifications.

I find the DevGuru Javascript Index page is a great resource for doing web programming, as it is very easy to read and you can quickly find what you are looking for.

Greg Bray
Here's the new one: http://www.devguru.com/technologies/JavaScript/home.asp
Gary Willoughby
+2  A: 

Personally I like to use gotapi.com - all of my documentation in one place :-)

Geek Num 88