View Full Version : JavaScript core api?

12-10-2007, 03:22 PM
Hi, I am looking for a JavaScript core api. But I cant find one.

Like how can I know what methods the Document, screen, Date, Math or what not objects have?

Is there an API out there which is browser independent that shows all core objects and methods?

12-10-2007, 04:28 PM
If you would have looked at the sticky threads in this forum, you would have seen this: http://codingforums.com/showthread.php?t=17254


12-10-2007, 04:38 PM
Actually I did look at that one, but there were so many different ones there. I thought maybe JavaScript had basic similarities that had a general API like the Java one for instance.

But thanks.

rnd me
12-10-2007, 06:20 PM
w3schools has an ok javascript reference.

12-10-2007, 07:36 PM
Well, it's complicated. First of all, some things are JavaScript Core (like the Math and Date objects) and some things are host (i.e. browser) (like Document, screen).

Second, the things that are part of the host are a hodgepodge of different specifications. There's the W3C DOM1-3 which consists of many modules, there's the Netscape client API (those which also got implemented by ie are often called DOM0), there's the non-standardised things all browsers have, and there's the browser specific things.

There's some tables for this over at Wikipedia:
- ECMAScript/JavaScript <uri:http://en.wikipedia.org/wiki/Comparison_of_layout_engines_%28ECMAScript%29>
- DOM <uri:http://en.wikipedia.org/wiki/Comparison_of_layout_engines_%28DOM%29>

Then you should check out webdevout: <uri:http://www.webdevout.net/>

If you really need it, you can find a reference of sorts at <uri:http://javascriptkit.com/jsref/index.shtml>.

A better idea might be to have bookmarks for the Mozilla JavaScript 1.5 Core Reference (http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference) and Guide (http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Guide) and the W3C DOM specifications (http://www.w3.org/DOM/DOMTR).

That only leaves out the Browser host stuff. This stuff is browser specific, so I can't really give you a single link. The place to look when if comes to Mozilla is the Gecko DOM Reference (http://developer.mozilla.org/en/docs/Gecko_DOM_Reference) which also contains browser specific host object documentation.

For IE specifically, you can find all data you need at MSDN > MSDN Library >
Web Development > HTML and CSS > HTML and DHTML Reference (http://msdn2.microsoft.com/en-us/library/ms533050.aspx) (Note: MSDN content frequently move around and changes URIs. You're better off using Google to find stuff than actually keeping the URL bookmarked.)

For Opera and Safari, their documentation is more in the form of support tables than actual interface descriptions. However, they mostly follow Mozilla.

12-10-2007, 08:32 PM
I agree with liorean. MDC is the best reference guide I have come across. Bookmark it and/or use google searches of the like: "mdc abc" or "mdc abc js" if it does not show up on the first result page.