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.

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 ...

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