From 074785cea106179cb3305637055ab0a009ca74f2 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:42:52 -0500 Subject: initial commit --- .../domimplementation/createdocument/index.html | 83 ++++++++++++++++++++++ files/pt-br/web/api/domimplementation/index.html | 81 +++++++++++++++++++++ 2 files changed, 164 insertions(+) create mode 100644 files/pt-br/web/api/domimplementation/createdocument/index.html create mode 100644 files/pt-br/web/api/domimplementation/index.html (limited to 'files/pt-br/web/api/domimplementation') diff --git a/files/pt-br/web/api/domimplementation/createdocument/index.html b/files/pt-br/web/api/domimplementation/createdocument/index.html new file mode 100644 index 0000000000..61c90cd7b8 --- /dev/null +++ b/files/pt-br/web/api/domimplementation/createdocument/index.html @@ -0,0 +1,83 @@ +--- +title: DOMImplementation.createDocument() +slug: Web/API/DOMImplementation/createDocument +translation_of: Web/API/DOMImplementation/createDocument +--- +

{{ApiRef("DOM")}}

+ +

O método DOMImplementation.createDocument() cria e retorna um {{domxref("XMLDocument")}}.

+ +

Sintaxe

+ +
doc = document.implementation.createDocument(namespaceURI, qualifiedNameStr, documentType);
+ +

Parâmetros

+ +
+
namespaceURI
+
É um {{domxref("DOMString")}} contendo a URI do namespace do documento que será criado, ou null se o documento não pertencer a nenhum.
+
+ +
+
qualifiedNameStr
+
Is a {{domxref("DOMString")}} containing the qualified name, that is an optional prefix and colon plus the local root element name, of the document to be created.
+
+ +
+
documentType {{optional_inline}}
+
+

Is the {{domxref("DocumentType")}} of the document to be created. It defaults to null.

+
+
+ + + +

Example

+ +
var doc = document.implementation.createDocument ('http://www.w3.org/1999/xhtml', 'html', null);
+var body = document.createElementNS('http://www.w3.org/1999/xhtml', 'body');
+body.setAttribute('id', 'abc');
+doc.documentElement.appendChild(body);
+alert(doc.getElementById('abc')); // [object HTMLBodyElement]
+
+ +

Specifications

+ + + + + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('DOM WHATWG', '#dom-domimplementation-createdocument', 'DOMImplementation.createDocument')}}{{Spec2('DOM WHATWG')}}Modified the return type of createDocument() from {{domxref("Document")}} to {{domxref("XMLDocument")}}.
+ The third argument of createDocument(), doctype, is now optional and default to null.
{{SpecName('DOM3 Core', 'core.html#Level-2-Core-DOM-createDocument', 'DOMImplementation.createDocument')}}{{Spec2('DOM3 Core')}}No change from {{SpecName("DOM2 Core")}}
{{SpecName('DOM2 Core', 'core.html#Level-2-Core-DOM-createDocument', 'DOMImplementation.createDocument')}}{{Spec2('DOM2 Core')}}Initial definition.
+ +

Browser compatibility

+ + + +

{{Compat("api.DOMImplementation.createDocument")}}

+ +

See also

+ + diff --git a/files/pt-br/web/api/domimplementation/index.html b/files/pt-br/web/api/domimplementation/index.html new file mode 100644 index 0000000000..e49ceda64a --- /dev/null +++ b/files/pt-br/web/api/domimplementation/index.html @@ -0,0 +1,81 @@ +--- +title: DOMImplementation +slug: Web/API/DOMImplementation +tags: + - API + - DOM + - Interface + - NeedsTranslation + - Reference + - Référence(2) + - TopicStub +translation_of: Web/API/DOMImplementation +--- +

{{ ApiRef("DOM") }}

+ +

The DOMImplementation interface represent an object providing methods which are not dependent on any particular document. Such an object is returned by the {{domxref("Document.implementation")}} property.

+ +

Property

+ +

This interface has no specific property and doesn't inherit any.

+ +

Methods

+ +

No inherited method.

+ +
+
{{domxref("DOMImplementation.createDocument()")}}
+
Creates and returns an {{domxref("XMLDocument")}}.
+
{{domxref("DOMImplementation.createDocumentType()")}}
+
Creates and returns a {{domxref("DocumentType")}}.
+
{{domxref("DOMImplementation.createHTMLDocument()")}}
+
Creates and returns an HTML {{domxref("Document")}}.
+
{{domxref("DOMImplementation.hasFeature()")}}
+
Returns a {{domxref("Boolean")}} indicating if a given feature is supported or not. This function is unreliable and kept for compatibility purpose alone: except for SVG-related queries, it always returns true. Old browsers are very inconsistent in their behavior.
+
+ +

Specifications

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('DOM WHATWG', '#domimplementation', 'DOMImplementation')}}{{Spec2('DOM WHATWG')}}Removed the getFeature() method.
+ Added the createHTMLDocument() method.
+ Modified the return type of createDocument() from {{domxref("Document")}} to {{domxref("XMLDocument")}}.
{{SpecName('DOM3 Core', 'core.html#ID-102161490', 'DOMImplementation')}}{{Spec2('DOM3 Core')}}Added the getFeature() method (never implemented by any user agent).
{{SpecName('DOM2 Core', 'core.html#ID-102161490', 'DOMImplementation')}}{{Spec2('DOM2 Core')}}Added the createDocument() and createDocumentType() methods.
{{SpecName('DOM1', 'level-one-core.html#ID-102161490', 'DOMImplementation')}}{{Spec2('DOM1')}}Initial definition.
+ +

Browser compatibility

+ + + +

{{Compat("api.DOMImplementation")}}

+ +

See also

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