Chapter 11. Learning JavaScript

In the previous chapters, you learned about a markup language (XHTML) and a style sheet language (CSS). While you can think of learning these languages as "starting to program," most seasoned programmers would make a distinction between marking up documents and proper "programming" where calculations are performed on data and decisions are made programmatically based upon some input the program receives. In this chapter, you really are going to start learning to program; you learn the basics of a programming language called JavaScript. JavaScript is a lightweight programming language, often referred to as a scripting language, but in working with it, you can learn many of the basic concepts of programming.

It's not possible to teach you everything there is to learn about JavaScript in one or two chapters, but what you will learn in this chapter and the next should be enough to help you understand the thousands of free scripts that are available on the Web and allow you to incorporate them into your web pages. You should even be able to customize these scripts and write some of your own based upon what you will learn in this and the following chapter. In addition, it will give you an idea of what programming is really about.

So this chapter is going to cover the basics of JavaScript; then in Chapter 12 you are going to see lots of examples that should both act as a library of helpful scripts that you can use in your own pages and also clarify how the ...

Get Beginning Web Programming with HTML, XHTML, and CSS, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.