Приглашаем посетить
Fundamentals of HTML Scripting
Chapter 2
Fundamentals of HTML Scripting
The Dynamic HTML object model has evolved from the object models that
were included in Microsoft Internet Explorer 3.0 and Netscape Navigator 3.0. This
chapter provides a historical perspective, comparing the old object models
with the one provided by Dynamic HTML and demonstrating the level of
support provided by the different versions of the browsers.
Scripting languages have evolved alongside the HTML object models.
By embedding scripts in your documents, you can access the HTML objects to
manipulate the elements on your Web pages. This chapter introduces this powerful
programming technique.
The following topics are covered in this chapter:
- Dynamic HTML object hierarchy
The Dynamic HTML object hierarchy is the API for creating live and interactive pages. The objects in the hierarchy represent the browser and the elements of the
HTML page. In this section, the object models supported by Internet Explorer 3.0 and Netscape Navigator 3.0 and 4.0 are discussed and compared to the Dynamic HTML object model supported by Internet Explorer 4.0.
- Authoring
scripts
The Dynamic HTML object model is accessed
by writing scripts and associating them with the HTML document. A
script is associated with the HTML document by using a Script
element, which contains executable code in a specified language. The Script
element can also be used to associate external script libraries with
the document.
- Choosing a scripting language: JavaScript vs.
VBScript
The two primary programming languages used on the Web are JavaScript
and VBScript. Both languages can fully manipulate the Dynamic HTML
objects. This section helps you determine which language to use for
specific circumstances.
- Advanced JavaScript
techniques
This section discusses some of the JavaScript techniques used throughout this book. It is not
meant to provide a language tutorial, but rather to familiarize you with some of
the interesting features of the JavaScript language and
their relationship to Dynamic HTML.
- Scripting and Web
security
Security is a widespread concern on
the Web. A programming language imposes limitations in order to
ensure the clients' security, and a programmer must understand
these limitations. This section introduces the security model for Dynamic
HTML. Additional security issues are addressed throughout this book.
NOTE: This chapter uses elements of the Dynamic HTML
object model to demonstrate various techniques. For each such
use, you will find a reference to the chapter in which the feature is discussed in
detail.
[Содержание]