substringData (W3C DOM Core method)
var sentence = document.createTextNode ("When you're smiling, the whole world smiles with you.");
For example, in the
following operation we extract seven characters starting from character
12, which returns the substring
var substring = sentence.substringData(12, 7);
this next example, the character offset plus character count is larger
than the total length of the string, so we'll get everything from the
character offset to the end of the string, which is
world smiles with you.
var substring = sentence.substringData(21, 999);
data returned by this method is a simple string — it is not a new
Extract the character data between specified character offsets.
The extracted substring — either the data in the specified range, or everything from offset to the end if offset plus count exceeds the length of the data
Internet Explorer 5.5 in HTML doesn't implement this method (it returns undefined).
There are no comments yet.