CHAPTER 4

image

HTML and JavaScript

In this chapter, you finally get your hands dirty in real JavaScript code. You’ll learn how JavaScript interacts with the page structure—defined in HTML—and how to receive data and give back information to your visitors. I start with an explanation of what an HTML document is and how it is structured, and then I explain several ways to create page content via JavaScript. You’ll then hear about the JavaScript developer’s Swiss Army knife—the Document Object Model (DOM)—and how to separate JavaScript and HTML to create now-seamless effects that developers used to create in an obtrusive manner with DHTML.

The Anatomy ...

Get Beginning JavaScript with DOM Scripting and Ajax, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.