O'Reilly logo

HTML5 24-Hour Trainer by Mark Fletcher, Joseph W. Lowery

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 21. Adding JavaScript

The modern Web is built on three technologies: HTML, CSS, and JavaScript. The first provides content and structure, the second provides presentation, and the third provides interactivity and advanced applications. JavaScript is a client-side — meaning it runs on your computer, not the web host — scripting language. Because JavaScript is not compiled, like Java or C++, all you need to write and read it is a text editor, just like HTML and CSS.

JavaScript is enjoying a bit of a renaissance these days, especially with the upcoming release of HTML5. The major browsers have all revamped their JavaScript engines with a focus on faster processing. HTML5 provides support for many JavaScript enhancements affecting user interactivity, databases, local storage, offline applications, geolocation, audio and video manipulation, and even drawing with the new <canvas> tag.

A comprehensive examination of all that JavaScript can do is far beyond the scope of this book, but this section of the book can get you started. For any work in JavaScript on the Web, you need to know how to include JavaScript in your web page both as directly as code and also by referencing an external script. In this lesson, you learn how to add JavaScript code to your page, how to prepare for website visitors who have JavaScript disabled, and how to test your JavaScript.

UNDERSTANDING JAVASCRIPT

JavaScript can address aspects of the browser used to look at a web page as well as the web page itself. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required