From 74f1c3c85cf4f0ff1cc631d1320ed90c404c6ed7 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Sun, 11 Jul 2021 13:02:49 -0400 Subject: delete conflicting/orphaned docs in ru (#1426) --- .../ru/orphaned/web/api/abstractworker/index.html | 96 --------- .../web/api/ambient_light_events/index.html | 63 ------ .../orphaned/web/api/body/arraybuffer/index.html | 91 --------- files/ru/orphaned/web/api/body/formdata/index.html | 60 ------ files/ru/orphaned/web/api/body/index.html | 100 ---------- files/ru/orphaned/web/api/body/json/index.html | 75 -------- files/ru/orphaned/web/api/childnode/index.html | 78 -------- .../orphaned/web/api/childnode/remove/index.html | 91 --------- .../web/api/childnode/replacewith/index.html | 114 ----------- .../api/document_object_model/events/index.html | 81 -------- .../web/api/element/currentstyle/index.html | 51 ----- .../web/api/elementcssinlinestyle/style/index.html | 79 -------- .../web/api/htmlhyperlinkelementutils/index.html | 179 ----------------- .../api/htmlorforeignelement/dataset/index.html | 115 ----------- .../api/htmlorforeignelement/tabindex/index.html | 87 --------- .../basic_concepts_behind_indexeddb/index.html | 214 --------------------- .../orphaned/web/api/localmediastream/index.html | 23 --- .../orphaned/web/api/node/getuserdata/index.html | 64 ------ files/ru/orphaned/web/api/notation/index.html | 53 ----- .../orphaned/web/api/parentnode/append/index.html | 135 ------------- .../web/api/parentnode/children/index.html | 144 -------------- .../api/parentnode/firstelementchild/index.html | 150 --------------- files/ru/orphaned/web/api/parentnode/index.html | 91 --------- .../web/api/parentnode/lastelementchild/index.html | 162 ---------------- .../orphaned/web/api/parentnode/prepend/index.html | 134 ------------- .../getdefaulticeservers/index.html | 57 ------ .../orphaned/web/api/serviceworkerstate/index.html | 47 ----- .../checking_authenticity_with_password/index.html | 34 ---- 28 files changed, 2668 deletions(-) delete mode 100644 files/ru/orphaned/web/api/abstractworker/index.html delete mode 100644 files/ru/orphaned/web/api/ambient_light_events/index.html delete mode 100644 files/ru/orphaned/web/api/body/arraybuffer/index.html delete mode 100644 files/ru/orphaned/web/api/body/formdata/index.html delete mode 100644 files/ru/orphaned/web/api/body/index.html delete mode 100644 files/ru/orphaned/web/api/body/json/index.html delete mode 100644 files/ru/orphaned/web/api/childnode/index.html delete mode 100644 files/ru/orphaned/web/api/childnode/remove/index.html delete mode 100644 files/ru/orphaned/web/api/childnode/replacewith/index.html delete mode 100644 files/ru/orphaned/web/api/document_object_model/events/index.html delete mode 100644 files/ru/orphaned/web/api/element/currentstyle/index.html delete mode 100644 files/ru/orphaned/web/api/elementcssinlinestyle/style/index.html delete mode 100644 files/ru/orphaned/web/api/htmlhyperlinkelementutils/index.html delete mode 100644 files/ru/orphaned/web/api/htmlorforeignelement/dataset/index.html delete mode 100644 files/ru/orphaned/web/api/htmlorforeignelement/tabindex/index.html delete mode 100644 files/ru/orphaned/web/api/indexeddb_api/basic_concepts_behind_indexeddb/index.html delete mode 100644 files/ru/orphaned/web/api/localmediastream/index.html delete mode 100644 files/ru/orphaned/web/api/node/getuserdata/index.html delete mode 100644 files/ru/orphaned/web/api/notation/index.html delete mode 100644 files/ru/orphaned/web/api/parentnode/append/index.html delete mode 100644 files/ru/orphaned/web/api/parentnode/children/index.html delete mode 100644 files/ru/orphaned/web/api/parentnode/firstelementchild/index.html delete mode 100644 files/ru/orphaned/web/api/parentnode/index.html delete mode 100644 files/ru/orphaned/web/api/parentnode/lastelementchild/index.html delete mode 100644 files/ru/orphaned/web/api/parentnode/prepend/index.html delete mode 100644 files/ru/orphaned/web/api/rtcpeerconnection/getdefaulticeservers/index.html delete mode 100644 files/ru/orphaned/web/api/serviceworkerstate/index.html delete mode 100644 files/ru/orphaned/web/api/web_crypto_api/checking_authenticity_with_password/index.html (limited to 'files/ru/orphaned/web/api') diff --git a/files/ru/orphaned/web/api/abstractworker/index.html b/files/ru/orphaned/web/api/abstractworker/index.html deleted file mode 100644 index 24a8af3b19..0000000000 --- a/files/ru/orphaned/web/api/abstractworker/index.html +++ /dev/null @@ -1,96 +0,0 @@ ---- -title: AbstractWorker -slug: orphaned/Web/API/AbstractWorker -tags: - - API - - AbstractWorker - - Interface - - SharedWorker - - Web Workers - - Web Workers API - - Worker - - Абстрактный - - Интерфейс -translation_of: Web/API/AbstractWorker -original_slug: Web/API/AbstractWorker ---- -
{{ APIRef("Web Workers API") }}
- -
Интерфейс AbstractWorker (абстрактный воркер) , как часть Web Workers API - это абстрактный интерфейс, который определяет общие свойства и методы для всех типов воркеров: для базового {{domxref("Worker")}} и также для {{domxref("ServiceWorker")}} и {{domxref("SharedWorker")}}. Вы напрямую не взаимодействует с AbstractWorker, как и с абстрактным классом.
- -

Свойства

- -

Интерфейс AbstractWorker не наследует никаких свойств

- -

Обработчики событий

- -
-
{{domxref("AbstractWorker.onerror")}}
-
{{ domxref("EventListener") }}, который вызывается каждый раз, когда {{domxref("ErrorEvent")}} с типом error всплывает через воркер.
-
- -

Методы

- -

Интерфейс AbstractWorker не наследует и не реализует никаких свойств

- -

Пример

- -

Прямого использования AbstractWorker не будет в коде, так как это абстрактный интерфейс. Вместо этого, взаимодействие будет происходить либо с {{domxref("Worker")}}, либо с {{domxref("SharedWorker")}}, оба из которых наследуют свойства от AbstractWorker.

- -

Ниже фрагмент кода, который демонстрирует создание нового Worker с помощью конструктора {{domxref("Worker.Worker", "Worker()")}}; ещё здесь показан способ как послать сообщению воркеру.

- -
var myWorker = new Worker('worker.js');
-
-first.onchange = function() {
-  myWorker.postMessage([first.value, second.value]);
-  console.log('Message posted to worker');
-}
- -

Код воркера загружается из файла "worker.js". В данном коде предполагается, что есть элемент {{HTMLElement("input")}}, его определяет переменная first. Для события {{domxref("change")}} элемента создаётся обработчик, поэтому когда пользователь изменяет значение для first, отправляется сообщение в воркер для уведомления его об данных изменениях.

- -

Вы можете найти больше примеров в репозитории MDN Web Docs на GitHub:

- - - -

Спецификации

- - - - - - - - - - - - - - - - - - - - - -
СпецификацияСтатусКомментарий
{{SpecName("HTML WHATWG", "#abstractworker", "AbstractWorker")}}{{Spec2("HTML WHATWG")}}Без изменений {{SpecName("Web Workers")}}.
{{SpecName("Web Workers", "#the-abstractworker-abstract-interface", "AbstractWorker")}}{{Spec2("Web Workers")}}Начальное определение.
- -

Совместимость с браузерами

- -
- - -

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

-
- -

Смотрите также

- - diff --git a/files/ru/orphaned/web/api/ambient_light_events/index.html b/files/ru/orphaned/web/api/ambient_light_events/index.html deleted file mode 100644 index 9cacc1fffa..0000000000 --- a/files/ru/orphaned/web/api/ambient_light_events/index.html +++ /dev/null @@ -1,63 +0,0 @@ ---- -title: Ambient Light Events -slug: orphaned/Web/API/Ambient_Light_Events -tags: - - Освещённость -translation_of: Web/API/Ambient_Light_Events -original_slug: Web/API/Ambient_Light_Events ---- -
{{DefaultAPISidebar("Ambient Light Events")}}{{SeeCompatTable}}
- -

События "окружающего света" -  удобный способ уведомить веб-страницу или приложение о каком-либо изменении интенсивности света. Это позволяет им реагировать на такое изменение, например, путём изменения цветового контраста пользовательского интерфейса (UI) или путём изменения экспозиции, необходимой для фотографирования.

- -

Световые события

- -

Когда датчик света устройства обнаруживает изменение уровня освещённости, он уведомляет браузер об этом изменении. Когда браузер получает такое уведомление, он вызывает {{domxref("DeviceLightEvent")}} событие, которое предоставляет информацию о точной интенсивности света.

- -

Это событие может быть захвачено на уровне объектом окна, используя метод {{domxref("EventTarget.addEventListener","addEventListener")}}  (используя имя события {{event("devicelight")}} ) или путём присоединения обработчика событий к свойству {{domxref("window.ondevicelight")}}.

- -

После того, как захвачен объект события даёт доступ к интенсивности света, выраженного в lux через свойство {{domxref("DeviceLightEvent.value")}}.

- -

Пример

- -
window.addEventListener('devicelight', function(event) {
-  var html = document.getElementsByTagName('html')[0];
-
-  if (event.value < 50) {
-    html.classList.add('darklight');
-    html.classList.remove('brightlight');
-  } else {
-    html.classList.add('brightlight');
-    html.classList.remove('darklight');
-  }
-});
- -

Характеристики

- - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName("AmbientLight", "", "Ambient Light Events")}}{{Spec2("AmbientLight")}}Initial definition
- -

Поддержка браузерами

- -

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

- -

Смотрите также

- - diff --git a/files/ru/orphaned/web/api/body/arraybuffer/index.html b/files/ru/orphaned/web/api/body/arraybuffer/index.html deleted file mode 100644 index 8c2e092cf3..0000000000 --- a/files/ru/orphaned/web/api/body/arraybuffer/index.html +++ /dev/null @@ -1,91 +0,0 @@ ---- -title: Body.arrayBuffer() -slug: orphaned/Web/API/Body/arrayBuffer -tags: - - API - - Экспериментальный - - справочник -translation_of: Web/API/Body/arrayBuffer -original_slug: Web/API/Body/arrayBuffer ---- -
{{APIRef("Fetch")}}
- -

Метод arrayBuffer() из примеси(mixin) {{domxref("Body")}} берёт поток(stream) {{domxref("Response")}} и читает его до завершения. Он возвращает промис, который будет успешно завершён с помощью {{domxref("ArrayBuffer")}}.

- -

Синтаксис

- -
response.arrayBuffer().then(function(buffer) {
-  // можно сделать что либо с буфером
-});
- -

Параметры

- -

Нат параметров.

- -

Возвращаемое значение

- -

Промис, который содержит {{domxref("ArrayBuffer")}}.

- -

Пример

- -

В нашем примере живой загрузки с array buffer есть кнопка Play. При нажатии на кнопку вызывается функция getData(). Стоит учесть что до проигрывания аудио файл будет скачан целиком. Если вам необходимо начать воспроизведение файла ogg во время загрузки (стримить аудио) - то лучше рассмотреть  {{domxref("HTMLAudioElement")}}:

- -
new Audio(music.ogg).play()
-
- -

В функции getData() мы создаём новый запрос используя конструктор {{domxref("Request.Request")}}, после этого используем его чтобы загрузить OGG звук. Мы также используем {{domxref("AudioContext.createBufferSource")}} чтобы создать ресурс аудиобуффера. При успешном завершении запроса, мы считываем {{domxref("ArrayBuffer")}} из ответа используя arrayBuffer(), декодируем аудио с помощью {{domxref("AudioContext.decodeAudioData")}}, устанавливаем раскодированные данные как ресурс аудио буфера (source.buffer), затем используем данные этого ресурса в  {{domxref("AudioContext.destination")}}.

- -

Когда функция getData() заканчивает своё выполнение, мы стартуем проигрывание аудио ресурса функцией start(0), потом блокируем кнопку проигрывания для предотвращения повторного проигрывания (это может привести к ошибкам)

- -
function getData() {
-  source = audioCtx.createBufferSource();
-
-  var myRequest = new Request('viper.ogg');
-
-  fetch(myRequest).then(function(response) {
-    return response.arrayBuffer();
-  }).then(function(buffer) {
-    audioCtx.decodeAudioData(buffer, function(decodedData) {
-      source.buffer = decodedData;
-      source.connect(audioCtx.destination);
-    });
-  });
-};
-
-// навешиваем обработчики старт и стоп на кнопку
-play.onclick = function() {
-  getData();
-  source.start(0);
-  play.setAttribute('disabled', 'disabled');
-}
- -

Спецификация

- - - - - - - - - - - - - - -
СпецификацияСтатусКомментарии
{{SpecName('Fetch','#dom-body-arraybuffer','arrayBuffer()')}}{{Spec2('Fetch')}} 
- -

Поддержка браузерами

- - - -

{{Compat("api.Body.arrayBuffer")}}

- -

Смотрите также

- - diff --git a/files/ru/orphaned/web/api/body/formdata/index.html b/files/ru/orphaned/web/api/body/formdata/index.html deleted file mode 100644 index 5e04b96274..0000000000 --- a/files/ru/orphaned/web/api/body/formdata/index.html +++ /dev/null @@ -1,60 +0,0 @@ ---- -title: Body.formData() -slug: orphaned/Web/API/Body/formData -translation_of: Web/API/Body/formData -original_slug: Web/API/Body/formData ---- -
{{APIRef("Fetch")}}
- -

Метод formData() из {{domxref("Body")}} принимает поток ответа {{domxref("Response")}} и считывает его до завершения. Он возвращает промис, который разрешается с помощью объекта {{domxref("FormData")}}.

- -
-

Примечание:  Это в основном относится к service workers. Если пользователь отправляет форму а service worker перехватывает запрос,  можно, например, вызвать formData() чтобы получить набор данных в формате ключ-значение, изменить некоторые поля, а затем отправить форму на сервер, или использовать её локально.

-
- -

Синтаксис

- -
response.formData()
-.then(function(formdata) {
-  // do something with your formdata
-});
- -

Параметры

- -

Нет.

- -

Возвращаемое значение

- -

{{domxref("Promise")}} которое разрешается с помощью объекта {{domxref("FormData")}}.

- -

Пример

- -

Нужно добавить.

- -

Спецификации

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('Fetch','#dom-body-formdata','formData()')}}{{Spec2('Fetch')}} 
- -

Браузерная совместимость

-

{{Compat("api.Body.formData")}}

- -

Также смотрите

- - diff --git a/files/ru/orphaned/web/api/body/index.html b/files/ru/orphaned/web/api/body/index.html deleted file mode 100644 index 0794ac997e..0000000000 --- a/files/ru/orphaned/web/api/body/index.html +++ /dev/null @@ -1,100 +0,0 @@ ---- -title: Body -slug: orphaned/Web/API/Body -tags: - - API - - BODY - - Experimental - - Fetch - - Fetch API - - Interface - - NeedsTranslation - - Reference - - TopicStub - - request -translation_of: Web/API/Body -original_slug: Web/API/Body ---- -
{{ APIRef("Fetch") }}
- -

The Body {{glossary("mixin")}} of the Fetch API represents the body of the response/request, allowing you to declare what its content type is and how it should be handled.

- -

Body is implemented by both {{domxref("Request")}} and {{domxref("Response")}}. This provides these objects with an associated body (a stream), a used flag (initially unset), and a MIME type (initially the empty byte sequence).

- -

Properties

- -
-
{{domxref("Body.body")}} {{readonlyInline}}
-
A simple getter used to expose a {{domxref("ReadableStream")}} of the body contents.
-
{{domxref("Body.bodyUsed")}} {{readonlyInline}}
-
A {{domxref("Boolean")}} that indicates whether the body has been read.
-
- -

Methods

- -
-
{{domxref("Body.arrayBuffer()")}}
-
Takes a {{domxref("Response")}} stream and reads it to completion. It returns a promise that resolves with an {{domxref("ArrayBuffer")}}.
-
{{domxref("Body.blob()")}}
-
Takes a {{domxref("Response")}} stream and reads it to completion. It returns a promise that resolves with a {{domxref("Blob")}}.
-
{{domxref("Body.formData()")}}
-
Takes a {{domxref("Response")}} stream and reads it to completion. It returns a promise that resolves with a {{domxref("FormData")}} object.
-
{{domxref("Body.json()")}}
-
Takes a {{domxref("Response")}} stream and reads it to completion. It returns a promise that resolves with the result of parsing the body text as {{jsxref("JSON")}}.
-
{{domxref("Body.text()")}}
-
Takes a {{domxref("Response")}} stream and reads it to completion. It returns a promise that resolves with a {{domxref("USVString")}} (text). The response is always decoded using UTF-8.
-
- -

Examples

- -

The example below uses a simple fetch call to grab an image and display it in an {{htmlelement("img")}} tag. You'll notice that since we are requesting an image, we need to run {{domxref("Body.blob","Body.blob()")}} ({{domxref("Response")}} implements body) to give the response its correct MIME type.

- -

HTML Content

- -
<img class="my-image" src="https://wikipedia.org/static/images/project-logos/frwiki-1.5x.png">
-
- -

JS Content

- -
var myImage = document.querySelector('.my-image');
-fetch('https://upload.wikimedia.org/wikipedia/commons/7/77/Delete_key1.jpg')
-	.then(res => res.blob())
-	.then(res => {
-		var objectURL = URL.createObjectURL(res);
-		myImage.src = objectURL;
-});
- -

{{ EmbedLiveSample('Examples', '100%', '250px') }}

- -

Specifications

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('Fetch','#body-mixin','Body')}}{{Spec2('Fetch')}} 
- -

Browser compatibility

- - - -

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

- -

See also

- - - -

 

diff --git a/files/ru/orphaned/web/api/body/json/index.html b/files/ru/orphaned/web/api/body/json/index.html deleted file mode 100644 index ae8657f9bb..0000000000 --- a/files/ru/orphaned/web/api/body/json/index.html +++ /dev/null @@ -1,75 +0,0 @@ ---- -title: Body.json() -slug: orphaned/Web/API/Body/json -tags: - - Fetch-запрос - - Справка - - метод -translation_of: Web/API/Body/json -original_slug: Web/API/Body/json ---- -
{{APIRef("Fetch")}}
- -

Метод json() , определён на миксине {{domxref("Body")}}, который включён в объектах Request и Response, принимает и читает тело {{domxref("Response")}} stream. Возвращает промис, который, когда ответ будет получен, вызовет колбэк с результатом парсинга тела ответа в {{jsxref("JSON")}} объект.

- -

Синтаксис

- -
response.json().then(function(data) {
-  // do something with your data
-});
- -

Аргументы

- -

Нет.

- -

Возвращает

- -

Промис, который, когда ответ будет получен, вызовет колбэк с результатом парсинга тела ответа в JSON объект. Этим может быть что угодно, что может быть представлено как JSON объект — объект, массив, строка, число...

- -

Пример

- -

В нашем fetch json примере (запустите fetch json live), мы создаём новый запрос, используя {{domxref("Request.Request")}} конструктор, в последствии мы используем его (запрос) для получения .json файла. Когда fetch запрос будет выполнен, мы прочтём и спарсим данные, используя json(), а далее вставим значения из полученного объекта в list элементы списка для отображения данных по нашему продукту.

- -
var myList = document.querySelector('ul');
-
-var myRequest = new Request('products.json');
-
-fetch(myRequest)
-  .then(function(response) { return response.json(); })
-  .then(function(data) {
-    for (var i = 0; i < data.products.length; i++) {
-      var listItem = document.createElement('li');
-      listItem.innerHTML = '<strong>' + data.products[i].Name + '</strong> can be found in ' +
-                           data.products[i].Location +
-                           '. Cost: <strong>£' + data.products[i].Price + '</strong>';
-      myList.appendChild(listItem);
-    }
-  });
- -

Спецификации

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('Fetch','#dom-body-json','json()')}}{{Spec2('Fetch')}} 
- -

Совместимость с браузерами

-

{{Compat("api.Body.json")}}

- -

Смотрите также

- - diff --git a/files/ru/orphaned/web/api/childnode/index.html b/files/ru/orphaned/web/api/childnode/index.html deleted file mode 100644 index e150876787..0000000000 --- a/files/ru/orphaned/web/api/childnode/index.html +++ /dev/null @@ -1,78 +0,0 @@ ---- -title: ChildNode -slug: orphaned/Web/API/ChildNode -tags: - - API - - DOM - - Experimental - - Expérimental(2) - - NeedsTranslation - - TopicStub -translation_of: Web/API/ChildNode -original_slug: Web/API/ChildNode ---- -

{{APIRef("DOM")}}

- -

Интерфейс ChildNode  содержит методы, специфичные для объектов  {{domxref("Node")}}, которые имеют родителя.

- -

ChildNode это просто интерфейс и ни один объект этого типа не может быть создан; он реализуется объектами {{domxref("Element")}}, {{domxref("DocumentType")}} и {{domxref("CharacterData")}}.

- -

Properties

- -

There is neither inherited, nor specific property.

- -

Methods

- -

Отсутствуют унаследованные методы.

- -
-
{{domxref("ChildNode.remove()")}} {{experimental_inline}}
-
Удаляет данный ChildNode из списка потомков его родителя.
-
{{domxref("ChildNode.before()")}} {{experimental_inline}}
-
Inserts a set of {{domxref("Node")}} or {{domxref("DOMString")}} objects in the children list of this ChildNode's parent, just before this ChildNode. {{domxref("DOMString")}} objects are inserted as equivalent {{domxref("Text")}} nodes.
-
{{domxref("ChildNode.after()")}} {{experimental_inline}}
-
Inserts a set of {{domxref("Node")}} or {{domxref("DOMString")}} objects in the children list of this ChildNode's parent, just after this ChildNode. {{domxref("DOMString")}} objects are inserted as equivalent {{domxref("Text")}} nodes.
-
{{domxref("ChildNode.replaceWith()")}} {{experimental_inline}}
-
Заменяет ChildNode  в списке потомков его родителя набором {{domxref("Node")}} или {{domxref("DOMString")}} объектов. {{domxref("DOMString")}} objects are inserted as equivalent {{domxref("Text")}} nodes.
-
- -

Specifications

- - - - - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('DOM WHATWG', '#interface-childnode', 'ChildNode')}}{{Spec2('DOM WHATWG')}}Интерфейс ElementTraversal  разделён на {{domxref("ParentNode")}} и ChildNode. Свойства previousElementSibling и nextElementSibling теперь определены в последнем.
- The {{domxref("CharacterData")}} and {{domxref("DocumentType")}} implemented the new interfaces.
- Добавлены методы remove(), before(), after() и replaceWith().
{{SpecName('Element Traversal', '#interface-elementTraversal', 'ElementTraversal')}}{{Spec2('Element Traversal')}}Added the initial definition of its properties to the ElementTraversal pure interface and use it on {{domxref("Element")}}.
- -

Polyfill

- -

External on github: childNode.js

- -

Browser compatibility

- -

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

- -

See also

- - diff --git a/files/ru/orphaned/web/api/childnode/remove/index.html b/files/ru/orphaned/web/api/childnode/remove/index.html deleted file mode 100644 index 2f39c5641a..0000000000 --- a/files/ru/orphaned/web/api/childnode/remove/index.html +++ /dev/null @@ -1,91 +0,0 @@ ---- -title: Node.remove() -slug: orphaned/Web/API/ChildNode/remove -translation_of: Web/API/ChildNode/remove -original_slug: Web/API/ChildNode/remove ---- -

Метод Node.remove() удаляет узел из дерева DOM

- -

 

- -

То, что элемент удалён из DOM, ещё не значит, что он удалён совсем! 

- -

Он остался объектом и исчезнет только тогда, когда исчезнут все ссылки на него.

- -

 

- -

Синтаксис

- -
Node.remove();
-
- - - -

Пример

- -

Использование remove()

- -
<div id="box">
-   <div id="one"></div>
-   <div id="two"></div>
-</div>
- -
var elem = document.querySelector("#one");
-elem.remove();
-alert(document.querySelector("#box").innerHTML); //Исчез блок #one
-alert(elem); //Но как видите, сам объект ещё жив
- -

Полифил

- -

Можно создать полифил для IE 9 и выше, используя следующий код:

- -
(function() {
-  var arr = [window.Element, window.CharacterData, window.DocumentType];
-  var args = [];
-
-  arr.forEach(function (item) {
-    if (item) {
-      args.push(item.prototype);
-    }
-  });
-
-  // from:https://github.com/jserz/js_piece/blob/master/DOM/ChildNode/remove()/remove().md
-  (function (arr) {
-    arr.forEach(function (item) {
-      if (item.hasOwnProperty('remove')) {
-        return;
-      }
-      Object.defineProperty(item, 'remove', {
-        configurable: true,
-        enumerable: true,
-        writable: true,
-        value: function remove() {
-          this.parentNode.removeChild(this);
-        }
-      });
-    });
-  })(args);
-})();
- -

Спецификация

- - - - - - - - - - - - - - -
СпецификацияСтатусКомментарий
{{SpecName('DOM WHATWG', '#dom-childnode-remove', 'ChildNode.remove')}}{{Spec2('DOM WHATWG')}}Initial definition.
- -

Поддержка браузерами

- -

{{Compat("api.ChildNode.remove")}}

diff --git a/files/ru/orphaned/web/api/childnode/replacewith/index.html b/files/ru/orphaned/web/api/childnode/replacewith/index.html deleted file mode 100644 index 0ee9091325..0000000000 --- a/files/ru/orphaned/web/api/childnode/replacewith/index.html +++ /dev/null @@ -1,114 +0,0 @@ ---- -title: ChildNode.replaceWith() -slug: orphaned/Web/API/ChildNode/replaceWith -translation_of: Web/API/ChildNode/replaceWith -original_slug: Web/API/ChildNode/replaceWith ---- -
{{APIRef("DOM")}}
- -

Метод ChildNode.replaceWith() заменяет ChildNode в списке детей их родителя множеством {{domxref("Node")}} или {{domxref("DOMString")}} объектов. {{domxref("DOMString")}} объекты вставляются как эквивалент нод {{domxref("Text")}}.

- -

Синтаксис

- -
[Throws, Unscopable]
-void ChildNode.replaceWith((Node or DOMString)... nodes);
-
- -

Параметры

- -
-
nodes
-
Множество заменяемых {{domxref("Node")}} или {{domxref("DOMString")}} объектов.
-
- -

Исключения

- - - -

Примеры

- -

Использование replaceWith()

- -
var parent = document.createElement("div");
-var child = document.createElement("p");
-parent.appendChild(child);
-var span = document.createElement("span");
-
-child.replaceWith(span);
-
-console.log(parent.outerHTML);
-// "<div><span></span></div>"
-
- -

ChildNode.replaceWith() не выполним

- -

Метод replaceWith() не входит в область видимости оператора with. Смотрите {{jsxref("Symbol.unscopables")}} для дополнительной информации.

- -
with(node) {
-  replaceWith("foo");
-}
-// ReferenceError: replaceWith is not defined 
- -

Полифил

- -

Вы можете заполнить метод replaceWith() в Internet Explorer 10+ и выше следующим кодом:

- -
function ReplaceWithPolyfill() {
-  'use-strict'; // For safari, and IE > 10
-  var parent = this.parentNode, i = arguments.length, currentNode;
-  if (!parent) return;
-  if (!i) // if there are no arguments
-    parent.removeChild(this);
-  while (i--) { // i-- decrements i and returns the value of i before the decrement
-    currentNode = arguments[i];
-    if (typeof currentNode !== 'object'){
-      currentNode = this.ownerDocument.createTextNode(currentNode);
-    } else if (currentNode.parentNode){
-      currentNode.parentNode.removeChild(currentNode);
-    }
-    // the value of "i" below is after the decrement
-    if (!i) // if currentNode is the first argument (currentNode === arguments[0])
-      parent.replaceChild(currentNode, this);
-    else // if currentNode isn't the first
-      parent.insertBefore(currentNode, this.nextSibling);
-  }
-}
-if (!Element.prototype.replaceWith)
-    Element.prototype.replaceWith = ReplaceWithPolyfill;
-if (!CharacterData.prototype.replaceWith)
-    CharacterData.prototype.replaceWith = ReplaceWithPolyfill;
-if (!DocumentType.prototype.replaceWith)
-    DocumentType.prototype.replaceWith = ReplaceWithPolyfill;
- -

Спецификация

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('DOM WHATWG', '#dom-childnode-replacewith', 'ChildNode.replacewith()')}}{{Spec2('DOM WHATWG')}}Initial definition.
- -

Совместимость с браузерами

- - - -

{{Compat("api.ChildNode.replaceWith")}}

- -

Смотрите также

- - diff --git a/files/ru/orphaned/web/api/document_object_model/events/index.html b/files/ru/orphaned/web/api/document_object_model/events/index.html deleted file mode 100644 index 3bdc87fe96..0000000000 --- a/files/ru/orphaned/web/api/document_object_model/events/index.html +++ /dev/null @@ -1,81 +0,0 @@ ---- -title: Events and the DOM -slug: orphaned/Web/API/Document_Object_Model/Events -translation_of: Web/API/Document_Object_Model/Events -original_slug: Web/API/Document_Object_Model/Events ---- -

Вступление

- -

Вступление

- -

В этой главе описывается модель событий DOM. Топ скрыть Интерфейс сам по себе описано, а также интерфейсы для регистрации событий на узлах в DOM, Также а обработчики события Главного , Также а Несколько больше Примеры, которые показывают, как Различные интерфейсы связаны друг события Главного с другом.

- -

Существует отличная диаграмма, которая чётко объясняет события трёх этапов через DOM в проекте DOM Level 3 Events .

- -

Также см. Пример 5: Распространение событий в главе «Примеры» для более подробного примера.

- -

Регистрация обработчиков событий

- -

Есть 3 способа регистрации обработанных событий для элемента DOM.

- -

EventTarget.addEventListener

- -
// Предполагая, что myButton является элементом кнопки
-myButton.addEventListener ('click', greet, false);
-function greet (event) {
-    // распечатать и посмотреть на объект события
-    // всегда печатать аргументы в случае пропуска любых других аргументов
-    console.log ('greet:', arguments);
-    оповещение («Привет, мир»);
-}
-
- -

Это метод, который вы должны использовать на современных веб-страницах.

- -

Примечание. Internet Explorer 6-8 не поддерживает этот метод, предлагая аналогичный {{domxref ("EventTarget.attachEvent")}} API. Для кросс-браузерной совместимости используйте одну из множества доступных библиотек JavaScript.

- -

Дополнительную информацию можно найти на справочной странице {{domxref ("EventTarget.addEventListener")}}.

- -

Атрибут HTML

- -
<button onclick = "alert ('Hello world!')">
-
- -

Код JavaScript в атрибуте передаётся объекту Event через eventпараметр. Возвращаемое значение обрабатывается особым образом, описанным в спецификации HTML .

- -

Этого пути следует избегать. Это делает разметку больше и менее читаемой. Проблемы содержания / структуры и поведения плохо разделены, что затрудняет поиск ошибки.

- -

Свойства элемента DOM

- -
// Предполагая, что myButton является элементом кнопки
-myButton.onclick = function(event){alert('Hello world');};
-
- -

Функция может быть определена для получения eventпараметра. Возвращаемое значение обрабатывается особым образом, описанным в спецификации HTML .

- -

Проблема этого метода в том, что для каждого элемента и для каждого события может быть установлен только один обработчик.

- -

Доступ к интерфейсам событий

- -

Обработчики событий могут быть присоединены к различным объектам, включая элементы DOM, документ, объект окна и т. Д. Когда происходит событие, объект события создаётся и последовательно передаётся обработчикам события.

- -

Интерфейс {{domxref ("Event")}} доступен из функции-обработчика через объект события, переданный в качестве первого аргумента. В следующем простом примере показано, как объект события передаётся в функцию-обработчик события и может использоваться из одной такой функции.

- -
function print(evt) {
-  // параметру evt автоматически назначается объект события
-  // позаботимся о различиях в console.log и alert
-  console.log('print:', evt);
-  alert(evt);
-}
-// любая функция должна иметь подходящее имя, это то, что называется семантическим
-table_el.onclick = print; 
-
- - - - diff --git a/files/ru/orphaned/web/api/element/currentstyle/index.html b/files/ru/orphaned/web/api/element/currentstyle/index.html deleted file mode 100644 index f98340d418..0000000000 --- a/files/ru/orphaned/web/api/element/currentstyle/index.html +++ /dev/null @@ -1,51 +0,0 @@ ---- -title: Element.currentStyle -slug: orphaned/Web/API/Element/currentStyle -tags: - - API - - NeedsExample - - Non-standard - - Property -translation_of: Web/API/Element/currentStyle -original_slug: Web/API/Element/currentStyle ---- -

{{Non-standard_header}}

- -

Element.currentStyle является собственностью, похожей на стандартизированную {{DOMxRef("window.getComputedStyle()")}} method. Он доступен в старых версиях Microsoft Internet Explorer. Однако, он возвращает единицы, установленные в CSS в то время как window.getComputedStyle()возвращает значения в пикселях.

- -

Polyfill

- -
-

Эта polyfill возвращает значения в пикселях и, скорее всего, будет довольно медленным, так как оно должно называться {{domxref("window.getComputedStyle()")}} каждый раз, когда читается его значение.

-
- -
/* Любое авторское право посвящено Общественному достоянию.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-if (!("currentStyle" in Element.prototype)) {
-  Object.defineProperty(Element.prototype, "currentStyle", {
-    get: function() {
-      return window.getComputedStyle(this);
-    }
-  });
-}
-
- -

Спецификации

- -

Не входит ни в какие спецификации.

- -

Microsoft had a description on MSDN.

- -

Совместимость с браузерами

- -

{{Compat("api.Element.currentStyle")}}

- -

Смотрите также

- - - -
{{APIRef("DOM")}}
diff --git a/files/ru/orphaned/web/api/elementcssinlinestyle/style/index.html b/files/ru/orphaned/web/api/elementcssinlinestyle/style/index.html deleted file mode 100644 index 72bae0ee34..0000000000 --- a/files/ru/orphaned/web/api/elementcssinlinestyle/style/index.html +++ /dev/null @@ -1,79 +0,0 @@ ---- -title: HTMLElement.style -slug: orphaned/Web/API/ElementCSSInlineStyle/style -tags: - - API - - HTML DOM - - HTMLElement - - NeedsBrowserAgnosticism - - NeedsBrowserCompatibility - - NeedsMarkupWork - - NeedsSpecTable - - Свойство - - Ссылки -translation_of: Web/API/ElementCSSInlineStyle/style -original_slug: Web/API/ElementCSSInlineStyle/style ---- -

Кратко

- -
-
{{ APIRef("HTML DOM") }}
-
- -

Свойство HTMLElement.style используется для получения и установки инлайновых стилей. При получении возвращается объект CSSStyleDeclaration , который содержит список из всех свойств стилей для этого элемента с значениями заданными  для атрибутов , что определённы  в инлайновом стиле (см. атрибут стиля) элемента. См. CSS Properties Reference для получения списка CSS свойств применимых вместе со style.  

- -

Настройка стилей

- -

Свойство style имеет тот же приоритет (и выше) в каскаде CSS как и прямая декларация стиля через атрибут style, полезен для настройки стиля отдельного специфичного элемента.

- -

Стили не следует устанавливать непосредственно через свойство style (например elt.style = "color: blue;"), поскольку оно считается доступным только для чтения и атрибут style возвращает объект CSSStyleDeclaration который доступен только для чтения. Вместо этого стили могут быть установлены путём присвоения значений свойствам style. Для добавления определённых стилей для элемента без изменения других свойств стилей предпочтительно использовать отдельные свойства style (например elt.style.color = '...'). -При использовании
elt.style.cssText = '...' или elt.setAttribute('style','...') устанавливаются стили перезаписывая уже существующие. Обратите внимание, что имена свойств стилей задаются в camel-case а не в kebab-case elt.style.<property> (т.е., elt.style.fontSize, а не elt.style.font-size).

- -

Объявленные стили сбрасываются присваиванием значения null,
elt.style.color = null

- -

Примеры

- -
// Устанавливает несколько стилей в одном выражении
-elt.style.cssText = "color: blue; border: 1px solid black";
-// Или
-elt.setAttribute("style", "color:red; border: 1px solid blue;");
-
-// Устанавливает определённый стиль оставляя другие значения стиля нетронутыми
-elt.style.color = "blue";
- -

Получение стиль-информации

- -

Свойство style в основном не имеет пользы в части информации о стиле элемента, оно только олицетворяет собой набор CSS деклараций атрибутов style элемента, а не тех которые проистекают из стиль-правил откуда-либо ещё, таких как стилевые правила раздела {{HTMLElement("head")}}, или внешней таблицы стилей. Для получения значений всех CSS свойств элемента вы должны использовать вместо этого {{domxref("window.getComputedStyle()")}}.

- -
-
var div = document.getElementById("div1");
-div.style.marginTop = ".25in";
-
- -

Следующий код показывает имена всех свойств стиля, значений, заданных явно для элемента elt и унаследованных "рассчитанных" значений:

- -
var elt = document.getElementById("elementIdHere");
-var out = "";
-var st = elt.style;
-var cs = window.getComputedStyle(elt, null);
-for (x in st) {
-  out += "  " + x + " = '" + st[x] + "' > '" + cs[x] + "'\n";
-}
- -

Спецификация

- -

DOM Level 2 Style: ElementCSSInlineStyle.style

- -

CSSOM: ElementCSSInlineStyle

- -

Совместимость

- - - -

{{Compat("api.HTMLElement.style")}}

- -

Смотрите также

- - diff --git a/files/ru/orphaned/web/api/htmlhyperlinkelementutils/index.html b/files/ru/orphaned/web/api/htmlhyperlinkelementutils/index.html deleted file mode 100644 index 2ee02cdbfd..0000000000 --- a/files/ru/orphaned/web/api/htmlhyperlinkelementutils/index.html +++ /dev/null @@ -1,179 +0,0 @@ ---- -title: HTMLHyperlinkElementUtils -slug: orphaned/Web/API/HTMLHyperlinkElementUtils -tags: - - API - - Experimental - - Mixin - - NeedsTranslation - - TopicStub - - URL API -translation_of: Web/API/HTMLHyperlinkElementUtils -original_slug: Web/API/HTMLHyperlinkElementUtils ---- -

{{ApiRef("URL API")}}{{SeeCompatTable}}

- -

The HTMLHyperlinkElementUtils mixin defines utility methods and properties to work with {{domxref("HTMLAnchorElement")}} and {{domxref("HTMLAreaElement")}}. These utilities allow to deal with common features like URLs.

- -

There are no objects of this type, but several objects {{domxref("HTMLAnchorElement")}} and {{domxref("HTMLAreaElement")}} implement it.

- -

Properties

- -

This interface doesn't inherit any property.

- -
-
{{domxref("HTMLHyperlinkElementUtils.href")}}
-
Is a {{domxref("USVString")}} containing the whole URL.
-
{{domxref("HTMLHyperlinkElementUtils.protocol")}}
-
Is a {{domxref("USVString")}} containing the protocol scheme of the URL, including the final ':'.
-
{{domxref("HTMLHyperlinkElementUtils.host")}}
-
Is a {{domxref("USVString")}} containing the host, that is the hostname, and then, if the port of the URL is not empty (which can happen because it was not specified or because it was specified to be the default port of the URL's scheme), a ':', and the port of the URL.
-
{{domxref("HTMLHyperlinkElementUtils.hostname")}}
-
Is a {{domxref("USVString")}} containing the domain of the URL.
-
{{domxref("HTMLHyperlinkElementUtils.port")}}
-
Is a {{domxref("USVString")}} containing the port number of the URL.
-
{{domxref("HTMLHyperlinkElementUtils.pathname")}}
-
Is a {{domxref("USVString")}} containing an initial '/' followed by the path of the URL.
-
{{domxref("HTMLHyperlinkElementUtils.search")}}
-
Is a {{domxref("USVString")}} containing a '?' followed by the parameters of the URL.
-
{{domxref("HTMLHyperlinkElementUtils.hash")}}
-
Is a {{domxref("USVString")}} containing a '#' followed by the fragment identifier of the URL.
-
{{domxref("HTMLHyperlinkElementUtils.username")}}
-
Is a {{domxref("USVString")}} containing the username specified before the domain name.
-
{{domxref("HTMLHyperlinkElementUtils.password")}}
-
Is a {{domxref("USVString")}} containing the password specified before the domain name.
-
{{domxref("HTMLHyperlinkElementUtils.origin")}} {{readonlyInline}}
-
Returns a {{domxref("USVString")}} containing the origin of the URL, that is its scheme, its domain and its port.
-
- -

Methods

- -

This interface doesn't inherit any method.

- -
-
{{domxref("HTMLHyperlinkElementUtils.toString()")}}
-
Returns a {{domxref("DOMString")}} containing the whole URL. It is a synonym for {{domxref("HTMLHyperlinkElementUtils.href")}}, though it can't be used to modify the value.
-
- -

Specifications

- - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#htmlhyperlinkelementutils', 'HTMLHyperlinkElementUtils')}}{{Spec2('HTML WHATWG')}}Initial definition
- -

Browser compatibility

- -

{{ CompatibilityTable() }}

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatNo}} [1]{{CompatGeckoDesktop("22")}} [2]{{CompatNo}} [1]{{CompatNo}} [1]{{CompatNo}} [1]
username and password{{CompatUnknown}}{{CompatGeckoDesktop("26")}} [2]{{CompatNo}}{{CompatUnknown}}{{CompatUnknown}}
origin {{CompatVersionUnknown()}}{{CompatGeckoDesktop("26")}} [2]{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatNo}} [1]{{CompatNo}} [1]{{CompatGeckoMobile("22")}} [2]{{CompatNo}} [1]{{CompatNo}} [1]{{CompatNo}} [1]
username and password{{CompatUnknown}}{{CompatUnknown}}{{CompatGeckoMobile("26")}} [2]{{CompatNo}}{{CompatUnknown}}{{CompatUnknown}}
origin {{CompatUnknown}}{{CompatUnknown}}{{CompatGeckoMobile("26")}} [2]{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
-
- -

[1] Though not grouped in a single abstract interface, these methods are directly available on the interfaces that implement it, if this interface is supported.

- -

[2] This mixin was called URLUtils before Firefox 45, and was also implemented to other by other interfaces, like {{domxref("Location")}}. From Firefox 45, the other interfaces implements their own version of the properties and methods they need.

- -

See also

- - - -
-
 
-
diff --git a/files/ru/orphaned/web/api/htmlorforeignelement/dataset/index.html b/files/ru/orphaned/web/api/htmlorforeignelement/dataset/index.html deleted file mode 100644 index a0e0c95bcd..0000000000 --- a/files/ru/orphaned/web/api/htmlorforeignelement/dataset/index.html +++ /dev/null @@ -1,115 +0,0 @@ ---- -title: HTMLElement.dataset -slug: orphaned/Web/API/HTMLOrForeignElement/dataset -translation_of: Web/API/HTMLOrForeignElement/dataset -original_slug: Web/API/HTMLOrForeignElement/dataset ---- -

{{ APIRef("HTML DOM") }}

- -

Свойство HTMLElement.dataset предоставляет доступ как для чтения, так и для изменения всех пользовательских дата-атрибутов custom data attributes (data-*) , установленных у элемента. Это map of DOMString, одна запись для каждого пользовательского атрибута данных. Обратите внимание, свойство dataset доступно только для чтения. Для записи должны использоваться  его "свойства", которые представлены data-атрибутами. Также обратите внимание, что HTML data-атрибут и соответствующий ему DOM-dataset.property не имеют одно и то же имя, но они всегда похожи:

- - - -

Преобразование имён

- -

dash-style в camelCase: имя пользовательского дата-атрибута преобразуется в ключ для {{ domxref("DOMStringMap") }} по следующим правилам:

- - - -

camelCase в dash-style: обратное преобразование ключа в имя атрибута производится по следующим правилам:

- - - -

Ограничение в правилах гарантирует, что эти два преобразования являются обратными друг другу.

- -

Например, атрибуту data-abc-def соответствует ключ abcDef.

- -

Доступ к значениям

- - - -

Синтаксис

- - - -

Примеры

- -
<div id="user" data-id="1234567890" data-user="johndoe" data-date-of-birth>John Doe</div>
-
-let el = document.querySelector('#user');
-
-// el.id == 'user'
-// el.dataset.id === '1234567890'
-// el.dataset.user === 'johndoe'
-// el.dataset.dateOfBirth === ''
-
-el.dataset.dateOfBirth = '1960-10-03'; // set the DOB.
-
-// 'someDataAttr' in el.dataset === false
-el.dataset.someDataAttr = 'mydata';
-// 'someDataAttr' in el.dataset === true
-
- -

Specifications

- - - - - - - - - - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', "dom.html#dom-dataset", "HTMLElement.dataset")}}{{Spec2('HTML WHATWG')}}No change from latest snapshot, {{SpecName('HTML5.1')}}
{{SpecName('HTML5.1', "dom.html#dom-dataset", "HTMLElement.dataset")}}{{Spec2('HTML5.1')}}Snapshot of {{SpecName('HTML WHATWG')}}, no change from {{SpecName('HTML5 W3C')}}
{{SpecName('HTML5 W3C', "dom.html#dom-dataset", "HTMLElement.dataset")}}{{Spec2('HTML5 W3C')}}Snapshot of  {{SpecName('HTML WHATWG')}}, initial definition.
- -

Совместимость с браузерами

- -

{{Compat("api.HTMLElement.dataset")}}

- -

Смотрите также

- - diff --git a/files/ru/orphaned/web/api/htmlorforeignelement/tabindex/index.html b/files/ru/orphaned/web/api/htmlorforeignelement/tabindex/index.html deleted file mode 100644 index adc75c26ba..0000000000 --- a/files/ru/orphaned/web/api/htmlorforeignelement/tabindex/index.html +++ /dev/null @@ -1,87 +0,0 @@ ---- -title: HTMLElement.tabIndex -slug: orphaned/Web/API/HTMLOrForeignElement/tabIndex -translation_of: Web/API/HTMLOrForeignElement/tabIndex -original_slug: Web/API/HTMLOrForeignElement/tabIndex ---- -
-
{{ APIRef("HTML DOM") }}
-
- -

Свойство HTMLElement.tabIndex предоставляет возможность вызова по кнопке Tab текущего элемента.

- -
-
Вызов по табуляции происходит в следующем порядке:
- -
    -
  1. элементы с положительным tabIndex. Элементы, имеющие одинаковое значение tabIndex вызываются в порядке появления в коде.  Переход осуществляется от меньших tabIndex до больших tabIndex. 
  2. -
  3. Элементы, которые не поддерживают атрибут tabIndex или поддерживают но tabIndex установлен в "0", выбираются по Tab в порядке их появления в коде.
  4. -
- -
Элементы для которых установлена блокировка (disabled) не могут быть выбраны кнопкой Tab и не могут быть в фокусе.
- -
 
- -
Значения могут начинаться с любого числа, могут быть отрицательными и могут быть непоследовательными, однако разные браузеры могут неправильно сработать при очень больших значениях.
- -
 
-
- -

Синтаксис

- -
elt.tabIndex = index;
-var index = elt.tabIndex;
-
- - - -

Пример

- -
var b1 = document.getElementById("button1");
-
-b1.tabIndex = 1;
-
- -

Спецификация

- -

 

- - - - - - - - - - - - - - - - - - - - - - - - - - -
СпецификацияСтатусКомментарии
{{SpecName('HTML WHATWG', '#dom-tabindex', 'tabindex')}}{{Spec2('HTML WHATWG')}}Не было изменений с {{SpecName('DOM2 HTML')}}.
{{SpecName('DOM2 HTML', 'html.html#ID-40676705', 'tabindex')}}{{Spec2('DOM2 HTML')}}Не было изменений с {{SpecName('DOM1')}}.
{{SpecName('DOM1', 'level-one-html.html#ID-40676705', 'tabindex')}}{{Spec2('DOM1')}}Начальное определение
- -

Поддержка в браузерах

- -

{{Compat("api.HTMLElement.tabIndex")}}

- -

Смотрите также

- - diff --git a/files/ru/orphaned/web/api/indexeddb_api/basic_concepts_behind_indexeddb/index.html b/files/ru/orphaned/web/api/indexeddb_api/basic_concepts_behind_indexeddb/index.html deleted file mode 100644 index 0e9312398c..0000000000 --- a/files/ru/orphaned/web/api/indexeddb_api/basic_concepts_behind_indexeddb/index.html +++ /dev/null @@ -1,214 +0,0 @@ ---- -title: Basic concepts -slug: orphaned/Web/API/IndexedDB_API/Basic_Concepts_Behind_IndexedDB -translation_of: Web/API/IndexedDB_API/Basic_Concepts_Behind_IndexedDB -original_slug: Web/API/IndexedDB_API/Basic_Concepts_Behind_IndexedDB ---- -

{{DefaultAPISidebar("IndexedDB")}}

- -
-

IndexedDB обеспечивает возможность постоянного хранения данных посредством браузера пользователя. Поскольку это наделяет создаваемые web-приложения с расширенными возможностями независимостью от доступа к сети, такие приложения получают возможность работы как online, так и offline. IndexedDB полезна для приложений, хранящих большое количество данных (например, каталог DVD библиотеки проката) и не нуждающихся в постоянном подключении к Интернету (например, почтовые клиенты, перечни запланированного to-do и заметки на память).

-
- -

Об этом документе

- -

В этом введении рассматриваются основные концепции и термины в IndexedDB. Оно содержит общую картину и объясняет ключевые понятия.

- -

Оно может стать полезным для:

- - - -

Обзор IndexedDB

- -

IndexedDB позволяет сохранять и извлекать объекты, проиндексированные с помощью "ключа". Все манипуляции над базой данных происходят при помощи транзакций. Как и большинство решений для web-хранилищ, IndexedDB следует same-origin policy. Поэтому, если получить доступ к сохранённым данным в пределах домена можно, то вне его - нет.

- -

IndexedDB - асинхронное API, которое может быть использовано в большинстве контекстов, включая Web Workers. Раньше оно включало синхронную версию, для использования в web workers, но это было удалено из спецификации в связи с недостатком интереса внутри web-сообщества.

- -

Существует так же конкурирующая с IndexedDB спецификация, WebSQL Database, но W3C исключила её 18 ноября 2010. Хотя IndexedDB и WebSQL оба являются решением для хранилищ, они предоставляют различный функционал. WebSQL Database - реляционная система доступа к базам данных, когда IndexedDB - система индексированной таблицы.

- -

Big concepts

- -

Если у вас есть опыт работы с другими типами баз данных, то вы можете быть сбиты с толку в процессе работы с IndexedDB. Поэтому имейте в виду следующие важные понятия:

- - - -

Definitions

- -

This section defines and explains terms used in the IndexedDB API.

- -

Database

- -
-
database
-
A repository of information, typically comprising one or more object stores. Each database must have the following: -
    -
  • Name. This identifies the database within a specific origin and stays constant throughout its lifetime. The name can be any string value (including an empty string).
  • -
  • -

    Current version. When a database is first created, its version is the integer 1 if not specified otherwise. Each database can have only one version at any given time.

    -
  • -
-
-
durable
-
-

In Firefox, IndexedDB used to be durable, meaning that in a readwrite transaction {{domxref("IDBTransaction.oncomplete")}} was fired only when all data was guaranteed to have been flushed to disk.

- -

As of Firefox 40, IndexedDB transactions have relaxed durability guarantees to increase performance (see {{Bug("1112702")}}), which is the same behaviour as other IndexedDB-supporting browsers. In this case the {{Event("complete")}} event is fired after the OS has been told to write the data but potentially before that data has actually been flushed to disk. The event may thus be delivered quicker than before, however, there exists a small chance that the entire transaction will be lost if the OS crashes or there is a loss of system power before the data is flushed to disk. Since such catastrophic events are rare, most consumers should not need to concern themselves further.

- -
-

Note: In Firefox, if you wish to ensure durability for some reason (e.g. you're storing critical data that cannot be recomputed later) you can force a transaction to flush to disk before delivering the complete event by creating a transaction using the experimental (non-standard) readwriteflush mode (see {{domxref("IDBDatabase.transaction")}}.) This is currently experimental, and can only be used if the dom.indexedDB.experimental pref is set to true in about:config.

-
-
-
object store
-
-

The mechanism by which data is stored in the database. The object store persistently holds records, which are key-value pairs. Records within an object store are sorted according to the keys in an ascending order.

- -

Every object store must have a name that is unique within its database. The object store can optionally have a key generator and a key path. If the object store has a key path, it is using in-line keys; otherwise, it is using out-of-line keys.

- -

For the reference documentation on object store, see {{domxref("IDBObjectStore")}}.

-
-
version
-
When a database is first created, its version is the integer 1. Each database has one version at a time; a database can't exist in multiple versions at once. The only way to change the version is by opening it with a greater version than the current one. This will start a versionchange transaction and fire an upgradeneeded event. The only place where the schema of the database can be updated is inside the handler of that event.
-
Note: This definition describes the most recent specification, which is only implemented in up-to-date browsers. Old browsers implemented the now deprecated and removed IDBDatabase.setVersion() method.
-
database connection
-
An operation created by opening a database. A given database can have multiple connections at the same time.
-
transaction
-
-

An atomic set of data-access and data-modification operations on a particular database. It is how you interact with the data in a database. In fact, any reading or changing of data in the database must happen in a transaction.

- -

A database connection can have several active transactions associated with it at a time, so long as the writing transactions do not have overlapping scopes. The scope of transactions, which is defined at creation, determines which object stores the transaction can interact with and remains constant for the lifetime of the transaction. So, for example, if a database connection already has a writing transaction with a scope that just covers the flyingMonkey object store, you can start a second transaction with a scope of the unicornCentaur and unicornPegasus object stores. As for reading transactions, you can have several of them — even overlapping ones.

- -

Transactions are expected to be short-lived, so the browser can terminate a transaction that takes too long, in order to free up storage resources that the long-running transaction has locked. You can abort the transaction, which rolls back the changes made to the database in the transaction. And you don't even have to wait for the transaction to start or be active to abort it.

- -

The three modes of transactions are: readwrite, readonly, and versionchange. The only way to create and delete object stores and indexes is by using a versionchange transaction. To learn more about transaction types, see the reference article for IndexedDB.

- -

Because everything happens within a transaction, it is a very important concept in IndexedDB. To learn more about transactions, especially on how they relate to versioning, see {{domxref("IDBTransaction")}}, which also has reference documentation.

-
-
request
-
The operation by which reading and writing on a database is done. Every request represents one read or write operation.
-
index
-
-

An index is a specialized object store for looking up records in another object store, called the referenced object store. The index is a persistent key-value storage where the value part of its records is the key part of a record in the referenced object store. The records in an index are automatically populated whenever records in the referenced object store are inserted, updated, or deleted. Each record in an index can point to only one record in its referenced object store, but several indexes can reference the same object store. When the object store changes, all indexes that refer to the object store are automatically updated.

- -

Alternatively, you can also look up records in an object store using the key.

- -

To learn more on using indexes, see Using IndexedDB. For the reference documentation on index, see IDBKeyRange.

-
-
- -

Key and value

- -
-
key
-
-

A data value by which stored values are organized and retrieved in the object store. The object store can derive the key from one of three sources: a key generator, a key path, or an explicitly specified value. The key must be of a data type that has a number that is greater than the one before it. Each record in an object store must have a key that is unique within the same store, so you cannot have multiple records with the same key in a given object store.

- -

A key can be one of the following types: string, date, float, a binary blob, and array. For arrays, the key can range from an empty value to infinity. And you can include an array within an array.

- -

Alternatively, you can also look up records in an object store using the index.

-
-
key generator
-
A mechanism for producing new keys in an ordered sequence. If an object store does not have a key generator, then the application must provide keys for records being stored. Generators are not shared between stores. This is more a browser implementation detail, because in web development, you don't really create or access key generators.
-
in-line key
-
A key that is stored as part of the stored value. It is found using a key path. An in-line key can be generated using a generator. After the key has been generated, it can then be stored in the value using the key path or it can also be used as a key.
-
out-of-line key
-
A key that is stored separately from the value being stored.
-
key path
-
Defines where the browser should extract the key from in the object store or index. A valid key path can include one of the following: an empty string, a JavaScript identifier, or multiple JavaScript identifiers separated by periods or an array containing any of those. It cannot include spaces.
-
value
-
-

Each record has a value, which could include anything that can be expressed in JavaScript, including boolean, number, string, date, object, array, regexp, undefined, and null.

- -

When an object or array is stored, the properties and values in that object or array can also be anything that is a valid value.

- -

Blobs and files can be stored, cf. specification.

-
-
- -

Range and scope

- -
-
scope
-
The set of object stores and indexes to which a transaction applies. The scopes of read-only transactions can overlap and execute at the same time. On the other hand, the scopes of writing transactions cannot overlap. You can still start several transactions with the same scope at the same time, but they just queue up and execute one after another.
-
cursor
-
A mechanism for iterating over multiple records with a key range. The cursor has a source that indicates which index or object store it is iterating. It has a position within the range, and moves in a direction that is increasing or decreasing in the order of record keys. For the reference documentation on cursors, see {{domxref("IDBCursor")}}.
-
key range
-
-

A continuous interval over some data type used for keys. Records can be retrieved from object stores and indexes using keys or a range of keys. You can limit or filter the range using lower and upper bounds. For example, you can iterate over all values of a key between x and y.

- -

For the reference documentation on key range, see {{domxref("IDBKeyRange")}}.

-
-
- -

Limitations

- -

IndexedDB is designed to cover most cases that need client-side storage. However, it is not designed for a few cases like the following:

- - - -

In addition, be aware that browsers can wipe out the database, such as in the following conditions:

- - - -

The exact circumstances and browser capabilities change over time, but the general philosophy of the browser vendors is to make the best effort to keep the data when possible.

- -

Next steps

- -

With these big concepts under our belts, we can get to more concrete stuff. For a tutorial on how to use the API, see Using IndexedDB.

- -

See also

- - diff --git a/files/ru/orphaned/web/api/localmediastream/index.html b/files/ru/orphaned/web/api/localmediastream/index.html deleted file mode 100644 index 4349f96b4a..0000000000 --- a/files/ru/orphaned/web/api/localmediastream/index.html +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: LocalMediaStream -slug: orphaned/Web/API/LocalMediaStream -translation_of: Web/API/LocalMediaStream -original_slug: Web/API/LocalMediaStream ---- -
{{APIRef("WebRTC")}} {{SeeCompatTable}}
- -

Интерфейс LocalMediaStream представляет собой поток медиа-контента извлечённый из локального источника данных. Этот интерфейс возвращается из getUserMedia().

- -

Methods

- -
-
{{domxref("LocalMediaStream.stop()")}}
-
Останавливает поток. Когда источником потока является подключённое устройство (например, камера или микрофон), останавливает захват на устройстве. 
-
- -

See Also

- - diff --git a/files/ru/orphaned/web/api/node/getuserdata/index.html b/files/ru/orphaned/web/api/node/getuserdata/index.html deleted file mode 100644 index 949bc17fd7..0000000000 --- a/files/ru/orphaned/web/api/node/getuserdata/index.html +++ /dev/null @@ -1,64 +0,0 @@ ---- -title: Node.getUserData() -slug: orphaned/Web/API/Node/getUserData -translation_of: Web/API/Node/getUserData -original_slug: Web/API/Node/getUserData ---- -

{{APIRef("DOM")}}{{ obsolete_header() }}

- -

Метод Node.getUserData() возвращает любого пользователя {{domxref("DOMUserData")}} установленного предварительно на данном узле через {{domxref("Node.setUserData()")}}.

- -
-

Методы Node.setUserData и {{domxref("Node.getUserData")}} больше не доступны для веб-контента. {{domxref("Element.dataset")}} или WeakMap могут быть использованы вместо него.

-
- -

Синтаксис

- -
userData = someNode.getUserData(userKey);
- -

Параметры

- - - -

Пример

- -
var d = document.setUserData('key', 15, null);
-alert(document.getUserData('key')); // 15
- -

Спецификации

- - - - - - - - - - - - - - - - - - - - - -
СпецификацияСтатусКомментарий
{{SpecName('DOM WHATWG', '#interface-node', 'Node')}}{{Spec2('DOM WHATWG')}}Удалено из спецификации
{{SpecName('DOM3 Core', 'core.html#Node3-getUserData', 'Node.getUserData()')}}{{Spec2('DOM3 Core')}}Изначальное описание
- -

Совместимость с браузерами

- -

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

- -

Смотрите также

- - diff --git a/files/ru/orphaned/web/api/notation/index.html b/files/ru/orphaned/web/api/notation/index.html deleted file mode 100644 index e5f51b30d7..0000000000 --- a/files/ru/orphaned/web/api/notation/index.html +++ /dev/null @@ -1,53 +0,0 @@ ---- -title: Нотация -slug: orphaned/Web/API/Notation -tags: - - Нотация -translation_of: Web/API/Notation -original_slug: Web/API/Notation ---- -
{{APIRef("DOM")}}{{draft}}{{obsolete_header}}
- -

Представляет нотацию DTD (только для чтения). Может объявлять формат неразобранного объекта или формально объявлять цели инструкции по обработке документа. Наследует методы и свойства от Node. Его nodeName - это имя нотации. Не имеет родителя.

- -

Свойства

- -
-
{{domxref("Notation.publicId")}} {{ReadOnlyInline}}
-
Это {{domxref("DOMString")}}.
-
{{domxref("Notation.systemId")}} {{ReadOnlyInline}}
-
Это {{domxref("DOMString")}}.
-
- -

Спецификации

- - - - - - - - - - - - - - - - - - - - - - - - -
СпецификацияСтатусКомментарии
{{SpecName("DOM3 Core", "core.html#ID-5431D1B9", "Notation")}}{{Spec2("DOM3 Core")}}Без изменений
{{SpecName("DOM2 Core", "core.html#ID-5431D1B9", "Notation")}}{{Spec2("DOM2 Core")}}Без изменений
{{SpecName('DOM1', 'level-one-core.html#ID-5431D1B9', 'Notation')}}{{Spec2('DOM1')}}Первое определение
- -

Поддержка браузерами

- - - -

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

diff --git a/files/ru/orphaned/web/api/parentnode/append/index.html b/files/ru/orphaned/web/api/parentnode/append/index.html deleted file mode 100644 index e35894dd86..0000000000 --- a/files/ru/orphaned/web/api/parentnode/append/index.html +++ /dev/null @@ -1,135 +0,0 @@ ---- -title: ParentNode.append() -slug: orphaned/Web/API/ParentNode/append -translation_of: Web/API/ParentNode/append -original_slug: Web/API/ParentNode/append ---- -
{{APIRef("DOM")}} {{SeeCompatTable}}
- -

Метод ParentNode.append добавляет набор объектов {{domxref("Node")}} или {{domxref("DOMString")}} в конец (после последнего потомка) ParentNode. {{domxref("DOMString")}} объекты добавляются как {{domxref("Text")}}.

- -

Отличия от {{domxref("Node.appendChild()")}}:

- - - -

Синтаксис

- -
[Throws, Unscopable]
-void ParentNode.append((Node или DOMString)... nodes);
-
- -

Параметры

- -
-
nodes
-
Набор объектов {{domxref("Node")}} или {{domxref("DOMString")}}, которые будут добавлены.
-
- -

Исключения

- - - -

Примеры

- -

Добавление элемента

- -
var parent = document.createElement("div");
-var p = document.createElement("p");
-parent.append(p);
-
-console.log(parent.childNodes); // NodeList [ <p> ]
-
- -

Добавление строки

- -
var parent = document.createElement("div");
-parent.append("Любой текст");
-
-console.log(parent.textContent); // "Любой текст"
- -

Добавление элемента или строки

- -
var parent = document.createElement("div");
-var p = document.createElement("p");
-parent.append("Любой текст", p);
-
-console.log(parent.childNodes); // NodeList [ #text "Любой текст", <p> ]
- -

ParentNode.append() не имеет области видимости

- -

Метод append() не имеет области видимости с директивой with. Больше информации в {{jsxref("Symbol.unscopables")}}.

- -
var parent = document.createElement("div");
-
-with(parent) {
-  append("foo");
-}
-// ReferenceError: append is not defined 
- -

Полифил

- -

Вы можете использовать полифил для метода append() в Internet Explorer 9 и выше:

- -
// Источник: https://github.com/jserz/js_piece/blob/master/DOM/ParentNode/append()/append().md
-(function (arr) {
-  arr.forEach(function (item) {
-    if (item.hasOwnProperty('append')) {
-      return;
-    }
-    Object.defineProperty(item, 'append', {
-      configurable: true,
-      enumerable: true,
-      writable: true,
-      value: function append() {
-        var argArr = Array.prototype.slice.call(arguments),
-          docFrag = document.createDocumentFragment();
-
-        argArr.forEach(function (argItem) {
-          var isNode = argItem instanceof Node;
-          docFrag.appendChild(isNode ? argItem : document.createTextNode(String(argItem)));
-        });
-
-        this.appendChild(docFrag);
-      }
-    });
-  });
-})([Element.prototype, Document.prototype, DocumentFragment.prototype]);
- -

Спецификация

- - - - - - - - - - - - - - -
СпецификацияСтатусКомментарий
{{SpecName('DOM WHATWG', '#dom-parentnode-append', 'ParentNode.append()')}}{{Spec2('DOM WHATWG')}}Initial definition.
- -

Поддержка браузерами

- - - -

{{Compat("api.ParentNode.append")}}

- -

Смотрите также

- - diff --git a/files/ru/orphaned/web/api/parentnode/children/index.html b/files/ru/orphaned/web/api/parentnode/children/index.html deleted file mode 100644 index b380d55fde..0000000000 --- a/files/ru/orphaned/web/api/parentnode/children/index.html +++ /dev/null @@ -1,144 +0,0 @@ ---- -title: Node.children -slug: orphaned/Web/API/ParentNode/children -tags: - - API - - DOM - - ParentNode - - Property - - Reference -translation_of: Web/API/ParentNode/children -original_slug: Web/API/ParentNode/children ---- -

{{ APIRef("DOM") }}

- -

Описание

- -

Свойство children {{domxref("ParentNode")}} является свойством только для чтения, которое возвращает {{domxref("HTMLCollection")}}, содержащее все дочерние {{domxref("Element", "elements")}} узла, на котором он был вызван.

- -

Синтаксис

- -
var elList = elementNodeReference.children; 
- -

В результате, elList - живая коллекция, состоящая из дочерних элементов узла elementNodeReference, и стоит подметить, что если у узла детей нет, она будет пустой. Определить это можно, обратившись к свойству length, которое содержит в себе количество элементов в коллекции.

- -

Пример

- -
<ul>
-   <li>1 пункт</li>
-   <li>2 пункт</li>
-</ul>
-
-<script type="text/javascript">
-
-   var elementChildrens = document.querySelector("ul").children;
-   for (var i=0, child; child=elementChildrens[i]; i++) {
-        // elementChildrens - коллекция детей списка
-        // child - последовательно, каждый из элементов elementChildrens
-        alert(child.innerHTML);
-   }
-
-</script>
-
-
- -

Спецификация

- - - - - - - - - - - - - - -
СпецификацияСтатусКомментарий
{{SpecName('DOM WHATWG', '#dom-parentnode-children', 'ParentNode.children')}}{{Spec2('DOM WHATWG')}}Начальное определение.
- -

Поддержка браузерами

- -

{{ CompatibilityTable() }}

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ОсобенностьChromeFirefox (Gecko)Internet ExplorerOperaSafari
Базовая поддержка {{domxref("Element")}}1.0{{CompatGeckoDesktop("1.9.1")}}9.0 [1]10.04.0
-

Поддержка {{domxref("Document")}} и {{domxref("DocumentFragment")}} {{experimental_inline}}

-
29.0{{CompatGeckoDesktop("25.0")}}{{CompatNo}}16.0{{CompatNo}}
Поддержка {{domxref("SVGElement")}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatNo}}{{CompatUnknown}}{{CompatNo}}
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
ОсобенностьAndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Базовая поддержка {{domxref("Element")}}{{ CompatVersionUnknown() }}{{CompatGeckoMobile("1.9.1")}}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}
Поддержка {{domxref("Document")}} и {{domxref("DocumentFragment")}} {{experimental_inline}}{{CompatVersionUnknown}}{{CompatGeckoMobile("25.0")}}{{CompatNo}}16.0{{CompatNo}}
-
- -

Internet Explorer 6, 7 и 8 поддерживают данное свойство, но ошибочно включают в коллекцию комментарии ({{domxref("Comment")}}) в HTML-коде.

- -

Смотрите также

- - diff --git a/files/ru/orphaned/web/api/parentnode/firstelementchild/index.html b/files/ru/orphaned/web/api/parentnode/firstelementchild/index.html deleted file mode 100644 index 21fb90f963..0000000000 --- a/files/ru/orphaned/web/api/parentnode/firstelementchild/index.html +++ /dev/null @@ -1,150 +0,0 @@ ---- -title: ParentNode.firstElementChild -slug: orphaned/Web/API/ParentNode/firstElementChild -tags: - - API - - DOM - - ParentNode - - Property - - Reference -translation_of: Web/API/ParentNode/firstElementChild -original_slug: Web/API/ParentNode/firstElementChild ---- -

{{ APIRef("DOM") }}

- -

Доступное только для чтения свойство ParentNode.firstElementChild возвращает первый дочерний элемент объекта ({{domxref("Element")}}) или null если дочерних элементов нет.

- -
-

This property was initially defined in the {{domxref("ElementTraversal")}} pure interface. As this interface contained two distinct set of properties, one aimed at {{domxref("Node")}} that have children, one at those that are children, they have been moved into two separate pure interfaces, {{domxref("ParentNode")}} and {{domxref("ChildNode")}}. In this case, firstElementChild moved to {{domxref("ParentNode")}}. This is a fairly technical change that shouldn't affect compatibility.

-
- -

Синтаксис

- -
var childNode = elementNodeReference.firstElementChild;
-
- -

Пример

- -
<p id="para-01">
-  <span>First span</span>
-</p>
-
-<script type="text/javascript">
-  var p01 = document.getElementById('para-01');
-  alert(p01.firstElementChild.nodeName)
-</script>
- -

В этом примере alert показывает 'span', что является именем тега первого дочернего узла элемента p.

- -

Polyfill для Internet Explorer 8

- -

Это свойство не поддерживается браузером Internet Explorer вплоть до 9 версии, поэтому следующий сниппет может быть использован для добавления поддержки IE8:

- -
// Source: https://github.com/Alhadis/Snippets/blob/master/js/polyfills/IE8-child-elements.js
-if(!("firstElementChild" in document.documentElement)){
-    Object.defineProperty(Element.prototype, "firstElementChild", {
-        get: function(){
-            for(var nodes = this.children, n, i = 0, l = nodes.length; i < l; ++i)
-                if(n = nodes[i], 1 === n.nodeType) return n;
-            return null;
-        }
-    });
-}
- -

Спецификация

- - - - - - - - - - - - - - - - - - - -
СпецификацияСтатусКомментарий
{{SpecName('DOM WHATWG', '#dom-parentnode-firstelementchild', 'ParentNode.firstElementChild')}}{{Spec2('DOM WHATWG')}}Splitted the ElementTraversal interface in {{domxref("ChildNode")}} and ParentNode. This method is now defined on the latter.
- The {{domxref("Document")}} and {{domxref("DocumentFragment")}} implemented the new interfaces.
{{SpecName('Element Traversal', '#attribute-firstElementChild', 'ElementTraversal.firstElementChild')}}{{Spec2('Element Traversal')}}Added its initial definition to the ElementTraversal pure interface and use it on {{domxref("Element")}}.
- -

Совместимость с браузерами

- -

{{ CompatibilityTable() }}

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Базовая поддержка ({{domxref("Element")}})1.0{{CompatGeckoDesktop("1.9.1")}}9.010.04.0
Поддержка {{domxref("Document")}} и {{domxref("DocumentFragment")}} {{experimental_inline}}29.0{{CompatGeckoDesktop("25.0")}}{{CompatNo}}16.0{{CompatNo}}
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Базовая поддержка ({{domxref("Element")}}){{ CompatVersionUnknown() }}{{CompatGeckoMobile("1.9.1")}}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}
Поддержка {{domxref("Document")}} и {{domxref("DocumentFragment")}} {{experimental_inline}}{{CompatVersionUnknown}}{{CompatGeckoMobile("25.0")}}{{CompatNo}}16.0{{CompatNo}}
-
- -

Смотрите также

- - diff --git a/files/ru/orphaned/web/api/parentnode/index.html b/files/ru/orphaned/web/api/parentnode/index.html deleted file mode 100644 index 1c4e7e2040..0000000000 --- a/files/ru/orphaned/web/api/parentnode/index.html +++ /dev/null @@ -1,91 +0,0 @@ ---- -title: ParentNode -slug: orphaned/Web/API/ParentNode -tags: - - API - - DOM - - NeedsTranslation - - Tab - - TopicStub -translation_of: Web/API/ParentNode -original_slug: Web/API/ParentNode ---- -

{{ APIRef("DOM") }}

- -

Интерфейс ParentNode содержит методы, которые относятся к {{domxref("Node")}} объектам , у которых могут быть потомки.

- -

ParentNode является сырым интерфейсом и объекты с данным типом создать нельзя; данный интерфейс имеется у {{domxref("Element")}}, {{domxref("Document")}}, и {{domxref("DocumentFragment")}} объектов.

- -

Свойства

- -
-
{{domxref("ParentNode.children")}} {{experimental_inline}} {{readonlyInline}}
- Возвращает живую  {{domxref("HTMLCollection")}}, которая содержит все объекты типа {{domxref("Element")}}, которые являются потомками данного ParentNode.
-
- {{domxref("ParentNode.firstElementChild")}} {{experimental_inline}} {{readonlyInline}}
- Возвращает {{domxref("Element")}} , который является первым потомком данного ParentNode, или null, если таковой отсутствует.
-
- {{ domxref("ParentNode.lastElementChild") }} {{experimental_inline}} {{readonlyInline}}
- Возвращает {{domxref("Element")}}, который является последним из потомков данного ParentNode, или null, если таковой отсутствует.
-
- {{ domxref("ParentNode.childElementCount") }} {{experimental_inline}} {{readonlyInline}}
- Возвращает unsigned long с количеством потомков, которые есть у объекта.
-
- -

Методы

- -
-
{{domxref("ParentNode.append()")}} {{experimental_inline}}
-
Вставляет набор объектов типа {{domxref("Node")}} или {{domxref("DOMString")}} после последнего потомка ParentNode. {{domxref("DOMString")}} объекты вставлены как эквивалент {{domxref("Text")}} узлы.
-
{{domxref("ParentNode.prepend()")}} {{experimental_inline}}
-
Вставляет набор объектов типа {{domxref("Node")}} или {{domxref("DOMString")}} перед первым потомком ParentNode. {{domxref("DOMString")}} объекты вставлены как эквивалент {{domxref("Text")}} узлы.
-
{{domxref("ParentNode.querySelector()")}}
-
Возвращает первый {{domxref("Element")}} с текущим элементом в качестве источника, который совпадает с определённой группой селекторов.
-
{{domxref("ParentNode.querySelectorAll()")}}
-
Возвращает {{domxref("NodeList")}}, который представляет собой список элементов с текущим элементом в качестве источника, который совпадает с определённой группой селекторов.
-
- -

Спецификация

- - - - - - - - - - - - - - - - - - - - - - - - -
СпецификацияСтатусКомментарий
{{SpecName('DOM WHATWG', '#parentnode', 'ParentNode')}}{{Spec2('DOM WHATWG')}}Добавлены методы append() и prepend().
{{SpecName('DOM WHATWG', '#dom-parentnode-firstelementchild', 'ParentNode.firstElementChild')}}{{Spec2('DOM WHATWG')}}Splitted the ElementTraversal interface in {{domxref("ChildNode")}} and ParentNode. The firstElementChild, lastElementChild, and childElementCount properties are now defined on the latter.
- The {{domxref("Document")}} and {{domxref("DocumentFragment")}} implemented the new interfaces.
- Added the children property.
- Added the append() and prepend() methods.
{{SpecName('Element Traversal', '#interface-elementTraversal', 'ElementTraversal')}}'{{Spec2('Element Traversal')}}Добавлено изначальное определение свойств в ElementTraversal чистый интерфейс и использование его в {{domxref("Element")}}.
- -

Совместимость с браузерами

- -

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

- -

 

- -

Смотрите также

- - diff --git a/files/ru/orphaned/web/api/parentnode/lastelementchild/index.html b/files/ru/orphaned/web/api/parentnode/lastelementchild/index.html deleted file mode 100644 index 8df658ceb5..0000000000 --- a/files/ru/orphaned/web/api/parentnode/lastelementchild/index.html +++ /dev/null @@ -1,162 +0,0 @@ ---- -title: ParentNode.lastElementChild -slug: orphaned/Web/API/ParentNode/lastElementChild -tags: - - API - - DOM - - ParentNode - - Property - - Reference -translation_of: Web/API/ParentNode/lastElementChild -original_slug: Web/API/ParentNode/lastElementChild ---- -

{{ APIRef("DOM") }}

- -

Свойство ParentNode.lastElementChild только для чтения. Возвращает последний дочерний элемент объекта или null если нет дочерних элементов.

- -
-

This property was initially defined in the {{domxref("ElementTraversal")}} pure interface. As this interface contained two distinct set of properties, one aimed at {{domxref("Node")}} that have children, one at those that are children, they have been moved into two separate pure interfaces, {{domxref("ParentNode")}} and {{domxref("ChildNode")}}. In this case, lastElementChild moved to {{domxref("ParentNode")}}. This is a fairly technical change that shouldn't affect compatibility.

-
- -

Синтаксис

- -
var element = node.lastElementChild; 
- -

Пример

- -
<ul id="foo">
-  <li>First  (1)</li>
-  <li>Second (2)</li>
-  <li>Third  (3)</li>
-</ul>
-
-<script>
-var foo = document.getElementById('foo');
-// yields: Third  (3)
-console.log(foo.lastElementChild.textContent);
-</script>
-
- -

Polyfill for IE8, IE9 and Safari

- -
// Overwrites native 'lastElementChild' prototype.
-// Adds Document & DocumentFragment support for IE9 & Safari.
-// Returns array instead of HTMLCollection.
-;(function(constructor) {
-    if (constructor &&
-        constructor.prototype &&
-        constructor.prototype.lastElementChild == null) {
-        Object.defineProperty(constructor.prototype, 'lastElementChild', {
-            get: function() {
-                var node, nodes = this.childNodes, i = nodes.length - 1;
-                while (node = nodes[i--]) {
-                    if (node.nodeType === 1) {
-                        return node;
-                    }
-                }
-                return null;
-            }
-        });
-    }
-})(window.Node || window.Element);
-
- -

Спецификация

- - - - - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('DOM WHATWG', '#dom-parentnode-lastelementchild', 'ParentNode.lastElementChild')}}{{Spec2('DOM WHATWG')}}Splitted the ElementTraversal interface in {{domxref("ChildNode")}} and ParentNode. This method is now defined on the latter.
- The {{domxref("Document")}} and {{domxref("DocumentFragment")}} implemented the new interfaces.
{{SpecName('Element Traversal', '#attribute-lastElementChild', 'ElementTraversal.lastElementChild')}}{{Spec2('Element Traversal')}}Added its initial definition to the ElementTraversal pure interface and use it on {{domxref("Element")}}.
- -

Совместимость с браузерами

- -

{{ CompatibilityTable() }}

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support (on {{domxref("Element")}})1.0{{CompatGeckoDesktop("1.9.1")}}9.010.04.0
Support on {{domxref("Document")}} and {{domxref("DocumentFragment")}} {{experimental_inline}}29.0{{CompatGeckoDesktop("25.0")}}{{CompatNo}}16.0{{CompatNo}}
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support (on {{domxref("Element")}}){{ CompatVersionUnknown() }}{{CompatGeckoMobile("1.9.1")}}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}
Support on {{domxref("Document")}} and {{domxref("DocumentFragment")}} {{experimental_inline}}{{CompatVersionUnknown}}{{CompatGeckoMobile("25.0")}}{{CompatNo}}16.0{{CompatNo}}
-
- - - -

Так же смотрите

- - diff --git a/files/ru/orphaned/web/api/parentnode/prepend/index.html b/files/ru/orphaned/web/api/parentnode/prepend/index.html deleted file mode 100644 index 489d85a390..0000000000 --- a/files/ru/orphaned/web/api/parentnode/prepend/index.html +++ /dev/null @@ -1,134 +0,0 @@ ---- -title: ParentNode.prepend() -slug: orphaned/Web/API/ParentNode/prepend -translation_of: Web/API/ParentNode/prepend -original_slug: Web/API/ParentNode/prepend ---- -
{{APIRef("DOM")}}
- -

Метод ParentNode.prepend() вставляет множество объектов {{domxref("Node")}} или {{domxref("DOMString")}} в начало (перед первым потомком) {{domxref("ParentNode")}}. Объекты {{domxref("DOMString")}} вставляются как {{domxref("Text")}}.

- -

Синтаксис

- -
ParentNode.prepend(...nodesToPrepend);
-
- -

Параметры

- -
-
nodesToPrepend
-
Один или болле узлов, которые вставляются перед первым дочерним узлом в  ParentNode. Каждый узел может быть определён либо как {{domxref("Node")}} - объект, либо как строка; строки вставляются как новые узлы типа {{domxref("Text")}}.
-
- -

Возвращаемое значение

- -

undefined.

- -

Исключения

- - - -

Примеры

- -

Добавление элемента в начало

- -
var parent = document.createElement("div");
-var p = document.createElement("p");
-var span = document.createElement("span");
-parent.append(p);
-parent.prepend(span);
-
-console.log(parent.childNodes); // NodeList [ <span>, <p> ]
-
- -

Добавление текста в начало

- -
var parent = document.createElement("div");
-parent.append("Some text");
-parent.prepend("Headline: ");
-
-console.log(parent.textContent); // "Headline: Some text"
- -

Добавление элемента и текста

- -
var parent = document.createElement("div");
-var p = document.createElement("p");
-parent.prepend("Some text", p);
-
-console.log(parent.childNodes); // NodeList [ #text "Some text", <p> ]
- -

ParentNode.prepend() не имеет области видимости

- -

Метод prepend() не входит в область видимости оператора with. Смотрите {{jsxref("Symbol.unscopables")}} для детальной информации.

- -
var parent = document.createElement("div");
-
-with(parent) {
-  prepend("foo");
-}
-// ReferenceError: prepend is not defined 
- -

Полифил

- -

Вы можете использовать полифил, если метод prepend() не доступный:

- -
// Source: https://github.com/jserz/js_piece/blob/master/DOM/ParentNode/prepend()/prepend().md
-(function (arr) {
-  arr.forEach(function (item) {
-    if (item.hasOwnProperty('prepend')) {
-      return;
-    }
-    Object.defineProperty(item, 'prepend', {
-      configurable: true,
-      enumerable: true,
-      writable: true,
-      value: function prepend() {
-        var argArr = Array.prototype.slice.call(arguments),
-          docFrag = document.createDocumentFragment();
-
-        argArr.forEach(function (argItem) {
-          var isNode = argItem instanceof Node;
-          docFrag.appendChild(isNode ? argItem : document.createTextNode(String(argItem)));
-        });
-
-        this.insertBefore(docFrag, this.firstChild);
-      }
-    });
-  });
-})([Element.prototype, Document.prototype, DocumentFragment.prototype]);
- -

Спецификация

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('DOM WHATWG', '#dom-parentnode-prepend', 'ParentNode.prepend()')}}{{Spec2('DOM WHATWG')}}Initial definition.
- -

Поддержка браузерами

- - - -

{{Compat("api.ParentNode.prepend")}}

- -

Смотрите также

- - diff --git a/files/ru/orphaned/web/api/rtcpeerconnection/getdefaulticeservers/index.html b/files/ru/orphaned/web/api/rtcpeerconnection/getdefaulticeservers/index.html deleted file mode 100644 index d02bdfae84..0000000000 --- a/files/ru/orphaned/web/api/rtcpeerconnection/getdefaulticeservers/index.html +++ /dev/null @@ -1,57 +0,0 @@ ---- -title: RTCPeerConnection.getDefaultIceServers() -slug: orphaned/Web/API/RTCPeerConnection/getDefaultIceServers -translation_of: Web/API/RTCPeerConnection/getDefaultIceServers -original_slug: Web/API/RTCPeerConnection/getDefaultIceServers ---- -

{{APIRef("WebRTC")}}{{SeeCompatTable}}

- -

Метод getDefaultIceServers() интерфейса {{domxref("RTCPeerConnection")}} , возвращает массив объектов  {{domxref("RTCIceServer")}}, который указывает, какие серверы ICE браузер будет использовать по умолчанию, если они не указаны в параметре {{domxref("RTCConfiguration")}} конструктора {{domxref("RTCPeerConnection")}} 

- -

Синтаксис

- -
 var defaultIceServers = RTCPeerConnection.getDefaultIceServers();
- -

Возвращаемое значение

- -

Массив  ICE серверов, определяемые как объекты класса  {{domxref("RTCIceServer")}} , которые браузер будет использовать для соединения, если иное не определено в параметре -  объекте конфигурации конструктора  {{domxref("RTCPeerConnection")}}. Если в браузере нет значений по умолчанию, массив будет пуст. Значение свойства не может быть  null.

- -

Пример

- -
var pc = new RTCPeerConnection();
-var iceServers = pc.getDefaultIceServers();
-
-if (iceServers.length === 0) {
-  // Решить проблему отсутствия серверов ICE по умолчанию, возможно, используя наши собственные настройки по умолчанию.
- -

Спецификации

- - - - - - - - - - - - - - - - -
СпецификацияСтатусКомментарий
WebRTC Extensions
- -

Совместимость с браузерами

- - - -

{{Compat("api.RTCPeerConnection.getDefaultIceServers")}}

- -

Смотрите также

- - diff --git a/files/ru/orphaned/web/api/serviceworkerstate/index.html b/files/ru/orphaned/web/api/serviceworkerstate/index.html deleted file mode 100644 index 7b6b3f87c2..0000000000 --- a/files/ru/orphaned/web/api/serviceworkerstate/index.html +++ /dev/null @@ -1,47 +0,0 @@ ---- -title: ServiceWorkerState -slug: orphaned/Web/API/ServiceWorkerState -translation_of: Web/API/ServiceWorkerState -original_slug: Web/API/ServiceWorkerState ---- -
{{APIRef("Service Workers API")}}
- -

ServiceWorkerState показывает состояние {{DOMxRef("ServiceWorker")}}'а.

- -

Значения

- -
-
installing
-
Service worker устанавливается. В этом состоянии, метод {{DOMxRef("ExtendableEvent.waitUntil()")}} может быть вызван в обработчике события install для продления установки до успешного завершения переданного промиса. Как правило, данный метод используется для того, чтобы избежать активации service worker'а до завершения настройки его кеша.
-
installed
-
Service worker находится в состоянии ожидания и будет активирован после закрытия всех страниц его источника, использующих предыдущую версию service worker'а.
-
activating
-
Service worker в данном состоянии считается активным. В этом состоянии, метод {{DOMxRef("ExtendableEvent.waitUntil()")}} может быть вызван в обработчике события onactivate для продления этапа активации до успешного завершения переданного промиса. Service worker не начнёт обрабатывать события до перехода в состояние activated.
-
activated
-
Service worker в данном состоянии активен и готов обрабатывать события.
-
redundant
-
Новый service worker заменяет данный либо service worker удаляется из-за ошибки при его установке.
-
- -

Спецификации

- - - - - - - - - - - - - - -
СпецификацияСтатусКомментарии
{{SpecName("Service Workers", "#service-worker-state-enum", "ServiceWorkerState")}}{{Spec2("Service Workers")}}Изначальное определение.
- -

Смотрите также

- - diff --git a/files/ru/orphaned/web/api/web_crypto_api/checking_authenticity_with_password/index.html b/files/ru/orphaned/web/api/web_crypto_api/checking_authenticity_with_password/index.html deleted file mode 100644 index 903e7cc7a2..0000000000 --- a/files/ru/orphaned/web/api/web_crypto_api/checking_authenticity_with_password/index.html +++ /dev/null @@ -1,34 +0,0 @@ ---- -title: Проверка подлинности данных с паролем -slug: orphaned/Web/API/Web_Crypto_API/Checking_authenticity_with_password -tags: - - HMAC - - Web Crypto -translation_of: Web/API/Web_Crypto_API/Checking_authenticity_with_password -original_slug: Web/API/Web_Crypto_API/Checking_authenticity_with_password ---- -

{{APIRef("Web Crypto API")}}{{draft}}

- -

Проверка подлинности данных может быть выполнена с помощью Web Crypto API. В этой статье мы покажем как создавать и управлять подписями, используя хэш-функцию и пароль.

- -

HMAC алгоритм генерирует хэш на основе передаваемых ключа и данных, которые нужно подписать. Позже, идентичный хэш может быть вычислен заново любым пользователем, у которого имеется ключ. Необходимость ключа позволяет хранить данные и хэш вместе: злоумышленник не сможет создать хэш для изменённых данных, не имея ключа.

- -

Стоит заметить, что алгоритм никак не связан с какой-либо другой информацией о владельце: знание ключа – необходимое и достаточное условие для изменения данных.

- -

Предположим, данные хранятся на компьютере. Чтобы получить доступ к записи или чтению, мы будем использовать localforage.js – библиотека-обёртка над хранилищами браузера. Эта библиотека необязательна и используется в качестве примера для удобства, чтобы сосредоточиться на криптографии.

- -

Данные, доступ к которым мы хотим получить, имеют следующую форму:

- -

 

- -

где data – данные для подписания и signature – подпись, информация для проверки подлинности.

- -

Криптографические ключи невозможно выучить наизусть, а обычные пароли недостаточно безопасны. Чтобы решить эту проблему, криптографы создали алгоритмы для создания криптографических ключей из паролей. Знание пароля позволяет воссоздать ключ и использовать его.

- -

Запрашиваем пароль у пользователя для генерации ключа:

- -
 
- -

С этим ключом мы можем вычислить хэш данных.

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