From 95aca4b4d8fa62815d4bd412fff1a364f842814a Mon Sep 17 00:00:00 2001 From: Ryan Johnson Date: Thu, 29 Apr 2021 16:16:42 -0700 Subject: remove retired locales (#699) --- files/it/web/api/node/appendchild/index.html | 99 ------ files/it/web/api/node/childnodes/index.html | 100 ------ files/it/web/api/node/firstchild/index.html | 91 ------ files/it/web/api/node/index.html | 368 ----------------------- files/it/web/api/node/lastchild/index.html | 59 ---- files/it/web/api/node/nextsibling/index.html | 101 ------- files/it/web/api/node/nodename/index.html | 117 ------- files/it/web/api/node/nodetype/index.html | 179 ----------- files/it/web/api/node/nodevalue/index.html | 76 ----- files/it/web/api/node/parentnode/index.html | 62 ---- files/it/web/api/node/previoussibling/index.html | 81 ----- files/it/web/api/node/textcontent/index.html | 139 --------- 12 files changed, 1472 deletions(-) delete mode 100644 files/it/web/api/node/appendchild/index.html delete mode 100644 files/it/web/api/node/childnodes/index.html delete mode 100644 files/it/web/api/node/firstchild/index.html delete mode 100644 files/it/web/api/node/index.html delete mode 100644 files/it/web/api/node/lastchild/index.html delete mode 100644 files/it/web/api/node/nextsibling/index.html delete mode 100644 files/it/web/api/node/nodename/index.html delete mode 100644 files/it/web/api/node/nodetype/index.html delete mode 100644 files/it/web/api/node/nodevalue/index.html delete mode 100644 files/it/web/api/node/parentnode/index.html delete mode 100644 files/it/web/api/node/previoussibling/index.html delete mode 100644 files/it/web/api/node/textcontent/index.html (limited to 'files/it/web/api/node') diff --git a/files/it/web/api/node/appendchild/index.html b/files/it/web/api/node/appendchild/index.html deleted file mode 100644 index acef4909a3..0000000000 --- a/files/it/web/api/node/appendchild/index.html +++ /dev/null @@ -1,99 +0,0 @@ ---- -title: Node.appendChild() -slug: Web/API/Node/appendChild -tags: - - API - - DOM - - Node - - Referenza - - metodo -translation_of: Web/API/Node/appendChild ---- -
{{APIRef("DOM")}}
- -

Il metodo Node.appendChild() aggiunge un nodo alla fine dell'elenco di figli di un nodo genitore specificato. Se il figlio dato è un riferimento a un nodo esistente nel documento, appendChild() lo sposta dalla sua posizione corrente alla nuova posizione (non è necessario rimuovere il nodo dal suo nodo padre prima di aggiungerlo ad un altro nodo).

- -

Ciò significa che un nodo non può essere in due punti del documento contemporaneamente. Quindi se il nodo ha già un genitore, il nodo viene prima rimosso, quindi aggiunto alla nuova posizione. Il metodo {{domxref("Node.cloneNode()")}} può essere usato per fare una copia del nodo prima di aggiungerlo sotto il nuovo genitore. Si noti che le copie eseguite con cloneNode non verranno automaticamente mantenute sincronizzate.

- -

Se il figlio dato è un {{domxref("DocumentFragment")}}, l'intero contenuto di {{domxref("DocumentFragment")}} viene spostato nell'elenco secondario del nodo genitore specificato.

- -

Sintassi

- -
element.appendChild(aChild);
- -

Parametri

- -
-
aChild
-
Il nodo da aggiungere al nodo genitore dato (comunemente un elemento).
-
- -

Valore di ritorno

- -

Il valore restituito è il figlio aggiunto tranne quando il figlio dato è un {{domxref("DocumentFragment")}}, nel qual caso viene restituito il {{domxref("DocumentFragment")}}.

- -

Appunti

- -

Il concatenamento potrebbe non funzionare come previsto a causa di appendChild() che restituisce l'elemento figlio:

- -
var aBlock = doc.createElement('block').appendChild(doc.createElement('b'));
- -

Sets aBlock to <b></b> only, which is probably not what you want.

- -

Esempio

- -
// Crea un nuovo elemento di paragrafo e aggiungilo alla fine del corpo del documento
-var p = document.createElement("p");
-document.body.appendChild(p);
- -

Specifiche

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SpecificaStatoCommento
{{SpecName('DOM WHATWG', '#dom-node-appendchild', 'Node.appendChild()')}}{{Spec2('DOM WHATWG')}}Nessun cambiamento da {{SpecName("DOM3 Core")}}.
{{SpecName('DOM3 Core', 'core.html#ID-184E7107', 'Node.appendChild()')}}{{Spec2('DOM3 Core')}}Nessun cambiamento da {{SpecName("DOM2 Core")}}.
{{SpecName('DOM2 Core', 'core.html#ID-184E7107', 'Node.appendChild()')}}{{Spec2('DOM2 Core')}}Nessun cambiamento da {{SpecName("DOM1")}}.
{{SpecName('DOM1', 'level-one-core.html#ID-184E7107', 'Node.appendChild()')}}{{Spec2('DOM1')}}Definizione inziale.
- -

Compatibilità con i browser

- -
- - -

{{Compat("api.Node.appendChild")}}

-
- -

Vedi anche

- - diff --git a/files/it/web/api/node/childnodes/index.html b/files/it/web/api/node/childnodes/index.html deleted file mode 100644 index 1db83ea87c..0000000000 --- a/files/it/web/api/node/childnodes/index.html +++ /dev/null @@ -1,100 +0,0 @@ ---- -title: Node.childNodes -slug: Web/API/Node/childNodes -translation_of: Web/API/Node/childNodes -original_slug: Web/API/Element/childNodes ---- -
-
{{APIRef("DOM")}}
-
- -

La proprietà di sola lettura Node.childNodes restituisce una {{domxref("NodeList")}} dinamica di {{domxref("Node","nodi")}} figli dell'elemento dato in cui il primo nodo figlio viene assegnato all'indice 0.

- -

Sintassi

- -
var nodeList = elementNodeReference.childNodes;
-
- -

Esempi

- -

Utilizzo semplice

- -
// parg è un riferimento a un elemento <p>
-
-// Innanzitutto controlliamo che l'elemento abbia dei nodi figli
-if (parg.hasChildNodes()) {
-  var children = parg.childNodes;
-
-  for (var i = 0; i < children.length; i++) {
-    // fare qualcosa con ogni bambino da children[i]
-    // NOTA: l'elenco è dinamico, l'aggiunta o la rimozione di bambini modificherà l'elenco
-  }
-}
- -

Rimuovi tutti i bambini da un nodo

- -
// Questo è un modo per rimuovere tutti i bambini da una
-// finestra di nodo è un riferimento ad un oggetto
-
-while (box.firstChild) {
-    //L'elenco è DINAMICO, quindi indicizzerà nuovamente ogni chiamata
-    box.removeChild(box.firstChild);
-}
- -

Appunti

- -

Gli elementi nella raccolta di nodi sono oggetti e non stringhe. Per ottenere dati da oggetti nodo, usa le loro proprietà (ad esempio elementNodeReference.childNodes[1].nodeName per ottenere il nome, ecc.).

- -

L'oggetto document ha 2 figli: la dichiarazione Doctype e l'elemento root, in genere documentElement. (Nei documenti (X)HTML questo è l'elemento HTML.)

- -

childNodes include tutti i nodi figli, inclusi nodi non-elemento come nodi di testo e commenti. Per ottenere una raccolta di soli elementi, usa {{domxref("ParentNode.children")}}.

- -

Specifiche

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SpecificaStatoCommento
{{SpecName('DOM WHATWG', '#dom-node-childnodes', 'Node.childNodes')}}{{Spec2('DOM WHATWG')}}Nessun cambiamento
{{SpecName('DOM3 Core', 'core.html#ID-1451460987', 'Node.childNodes')}}{{Spec2('DOM3 Core')}}Nessun cambiamento
{{SpecName('DOM2 Core', 'core.html#ID-1451460987', 'Node.childNodes')}}{{Spec2('DOM2 Core')}}Nessun cambiamento
{{SpecName('DOM1', 'level-one-core.html#ID-1451460987', 'Node.childNodes')}}{{Spec2('DOM1')}}Definizione iniziale
- -

Compatibilità con i browser

- - - -

{{Compat("api.Node.childNodes")}}

- -

Vedi anche

- - diff --git a/files/it/web/api/node/firstchild/index.html b/files/it/web/api/node/firstchild/index.html deleted file mode 100644 index b99b694dbe..0000000000 --- a/files/it/web/api/node/firstchild/index.html +++ /dev/null @@ -1,91 +0,0 @@ ---- -title: Node.firstChild -slug: Web/API/Node/firstChild -tags: - - API - - DOM - - Node - - Proprietà - - Referenza -translation_of: Web/API/Node/firstChild -original_slug: Web/API/Element/firstChild ---- -
{{APIRef("DOM")}}
- -

La proprietà di sola lettura Node.firstChild restituisce il primo figlio del nodo nell'albero o null se il nodo non ha figli. Se il nodo è un Document, restituisce il primo nodo nell'elenco dei suoi figli diretti.

- -

Sintassi

- -
var childNode = node.firstChild;
-
- -

Esempio

- -

Questo esempio dimostra l'uso di firstChild e il modo in cui i nodi degli spazi bianchi potrebbero interferire con l'utilizzo di questa proprietà.

- -
<p id="para-01">
-  <span>First span</span>
-</p>
-
-<script>
-  var p01 = document.getElementById('para-01');
-  console.log(p01.firstChild.nodeName);
-</script>
- -

In quanto sopra, la console console mostrerà '#text' perché viene inserito un nodo di testo per mantenere lo spazio bianco tra la fine dei tag di apertura <p> e <span>. Qualsiasi spazio bianco creerà un nodo #text da un singolo spazio a più spazi, ritorni, schede e così via.

- -

Un altro nodo #text viene inserito tra i tag di chiusura </span> e </p>.

- -

Se questo spazio viene rimosso dall'origine, i nodi #text non vengono inseriti e l'elemento span diventa il primo figlio del paragrafo.

- -
<p id="para-01"><span>First span</span></p>
-
-<script>
-  var p01 = document.getElementById('para-01');
-  console.log(p01.firstChild.nodeName);
-</script>
-
- -

Ora l'avviso mostrerà 'SPAN'.

- -

Per evitare il problema con node.firstChild che restituisce i nodi #text#comment, {{domxref("ParentNode.firstElementChild")}} può essere utilizzato per restituire solo il primo nodo elemento. Tuttavia, node.firstElementChild richiede uno shim per Internet Explorer 9 e versioni precedenti.

- -

Specifiche

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SpecificaStatoCommentp
{{SpecName('DOM WHATWG', '#dom-node-firstchild', 'Node.firstChild')}}{{Spec2('DOM WHATWG')}}Nessun cambiamento
{{SpecName('DOM3 Core', 'core.html#ID-169727388', 'Node.firstChild')}}{{Spec2('DOM3 Core')}}Nessun cambiamento
{{SpecName('DOM2 Core', 'core.html#ID-169727388', 'Node.firstChild')}}{{Spec2('DOM2 Core')}}Nessun cambiamento
{{SpecName('DOM1', 'level-one-core.html#ID-169727388', 'Node.firstChild')}}{{Spec2('DOM1')}}Definizione iniziale
- -

Compatibilità con i browser

- - - -

{{Compat("api.Node.firstChild")}}

diff --git a/files/it/web/api/node/index.html b/files/it/web/api/node/index.html deleted file mode 100644 index 7e0112e21c..0000000000 --- a/files/it/web/api/node/index.html +++ /dev/null @@ -1,368 +0,0 @@ ---- -title: Node -slug: Web/API/Node -tags: - - API - - DOM - - DOM Reference - - Interface - - NeedsTranslation - - Node - - Reference - - TopicStub -translation_of: Web/API/Node ---- -
{{APIRef("DOM")}}
- -

Node is an interface from which a number of DOM API object types inherit. It allows those types to be treated similarly; for example, inheriting the same set of methods, or being tested in the same way.

- -

The following interfaces all inherit from Node’s methods and properties: {{domxref("Document")}}, {{domxref("Element")}}, {{domxref("Attr")}}, {{domxref("CharacterData")}} (which {{domxref("Text")}}, {{domxref("Comment")}}, and {{domxref("CDATASection")}} inherit), {{domxref("ProcessingInstruction")}}, {{domxref("DocumentFragment")}}, {{domxref("DocumentType")}}, {{domxref("Notation")}}, {{domxref("Entity")}}, {{domxref("EntityReference")}}

- -

These interfaces may return null in certain cases where the methods and properties are not relevant. They may throw an exception — for example when adding children to a node type for which no children can exist.

- -

{{InheritanceDiagram}}

- -

Properties

- -

Inherits properties from its parents {{domxref("EventTarget")}}.[1]

- -
-
{{domxref("Node.baseURI")}} {{readonlyInline}}
-
Returns a {{domxref("DOMString")}} representing the base URL. The concept of base URL changes from one language to another; in HTML, it corresponds to the protocol, the domain name and the directory structure, that is all until the last '/'.
-
{{domxref("Node.baseURIObject")}} {{Non-standard_inline()}}
-
(Not available to web content.) The read-only {{ Interface("nsIURI") }} object representing the base URI for the element.
-
{{domxref("Node.childNodes")}} {{readonlyInline}}
-
Returns a live {{domxref("NodeList")}} containing all the children of this node. {{domxref("NodeList")}} being live means that if the children of the Node change, the {{domxref("NodeList")}} object is automatically updated.
-
{{domxref("Node.firstChild")}} {{readonlyInline}}
-
Returns a {{domxref("Node")}} representing the first direct child node of the node, or null if the node has no child.
-
{{domxref("Node.isConnected")}} {{readonlyInline}}
-
Returns a boolean indicating whether or not the Node is connected (directly or indirectly) to the context object, e.g. the {{domxref("Document")}} object in the case of the normal DOM, or the {{domxref("ShadowRoot")}} in the case of a shadow DOM.
-
{{domxref("Node.lastChild")}} {{readonlyInline}}
-
Returns a {{domxref("Node")}} representing the last direct child node of the node, or null if the node has no child.
-
{{domxref("Node.nextSibling")}} {{readonlyInline}}
-
Returns a {{domxref("Node")}} representing the next node in the tree, or null if there isn't such node.
-
{{domxref("Node.nodeName")}} {{readonlyInline}}
-
Returns a {{domxref("DOMString")}} containing the name of the Node. The structure of the name will differ with the node type. E.g. An {{domxref("HTMLElement")}} will contain the name of the corresponding tag, like 'audio' for an {{domxref("HTMLAudioElement")}}, a {{domxref("Text")}} node will have the '#text' string, or a {{domxref("Document")}} node will have the '#document' string.
-
{{domxref("Node.nodePrincipal")}} {{Non-standard_inline()}}
-
A {{ Interface("nsIPrincipal") }} representing the node principal.
-
{{domxref("Node.nodeType")}}{{readonlyInline}}
-
Returns an unsigned short representing the type of the node. Possible values are: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameValue
ELEMENT_NODE1
ATTRIBUTE_NODE {{deprecated_inline()}}2
TEXT_NODE3
CDATA_SECTION_NODE {{deprecated_inline()}}4
ENTITY_REFERENCE_NODE {{deprecated_inline()}}5
ENTITY_NODE {{deprecated_inline()}}6
PROCESSING_INSTRUCTION_NODE7
COMMENT_NODE8
DOCUMENT_NODE9
DOCUMENT_TYPE_NODE10
DOCUMENT_FRAGMENT_NODE11
NOTATION_NODE {{deprecated_inline()}}12
-
-
{{domxref("Node.nodeValue")}}
-
Returns / Sets the value of the current node
-
{{domxref("Node.ownerDocument")}} {{readonlyInline}}
-
Returns the {{domxref("Document")}} that this node belongs to. If the node is itself a document, returns null.
-
{{domxref("Node.parentNode")}} {{readonlyInline}}
-
Returns a {{domxref("Node")}} that is the parent of this node. If there is no such node, like if this node is the top of the tree or if doesn't participate in a tree, this property returns null.
-
{{domxref("Node.parentElement")}} {{readonlyInline}}
-
Returns an {{domxref("Element")}} that is the parent of this node. If the node has no parent, or if that parent is not an {{domxref("Element")}}, this property returns null.
-
{{domxref("Node.previousSibling")}} {{readonlyInline}}
-
Returns a {{domxref("Node")}} representing the previous node in the tree, or null if there isn't such node.
-
{{domxref("Node.textContent")}}
-
Returns / Sets the textual content of an element and all its descendants.
-
- -

Deprecated properties

- -
-
{{domxref("Node.rootNode")}} {{readOnlyInline}} {{deprecated_inline}}
-
Returns a {{domxref("Node")}} object representing the topmost node in the tree, or the current node if it's the topmost node in the tree. This has been replaced by {{domxref("Node.getRootNode()")}}.
-
- -

Obsolete properties

- -
-
{{domxref("Node.localName")}} {{obsolete_inline}}{{readonlyInline}}
-
Returns a {{domxref("DOMString")}} representing the local part of the qualified name of an element. -
-

Note: In Firefox 3.5 and earlier, the property upper-cases the local name for HTML elements (but not XHTML elements). In later versions, this does not happen, so the property is in lower case for both HTML and XHTML. {{gecko_minversion_inline("1.9.2")}}

-
-
-
{{domxref("Node.namespaceURI")}} {{obsolete_inline}}{{readonlyInline}}
-
The namespace URI of this node, or null if it is no namespace. -
-

Note: In Firefox 3.5 and earlier, HTML elements are in no namespace. In later versions, HTML elements are in the http://www.w3.org/1999/xhtml/ namespace in both HTML and XML trees. {{gecko_minversion_inline("1.9.2")}}

-
-
-
{{domxref("Node.prefix")}} {{obsolete_inline}}{{readonlyInline}}
-
Is a {{domxref("DOMString")}} representing the namespace prefix of the node, or null if no prefix is specified.
-
- -

Methods

- -

Inherits methods from its parent, {{domxref("EventTarget")}}.[1]

- -
-
{{domxref("Node.appendChild()")}}
-
Adds the specified childNode argument as the last child to the current node.
- If the argument referenced an existing node on the DOM tree, the node will be detached from its current position and attached at the new position.
-
{{domxref("Node.cloneNode()")}}
-
Clone a {{domxref("Node")}}, and optionally, all of its contents. By default, it clones the content of the node.
-
{{domxref("Node.compareDocumentPosition()")}}
-
Compares the position of the current node against another node in any other document.
-
{{domxref("Node.contains()")}}
-
Returns a {{jsxref("Boolean")}} value indicating whether a node is a descendant of a given node or not.
-
{{domxref("Node.getRootNode()")}}
-
Returns the context object's root which optionally includes the shadow root if it is available. 
-
{{domxref("Node.hasChildNodes()")}}
-
Returns a {{jsxref("Boolean")}} indicating if the element has any child nodes, or not.
-
{{domxref("Node.insertBefore()")}}
-
Inserts a {{domxref("Node")}} before the reference node as a child of a specified parent node.
-
{{domxref("Node.isDefaultNamespace()")}}
-
Accepts a namespace URI as an argument and returns a {{jsxref("Boolean")}} with a value of true if the namespace is the default namespace on the given node or false if not.
-
{{domxref("Node.isEqualNode()")}}
-
Returns a {{jsxref("Boolean")}} which indicates whether or not two nodes are of the same type and all their defining data points match.
-
{{domxref("Node.isSameNode()")}}
-
Returns a {{jsxref("Boolean")}} value indicating whether or not the two nodes are the same (that is, they reference the same object).
-
{{domxref("Node.lookupPrefix()")}}
-
Returns a {{domxref("DOMString")}} containing the prefix for a given namespace URI, if present, and null if not. When multiple prefixes are possible, the result is implementation-dependent.
-
{{domxref("Node.lookupNamespaceURI()")}}
-
Accepts a prefix and returns the namespace URI associated with it on the given node if found (and null if not). Supplying null for the prefix will return the default namespace.
-
{{domxref("Node.normalize()")}}
-
Clean up all the text nodes under this element (merge adjacent, remove empty).
-
{{domxref("Node.removeChild()")}}
-
Removes a child node from the current element, which must be a child of the current node.
-
{{domxref("Node.replaceChild()")}}
-
Replaces one child {{domxref("Node")}} of the current one with the second one given in parameter.
-
- -

Obsolete methods

- -
-
{{domxref("Node.getFeature()")}} {{obsolete_inline}}
-
 
-
{{domxref("Node.getUserData()")}} {{obsolete_inline}}
-
Allows a user to get some {{domxref("DOMUserData")}} from the node.
-
{{domxref("Node.hasAttributes()")}} {{obsolete_inline}}
-
Returns a {{jsxref("Boolean")}} indicating if the element has any attributes, or not.
-
{{domxref("Node.isSupported()")}} {{obsolete_inline}}
-
Returns a {{jsxref("Boolean")}} flag containing the result of a test whether the DOM implementation implements a specific feature and this feature is supported by the specific node.
-
{{domxref("Node.setUserData()")}} {{obsolete_inline}}
-
Allows a user to attach, or remove, {{domxref("DOMUserData")}} to the node.
-
- -

Examples

- -

Remove all children nested within a node

- -
Element.prototype.removeAll = function () {
-  while (this.firstChild) { this.removeChild(this.firstChild); }
-  return this;
-};
- -

Sample usage

- -
/* ... an alternative to document.body.innerHTML = "" ... */
-document.body.removeAll();
- -

Recurse through child nodes

- -

The following function calls a function recursively for each node contained by a root node (including the root itself):

- -
function eachNode(rootNode, callback){
-	if(!callback){
-		var nodes = [];
-		eachNode(rootNode, function(node){
-			nodes.push(node);
-		});
-		return nodes;
-	}
-
-	if(false === callback(rootNode))
-		return false;
-
-	if(rootNode.hasChildNodes()){
-		var nodes = rootNode.childNodes;
-		for(var i = 0, l = nodes.length; i < l; ++i)
-			if(false === eachNode(nodes[i], callback))
-				return;
-	}
-}
- -

Syntax

- -
eachNode(rootNode, callback);
- -

Description

- -

Recursively calls a function for each descendant node of rootNode (including the root itself).

- -

If callback is omitted, the function returns an {{jsxref("Array")}} instead, which contains rootNode and all nodes contained therein.

- -

If callback is provided, and it returns {{jsxref("Boolean")}} false when called, the current recursion level is aborted, and the function resumes execution at the last parent's level. This can be used to abort loops once a node has been found (such as searching for a text node that contains a certain string).

- -

Parameters

- -
-
rootNode
-
The Node object whose descendants will be recursed through.
-
callback
-
An optional callback function that receives a Node as its only argument. If omitted, eachNode returns an {{jsxref("Array")}} of every node contained within rootNode (including the root itself).
-
- -

Sample usage

- -

The following example prints the textContent properties of each <span> tag in a <div> element named "box":

- -
<div id="box">
-	<span>Foo</span>
-	<span>Bar</span>
-	<span>Baz</span>
-</div>
- -
var box = document.getElementById("box");
-eachNode(box, function(node){
-	if(null != node.textContent){
-		console.log(node.textContent);
-	}
-});
- -

The following strings will be displayed in the user's console:

- -
"\n\t", "Foo", "\n\t", "Bar", "\n\t", "Baz"
- -
-

Note: Whitespace forms part of a {{domxref("Text")}} node, meaning indentation and newlines form separate Text between the Element nodes.

-
- -

Realistic usage

- -

The following demonstrates a real-world use of the eachNode function: searching for text on a web-page. We use a wrapper function named grep to do the searching:

- -
function grep(parentNode, pattern){
-	var matches = [];
-	var endScan = false;
-
-	eachNode(parentNode, function(node){
-		if(endScan)
-			return false;
-
-		// Ignore anything which isn't a text node
-		if(node.nodeType !== Node.TEXT_NODE)
-			return;
-
-		if("string" === typeof pattern){
-			if(-1 !== node.textContent.indexOf(pattern))
-				matches.push(node);
-		}
-		else if(pattern.test(node.textContent)){
-			if(!pattern.global){
-				endScan = true;
-				matches = node;
-			}
-			else matches.push(node);
-		}
-	});
-
-	return matches;
-}
- -

For example, to find {{domxref("Text")}} nodes that contain typos:

- -
var typos = ["teh", "adn", "btu", "adress", "youre", "msitakes"];
-var pattern = new RegExp("\\b(" + typos.join("|") + ")\\b", "gi");
-var mistakes = grep(document.body, pattern);
-console.log(mistakes);
-
- -

Specifications

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('DOM WHATWG', '#interface-node', 'Node')}}{{Spec2('DOM WHATWG')}}Removed the following properties: attributes, namespaceURI, prefix, and localName.
- Removed the following methods: isSupported(), hasAttributes(), getFeature(), setUserData(), and getUserData().
{{SpecName('DOM3 Core', 'core.html#ID-1950641247', 'Node')}}{{Spec2('DOM3 Core')}}The methods insertBefore(), replaceChild(), removeChild(), and appendChild() returns one more kind of error (NOT_SUPPORTED_ERR) if called on a {{domxref("Document")}}.
- The normalize() method has been modified so that {{domxref("Text")}} node can also be normalized if the proper {{domxref("DOMConfiguration")}} flag is set.
- Added the following methods: compareDocumentPosition(), isSameNode(), lookupPrefix(), isDefaultNamespace(), lookupNamespaceURI(), isEqualNode(), getFeature(), setUserData(), and getUserData().
- Added the following properties: baseURI and textContent.
{{SpecName('DOM2 Core', 'core.html#ID-1950641247', 'Node')}}{{Spec2('DOM2 Core')}}The ownerDocument property was slightly modified so that {{domxref("DocumentFragment")}} also returns null.
- Added the following properties: namespaceURI, prefix, and localName.
- Added the following methods: normalize(), isSupported() and hasAttributes().
{{SpecName('DOM1', 'level-one-core.html#ID-1950641247', 'Node')}}{{Spec2('DOM1')}}Initial definition
- -

Browser compatibility

- - - -

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

diff --git a/files/it/web/api/node/lastchild/index.html b/files/it/web/api/node/lastchild/index.html deleted file mode 100644 index 34804c5644..0000000000 --- a/files/it/web/api/node/lastchild/index.html +++ /dev/null @@ -1,59 +0,0 @@ ---- -title: Node.lastChild -slug: Web/API/Node/lastChild -translation_of: Web/API/Node/lastChild ---- -
{{APIRef("DOM")}}
- -

La proprietà di sola lettura Node.lastChild restituisce l'ultimo figlio del nodo. Se il suo genitore è un elemento, allora il bambino è generalmente un nodo di elemento, un nodo di testo o un nodo di commento. Restituisce null se non ci sono elementi figli.

- -

Sintassi

- -
var childNode = node.lastChild;
-
- -

Esempio

- -
var tr = document.getElementById("row1");
-var corner_td = tr.lastChild;
-
- -

Specifiche

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SpecificaStatoCommento
{{SpecName('DOM WHATWG', '#dom-node-lastchild', 'Node.lastChild')}}{{Spec2('DOM WHATWG')}}Nessun cambiamento
{{SpecName('DOM3 Core', 'core.html#ID-61AD09FB', 'Node.lastChild')}}{{Spec2('DOM3 Core')}}Nessun cambiamento
{{SpecName('DOM2 Core', 'core.html#ID-61AD09FB', 'Node.lastChild')}}{{Spec2('DOM2 Core')}}Nessun cambiamento
{{SpecName('DOM1', 'level-one-core.html#ID-61AD09FB', 'Node.lastChild')}}{{Spec2('DOM1')}}Definizione iniziale
- -

Compatibilità con i browser

- - - -

{{Compat("api.Node.lastChild")}}

diff --git a/files/it/web/api/node/nextsibling/index.html b/files/it/web/api/node/nextsibling/index.html deleted file mode 100644 index f2355a6402..0000000000 --- a/files/it/web/api/node/nextsibling/index.html +++ /dev/null @@ -1,101 +0,0 @@ ---- -title: Node.nextSibling -slug: Web/API/Node/nextSibling -translation_of: Web/API/Node/nextSibling ---- -
{{APIRef("DOM")}}
- -

La proprietà di sola lettura Node.nextSibling restituisce il nodo immediatamente successivo a quello specificato nei {{domxref("Node.childNodes","childNodes")}}, del loro genitore o restituisce null se il nodo specificato è l'ultimo figlio nell'elemento genitore.

- -

Sintassi

- -
nextNode = node.nextSibling
-
- -

Appunti

- -
-

I browser basati su Gecko inseriscono nodi di testo in un documento per rappresentare gli spazi bianchi nel codice sorgente. Pertanto, un nodo ottenuto, ad esempio, utilizzando Node.firstChildNode.previousSibling può fare riferimento a un nodo di testo di spazi bianchi piuttosto che all'elemento effettivo che l'autore intendeva ottenere.

- -

Vedi Whitespace in the DOM e W3C DOM 3 FAQ: Why are some Text nodes empty? per maggiori informazioni.

-
- -

{{domxref("Element.nextElementSibling")}} può essere usato per ottenere l'elemento successivo saltando eventuali nodi di spazi vuoti, altro testo tra elementi o commenti.

- -

Esempio

- -
<div id="div-1">Here is div-1</div>
-<div id="div-2">Here is div-2</div>
-
-<script>
-var el = document.getElementById('div-1').nextSibling,
-    i = 1;
-
-console.group('Siblings of div-1:');
-
-while (el) {
-  console.log(i, '. ', el.nodeName);
-  el = el.nextSibling;
-  i++;
-}
-
-console.groupEnd();
-</script>
-
-/**************************************************
-  The console displays the following:
-
-     Siblings of div-1
-
-      1. #text
-      2. DIV
-      3. #text
-      4. SCRIPT
-
-**************************************************/
-
- -

Nell'esempio precedente, i nodi, #text sono inseriti nel DOM in cui si verifica lo spazio bianco tra i tag (ad esempio dopo il tag di chiusura di un elemento e prima del tag di apertura del successivo).

- -

La possibile inclusione di nodi di testo deve essere consentita quando si attraversa il DOM utilizzando nextSibling. Vedi le risorse nella sezione Appunti.

- -

Specifiche

- - - - - - - - - - - - - - - - - - - - - - - - - - -
SpecificaStatoCommento
{{SpecName('DOM WHATWG', '#dom-node-nextsibling', 'Node.nextSibling')}}{{Spec2('DOM WHATWG')}}Nessun cambiamento
{{SpecName('DOM2 Core', 'core.html#ID-6AC54C2F', 'Node.nextSibling')}}{{Spec2('DOM2 Core')}}Nessun cambiamento
{{SpecName('DOM1', 'level-one-core.html#attribute-nextSibling', 'Node.nextSibling')}}{{Spec2('DOM1')}}Definizione iniziale
- -

Compatibilità con i browser

- - - -

{{Compat("api.Node.nextSibling")}}

- -

Vedi anche

- - diff --git a/files/it/web/api/node/nodename/index.html b/files/it/web/api/node/nodename/index.html deleted file mode 100644 index 2738910a45..0000000000 --- a/files/it/web/api/node/nodename/index.html +++ /dev/null @@ -1,117 +0,0 @@ ---- -title: Node.nodeName -slug: Web/API/Node/nodeName -tags: - - API - - DOM - - Gecko - - NeedsSpecTable - - Node - - Property - - Read-only -translation_of: Web/API/Node/nodeName -original_slug: Web/API/Element/nodeName ---- -
{{APIRef("DOM")}}
- -

La proprietà di sola lettura nodeName restituisce il nome dell'attuale {{domxref("Node")}} come stringa.

- -

Sintassi

- -
var str = node.nodeName;
-
- -

Valore

- -

Una {{domxref("DOMString")}}. I valori per i diversi tipi di nodi sono:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Interfacciavalore nodeName
{{domxref("Attr")}}Il valore di {{domxref("Attr.name")}}
{{domxref("CDATASection")}}"#cdata-section"
{{domxref("Comment")}}"#comment"
{{domxref("Document")}}"#document"
{{domxref("DocumentFragment")}}"#document-fragment"
{{domxref("DocumentType")}}Il valore di {{domxref("DocumentType.name")}}
{{domxref("Element")}}Il valore di {{domxref("Element.tagName")}}
{{domxref("Entity")}}Il nome dell'entità
{{domxref("EntityReference")}}Il nome del riferimento all'entità
{{domxref("Notation")}}Il nome della notazione
{{domxref("ProcessingInstruction")}}Il valore di {{domxref("ProcessingInstruction.target")}}
{{domxref("Text")}}"#text"
- -

Esempio

- -

Dato il seguente markup:

- -
<div id="d1">hello world</div>
-<input type="text" id="t">
-
- -

e il seguente script:

- -
var div1 = document.getElementById("d1");
-var text_field = document.getElementById("t");
-
-text_field.value = div1.nodeName;
-
- -

IIn XHTML (o in qualsiasi altro formato XML), il valore di text_field sarebbe letto "div". Tuttavia, in HTML, il valore di text_field sarebbe letto "DIV", poichè nodeNametagName restituiscono in maiuscolo gli elementi HTML nei DOM contrassegnati come documenti HTML. Read more details on nodeName case sensitivity in different browsers.

- -

Nota che la proprietà {{domxref("Element.tagName")}} potrebbe essere stata utilizzata, poiché nodeName ha lo stesso valore di tagName per un elemento. Tieni presente, tuttavia, che nodeName ritornerà "#text" per i nodi di testo mentre tagName restituirà undefined.

- -

Specifiche

- - - -

Compatibilità con i browser

- - - -

{{Compat("api.Node.nodeName")}}

diff --git a/files/it/web/api/node/nodetype/index.html b/files/it/web/api/node/nodetype/index.html deleted file mode 100644 index c484034dc7..0000000000 --- a/files/it/web/api/node/nodetype/index.html +++ /dev/null @@ -1,179 +0,0 @@ ---- -title: Node.nodeType -slug: Web/API/Node/nodeType -tags: - - API - - DOM - - Proprietà - - Referenza -translation_of: Web/API/Node/nodeType -original_slug: Web/API/Element/nodeType ---- -
{{APIRef("DOM")}}
- -

La proprietà di sola lettura Node.nodeType è un numero intero che identifica il nodo. Distingue tra diversi tipi di nodi tra loro, come {{domxref("Element", "elements")}}, {{domxref("Text", "text")}} and {{domxref("Comment", "comments")}}.

- -

Sintassi

- -
var type = node.nodeType;
-
- -

Restituisce un numero intero che specifica il tipo del nodo. I valori possibili sono elencati in {{anch("Tipi di nodi costanti")}}.

- -

Constanti

- -

Tipi di nodi costanti

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ConstanteValoreDescrizione
Node.ELEMENT_NODE1Un nodo {{domxref("Element")}} come {{HTMLElement("p")}} o {{HTMLElement("div")}}.
Node.TEXT_NODE3L'attuale {{domxref("Text")}} dentro un {{domxref("Element")}} o {{domxref("Attr")}}.
Node.CDATA_SECTION_NODE4Una {{domxref("CDATASection")}}, ad esempio <!CDATA[[ … ]]>.
Node.PROCESSING_INSTRUCTION_NODE7Una {{domxref("ProcessingInstruction")}} di un documento XML, come <?xml-stylesheet … ?>.
Node.COMMENT_NODE8Un nodo {{domxref("Comment")}}, come <!-- … -->.
Node.DOCUMENT_NODE9Un nodo {{domxref("Document")}}.
Node.DOCUMENT_TYPE_NODE10Un nodo {{domxref("DocumentType")}}, come <!DOCTYPE html>.
Node.DOCUMENT_FRAGMENT_NODE11Un nodo {{domxref("DocumentFragment")}}.
- -

Tipi di nodo deprecati {{deprecated_inline()}}

- -
-

Le seguenti costanti sono state deprecate e non dovrebbero essere più utilizzate.

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ConstanteValoreDescrizione
Node.ATTRIBUTE_NODE2Un {{domxref("Attr", "Attribute")}} di un {{domxref("Element")}}. Gli attributi non implementano più l'interfaccia {{domxref("Node")}} dal {{SpecName("DOM4")}}.
Node.ENTITY_REFERENCE_NODE5Un nodo di riferimento di entità XML, come &foo;. Rimosso nel {{SpecName("DOM4")}}.
Node.ENTITY_NODE6Un nodo XML <!ENTITY …>. Rimosso nel {{SpecName("DOM4")}}.
Node.NOTATION_NODE12Un nodo XML <!NOTATION …>. Rimosso nel {{SpecName("DOM4")}}.
- -

Esempi

- -

Diversi tipi di nodi

- -
document.nodeType === Node.DOCUMENT_NODE; // true
-document.doctype.nodeType === Node.DOCUMENT_TYPE_NODE; // true
-
-document.createDocumentFragment().nodeType === Node.DOCUMENT_FRAGMENT_NODE; // true
-
-var p = document.createElement("p");
-p.textContent = "Once upon a time…";
-
-p.nodeType === Node.ELEMENT_NODE; // true
-p.firstChild.nodeType === Node.TEXT_NODE; // true
-
- -

Commenti

- -

Questo esempio controlla se il primo nodo all'interno dell'elemento del documento è un commento e visualizza un messaggio in caso contrario.

- -
var node = document.documentElement.firstChild;
-if (node.nodeType !== Node.COMMENT_NODE) {
-  console.warn("Dovresti commentare il tuo codice!");
-}
-
- -

Specifiche

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SpecificaStatoCommento
{{SpecName('DOM WHATWG', '#dom-node-nodetype', 'Node.nodeType')}}{{Spec2('DOM WHATWG')}}Deprecated ATTRIBUTE_NODE, ENTITY_REFERENCE_NODE and NOTATION_NODE types.
{{SpecName('DOM3 Core', 'core.html#ID-1950641247', 'Node.nodeType')}}{{Spec2('DOM3 Core')}}Nessun cambiamento.
{{SpecName('DOM2 Core', 'core.html#ID-111237558', 'Node.nodeType')}}{{Spec2('DOM2 Core')}}Nessun cambiamento.
{{SpecName('DOM1', 'level-one-core.html#ID-111237558', 'Node.nodeType')}}{{Spec2('DOM1')}}Definizione iniziale.
- -

Compatibilità con i browser

- - - -

{{Compat("api.Node.nodeType")}}

diff --git a/files/it/web/api/node/nodevalue/index.html b/files/it/web/api/node/nodevalue/index.html deleted file mode 100644 index 6eef21baad..0000000000 --- a/files/it/web/api/node/nodevalue/index.html +++ /dev/null @@ -1,76 +0,0 @@ ---- -title: element.nodeValue -slug: Web/API/Node/nodeValue -tags: - - DOM - - Gecko - - Reference_del_DOM_di_Gecko - - Tutte_le_categorie -translation_of: Web/API/Node/nodeValue -original_slug: Web/API/Element/nodeValue ---- -

{{ ApiRef() }}

-

Sommario

-

Restituisce il valore del nodo corrente.

-

Sintassi

-
valore = document.nodeValue
-
-

valore è una stringa contenente il valore del nodo corrente, se esiste.

-

Note

-

La proprietà nodeValue dell'intero documento, restituisce null. Per un nodo di tipo testo, commento o CDATA, nodeValue restituisce il contenuto del nodo. Per i nodi attributo, restituisce il valore dell'attributo.

-

La tabella seguente mostra i valori restituiti per i vari tipi di elementi:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Attril valore dell'attributo
CDATASectionil contenuto della sezione CDATA
Commentil commento
Documentnull
DocumentFragmentnull
DocumentTypenull
Elementnull
NamedNodeMapnull
EntityReferencenull
Notationnull
ProcessingInstructionl'intero contenuto, escluso il target
Textil contenuto del nodo testo
-

Quando nodeValue è impostato a null, reimpostarlo non ha alcun effetto.

-

Specifiche

-

nodeValue

diff --git a/files/it/web/api/node/parentnode/index.html b/files/it/web/api/node/parentnode/index.html deleted file mode 100644 index 610cc3e5e4..0000000000 --- a/files/it/web/api/node/parentnode/index.html +++ /dev/null @@ -1,62 +0,0 @@ ---- -title: Node.parentNode -slug: Web/API/Node/parentNode -tags: - - API - - DOM - - Gecko - - Proprietà -translation_of: Web/API/Node/parentNode -original_slug: Web/API/Element/parentNode ---- -
-
{{APIRef("DOM")}}
-
- -

La proprietà di sola lettura Node.parentNode restituisce il genitore del nodo specificato nell'albero DOM.

- -

Sintassi

- -
parentNode = node.parentNode
-
- -

parentNode è il genitore del nodo corrente. Il genitore di un elemento è un nodo Element, un nodo Document, o un nodo DocumentFragment.

- -

Esempio

- -
if (node.parentNode) {
-  // rimuovi un nodo dall'albero, a meno che
-  // non sia già nell'albero
-  node.parentNode.removeChild(node);
-}
- -

Note

- -

I nodi DocumentDocumentFragment non possono mai avere un genitore, quindi parentNode ritornerà sempre null.

- -

Restituisce anche null se il nodo è appena stato creato e non è ancora collegato all'albero.

- -

Compatibilità con i browser

- - - -

{{Compat("api.Node.parentNode")}}

- -

Specifiche

- - - -

Vedi anche

- - diff --git a/files/it/web/api/node/previoussibling/index.html b/files/it/web/api/node/previoussibling/index.html deleted file mode 100644 index 735433da9e..0000000000 --- a/files/it/web/api/node/previoussibling/index.html +++ /dev/null @@ -1,81 +0,0 @@ ---- -title: Node.previousSibling -slug: Web/API/Node/previousSibling -translation_of: Web/API/Node/previousSibling ---- -
-
{{APIRef("DOM")}}
-
- -

La proprietà di sola lettura Node.previousSibling restituisce il nodo immediatamente precedente a quello specificato nell'elenco {{domxref("Node.childNodes", "childNodes")}} del genitore, o null se il nodo specificato è il primo in tale elenco.

- -

Sintassi

- -
previousNode = node.previousSibling;
-
- -

Esempio

- -
<img id="b0">
-<img id="b1">
-<img id="b2">
- -
console.log(document.getElementById("b1").previousSibling); // <img id="b0">
-console.log(document.getElementById("b2").previousSibling.id); // "b1"
-
- -

Appunti

- -
-

I browser basati su Gecko inseriscono nodi di testo in un documento per rappresentare gli spazi bianchi nel codice sorgente. Pertanto, un nodo ottenuto, ad esempio, utilizzando Node.firstChildNode.previousSibling può fare riferimento a un nodo di testo di spazi bianchi piuttosto che all'elemento effettivo che l'autore intendeva ottenere.

- -

Vedi Whitespace in the DOM e W3C DOM 3 FAQ: Why are some Text nodes empty? per maggiori informazioni.

-
- -

Per navigare nella direzione opposta attraverso l'elenco dei nodi secondari usa Node.nextSibling.

- -

Specifiche

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SpecificaStatoCommento
{{SpecName('DOM WHATWG', '#dom-node-previousSibling', 'Node.previousSibling')}}{{Spec2('DOM WHATWG')}}Nessun cambiamento
{{SpecName('DOM3 Core', 'core.html#ID-640FB3C8', 'Node.previousSibling')}}{{Spec2('DOM3 Core')}}Nessun cambiamento
{{SpecName('DOM2 Core', 'core.html#ID-640FB3C8', 'Node.previousSibling')}}{{Spec2('DOM2 Core')}}Nessun cambiamento
{{SpecName('DOM1', 'level-one-core.html#attribute-previousSibling', 'Node.previousSibling')}}{{Spec2('DOM1')}}Definizione iniziale
- -

Compatibilità con i browser

- - - -

{{Compat("api.Node.previousSibling")}}

- -

Vedi anche

- - diff --git a/files/it/web/api/node/textcontent/index.html b/files/it/web/api/node/textcontent/index.html deleted file mode 100644 index bd2186323e..0000000000 --- a/files/it/web/api/node/textcontent/index.html +++ /dev/null @@ -1,139 +0,0 @@ ---- -title: Node.textContent -slug: Web/API/Node/textContent -tags: - - API - - Command API - - DOM - - Proprietà - - Referenza -translation_of: Web/API/Node/textContent -original_slug: Web/API/Element/textContent ---- -
{{APIRef("DOM")}}
- -

La proprietà textContent dell'interfaccia {{domxref("Node")}} rappresenta il contenuto del testo di un nodo e dei suoi discendenti.

- -
-

Note: textContent e {{domxref("HTMLElement.innerText")}} sono facilmente confusi, ma i due sono diversi in modi molto importanti.

-
- -

Sintassi

- -
var text = Node.textContent;
-Node.textContent = string;
-
- -

Valore di ritorno

- -

Una stringa o null.

- -

Descrizione

- -

Quando ottieni questa proprietà:

- - - -

L'impostazione di textContent su un nodo rimuove tutti i figli del nodo e li sostituisce con un singolo nodo di testo con il valore di stringa specificato.

- -

Differenze da innerText

- -

Non lasciarti confondere dalle differenze tra Node.textContent e {{domxref("HTMLElement.innerText")}}. Anche se i nomi sembrano simili, ci sono differenze importanti:

- - - -

Differenze da innerHTML

- -

{{domxref("Element.innerHTML")}} restituisce HTML, come indica il nome. A volte le persone usano innerHTML per recuperare o scrivere testo all'interno di un elemento, ma textContent ha prestazioni migliori perché il suo valore non viene analizzato come HTML. Inoltre, l'utilizzo di textContent può impedire gli attacchi XSS.

- -

Esempi

- -

Dato questo codice HTML:

- -
<div id="divA">Questo è <span>un</span> testo!</div>
- -

...puoi usare textContent per ottenere il contenuto del testo dell'elemento:

- -
let text = document.getElementById('divA').textContent;
-// La variabile text è ora: "Questo è un testo!"
- -

...o imposta il contenuto del testo dell'elemento:

- -
document.getElementById('divA').textContent = 'Questo testo è diverso!';
-// L'HTML per divA è ora:
-// <div id="divA">Questo testo è diverso!</div>
-
- -

Polyfill per IE8

- -
// Source: Eli Grey @ https://eligrey.com/blog/post/textcontent-in-ie8
-if (Object.defineProperty
-  && Object.getOwnPropertyDescriptor
-  && Object.getOwnPropertyDescriptor(Element.prototype, "textContent")
-  && !Object.getOwnPropertyDescriptor(Element.prototype, "textContent").get) {
-  (function() {
-    var innerText = Object.getOwnPropertyDescriptor(Element.prototype, "innerText");
-    Object.defineProperty(Element.prototype, "textContent",
-     // Passare innerText o innerText.get direttamente non funziona,
-     // è richiesta la funzione wrapper.
-     {
-       get: function() {
-         return innerText.get.call(this);
-       },
-       set: function(s) {
-         return innerText.set.call(this, s);
-       }
-     }
-   );
-  })();
-}
-
- -

Compatibilità con i browser

- - - -

{{Compat("api.Node.textContent")}}

- -

Specifiche

- - - - - - - - - - - - - - - - - - - - - - - - -
SpecificaStatoCommento
{{SpecName('DOM WHATWG','#dom-node-textcontent','Node.textContent')}}{{Spec2('DOM WHATWG')}}Nessun cambiamento vs. DOM4
{{SpecName('DOM4','#dom-node-textcontent','Node.textContent')}}{{Spec2('DOM4')}}
{{SpecName('DOM3 Core','core.html#Node3-textContent','Node.textContent')}}{{Spec2('DOM3 Core')}}Introdotto
- -

Vedi anche

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