From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../web/api/document/createcdatasection/index.html | 52 ++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 files/fr/web/api/document/createcdatasection/index.html (limited to 'files/fr/web/api/document/createcdatasection') diff --git a/files/fr/web/api/document/createcdatasection/index.html b/files/fr/web/api/document/createcdatasection/index.html new file mode 100644 index 0000000000..ea4fb083ea --- /dev/null +++ b/files/fr/web/api/document/createcdatasection/index.html @@ -0,0 +1,52 @@ +--- +title: Document.createCDATASection() +slug: Web/API/Document/createCDATASection +tags: + - API + - Création + - DOM + - Document + - Méthode + - Section + - XML + - données +translation_of: Web/API/Document/createCDATASection +--- +
{{APIRef("DOM")}}
+ +

createCDATASection() crée un nouveau noeud de section CDATA et le renvoie.

+ +

Syntaxe

+ +
CDATASectionNode = document.createCDATASection(data)
+
+ + + +

Exemple

+ +
var docu = new DOMParser().parseFromString('<xml></xml>',  "application/xml")
+
+var cdata = docu.createCDATASection('Some <CDATA> data & then some');
+
+docu.getElementsByTagName('xml')[0].appendChild(cdata);
+
+alert(new XMLSerializer().serializeToString(docu));
+// Affiche : <xml><![CDATA[Some <CDATA> data & then some]]></xml>
+
+ +

Notes

+ + + +

Spécification

+ + -- cgit v1.2.3-54-g00ecf