JavaScript

JavaScript (or to give it its proper standards-based name, ECMAScript) is the client-side programming language for web apps. There are actually two ways to look at the role of this language. Firstly, it could be seen as a scripting language for adding dynamic functionality to web pages. From this perspective, the web page is the dominant feature, and the program is simply adding value to the presentation. Secondly, the web page could be seen as providing the user interface to the functions of the program. For this perspective, the program is the principle feature, and the web page is the merely a means of interacting with the user. Perhaps which way you see things depends mainly on whether you're a web designer or a programmer? Either way, it's a useful language to know, and it has some very neat features...

Note that these pages don't attempt to teach JavaScript programming from scratch. Instead, I assume you have some familiarity with the language and present some detailed examples to study. If you've never worked with JavaScript before, then I suggest the codecademy site's JavaScript thread is a great place to start.

In fact, programming in JavaScript, with the code executing in a browser, leads to a very natural adoption of the Model-View-Controller approach to development. The HTML and CSS, as rendered by the browser, codes the view. JavaScript objects implement the model, providing the core logic and functions of the appplication. Then the event handler code (also written in JavaScript) connecting the view (the GUI) to the model provides the controller. This design (meta)pattern is adopted in many of the examples.

There are a few examples on the following pages for you to study...