I want to know which sites can give me information on the list of JavaScript functions that are supported by IE/Firefox/Opera/Safari.
Take a look at quirksmode
and in the Compatibility Master Table
you will get a detailed listing.
Perhaps not a direct answer to this question, but never-the-less I think this is useful to know about: You can use the Sputnik JavaScript Conformance tool in Google Labs to check ECMAScript conformance in browsers:
Sputnik is a JavaScript conformance
test suite containing over 5000 tests.
It tests how well a JavaScript
implementation adheres to the ECMA-262
specification version 5, looking only
at those features that were also
present in the previous version,
version 3, and not the new features
added in version 5.
There are several sites for that but you'll probably find that none are absolutely complete, so it is worth checking out each of them
quirksmode.org compatibility tables
sitepoint JS reference (work in progress)
Mozilla MDC reference (mozilla only but worth mentioning)
This looks useful http://kangax.github.com/es5-compat-table/
Related
I was looking at Mozilla Developer Documentation on Javascript. Is it Mozilla's interpretation of the ECMAScript standard or is it documenting how they have implemented Javascript in Firefox?
Basically, I want to know whether their documentation is valid across all browsers or just Firefox.
It's both, basically. From JavaScript/Reference/About:
The JavaScript Reference serves as a repository of facts about the
JavaScript language. The entire language is described here in detail. […]
Recent versions of Mozilla-based browsers support newer versions of
JavaScript. […]
Browsers that do not support at least JavaScript 1.5 are very rare
today, since JavaScript 1.5 was introduced back in 1999. If you're
interested in historic information, please refer to the Wikipedia
article on ECMAScript.
JavaScript documentation of core language features (pure ECMAScript,
for the most part) [consists of the Guide and the Reference].
It is definitely a reference about the Mozilla implementation(s) of JavaScript, which today covers all of EcmaScript 5.1 features. They're well documented, also containing information about bugs in older Mozilla implementations and in relevant other engines. Each article also lists cross-browser support in a table, though these are sometimes not correct and/or exhaustive.
The reference also includes documentation of proprietary Mozilla features and of their draft implementations for upcoming standards. These are properly marked as such, usually with the non-standard-tag.
Also, don't forget that it's a wiki!
as Alex K has said in his comment
It documents Geko, the mozilla implementation of JS which also includes all the non-standard functionality they have included
It is also an excellent reference for standard js api calls, but should always be used with a slight caveat of, it is the Geko implementation so may not behave as described, but generally it does in my PERSONAL experience
I just tried in Firebug console,
let (X=10) X/2
and
[x,y]=[y,x]
These are features supported by SpiderMonkey, I guess V8 has its own share.
Where can I learn of features that are not yet included in ECMAScript, but work in various browsers? Is there a place where these are collected together?
ECMAScript 6 (a.k.a. ECMAScript 2015) is the current standard for JavaScript, but engines have yet to implement it completely:
Table showing what ES6 features are supported where: http://kangax.github.io/compat-table/es6/
Three books on ES6 that are free to read online (buy them I you like them!):
Read Understanding ECMAScript 6
Exploring ES6
JavaScript Allongé, the "Six" Edition
ES6 in bullet lists
Starting with ECMAScript 2016, there will be yearly releases and a new release process:
Blog post explaining the new release process and the features that are candidates for ES2016: http://www.2ality.com/2015/11/tc39-process.html
Official list of proposed features (that may or may not be accepted for the ECMAScript standard): https://github.com/tc39/ecma262
Feature table for ES2016: http://kangax.github.io/compat-table/es7/
If you want to use any of the new features even on older engines, you can transpile them to ES5 via Babel: https://babeljs.io/
And here is a article covering various resources around Harmony/ES6/Javascript.next:
http://addyosmani.com/blog/ecmascript-6-resources-for-the-curious-javascripter/
That first feature is known as a "let expression" and it is nonstandard; it was dropped from Firefox 41, and the similarly nonstandard "let block" was dropped from Firefox 44: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let#Non-standard_let_extensions
I was surprised to find that this particular non-standard JS was not mentioned in Kangax's table, but I guess he had to restrict this list to non-standard JS extensions that are supported by multiple engines: https://kangax.github.io/compat-table/non-standard/
If you want to go deeper down the rabbit-hole, and Kangax and MDN haven't satisfied your curiosity, this old reference may tell you about curiosities in older browsers: help.dottoro.com/ljsdaoxj.php
Beyond that, the browser-makers usually document the quirks of their own browsers (MDN is also good about documenting non-Mozilla quirks, but it's not perfect); speaking of quirks, Peter-Paul Koch documents both standard and non-standard DOM methods here: quirksmode.org/dom/
Anyway, these aren't just "not yet" in the standards, but likely "not ever" and you shouldn't use them in your own code.
For current ECMAScript 264 implementation here is a list of features supported by different browser vendors:
http://kangax.github.com/es5-compat-table/
For the next generation ECMAScript Harmony some resources:
http://addyosmani.com/blog/ecmascript-6-resources-for-the-curious-javascripter/
http://kangax.github.com/es5-compat-table/es6/
Looking through the Mozilla JavaScript site, I see that JavaScript 1.8 has a lot of great functions. In most cases it has code you can add to extend prototypes of the basic types in the case that the function is not implemented on the user's browser. Is there a library that you can use to add all those functions and therefore use JavaScript 1.8 freely in your code?
You are probably looking for a shim.
Check out the es5-shim: https://github.com/kriskowal/es5-shim/
Modernizr has a pretty exhaustive list (wiki) of alternative polyfills or shims (look under ECMAScript 5 for your needs):
https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-browser-Polyfills
Also, not all features can be provided by shims or polyfills. You could start an issue (remember to search and read the README first) for a feature that you want but isn't provided and the developer might tell you if it's not possible.
Since this version has lots of syntax differences (mentioned by Rob W), there are only two way this can be done
Somebody would have to write a JS interpreter in JavaScript, which would be good awful slow.
Write a server side compiler that turns JavaScript 1.8 into EcmaScript.
No, there isn't one out there.
I would like to see list of changes that were made in every version of JavaScript. I would also be interested in what is planned to be added in JavaScript and when a new realease is planned.
Do you know any site where this info can be found?
Thank you
The standard it is based around: Ecmascript specs: http://www.ecma-international.org/publications/standards/Ecma-262.htm
Firefox specifics:
MDC javascript docs including differences in javascript versions: https://developer.mozilla.org/en/javascript
IE specifics: MSDN library, scripting area: http://msdn.microsoft.com/en-us/library/ff729665(v=VS.94).aspx
JavaScript is a dialect of ECMAScript, have a look at the Wikipedia page of ECMAScript for a version history. You can find the full documentation on the official ECMAScript page.
How well supported is the document.getElements() function. Additionally, is there a javascript reference page that has detailed browser support information somewhere. I usually use the mozilla docs, but I was wondering if there is something better.
I actually can't find any documentation on document.getElements() but when I do things like:
document.getElements("div a");
It works great in chrome, ff, safari, ie8 and ie6-9 via IETester. I think IETester may use the same javascript engine for all browsers though (not sure about that).
There is no such thing as document.getElements... I'll bet your coding in Jsfiddle and don't realize that the mootools lib is included ;)
Have a look:
http://jsfiddle.net/Zevan/pRKzy/
quirksmode.org is a pretty good resource for things like this (though not fully updated on IE9, as it's a moving target at the moment).
Note: they don't have an entry for document.getElements() specifically (are you sure you're getting this name right?), but in general it's a pretty complete reference, here's an example - check out .querySelectorAll() (which does what you describe...).
Probably you are looking for querySelecterAll function:
elementList = parentNode.querySelectorAll(selectors);
This is most handy and much usable function.
To check how your requested feature is supported among browsers you can use "Can I Use" site:
https://caniuse.com/#search=querySelectorAll
On this site you can check not only functions but HTML attributes and CSS capabilities too