Reputation: 4909
This is a bit of a round up of the things I haven't found clear answers to today.
There appear to be different versions of Javascript, but I've not seen any books or web sites say "This targets ECMAScript version 2". There seems to be an ECMAScript 5 which if the wiki page is to be believed isn't used in any browsers. So do I need to know about versions?
Server side Javascript. I've seen a few mentions of this, and I haven't been looking at it specifically, but in a sentence or two, where is server side Javascript used and why?
I assume different browsers support different subsets (guessing) of Javascript, but then again, I haven't read that, it just seemed logical given the state of all the other web technologies. Is that right or am I way off?
Upvotes: 5
Views: 204
Reputation: 23648
But this does not keep you from using most of ES5 features in todays browers. Turns out you can emulate most of them by adding functions to prototypes (like the string.trim function is rather easy to implement)
Update: As Reid pointed out in the comments there is a nice table outlining ES5 compatibility in different browsers available here
There are a couple other servers that also run javascript on the server. MongoDB for example uses JSon to transfer results back and forth, and map/reduce functions have to be written in JavaScript that then gets run on the server.
This means that while Google Chrome supports local storage, they provide access to that functionality through JavaScript objects inside the DOM. In IE8 these objects simply don't exist and can't be called.
Also: EcmaScript always refers to JavaScript, they just couldn't name the standard JavaScript since JavaScript is a trademark of Sun (the company that owns Java).
Upvotes: 4
Reputation: 72975
Everyone only mentions ES5 because ES4 was dropped, and ES1,2 and 3 all came out within 3 years of each other. ES3 came out in 1999, so until ES5 is finalised/supported it's the only version that exists for all intents and purposes.
Upvotes: 0