The substringData() method gets a string from the CDATA node.
Parameter | Description |
---|---|
start | Required. Specifies where to begin extracting characters. Start value starts at zero |
length | Required. Specifies how many characters to extract |
The following code fragment loads "books_cdata.xml" into xmlDoc using loadXMLDoc() and gets the "Stun" string form the first CDATA element:
Output: