Chapter 2: Building a JavaScript Program

In This Chapter

arrow.png Understanding the basic syntax of JavaScript

arrow.png Implementing JavaScript functions

arrow.png Working with JavaScript and HTML

arrow.png Using JavaScript with a web browser

The preceding chapter shows how to add the JavaScript tag to a page, and this chapter concentrates on what you can do after that. Key to understanding a programming language is learning its syntax. Just like when you learn a foreign language and you need to learn the words and grammar of the language, the syntax of a programming language is just that: the words and grammar that make up the language.

JavaScript is viewed through a web browser and programmed in a text editor, just like HTML and CSS. The examples you see throughout this chapter can be programmed just like any of the other examples you see throughout the book.

In this chapter, you’ll see how to build a JavaScript program, including some of the ins and outs of programming in JavaScript.

Getting Started with JavaScript Programming

Since this might be your first exposure to programming of any kind, this section starts ...

Get PHP, MySQL, JavaScript & HTML5 All-in-One For Dummies 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.