Javascript [Electronic resources] : The Definitive Guide (4th Edition) نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Javascript [Electronic resources] : The Definitive Guide (4th Edition) - نسخه متنی

David Flanagan

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید







Chapter 14. The Document Object


Every Window object has a
document
property. This property refers to a Document object that represents
the HTML document displayed in the window. The Document object is
probably the most commonly used object in client-side JavaScript.
We've already seen several examples in this book that use the
write( ) method of the Document object to insert
dynamic content into a document while it is being parsed. In addition
to the frequently used write( ) method, the
Document object defines properties that provide information about the
document as a whole: its URL, its last-modified date, the URL of the
document that linked to it, the colors in which it is displayed, and
so on.

Client-side JavaScript exists to turn static HTML documents into
interactive programs -- it is the Document object that gives
JavaScript interactive access to the content of otherwise static
documents. In addition to the properties that provide information
about a document as a whole, the Document object has a number of very
important properties that provide information about document content.
The forms[]
array, for instance, contains Form objects that represent all the
HTML forms in the document. And the
images[] and applets[]
arrays contain objects that represent the images and applets in the
document. These arrays and the objects they contain open up a world
of possibilities for client-side JavaScript programs, and the bulk of
this chapter is devoted to documenting them.

This chapter covers the core features of the Document object that are
implemented by virtually every JavaScript-enabled browser. Newer
browsers, such as IE 4 and later and Netscape 6 and later, implement
a full document object model, or DOM, that gives JavaScript complete
access to and control over all document content. These advanced DOM
features are covered in Chapter 17.



    / 844