We've posted a new excerpt article on Wrox.com that should be of interest to the JavaScript professionals in this forum. The article is:
JavaScript DOM Ranges, By Nicholas C. Zakas, excerpted from his book
Professional JavaScript for Web Developers. The article begins:
Quote:
|
quote:The DOM is a very exciting set of functionality for web pages, but most of the attention has been drawn by the standard DOM functionality. Many developers are unaware that the DOM has much more to offer than just createElement() and appendChild(); DOM ranges are a very powerful tool for dynamic web page manipulation.
|
Quote:
A range can be used to select a section of a document regardless of node boundaries (note that the selection occurs behind the scenes and cannot be seen by the user). Ranges are helpful when regular DOM manipulation isn't specific enough to change a document.
DOM Level 2 defines a method called createRange() to, well, create ranges. In DOM-compliant browsers (not Internet Explorer, by the way), this method belongs to the document object, so a new range can be created like this:
Code:
var oRange = document.createRange();
|
We hope you enjoy the
complete article.
Jim Minatel
Senior Acquisitions Editor
Wiley Technology Publishing
WROX Press
Blog:
http://wroxblog.typepad.com/
Jim's Book of the week:
No book this week - Donate to the Red Cross!
__________________
Jim Minatel
Associate Publisher, WROX - A Wiley Brand
Did someone here help you? Click

on their post!