HTML and CSS Reference
In-Depth Information
Chapter 4
Making sense of JavaScript
Grasp the subject, the words will follow.
—Cato, the Elder
JavaScript is probably a language with nine (or even more) lives. JavaScript made its official debut
in 1996 as part of the Netscape browser and happily survived the first 15 years of the Internet era.
It was originally supposed to be a simple language targeted at web authors willing to make their
HTML pages more responsive and attractive. JavaScript was never designed to be a full-fledged
programming language, but rather something that was easy to work with.
And in the end it worked very well.
JavaScript has a remarkably low barrier to entry and it is flexible enough to enable experts to do
nearly anything with it. Today, knowing JavaScript is a critical skill for essentially all developers; it is
easy to get acquainted with, but unfortunately, it's also not trivial to master.
With the release of Windows 8, Microsoft makes HTML5 and JavaScript a first-class platform for
building applications. Developers use HTML5 to build layout and CSS to style it. Developers also use
JavaScript to manipulate page elements. At the same time, though, developers have access to a bunch
of system-provided libraries that offer user interface widgets and components that allow developers
to access capabilities specific to Windows 8.
It is expected that developers using JavaScript to write Windows 8 applications are primarily
interested in binding freshly downloaded data to user interface elements. It doesn't mean, however,
that you can't use JavaScript to implement at least a few bits of business logic. In general, though,
keep in mind that the more business logic you must express in JavaScript, the less appropriate
JavaScript may be as your choice of programming language.
This chapter aims at revisiting the foundation of the JavaScript language, and discusses a few basic
patterns for organizing JavaScript code from within a Windows 8 application.
Search WWH ::




Custom Search