Copyright© 1999 by Eric M. Schurman and William J. Pardi
A Division of Microsoft Corporation
One Microsoft Way
Redmond, Washington 98052-6399
Copyright © 1999 by Eric M. Schurman and William J. Pardi.
All rights reserved. No part of the contents of this book may be reproduced or transmitted in any form or by any means without the written permission of the publisher.
Library of Congress Cataloging-in-Publication Data
Schurman, Eric. M.
Dynamic HTML in Action / Eric M. Schurman, William J. Pardi. --
Pardi appears first on previous ed.
1. DHTML (Document markup language) I. Pardi, William J.
Printed and bound in the United States of America.
1 2 3 4 5 6 7 8 9 MLML 4 3 2 1 0 9
Distributed in Canada by ITP Nelson, a division of Thomson Canada Limited.
A CIP catalogue record for this book is available from the British Library.
Microsoft Press books are available through booksellers and distributors worldwide. For further information about international editions, contact your local Microsoft Corporation office or contact Microsoft Press International directly at fax (425) 936-7329. Visit our Web site at mspress.microsoft.com.
Macintosh is a registered trademark of Apple Computer, Inc. used under license. Active Channel, ActiveX, Chromeffects, DirectAnimation, DirectX, JScript, Microsoft, the Microsoft Internet Explorer logo, MSDN, NetShow, PowerPoint, Visual Basic, Visual C++, Visual Interdev, Visual J++, Visual Studio, Windows, and Windows NT are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. Other product and company names mentioned herein may be the trademarks of their respective owners.
The example companies, organizations, products, people, and events depicted herein are fictious. No association with any real company, organization, product, person, or event is intended or should be inferred.
Acquisitions Editor: Juliana Aldous
Project Editor: Thom Votteler
Technical Editor: Tim Upton and Linda Harmony
Foremost, thanks go to Microsoft Press. Without the massive efforts of its editors, technical editors, proofreader/copy editors, indexers, artists, and compositors, this book would never have come to fruition. Professionals like these let us focus on writing while they take care of the innumerable details that are required to get a finished product out the door. Additional thanks go the acquisitions editors for trusting in our vision and to the sales and marketing staff for actually getting this book into your hands.
We also would like to thank our families and friends: Cari, Murphy, Bayley, Sebastian, Jodie, Cody, Ryan, and everyone else who showed great patience during the long nights and weekends of writing and editing. We couldn’t have done it without your support.
This is the second edition of Dynamic HTML in Action. We conceived the idea for the first edition of this book when we were developing computer applications with early beta versions of Microsoft Internet Explorer 4. At the time, we knew of no resource that demonstrated how the various emerging technologies for the World Wide Web could be used together. The first edition became the resource we wanted. Since that time, we have developed numerous sites for the Web and worked with a variety of browsers, including many versions of both Netscape Navigator and Internet Explorer. Dynamic HTML in Action, Second Edition reflects what we’ve learned.
Developing for the Web requires an understanding of how various browsers behave, as well as knowledge of a range of technologies, including Hypertext Markup Language (HTML), script, Cascading Style Sheets (CSS), multimedia, and more. Our intent in this book is to help you to create cross browser content for the Web quickly and effectively.
What You Should Know
This book is aimed at those who have at least basic computer knowledge and some familiarity with the World Wide Web and Web browsers. You might be interested in this book if you are
- A novice who is familiar with the Web and eager to begin creating simple HTML documents
- A Web developer looking to expand your knowledge of scripting and DHTML
- An experienced programmer who wants to move into Internet technologies
You do not need programming experience to learn from this book, although it would probably make the scripting topics a bit easier to understand. Knowledge of HTML is helpful, although we will cover some HTML basics in the early chapters.
This book includes numerous code samples, both in the text and on the companion CD-ROM. You can use these samples as models for your own projects or as a source of ideas if you are stuck on a particular problem. You can even copy the samples and use them in your own pages.
Most of the following chapters contain Web addresses pointing to various references. Although these were accurate and active at the time this book was written, please remember that sites on the Web change often; some of the addresses cited in the book might no longer be active when you try to access them. To minimize this problem, we have created a Web page that will be updated to contain active versions of many of these online links. This page is available as the MSDN Online Resource page at msdn.microsoft.com/resources/schurmandhtml.htm, or by opening the file named MSDN_OL.htm on the companion CD.
Throughout this book, we refer to information available on the Microsoft Site Builder Network (SBN). Most of these resources can be accessed on the companion CD or on the Internet. To access a topic on the CD, open the file Workshop (References).htm, and then navigate as described to that particular topic. These topics are also available on the Internet. To get to the online versions, visit the MSDN Online Resource page described above, or go to microsoft.com/sitebuilder.
Organization of This Book
This book is organized into parts. We begin with the most basic concepts and technologies that represent the core of Web development. As the book progresses, it builds upon this base to cover techniques that give you more sophisticated control over the browser. Toward the end of the book are a number of technologies that are specific to a particular browser, or that are of a fairly technical nature.
HTML: The Framework for Active Web Content
The chapters in Part I provide an overview of some of what is possible with Dynamic HTML; they also introduce HTML, the underlying standard that governs how Web pages are displayed in browsers. In this part, we cover everything from formatting text to creating tables and complex forms. The final chapter in this Part introduces the concept of an Object Model, which allows manipulation of a page’s content through script.
Adding Interactivity: Using Scripts To Activate Your Page
Text and Page Layout: Using Cascading Style Sheets
Part III covers the use of Cascading Style Sheets (CSS), a standard that enables you to separate content from formatting and simultaneously gain a high level of control over the appearance of your Web pages. This Part also discusses the manipulation of CSS with script, as well as the use of Visual Filters and Transitions.
Part IV teaches you how to manage multimedia on your page. Topics discussed range from video and audio to the DirectAnimation multimedia controls, which offer such useful features as the exact timing of events and movement, and vector graphics. Part IV also discusses the challenges of successfully implementing multimedia on the Web.
Advanced Techniques: Data Binding, XML, and More
The chapters in Part V cover a wide variety of topics, ranging from DHTML Behaviors and cookies to the integration of data into Web pages. An entire chapter in this Part is devoted to the challenges of creating cross browser Web content. The final chapter rolls together a large number of the techniques discussed in this book into a sample Web site.
The four appendixes discuss troubleshooting, list a number of useful tools and resources, provide Object Model documentation, and offer a substantial reference of character entities.
What’s on the Companion CD?
At the back of the book, you’ll find a companion CD, which contains:
- A Readme.txt file that explains how to install and use the various components on the CD
- All the code samples in the book, organized by chapter number
- A sample Web site, accessible by running the SampSite.htm file
- An electronic version of the book in HTML format, in the Ebook folder
- A snapshot of the SBN Workshop Web site, containing many references and samples
- Full documentation for JScript and VBScript, in the Tools folder
- Various tools in the Tools folder