|
January 25, 2001 Extracting DOM Substrings Tips: January 2001
Yehuda Shiran, Ph.D.
|
|
Netscape 6 is richer in functionality
than Internet Explorer 5, as far as text manipulation is concerned. The substringData()
method is one example. Operating on text nodes, it extracts a substring from the
text node data. You can specify the offset of the substring and its length. Here
is its syntax:
where:
Let's create a text node at the
Now, let's extract a substring that starts at offset 4 and of length 5. Click this button to get the answer in Netscape 6. Click in Internet Explorer 5.x and get an error message: Here is the definition of this button:
People who read this tip also read these tips: Look for similar tips by subject: |