Hour 4: DOM Objects and Built-In Objects
Hour 5: Different Types of Data
Hour 6: Scripts That Do More
Hour 7: Object Oriented Programming
Hour 8: Meet JSON
Hour 9: Responding to Events
PART III: WORKING WITH THE DOCUMENT OBJECT MODEL
Hour 11: Navigating the DOM
Hour 12: Scripting the DOM
Hour 14: Good Coding Practice
Hour 15: Graphics and Animation
PART IV: AJAX
Hour 16: Introducing Ajax
Hour 17: Creating a Simple Ajax Library
Hour 18: Solving Ajax Problems
Hour 19: Making Life Easier with Libraries
Hour 20: A Closer Look at jQuery
Hour 21: The jQuery UI User Interface Library
PART VII: APPENDIXES
So-called “unobtrusive” scripting techniques and the use of DOM scripting focus on adding interaction to web pages while keeping the HTML simple to read and well separated from the program code.
All of the code examples in this learning kit are written to validate correctly as HTML5. In the main, though, the code avoids using HTML5-specific syntax because at the time of writing its support in web browsers is still not universal. The code examples should work correctly in virtually any recent web browser, regardless of the type of computer or operating system.
In addition to the main text of each lesson, you will find a number of boxes labeled as Notes, Tips, and Cautions.
These sections provide additional comments that might help you to understand the text and examples.
These blocks give additional hints, shortcuts, or workarounds to make coding easier.
Avoid common pitfalls by using the information in these blocks.
Every hour ends with a short question-and-answer section to help with follow-up questions that occur as a result of reading the hour.
You can also take an interactive quiz on the content of each hour as well as do some suggested exercises to help you get more out of what you learned and apply this knowledge to your own applications.
The Learning Lab is divided into six parts, gradually increasing in the complexity of the techniques taught.
Here more sophisticated programming paradigms are introduced, such as program control loops and event handling, object oriented programming, JSON notation, and cookies.
• Part III—Working with the Document Object Model (DOM)
• Part IV—Ajax
Here you learn how to make background calls to the server using the
XMLHTTPRequest object and handle the server responses, build a simple Ajax library, and learn about debugging Ajax applications.
In this part, you learn how to simplify cross-browser development using third-party libraries such as Prototype and jQuery.
The examples can all be created in a text editing program, such as Windows’ Notepad. At least one such application ships with just about every operating system, and countless more are available for no or low cost via download from the Internet.
To see your program code working, you’ll need a web browser such as Internet Explorer, Mozilla Firefox, Opera, Safari, or Google Chrome. It is recommended that you upgrade your browser to the latest current stable version.
The vast majority of the examples do not need an Internet connection to function. Simply storing the source code file in a convenient location on your computer and opening it with your chosen browser is generally sufficient. The exceptions to this are the hour on cookies and the section about Ajax; to explore all of the example code will require a web connection (or a connection to a web server on your Local Area Network) and a little web space in which to post the example code. If you’ve done some HTML coding, you may already have that covered; if not, a hobby-grade web hosting account costs very little and will be more than adequate for trying out the examples in this book. (Check that your web host allows you to run scripts written in the PHP language if you want to try out the Ajax examples in Part IV. Nearly all hosts do).
Phil Ballard, the author of Sams Teach Yourself Ajax in 10 Minutes, graduated in 1980 with an honors degree in electronics from the University of Leeds, England. Following an early career as a research scientist with a major multinational, he spent a few years in commercial and managerial roles within the high technology sector, later working full time as a software engineering consultant.
Operating as “The Mouse Whisperer” (www.mousewhisperer.co.uk), Ballard has spent recent years involved solely in website and intranet design and development for an international portfolio of clients.
Michael Moncur is a freelance webmaster and author. He runs a network of websites, including the Web’s oldest site about famous quotations, online since 1994. He wrote Sams Teach Yourself DHTML in 24 Hours and has also written several bestselling books about networking, certification programs, and databases. He lives with his wife in Salt Lake City.
As the reader of this book, you are our most important critic and commentator. We value your opinion and want to know what we’re doing right, what we could do better, what areas you’d like to see us publish in, and any other words of wisdom you’re willing to pass our way.
We welcome your comments. You can email or write to let us know what you did or didn’t like about this book—as well as what we can do to make our books better.
Please note that we cannot help you with technical problems related to this product’s topic, and that due to the high volume of mail we receive, we might not be able to reply to every message.
When you write, please be sure to include this book’s title and author as well as your name and email address. We will carefully review your comments and share them with the author and editors who worked on the book.
Mail: Sams Publishing
ATTN: Reader Feedback
800 East 96th Street
Indianapolis, IN 46240 USA
Visit our website and register this book at informit.com/register for convenient access to any updates, downloads, or errata that might be available.