JavaScript and Browser Support

If you are into web game development then you’re most likely a Flash developer or a HTML5/JavaScript developer. Flash has been around for many years, but JavaScript is a bit different.

JavaScript has been in a continual state of flux for the last 16 years and is now thankfully settling down after some interesting years. Blame those people at Google. Until 2005, JavaScript was something people mostly preferred to forget. It was good for a few browser tricks but the bad experiences with JavaScript development and in particular Netscape browsers at the turn of the century soured it for many developers.

Then along came Google and showed how JavaScript with Ajax updating parts of web pages could improve things. Google Maps and Gmail both did wonderful things with JavaScript, and even worked in Internet Explorer. The tools for JavaScript development were not very good though (alert() anybody?), at least until the awesome Firebug extension for Firefox came along that let you step through code, add breakpoints, etc.

But there are still issues of compatibility, and it’s by no means perfect but it’s improving. Your code can check for advanced browser features and should only use them if they’re supported, but let’s have a little digression about ECMAScript.

JavaScript is often called ECMAScript (European Computer Manufacturers Association who publish the standard) because it is a dialect of ECMAScript. You might also be familiar with another well known dialect: ActionScript. If you think that’s complicated — take a look at the world of ECMAScript (picture) by John Resig, author of the excellent JQuery.

For the past few years the JavaScript in browsers has been based on ECMAScript 3, but version 5 was agreed at the end of 2009 and a 5.1 a few months ago. This adds new features such as getters and setters, reflection on objects (which lets your code examine them at runtime) and tidies up ambiguities. Version 4 never appeared.

All modern versions of browsers support ECMAScript 5 features but what exactly defines a modern browser? A very handy checklist is here. It also shows you what features are supported in your browser in the first column. Greens are good.

If you are learning JavaScript there are many tutorials on the web but keep a look out for the more recent ones. This one on Understanding JavaScript OOP by Brazilian Quildreen Motta is very good.

If you think it’s time to update your learning or want a good grounding, also try the excellent free site http://www.codecademy.com and work through lots of the exercises. It uses gamification to incentivize you, and you earn badges whenever you’ve completed tutorials.

Microsoft’s next version of Internet Explorer (10) has hardware accelerated canvas and, as a way to promote take up, they’ve had the best-selling and Bafta-winning (British Academy of Film and Television Awards) smartphone game, Cut the Rope, converted to HTML5/JavaScript. Take a look behind the scenes with a video and technical article on the conversion.

Also on that page they’re giving away PxLoader, a JavaScript Resource Loader library that you lets you pre-load assets for HTML5 applications, games and sites. It’s open source and free.

Post a Comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>