Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
This feature is well established and works across many devices and browser versions. It’s been available across browsers since июль 2015 г..
XMLSerializer может быть использован для конвертации веток DOM-дерева или дерева целиком в текст. XMLSerializer доступен непривилегированным скриптам.
Для получения более подробной информации об XMLSerializer в расширениях для браузера Firefox, пожалуйста обратитесь к документации nsIDOMSerializer.
Возвращает сериализованное дерево или ветку в виде строки
XMLSerializer.serializeToStream()Поддерево, обёрнутое в указанный элемент, сериализуется в поток байтов с использованием указанной кодировки.
The next example uses XMLSerializer with insertAdjacentHTML() to insert a newly created DOM Node into the Document's body. Because insertAdjacentHTML() accepts a string and not a Node for its second parameter, XMLSerializer is used to first convert the node into a string.
Enable JavaScript to view this browser compatibility table.
This page was last modified on 17 дек. 2024 г. by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.