Name
DOMParser.parseFromString( ): parse XML markup
Synopsis
Document parseFromString(Stringtext
, StringcontentType
)
Arguments
-
text
The XML markup to parse.
-
contentType
The content type of the text. This may be one of âtext/xmlâ, âapplication/xmlâ, or âapplication/xhtml+xmlâ. Note that âtext/htmlâ is not supported.
Returns
A Document object that holds the parsed representation of
text
. See Document.loadXML( )
for an IE-specific
alternative to this method.
Get JavaScript: The Definitive Guide, 5th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.