Chapter BC1. XHTML Foundations

In This Chapter

  • Reviewing HTML

  • Comparing HTML to XHTML

  • Building the basic page

  • Adding images and links

  • Formatting data with lists and tables

  • Validating your code

  • Building forms

JavaScript is a powerful language, but it doesn't really stand on its own. Like most modern programming languages, it supports graphical user interfaces. In a lot of graphical languages, you have to spend a lot of time learning how to build the interface and interact with it. JavaScript makes this pretty easy, because the graphical part of a JavaScript application is actually a Web page made in HTML or XHTML. Because the HTML foundation is so important to JavaScript, it pays to brush up on your HTML skills to ensure you're designing pages that will be easy to code.

HTML and XHTML

HTML has been around for a while now, and it has been continuously changing. Ideas that were once cutting edge (like using frames) are now considered out of date. Much of the modern thinking about HTML has been shaped by the need to write JavaScript code around the Web page. When you're writing pages that will be supported by JavaScript code, keep a few key ideas in mind:

  • Make the code as clean as possible. Things can get complicated fast. HTML code should be clean and easy to read. It shouldn't have any unnecessary features, and it should be formatted in a way that is easy to follow.

  • Separate structure from design. Try to keep your HTML code focused on the structure of the code (what it means) rather than the ...

Get JavaScript® and AJAX for Dummies® now with O’Reilly online learning.

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