Skip to Content
JavaScript Pocket Reference
book

JavaScript Pocket Reference

by David Flanagan
October 1998
Intermediate to advanced
95 pages
4h 36m
English
O'Reilly Media, Inc.
Content preview from JavaScript Pocket Reference
Client-side JavaScript
|
45
The IE 4 DOM also includes the related outerHTML property,
which replaces the element and its content, and the
insertAdjacentHTML() and insertAdjacentText() methods.
These are not as commonly used, nor as commonly imple-
mented outside of IE as
innerHTML; you can read about them
in the reference section under Element.
DOM compatibility
If you want to write a script that uses the W3C DOM when it is
available, and otherwise uses the IE 4 DOM if it is available, you
can use a capability-testing approach that first checks for the exist-
ence of a method or property to determine whether the browser has
the capability you desire. For example:
if (document.getElementById) {
// If the W3C method exists, use it
}
else if (document.all) {
// If the all[] array exists, use it
}
else {
// Otherwise use the legacy DOM
}
DHTML: Scripting CSS Styles
DHTML, or Dynamic HTML, is the result of combining
HTML, CSS, and JavaScript: it uses scripts to dynamically
modify the style—which may include the position and visi-
bility—of document elements. In the W3C and the IE 4
DOMs, every document element has a
style property that
corresponds to the HTML
style attribute that specifies inline
styles. Instead of referring to a simple string, however, the
style property refers to a Style object that has properties cor-
responding to each of the CSS attributes of the style.
For example, if an element
e has a style ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

JavaScript Pocket Reference, 2nd Edition

JavaScript Pocket Reference, 2nd Edition

David Flanagan
Jump Start JavaScript

Jump Start JavaScript

Ara Pehlivanian, Don Nguyen

Publisher Resources

ISBN: 1565925211