From d53bae971e455859229bcb3246e29bcbc85179d2 Mon Sep 17 00:00:00 2001 From: MDN Date: Tue, 8 Mar 2022 00:12:08 +0000 Subject: [CRON] sync translated content --- .../learn/javascript/asynchronous/index.html | 639 +++++++++++++++++++++ .../javascript/asynchronous/introducing/index.html | 165 ++++++ 2 files changed, 804 insertions(+) create mode 100644 files/ru/conflicting/learn/javascript/asynchronous/index.html create mode 100644 files/ru/conflicting/learn/javascript/asynchronous/introducing/index.html (limited to 'files/ru/conflicting') diff --git a/files/ru/conflicting/learn/javascript/asynchronous/index.html b/files/ru/conflicting/learn/javascript/asynchronous/index.html new file mode 100644 index 0000000000..f87839f2ff --- /dev/null +++ b/files/ru/conflicting/learn/javascript/asynchronous/index.html @@ -0,0 +1,639 @@ +--- +title: 'Объединённый асинхронный JavaScript: Таймауты и интервалы' +slug: conflicting/Learn/JavaScript/Asynchronous +translation_of: Learn/JavaScript/Asynchronous/Timeouts_and_intervals +original_slug: Learn/JavaScript/Asynchronous/Timeouts_and_intervals +--- +
{{LearnSidebar}}
+ +
{{PreviousMenuNext("Learn/JavaScript/Asynchronous/Introducing", "Learn/JavaScript/Asynchronous/Promises", "Learn/JavaScript/Asynchronous")}}
+ +

В этом руководстве рассматриваются традиционные методы, доступные в JavaScript для асинхронного выполнения кода по истечении заданного периода времени или через регулярный интервал (например, заданное количество раз в секунду), обсуждаются их полезные свойства и рассматриваются присущие им проблемы. .

+ + + + + + + + + + + + +
Необходимые условия:Базовая компьютерная грамотность, достаточное понимание основ JavaScript.
Цель:Понимание асинхронных циклов и интервалов, и то как их можно использовать.
+ +

Введение

+ +

В течение долгого времени веб-платформа предлагала программистам JavaScript ряд функций, которые позволяли им асинхронно выполнять код по истечении определённого временного интервала и повторно выполнять асинхронный блок кода, пока вы не скажете ему остановиться.

+ +

Эти функции:

+ +
+
setTimeout()
+
Выполняет указанный блок кода один раз по истечении указанного времени
+
setInterval()
+
Выполняет указанный блок кода несколько раз с определённым интервалом между каждым вызовом.
+
requestAnimationFrame()
+
Современная версия setInterval (). Выполняют указанный блок кода перед тем, как браузер в следующий раз перерисовывает отображение, позволяя запускать анимацию с подходящей частотой кадров независимо от среды, в которой она выполняется.
+
+ +

Асинхронный код, установленный этими функциями, выполняется в основном потоке (по истечении указанного им таймера).

+ +
+

Важно знать, что вы можете (и часто будете) запускать другой код до выполнения вызова setTimeout () или между итерациями setInterval (). В зависимости от того, насколько интенсивно используются эти операции для процессора, они могут ещё больше задержать выполнение асинхронного кода, поскольку любой асинхронный код будет выполняться только после того, как станет доступен основной поток. (Другими словами, когда стек пуст.) вы узнаете больше по этому вопросу по мере изучения этой статьи.

+
+ +

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

+ +

setTimeout()

+ +

Как мы ранее отметили, setTimeout () выполняет определённый блок кода один раз по истечении заданного времени. Принимает следующие параметры:

+ + + +
+

NOTE:  Указанное время (или задержка) не является гарантированным временем выполнения, а скорее минимальным временем выполнения. Обратные вызовы, которые вы передаёте этим функциям, не могут выполняться, пока стек в основном потоке не станет пустым.

+ +

Как следствие, такой код, как setTimeout (fn, 0), будет выполняться, как только стек будет пуст, а не сразу. Если вы выполните такой код, как setTimeout (fn, 0), но сразу после выполнения цикла, который насчитывает от 1 до 10 миллиардов, ваш колбэк будет выполнен через несколько секунд.

+
+ +

В следующем примере, браузер будет ожидать две секунды перед тем как  выполнит анонимную функцию, тогда отобразит сообщение (живой пример, и исходный код):

+ +
let myGreeting = setTimeout(function() {
+  alert('Hello, Mr. Universe!');
+}, 2000)
+ +

Указанные вами функции не обязательно должны быть анонимными. Вы можете дать своей функции имя и даже определить её где-нибудь ещё и передать ссылку на функцию в setTimeout (). Следующие две версии фрагмента кода эквивалентны первой:

+ +
// С именованной функцией
+let myGreeting = setTimeout(function sayHi() {
+  alert('Hello, Mr. Universe!');
+}, 2000)
+
+// С функцией определённой отдельно
+function sayHi() {
+  alert('Hello Mr. Universe!');
+}
+
+let myGreeting = setTimeout(sayHi, 2000);
+ +

Это может быть полезно, если у вас есть функция, которую нужно вызывать как по таймауту, так например и в ответ на событие. Но это также может  помочь поддерживать ваш код в чистоте, особенно если колбэк тайм-аута занимает больше, чем несколько строк кода.

+ +

setTimeout () возвращает значение идентификатора, которое можно использовать для ссылки на тайм-аут позже, например, когда вы хотите его остановить.

+ +

Передача параметров в функцию setTimeout ()

+ +

Любые параметры, которые вы хотите передать функции, выполняемой внутри setTimeout (), должны быть переданы ей как дополнительные параметры в конце списка.

+ +

Например, вы можете реорганизовать предыдущую функцию, чтобы она передавала привет любому имени, переданному ей:

+ +
function sayHi(who) {
+  alert(`Hello ${who}!`);
+}
+ +

Теперь вы можете передать имя в вызов setTimeout () в качестве третьего параметра:

+ +
let myGreeting = setTimeout(sayHi, 2000, 'Mr. Universe');
+ +

Очистка таймаутов

+ +

Наконец, если был создан тайм-аут, вы можете отменить его до истечения указанного времени, вызвав clearTimeout(), передав ему идентификатор вызова setTimeout() в качестве параметра. Итак, чтобы отменить указанный выше тайм-аут, вы должны сделать следующее:

+ +
clearTimeout(myGreeting);
+ +
+

Note: См.greeter-app.html для более полной демонстрации, которая позволяет вам указать имя для приветствия и отменить приветствие с помощью отдельной кнопки (см. исходный код).

+
+ +

setInterval()

+ +

setTimeout () отлично работает, когда вам нужно один раз запустить код по истечении заданного периода времени. Но что происходит, когда вам нужно запускать код снова и снова - например, в случае анимации?

+ +

Здесь пригодится setInterval() . Работает очень похоже на setTimeout (), за исключением того, что функция, которую вы передаёте в качестве первого параметра, выполняется повторно не менее чем за количество миллисекунд, заданных вторым параметром. Вы также можете передать любые параметры, необходимые для выполняемой функции, в качестве последующих параметров вызова setInterval ().

+ +

Давайте посмотрим на пример. Следующая функция создаёт новый объект Date(), с помощью toLocaleTimeString() извлекает из него строку с временем и отображает её в пользовательском интерфейсе. Затем он запускает функцию один раз в секунду с помощью setInterval(), создавая эффект цифровых часов, которые обновляются раз в секунду ( реальный пример, и исходный код):

+ +
function displayTime() {
+   let date = new Date();
+   let time = date.toLocaleTimeString();
+   document.getElementById('demo').textContent = time;
+}
+
+const createClock = setInterval(displayTime, 1000);
+ +

Как и setTimeout (), setInterval () возвращает определённое значение, которое вы можете использовать позже, когда вам нужно очистить интервал.

+ +

Очистка интервала

+ +

setInterval () выполняет задачу постоянно. setInterval () продолжает выполнять задачу вечно, если вы что-то с ней не сделаете. Возможно, вам понадобится способ остановить такие задачи, иначе вы можете получить ошибки, если браузер не сможет выполнить какие-либо другие версии задачи или если анимация, обрабатываемая задачей, завершилась. Вы можете сделать это так же, как останавливаете timeouts - передавая идентификатор, возвращаемый вызовом setInterval (), в функцию clearInterval ():

+ +
const myInterval = setInterval(myFunction, 2000);
+
+clearInterval(myInterval);
+ +

Активное обучение: Создание собственного секундомера!

+ +

Учитывая все вышесказанное, у нас есть для вас задача. Возьмите копию нашего примера setInterval-clock.html , и измените её так, чтобы создать свой собственный простой секундомер.

+ +

Вам нужно отображать время, как и раньше, но в этом примере вам нужно:

+ + + +

Несколько подсказок для вас:

+ + + +
+

Note: Если вы застряли, вы можете увидеть нашу версию (см. также исходный код ).

+
+ +

Что нужно помнить о setTimeout () и setInterval ()

+ +

При работе с setTimeout () и setInterval () следует помнить о нескольких вещах. Давайте рассмотрим их.

+ +

Рекурсивные таймауты

+ +

Есть ещё один способ использования setTimeout (): вы можете вызвать его рекурсивно для повторного запуска одного и того же кода вместо использования setInterval ().

+ +

В приведённом ниже примере используется рекурсивный setTimeout () для запуска переданной функции каждые 100 миллисекунд:

+ +
let i = 1;
+
+setTimeout(function run() {
+  console.log(i);
+  i++;
+  setTimeout(run, 100);
+}, 100);
+ +

Сравните приведённый выше пример со следующим - здесь используется setInterval () для достижения того же эффекта:

+ +
let i = 1;
+
+setInterval(function run() {
+  console.log(i);
+  i++
+}, 100);
+ +

Чем рекурсивный setTimeout () отличается от setInterval () ?

+ +

Разница между двумя версиями приведённого выше кода невелика.

+ + + +

Когда ваш код потенциально может занять больше времени, чем назначенный вами интервал времени, лучше использовать рекурсивный setTimeout () - это сохранит постоянный временной интервал между выполнениями независимо от того, сколько времени потребуется для выполнения кода, и вы избежите ошибок.

+ +

Немедленные таймауты

+ +

Использование 0 в качестве значения для setTimeout () позволяет планировать выполнение указанной колбэк-функции как можно скорее, но только после того, как будет запущен основной поток кода.

+ +

Например, код приведённый ниже (рабочий код) выводит alert содержащий "Hello", затем alert содержащий "World" как только вы нажмёте ОК в первом alert.

+ +
setTimeout(function() {
+  alert('World');
+}, 0);
+
+alert('Hello');
+ +

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

+ +

Очистка с помощью clearTimeout() или clearInterval()

+ +

clearTimeout () и clearInterval () используют один и тот же список записей для очистки. Интересно, что это означает, что вы можете использовать любой метод для очистки setTimeout () или setInterval ().

+ +

Для согласованности следует использовать clearTimeout () для очистки записей setTimeout () и clearInterval () для очистки записей setInterval (). Это поможет избежать путаницы.

+ +

requestAnimationFrame()

+ +

requestAnimationFrame() это специализированная функция цикла, созданная для эффективного запуска анимации в браузере. По сути, это современная версия setInterval () - она выполняет указанный блок кода до того, как браузер перерисовывает изображение, позволяя запускать анимацию с подходящей частотой кадров независимо от среды, в которой она выполняется.

+ +

Он был создан в ответ на проблемы с setInterval (), который, например, не работает с частотой кадров, оптимизированной для устройства, иногда пропускает кадры, продолжает работать, даже если вкладка не является активной вкладкой или анимация прокручивается со страницы и т. д.(Читай об этом больше в CreativeJS.)

+ +
+

Note: вы можете найти примеры использования requestAnimationFrame() в этом курсе — например в  Рисование графики, and Практика построения объектов.

+
+ +

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

+ +
function draw() {
+   // Drawing code goes here
+   requestAnimationFrame(draw);
+}
+
+draw();
+ +

Идея состоит в том, чтобы определить функцию, в которой ваша анимация обновляется (например, ваши спрайты перемещаются, счёт обновляется, данные обновляются или что-то ещё). Затем вы вызываете его, чтобы начать процесс. В конце функционального блока вы вызываете requestAnimationFrame () со ссылкой на функцию, переданной в качестве параметра, и это даёт браузеру указание вызвать функцию снова при следующей перерисовке дисплея. Затем он выполняется непрерывно, поскольку код рекурсивно вызывает requestAnimationFrame ().

+ +
+

Note: Если вы хотите выполнить простое постоянное анимирование DOM , CSS Анимация вероятно будет быстрее. Она вычисляется непосредственно внутренним кодом браузера, а не JavaScript.

+ +

Однако, если вы делаете что-то более сложное, включающее объекты, которые не доступны напрямую в the DOM (такие как 2D Canvas API или WebGL ), requestAnimationFrame() предпочтительный вариант в большинстве случаев.

+
+ +

Как быстро работает ваша анимация?

+ +

Плавность анимации напрямую зависит от частоты кадров анимации и измеряется в кадрах в секунду (fps). Чем выше это число, тем плавное будет выглядеть ваша анимация до точки.

+ +

Поскольку большинство экранов имеют частоту обновления 60 Гц, максимальная частота кадров, к которой вы можете стремиться, составляет 60 кадров в секунду (FPS) при работе с веб-браузерами. Однако большее количество кадров означает больше обработки, которая часто может вызывать заикание и пропуски, также известные как пропадание кадров или заедание.

+ +

Если у вас есть монитор с частотой обновления 60 Гц и вы хотите достичь 60 кадров в секунду, у вас есть около 16,7 миллисекунд (1000/60) для выполнения кода анимации для рендеринга каждого кадра. Это напоминание о том, что вам нужно помнить об объёме кода, который вы пытаетесь запустить во время каждого прохождения цикла анимации.

+ +

requestAnimationFrame () всегда пытается приблизиться к этому волшебному значению 60 FPS, насколько это возможно. Иногда это невозможно - если у вас действительно сложная анимация и вы запускаете её на медленном компьютере, частота кадров будет меньше. Во всех случаях requestAnimationFrame () всегда будет делать все возможное с тем, что у него есть.

+ +

Чем отличается requestAnimationFrame() от setInterval() and setTimeout()?

+ +

Давайте поговорим ещё немного о том, чем метод requestAnimationFrame () отличается от других методов, используемых ранее. Глядя на наш код сверху:

+ +
function draw() {
+   // Drawing code goes here
+   requestAnimationFrame(draw);
+}
+
+draw();
+ +

Такой же код с использованием setInterval():

+ +
function draw() {
+   // Drawing code goes here
+}
+
+setInterval(draw, 17);
+ +

Как мы уже говорили ранее, вы не указываете временной интервал для requestAnimationFrame (). Просто он работает максимально быстро и плавно в текущих условиях. Браузер также не тратит время на запуск, если по какой-то причине анимация выходит за пределы экрана и т. д.

+ +

setInterval (), с другой стороны, требует указания интервала. Мы пришли к нашему окончательному значению 17 по формуле 1000 миллисекунд / 60 Гц, а затем округлили его в большую сторону. Округление - хорошая идея; если вы округлите в меньшую сторону, браузер может попытаться запустить анимацию со скоростью, превышающей 60 кадров в секунду, и в любом случае это не повлияет на плавность анимации. Как мы уже говорили, стандартная частота обновления - 60 Гц.

+ +

В том числе временная метка

+ +

Фактическому колбэку, переданному в функцию requestAnimationFrame (), также может быть задан параметр: значение отметки времени, которое представляет время с момента начала работы requestAnimationFrame ().

+ +

Это полезно, поскольку позволяет запускать вещи в определённое время и в постоянном темпе, независимо от того, насколько быстрым или медленным может быть ваше устройство. Общий шаблон, который вы бы использовали, выглядит примерно так:

+ +
let startTime = null;
+
+function draw(timestamp) {
+    if (!startTime) {
+      startTime = timestamp;
+    }
+
+   currentTime = timestamp - startTime;
+
+   // Do something based on current time
+
+   requestAnimationFrame(draw);
+}
+
+draw();
+ +

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

+ +

requestAnimationFrame () поддерживается в более поздних версиях браузеров, чем setInterval () / setTimeout (). Интересно, что он доступен в Internet Explorer 10 и выше.

+ +

Итак, если вам не требуется поддержка старых версий IE, нет особых причин не использовать requestAnimationFrame().

+ +

Простой пример

+ +

Хватит теории! Давайте выполним упражнение с использованием requestAnimationFrame() . Создадим простую анимацию "spinner animation"—вы могли её видеть в приложениях когда происходят задержки при ответе с сервера и т.п..

+ +
+

Note: Для такой простой анимации, вам следовало бы использовать CSS . Однако такой вид анимации очень полезен для демонстрации requestAnimationFrame() , вы скорее всего будете использовать этот метод когда делаете что-то более сложное, например обновление отображения игры в каждом кадре.

+
+ +
    +
  1. +

    Возьмите базовый HTML шаблон (такой как этот).

    +
  2. +
  3. +

    Поместите пустой  {{htmlelement("div")}} элемент внутри элемента {{htmlelement("body")}}, затем добавьте внутрь символ ↻ . Этот символ будет действовать как spinner в нашем примере.

    +
  4. +
  5. +

    Примените следующий CSS к HTML шаблону (любым предпочитаемым способом). Он установ красный фон на странице, высоту <body> равную 100% высоты {{htmlelement("html")}} , и центрирует <div> внутри <body>, по горизонтали и вертикали.

    + +
    html {
    +  background-color: white;
    +  height: 100%;
    +}
    +
    +body {
    +  height: inherit;
    +  background-color: red;
    +  margin: 0;
    +  display: flex;
    +  justify-content: center;
    +  align-items: center;
    +}
    +
    +div {
    +  display: inline-block;
    +  font-size: 10rem;
    +}
    +
  6. +
  7. +

    Разместите  {{htmlelement("script")}} элемент перед </body> .

    +
  8. +
  9. +

    Разместите следующий JavaScript-код в  <script> . Здесь вы сохраняете ссылку на <div> внутри, устанавливаете для переменной rotateCount значение 0, устанавливаете неинициализированную переменную, которая позже будет использоваться для хранения ссылки на вызов requestAnimationFrame(), и устанавливаете для переменной startTime значение null, которая будет позже использоваться для хранения времени начала requestAnimationFrame().

    + +
    const spinner = document.querySelector('div');
    +let rotateCount = 0;
    +let startTime = null;
    +let rAF;
    +
    +
  10. +
  11. +

    Под предыдущим кодом вставьте функцию draw() которая будет использоваться для хранения нашего кода анимации, который включает параметр timestamp :

    + +
    function draw(timestamp) {
    +
    +}
    +
  12. +
  13. +

    Внутри draw () добавьте следующие строки. Они определят время начала, если оно ещё не определено (это произойдёт только на первой итерации цикла), и установят для параметра rotateCount значение для поворота счётчика (текущая временная метка, возьмите начальную временную метку, разделённую на три, чтобы замедлиться):

    + +
      if (!startTime) {
    +   startTime = timestamp;
    +  }
    +
    +  rotateCount = (timestamp - startTime) / 3;
    +
    +
  14. +
  15. +

    Под предыдущей строкой внутри draw () добавьте следующий блок - он проверяет, превышает ли значение rotateCount 359 (например, 360, полный круг). Если это так, он устанавливает значение по модулю 360 (то есть остаток, оставшийся после деления значения на 360), поэтому круговая анимация может продолжаться непрерывно с разумным низким значением. Обратите внимание, что это не является строго необходимым, но легче работать со значениями от 0 до 359 градусов, чем со значениями типа «128000 градусов».

    + +
    if (rotateCount > 359) {
    +  rotateCount %= 360;
    +}
    +
  16. +
  17. Затем, под предыдущим блоком, добавьте следующую строку, чтобы вращать spinner: +
    spinner.style.transform = `rotate(${rotateCount}deg)`;
    +
  18. +
  19. +

    В самом низу внутри функции draw () вставьте следующую строку. Это ключ ко всей операции - вы устанавливаете для переменной, определённой ранее, активный вызов requestAnimation (), который принимает функцию draw () в качестве своего параметра. Это запускает анимацию, постоянно выполняя функцию draw () со скоростью, близкой к 60 FPS.

    + +
    rAF = requestAnimationFrame(draw);
    +
  20. +
  21. +

    Ниже, вызовите функцию draw() для запуска анимации.

    + +
    draw();
    +
  22. +
+ +
+

Note: вы можете посмотреть рабочий образец на GitHub. ( исходный код.)

+
+ +

Очистка вызова  requestAnimationFrame() 

+ +

Очистить вызов requestAnimationFrame () можно, вызвав соответствующий метод cancelAnimationFrame (). (Обратите внимание, что имя функции начинается с «cancel», а не «clear», как у методов «set ...».)

+ +

Просто передайте ему значение, возвращаемое вызовом requestAnimationFrame () для отмены, которое вы сохранили в переменной rAF:

+ +
cancelAnimationFrame(rAF);
+ +

Активное обучение: запуск и остановка нашей анимации

+ +

В этом упражнении мы хотели бы, чтобы вы протестировали метод cancelAnimationFrame (), взяв наш предыдущий пример и обновив его, добавив обработчик событий для запуска и остановки счётчика при щелчке мышью в любом месте страницы.

+ +

Подсказки:

+ + + +
+

Note: Для начала попробуйте сами; если вы действительно застряли, посмотрите наш живой пример и исходный код.

+
+ +

Регулировка анимации requestAnimationFrame() 

+ +

Одним из ограничений requestAnimationFrame () является то, что вы не можете выбирать частоту кадров. В большинстве случаев это не проблема, так как обычно вы хотите, чтобы ваша анимация работала как можно плавное. Но как насчёт того, чтобы создать олдскульную 8-битную анимацию?

+ +

Это было проблемой, например в анимации ходьбы, вдохновлённой островом обезьян, из статьи Drawing Graphics:

+ +

{{EmbedGHLiveSample("learning-area/javascript/apis/drawing-graphics/loops_animation/7_canvas_walking_animation.html", '100%', 260)}}

+ +

В этом примере вы должны анимировать как положение персонажа на экране, так и отображаемый спрайт. В анимации спрайта всего 6 кадров. Если бы вы показывали разные кадры спрайта для каждого кадра, отображаемого на экране, с помощью requestAnimationFrame (), Guybrush двигал бы конечностями слишком быстро, и анимация выглядела бы нелепо. Следовательно, в этом примере регулируется скорость, с которой спрайт циклически повторяет свои кадры, используя следующий код:

+ +
if (posX % 13 === 0) {
+  if (sprite === 5) {
+    sprite = 0;
+  } else {
+    sprite++;
+  }
+}
+ +

Таким образом, код циклически повторяет спрайт только один раз каждые 13 кадров анимации.

+ +

... Фактически, это примерно каждые 6,5 кадров, поскольку мы обновляем posX (положение персонажа на экране) на два кадра:

+ +
if (posX > width/2) {
+  newStartPos = -( (width/2) + 102 );
+  posX = Math.ceil(newStartPos / 13) * 13;
+  console.log(posX);
+} else {
+  posX += 2;
+}
+ +

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

+ +

Метод, который вы используете для регулирования анимации, будет зависеть от вашего конкретного кода. Например, в предыдущем примере счётчика вы могли заставить его двигаться медленнее, увеличивая rotateCount только на единицу в каждом кадре вместо двух.

+ +

Активное обучение: игра на реакцию

+ +

В последнем разделе этой статьи вы создадите игру на реакцию для двух игроков. В игре будет два игрока, один из которых управляет игрой с помощью клавиши A, а другой - с помощью клавиши L.

+ +

При нажатии кнопки «Start» счётчик, подобный тому, что мы видели ранее, отображается в течение случайного промежутка времени от 5 до 10 секунд. По истечении этого времени появится сообщение «PLAYERS GO !!» - как только это произойдёт, первый игрок, который нажмёт свою кнопку управления, выиграет игру.

+ +

{{EmbedGHLiveSample("learning-area/javascript/asynchronous/loops-and-intervals/reaction-game.html", '100%', 500)}}

+ +

Давайте поработаем над этим:

+ +
    +
  1. +

    Прежде всего, скачайте стартовый файл. Он содержит законченную структуру HTML и стили CSS, что даёт нам игровую доску, которая показывает информацию двух игроков (как показано выше), но с счётчиком и параграфом результатов, отображаемыми друг над другом. Вам нужно просто написать JavaScript-код.

    +
  2. +
  3. +

    Внутри пустого элемента {{htmlelement("script")}} на вашей странице, начните с добавления следующих строк кода, которые определяют некоторые переменные и константы, которые вам понадобятся в дальнейшем:

    + +
    const spinner = document.querySelector('.spinner p');
    +const spinnerContainer = document.querySelector('.spinner');
    +let rotateCount = 0;
    +let startTime = null;
    +let rAF;
    +const btn = document.querySelector('button');
    +const result = document.querySelector('.result');
    + +

    В следующем порядке:

    + +
      +
    1. Ссылка на спиннер, чтобы вы могли его анимировать.
    2. +
    3. Ссылка на элемент {{htmlelement("div")}} содержащий спиннер, используемый для отображения и скрытия.
    4. +
    5. Счётчик поворотов. Он определяет, на сколько вы хотите показывать вращение спиннера на каждом кадре анимации.
    6. +
    7. Нулевое время начала. Это будет заполнено временем начала, когда счётчик начнёт вращаться.
    8. +
    9. Неинициализированная переменная для последующего хранения вызова {{domxref("Window.requestAnimationFrame", "requestAnimationFrame()")}} который анимирует спиннер.
    10. +
    11. Ссылка на кнопку Start .
    12. +
    13. Ссылка на параграф результатов.
    14. +
    +
  4. +
  5. +

    Ниже добавьте следующую функцию. Она просто берёт два числа и возвращает случайное число между ними. Это понадобится вам позже, чтобы сгенерировать случайный интервал ожидания.

    + +
    function random(min,max) {
    +  var num = Math.floor(Math.random()*(max-min)) + min;
    +  return num;
    +}
    +
  6. +
  7. +

    Затем добавьте функцию draw(), которая анимирует спиннер. Это очень похоже на версию из предыдущего примера простого счётчика:

    + +
    function draw(timestamp) {
    +  if(!startTime) {
    +   startTime = timestamp;
    +  }
    +
    +  rotateCount = (timestamp - startTime) / 3;
    +
    +  if(rotateCount > 359) {
    +    rotateCount %= 360;
    +  }
    +
    +  spinner.style.transform = 'rotate(' + rotateCount + 'deg)';
    +  rAF = requestAnimationFrame(draw);
    +}
    +
  8. +
  9. +

    Теперь пришло время настроить начальное состояние приложения при первой загрузке страницы. Добавьте следующие две строки, которые просто скрывают абзац результатов и контейнер счётчика с помощью display: none ;.

    + +
    result.style.display = 'none';
    +spinnerContainer.style.display = 'none';
    +
  10. +
  11. +

    Затем определите функцию reset (), которая возвращает приложение в исходное состояние, необходимое для повторного запуска игры после её завершения. Добавьте в конец кода следующее:

    + +
    function reset() {
    +  btn.style.display = 'block';
    +  result.textContent = '';
    +  result.style.display = 'none';
    +}
    +
  12. +
  13. +

    Хорошо, хватит подготовки! Пришло время сделать игру доступной! Добавьте в свой код следующий блок. Функция start () вызывает draw (), чтобы запустить вращение спиннера и отобразить его в пользовательском интерфейсе, скрыть кнопку Start, чтобы вы не могли испортить игру, запустив её несколько раз одновременно, и запускает вызов setTimeout (), который выполняется функция setEndgame () по прошествии случайного интервала от 5 до 10 секунд. Следующий блок также добавляет обработчик событий к вашей кнопке для запуска функции start () при её нажатии.

    + +
    btn.addEventListener('click', start);
    +
    +function start() {
    +  draw();
    +  spinnerContainer.style.display = 'block';
    +  btn.style.display = 'none';
    +  setTimeout(setEndgame, random(5000,10000));
    +}
    + +
    +

    Note: вы увидите, что этот пример вызывает setTimeout() без сохранения возвращаемого значения. (не  let myTimeout = setTimeout(functionName, interval).) 

    + +

    Это прекрасно работает, если вам не нужно очищать интервал / тайм-аут в любой момент. Если вы это сделаете, вам нужно будет сохранить возвращённый идентификатор!

    +
    + +

    Конечным результатом предыдущего кода является то, что при нажатии кнопки «Start» отображается спиннер, и игроки вынуждены ждать произвольное количество времени, прежде чем их попросят нажать их кнопку. Эта последняя часть обрабатывается функцией setEndgame (), которую вы определите позже.

    +
  14. +
  15. +

    Добавьте в свой код следующую функцию:

    + +
    function setEndgame() {
    +  cancelAnimationFrame(rAF);
    +  spinnerContainer.style.display = 'none';
    +  result.style.display = 'block';
    +  result.textContent = 'PLAYERS GO!!';
    +
    +  document.addEventListener('keydown', keyHandler);
    +
    +  function keyHandler(e) {
    +    let isOver = false;
    +    console.log(e.key);
    +
    +    if (e.key === "a") {
    +      result.textContent = 'Player 1 won!!';
    +      isOver = true;
    +    } else if (e.key === "l") {
    +      result.textContent = 'Player 2 won!!';
    +      isOver = true;
    +    }
    +
    +    if (isOver) {
    +      document.removeEventListener('keydown', keyHandler);
    +      setTimeout(reset, 5000);
    +    }
    +  };
    +}
    + +

    Выполните следующие инструкции:

    + +
      +
    1. Во-первых, отмените анимацию спиннера с помощью {{domxref("window.cancelAnimationFrame", "cancelAnimationFrame()")}} (всегда полезно очистить ненужные процессы), и скройте контейнер счётчика.
    2. +
    3. Затем, отобразите абзац с результатами и установите для его текстового содержимого значение "PLAYERS GO!!"  чтобы сообщить игрокам, что теперь они могут нажать свою кнопку, чтобы победить.
    4. +
    5. Прикрепите к документу обработчик событий keydown . При нажатии любой кнопки запускается функция keyHandler().
    6. +
    7. Внутри keyHandler(), код включает объект события в качестве параметра (представленного e) — его свойство {{domxref("KeyboardEvent.key", "key")}} содержит только что нажатую клавишу, и вы можете использовать это для ответа на определённые нажатия клавиш определёнными действиями.
    8. +
    9. Установите для переменной isOver значение false, чтобы мы могли отслеживать, были ли нажаты правильные клавиши, чтобы игрок 1 или 2 выиграл. Мы не хотим, чтобы игра заканчивалась при нажатии неправильной клавиши.
    10. +
    11. Регистрация e.key в консоли, это полезный способ узнать значение различных клавиш, которые вы нажимаете.
    12. +
    13. Когда e.key принимает значение "a", отобразить сообщение о том, что Player 1 выиграл, а когда e.key это "l", отобразить сообщение о том, что Player 2 выиграл. (Note: Это будет работать только со строчными буквами a и l — если переданы прописные A или L , это считается другими клавишами!) Если была нажата одна из этих клавиш, установите для isOver значение true.
    14. +
    15. Только если isOver равно true, удалите обработчик событий keydown с помощью {{domxref("EventTarget.removeEventListener", "removeEventListener()")}} чтобы после того, как произошло выигрышное нажатие, больше не было возможности ввода с клавиатуры, чтобы испортить финальный результат игры. Вы также используете setTimeout() для вызова reset() через 5 секунд — как объяснялось ранее, эта функция сбрасывает игру обратно в исходное состояние, чтобы можно было начать новую игру.
    16. +
    +
  16. +
+ +

Вот и все - вы справились!

+ +
+

Note: Если вы где то застряли, взгляните на наша версия игры (см. также исходный код ).

+
+ +

Заключение

+ +

Вот и все — все основы асинхронных циклов и интервалов рассмотрены в статье. Вы найдёте эти методы полезными во многих ситуациях, но постарайтесь не злоупотреблять ими! Поскольку они по-прежнему выполняются в основном потоке, тяжёлые и интенсивные колбэки (особенно те, которые управляют DOM) могут действительно замедлить страницу, если вы не будете осторожны.

+ +

{{PreviousMenuNext("Learn/JavaScript/Asynchronous/Introducing", "Learn/JavaScript/Asynchronous/Promises", "Learn/JavaScript/Asynchronous")}}

+ +

В этом модуле

+ + + +
+
+
diff --git a/files/ru/conflicting/learn/javascript/asynchronous/introducing/index.html b/files/ru/conflicting/learn/javascript/asynchronous/introducing/index.html new file mode 100644 index 0000000000..1257b751b8 --- /dev/null +++ b/files/ru/conflicting/learn/javascript/asynchronous/introducing/index.html @@ -0,0 +1,165 @@ +--- +title: Основные понятия асинхронного программирования +slug: conflicting/Learn/JavaScript/Asynchronous/Introducing +tags: + - JavaScript + - Promises + - Асинхронность + - Обучение + - блокировки + - потоки +translation_of: Learn/JavaScript/Asynchronous/Concepts +original_slug: Learn/JavaScript/Asynchronous/Concepts +--- +
{{LearnSidebar}}{{NextMenu("Learn/JavaScript/Asynchronous/Introducing", "Learn/JavaScript/Asynchronous")}}
+ +

В этой статье мы бегло познакомимся с основными понятиями, связанными с асинхронным программированием и как они применяются в веб браузерах и  JavaScript. Вы должны понять эти концепции, прежде чем приступать к другим статьям этого раздела.

+ + + + + + + + + + + + +
Необходимые знания:Базовая компьютерная грамотность, знакомство с основами JavaScript.
Цель:Понять основные идеи асинхронного программирования, и как они проявляются в веб-браузерах и JavaScript.
+ +

Что же такое Асинхронность?

+ +

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

+ +

Пользователь современного ПК, наверняка, наблюдал, как курсор меняет свой вид и становится "разноцветным спинером" (у пользователей MacOS). Таким образом операционная система сообщает - "текущая программа, ожидает завершения какого то длительного процесса в системе и я решила сообщить тебе, что бы ты не волновался".

+ +

Multi-colored macOS beachball busy spinner

+ +

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

+ +

Блокировка кода

+ +

Асинхронные техники очень полезны, особенно при веб разработке. Когда ваше приложение запущено в браузере и выполняет свои задачи, не возвращая контроль окружению, браузер может подвисать. Это называется блокировка; браузер заблокирован и не может реагировать на действия пользователя и выполнять служебные.задачи, до тех пор пока веб приложение не освободит ресурсы процессора.

+ +

Давайте рассмотрим несколько примеров, которые покажут, что именно значит блокировка.

+ +

В нашем simple-sync.html примере (see it running live), добавим кнопке событие на клик, чтобы при нажатии на неё запускалась трудоёмкая операция (расчёт 10000000 дат, и вывод последней рассчитанной даты на консоль) после чего в DOM добавляется ещё один параграф:

+ +
const btn = document.querySelector('button');
+btn.addEventListener('click', () => {
+  let myDate;
+  for(let i = 0; i < 10000000; i++) {
+    let date = new Date();
+    myDate = date
+  }
+
+  console.log(myDate);
+
+  let pElem = document.createElement('p');
+  pElem.textContent = 'This is a newly-added paragraph.';
+  document.body.appendChild(pElem);
+});
+ +

Когда запустите этот пример, откройте JavaScript консоль и нажмите на кнопку — вы заметите, что параграф не появится на странице, до тех пор пока все даты не будут рассчитаны и результат последнего вычисления не будет выведен на консоль. Этот код выполняется в том порядке, в котором он написан в файле и самая последняя операция не будет запущена, пока не завершатся все операции перед ней.

+ +
+

Примечание: Предыдущий пример слишком не реальный. Вам никогда не понадобится считать столько дат в реальном приложении! Однако, он помогает вам понять основную идею.

+
+ +

В нашем следующем примере, simple-sync-ui-blocking.html (посмотреть пример), мы сделаем что-нибудь более реалистичное, с чем вы сможете столкнуться на реальной странице. Мы заблокируем действия пользователя отрисовкой страницы. В этом примере у нас две кнопки:

+ + + +
function expensiveOperation() {
+  for(let i = 0; i < 1000000; i++) {
+    ctx.fillStyle = 'rgba(0,0,255, 0.2)';
+    ctx.beginPath();
+    ctx.arc(random(0, canvas.width), random(0, canvas.height), 10, degToRad(0), degToRad(360), false);
+    ctx.fill()
+  }
+}
+
+fillBtn.addEventListener('click', expensiveOperation);
+
+alertBtn.addEventListener('click', () =>
+  alert('You clicked me!')
+);
+ +

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

+ +
+

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

+
+ +

Почему так происходит? Потому что JavaScript, в общем случае, выполняет команды в одном потоке. Пришло время познакомиться с понятием потока.

+ +

Потоки

+ +

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

+ +
Task A --> Task B --> Task C
+ +

Каждая задача будет выполнена последовательно; только когда текущая задача завершится, следующая сможет начаться.

+ +

Как мы говорили выше, большинство компьютеров теперь имеют процессор с несколькими ядрами, т.е. могут выполнять несколько задач одновременно. Языки программирования, поддерживающие многопоточность, могут использовать несколько ядер, чтобы выполнять несколько задач одновременно:

+ +
Thread 1: Task A --> Task B
+Thread 2: Task C --> Task D
+ +

JavaScript однопоточный

+ +

JavaScript, традиционно для скриптовых языков, однопоточный. Даже, если есть несколько ядер, вы можете использовать их только для выполнения задач в одном потоке, называемом основной поток. Наш пример выше, выполняется следующим образом:

+ +
Main thread: Render circles to canvas --> Display alert()
+ +

В итоге, JavaScript получил несколько инструментов, которые могут помочь в решении подобных проблем. Web workers позволяют вам обработать некоторый JavaScript-код в отдельном потоке, который называется обработчик, таким образом вы можете запускать отдельные блоки JavaScript-кода одновременно. В основном, вы будете использовать воркеры, чтобы запустить ресурсоёмкий процесс, отдельно от основного потока, чтобы не блокировать действия пользователя.

+ +
  Main thread: Task A --> Task C
+Worker thread: Expensive task B
+ +

Помня об этом, выполните наш следующий пример simple-sync-worker.html (посмотреть пример в действии), с открытой консолью. Это переписанный предыдущий пример, который теперь рассчитывает 10 миллионов дат в отдельном потоке обработчика. Теперь, когда вы нажимаете на кнопку, браузер может добавить новый элемент на страницу, до того как все даты будут посчитаны. Самая первая операция больше не блокирует выполнение следующей.

+ +

Асинхронный код

+ +

Воркеры полезный инструмент, но у них есть свои ограничения. Самое существенное, заключается в том, что они не имеют доступа к {{Glossary("DOM")}} — вы не можете использовать воркер для обновления UI. Мы не можем отрисовать миллион наших точек  внутри воркера; он может только обработать большой объем информации.

+ +

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

+ +
Main thread: Task A --> Task B
+ +

В этом примере, предположим Task A делает что-то вроде получения картинки с сервера а Task B затем делает что-нибудь с полученной картинкой, например, применяет к ней фильтр. Если запустить выполняться Task A и тут же попытаться выполнить Task B, то вы получите ошибку, поскольку картинка ещё не будет доступна.

+ +
  Main thread: Task A --> Task B --> |Task D|
+Worker thread: Task C -----------> |      |
+ +

Теперь, давайте предположим, что Task D использует результат выполнения обеих задач Task B и Task C. Если мы уверенны, что оба результата будут доступны одновременно, тогда не возникнет проблем, однако, часто это не так. Если Task D попытаться запустить, когда какого-то нужного ей результата ещё нет, выполнение закончится ошибкой.

+ +

Чтобы избежать подобных проблем, браузеры позволяют нам выполнять определённые операции асинхронно. Такие возможности, как Promises позволяют запустить некоторую операцию (например, получение картинки с сервера), и затем подождать пока операция не вернёт результат, перед тем как начать выполнение другой задачи:

+ +
Main thread: Task A                   Task B
+    Promise:      |__async operation__|
+ +

Поскольку операция выполняется где-то отдельно, основной поток не блокируется, при выполнении асинхронных задач.

+ +

В следующей статье, мы покажем вам, как писать асинхронный код. Захватывает дух, неправда ли? Продолжайте читать!

+ +

Заключение

+ +

При проектировании современных программ все больше используется асинхронное программирование, чтобы программа имела возможность выполнять несколько операций в конкретный момент времени. Как только вы начнёте использовать новые, более мощные возможности API, вы обнаружите множество ситуаций, где решить нужную задачу можно только асинхронно. Раньше было сложно писать асинхронный код. До сих пор, нужно время, чтобы привыкнуть к такому подходу, но процесс стал намного легче. Далее, в этом разделе, мы будем глубже исследовать вопрос, когда же асинхронный код необходим и как спроектировать программу, чтобы избежать проблем, описанных выше.

+ +

В этом модуле

+ + -- cgit v1.2.3-54-g00ecf From ba8d3f6f9d418e3b7fdfe79ccfb6e7a6ffb7f566 Mon Sep 17 00:00:00 2001 From: MDN Date: Sat, 12 Mar 2022 00:12:34 +0000 Subject: [CRON] sync translated content --- files/de/_redirects.txt | 1 + files/de/_wikihistory.json | 14 +- files/de/conflicting/tools/index.html | 10 ++ files/de/tools/index/index.html | 9 - files/es/_redirects.txt | 5 +- files/es/_wikihistory.json | 30 ++-- files/es/conflicting/web/html/index.html | 9 + files/es/conflicting/web/svg/index.html | 7 + files/es/web/api/eventsource/onopen/index.html | 52 ------ files/es/web/api/eventsource/open_event/index.html | 53 ++++++ files/es/web/html/index/index.html | 9 - files/es/web/svg/index/index.html | 6 - files/fr/_redirects.txt | 23 ++- files/fr/_wikihistory.json | 128 +++++++------ files/fr/conflicting/games/index.md | 11 ++ files/fr/conflicting/glossary/index.md | 11 ++ files/fr/conflicting/learn/index.md | 12 ++ .../mozilla/add-ons/webextensions/index.md | 11 ++ files/fr/conflicting/tools/index.html | 9 + files/fr/conflicting/web/html/index.md | 10 ++ files/fr/conflicting/web/http/index.md | 16 ++ files/fr/conflicting/web/mathml/index.md | 9 + files/fr/conflicting/web/svg/index.md | 9 + files/fr/conflicting/web/xslt/index.md | 9 + files/fr/games/index/index.md | 11 -- files/fr/glossary/index/index.md | 11 -- files/fr/learn/index/index.md | 12 -- .../mozilla/add-ons/webextensions/index/index.md | 10 -- files/fr/tools/index/index.html | 9 - files/fr/web/api/eventsource/onopen/index.md | 42 ----- files/fr/web/api/eventsource/open_event/index.md | 43 +++++ files/fr/web/html/index/index.md | 9 - files/fr/web/http/index/index.md | 15 -- files/fr/web/mathml/index/index.md | 8 - files/fr/web/svg/index/index.md | 8 - files/fr/web/xslt/index/index.md | 9 - files/ja/_redirects.txt | 21 ++- files/ja/_wikihistory.json | 200 ++++++++++----------- files/ja/conflicting/games/index.html | 12 ++ files/ja/conflicting/glossary/index.html | 12 ++ files/ja/conflicting/learn/index.html | 11 ++ .../mozilla/add-ons/webextensions/index.html | 15 ++ files/ja/conflicting/tools/index.html | 10 ++ files/ja/conflicting/web/accessibility/index.html | 12 ++ files/ja/conflicting/web/guide/index.html | 12 ++ files/ja/conflicting/web/html/index.html | 11 ++ files/ja/conflicting/web/http/index.html | 14 ++ files/ja/conflicting/web/mathml/index.html | 10 ++ files/ja/conflicting/web/svg/index.html | 10 ++ files/ja/conflicting/web/xpath/index.html | 16 ++ files/ja/conflicting/web/xslt/index.html | 13 ++ files/ja/conflicting/webassembly/index.html | 12 ++ files/ja/games/index/index.html | 11 -- files/ja/glossary/index/index.html | 11 -- files/ja/learn/index/index.html | 10 -- .../mozilla/add-ons/webextensions/index/index.html | 14 -- files/ja/tools/index/index.html | 9 - files/ja/web/accessibility/index/index.html | 11 -- .../ja/web/api/eventsource/error_event/index.html | 66 +++++++ .../web/api/eventsource/message_event/index.html | 70 ++++++++ files/ja/web/api/eventsource/onerror/index.html | 65 ------- files/ja/web/api/eventsource/onmessage/index.html | 69 ------- .../web/api/mediaquerylist/change_event/index.html | 73 ++++++++ .../ja/web/api/mediaquerylist/onchange/index.html | 72 -------- files/ja/web/guide/index/index.html | 11 -- files/ja/web/html/index/index.html | 10 -- files/ja/web/http/index/index.html | 13 -- files/ja/web/mathml/index/index.html | 9 - files/ja/web/svg/index/index.html | 9 - files/ja/web/xpath/index/index.html | 15 -- files/ja/web/xslt/index/index.html | 12 -- files/ja/webassembly/index/index.html | 11 -- files/ko/_redirects.txt | 6 + files/ko/_wikihistory.json | 75 +++----- files/ko/conflicting/games/index.html | 11 ++ files/ko/conflicting/glossary/index.html | 12 ++ files/ko/conflicting/learn/index.html | 11 ++ files/ko/conflicting/web/guide/index.html | 12 ++ files/ko/conflicting/web/html/index.html | 11 ++ files/ko/conflicting/web/http/index.html | 12 ++ files/ko/games/index/index.html | 10 -- files/ko/glossary/index/index.html | 11 -- files/ko/learn/index/index.html | 10 -- files/ko/web/guide/index/index.html | 11 -- files/ko/web/html/index/index.html | 10 -- files/ko/web/http/index/index.html | 11 -- files/pt-br/_redirects.txt | 1 + files/pt-br/_wikihistory.json | 2 +- .../web/api/eventsource/error_event/index.html | 122 +++++++++++++ files/pt-br/web/api/eventsource/onerror/index.html | 121 ------------- files/ru/_redirects.txt | 1 + files/ru/_wikihistory.json | 16 +- files/ru/conflicting/tools/index.html | 9 + files/ru/tools/index/index.html | 8 - files/zh-cn/_redirects.txt | 7 +- files/zh-cn/_wikihistory.json | 18 +- files/zh-cn/conflicting/web/html/index.html | 10 ++ .../web/api/eventsource/error_event/index.html | 56 ++++++ files/zh-cn/web/api/eventsource/onerror/index.html | 56 ------ files/zh-cn/web/api/eventsource/onopen/index.html | 57 ------ .../web/api/eventsource/open_event/index.html | 57 ++++++ files/zh-cn/web/html/index/index.html | 9 - 102 files changed, 1215 insertions(+), 1160 deletions(-) create mode 100644 files/de/conflicting/tools/index.html delete mode 100644 files/de/tools/index/index.html create mode 100644 files/es/conflicting/web/html/index.html create mode 100644 files/es/conflicting/web/svg/index.html delete mode 100644 files/es/web/api/eventsource/onopen/index.html create mode 100644 files/es/web/api/eventsource/open_event/index.html delete mode 100644 files/es/web/html/index/index.html delete mode 100644 files/es/web/svg/index/index.html create mode 100644 files/fr/conflicting/games/index.md create mode 100644 files/fr/conflicting/glossary/index.md create mode 100644 files/fr/conflicting/learn/index.md create mode 100644 files/fr/conflicting/mozilla/add-ons/webextensions/index.md create mode 100644 files/fr/conflicting/tools/index.html create mode 100644 files/fr/conflicting/web/html/index.md create mode 100644 files/fr/conflicting/web/http/index.md create mode 100644 files/fr/conflicting/web/mathml/index.md create mode 100644 files/fr/conflicting/web/svg/index.md create mode 100644 files/fr/conflicting/web/xslt/index.md delete mode 100644 files/fr/games/index/index.md delete mode 100644 files/fr/glossary/index/index.md delete mode 100644 files/fr/learn/index/index.md delete mode 100644 files/fr/mozilla/add-ons/webextensions/index/index.md delete mode 100644 files/fr/tools/index/index.html delete mode 100644 files/fr/web/api/eventsource/onopen/index.md create mode 100644 files/fr/web/api/eventsource/open_event/index.md delete mode 100644 files/fr/web/html/index/index.md delete mode 100644 files/fr/web/http/index/index.md delete mode 100644 files/fr/web/mathml/index/index.md delete mode 100644 files/fr/web/svg/index/index.md delete mode 100644 files/fr/web/xslt/index/index.md create mode 100644 files/ja/conflicting/games/index.html create mode 100644 files/ja/conflicting/glossary/index.html create mode 100644 files/ja/conflicting/learn/index.html create mode 100644 files/ja/conflicting/mozilla/add-ons/webextensions/index.html create mode 100644 files/ja/conflicting/tools/index.html create mode 100644 files/ja/conflicting/web/accessibility/index.html create mode 100644 files/ja/conflicting/web/guide/index.html create mode 100644 files/ja/conflicting/web/html/index.html create mode 100644 files/ja/conflicting/web/http/index.html create mode 100644 files/ja/conflicting/web/mathml/index.html create mode 100644 files/ja/conflicting/web/svg/index.html create mode 100644 files/ja/conflicting/web/xpath/index.html create mode 100644 files/ja/conflicting/web/xslt/index.html create mode 100644 files/ja/conflicting/webassembly/index.html delete mode 100644 files/ja/games/index/index.html delete mode 100644 files/ja/glossary/index/index.html delete mode 100644 files/ja/learn/index/index.html delete mode 100644 files/ja/mozilla/add-ons/webextensions/index/index.html delete mode 100644 files/ja/tools/index/index.html delete mode 100644 files/ja/web/accessibility/index/index.html create mode 100644 files/ja/web/api/eventsource/error_event/index.html create mode 100644 files/ja/web/api/eventsource/message_event/index.html delete mode 100644 files/ja/web/api/eventsource/onerror/index.html delete mode 100644 files/ja/web/api/eventsource/onmessage/index.html create mode 100644 files/ja/web/api/mediaquerylist/change_event/index.html delete mode 100644 files/ja/web/api/mediaquerylist/onchange/index.html delete mode 100644 files/ja/web/guide/index/index.html delete mode 100644 files/ja/web/html/index/index.html delete mode 100644 files/ja/web/http/index/index.html delete mode 100644 files/ja/web/mathml/index/index.html delete mode 100644 files/ja/web/svg/index/index.html delete mode 100644 files/ja/web/xpath/index/index.html delete mode 100644 files/ja/web/xslt/index/index.html delete mode 100644 files/ja/webassembly/index/index.html create mode 100644 files/ko/conflicting/games/index.html create mode 100644 files/ko/conflicting/glossary/index.html create mode 100644 files/ko/conflicting/learn/index.html create mode 100644 files/ko/conflicting/web/guide/index.html create mode 100644 files/ko/conflicting/web/html/index.html create mode 100644 files/ko/conflicting/web/http/index.html delete mode 100644 files/ko/games/index/index.html delete mode 100644 files/ko/glossary/index/index.html delete mode 100644 files/ko/learn/index/index.html delete mode 100644 files/ko/web/guide/index/index.html delete mode 100644 files/ko/web/html/index/index.html delete mode 100644 files/ko/web/http/index/index.html create mode 100644 files/pt-br/web/api/eventsource/error_event/index.html delete mode 100644 files/pt-br/web/api/eventsource/onerror/index.html create mode 100644 files/ru/conflicting/tools/index.html delete mode 100644 files/ru/tools/index/index.html create mode 100644 files/zh-cn/conflicting/web/html/index.html create mode 100644 files/zh-cn/web/api/eventsource/error_event/index.html delete mode 100644 files/zh-cn/web/api/eventsource/onerror/index.html delete mode 100644 files/zh-cn/web/api/eventsource/onopen/index.html create mode 100644 files/zh-cn/web/api/eventsource/open_event/index.html delete mode 100644 files/zh-cn/web/html/index/index.html (limited to 'files/ru/conflicting') diff --git a/files/de/_redirects.txt b/files/de/_redirects.txt index f6ee4d81d4..0bdaf0f0ef 100644 --- a/files/de/_redirects.txt +++ b/files/de/_redirects.txt @@ -406,6 +406,7 @@ /de/docs/Tools/3D_untersuchung /de/docs/Tools/3D_View /de/docs/Tools/Barrierefreiheits_inspektor /de/docs/Tools/Accessibility_inspector /de/docs/Tools/Browser_Werkzeuge /de/docs/Tools/Browser_Toolbox +/de/docs/Tools/Index /de/docs/conflicting/Tools /de/docs/Tools/Page_Inspector/How_to/Event_Listener_untersuchen /de/docs/Tools/Page_Inspector/How_to/Examine_event_listeners /de/docs/Tools/Page_Inspector/How_to/Raster_Layout_untersuchen /de/docs/Tools/Page_Inspector/How_to/Examine_grid_layouts /de/docs/Tools/Seiten_Inspektor /de/docs/Tools/Page_Inspector diff --git a/files/de/_wikihistory.json b/files/de/_wikihistory.json index 544d6f1274..0303027ece 100644 --- a/files/de/_wikihistory.json +++ b/files/de/_wikihistory.json @@ -2007,13 +2007,6 @@ "AngelSankturio" ] }, - "Tools/Index": { - "modified": "2020-07-16T22:36:02.468Z", - "contributors": [ - "wbamberg", - "fscholz" - ] - }, "Tools/JSON_viewer": { "modified": "2020-07-16T22:36:31.343Z", "contributors": [ @@ -13538,6 +13531,13 @@ "Dria" ] }, + "conflicting/Tools": { + "modified": "2020-07-16T22:36:02.468Z", + "contributors": [ + "wbamberg", + "fscholz" + ] + }, "conflicting/Web/API": { "modified": "2019-03-23T23:21:31.048Z", "contributors": [ diff --git a/files/de/conflicting/tools/index.html b/files/de/conflicting/tools/index.html new file mode 100644 index 0000000000..8b7e222774 --- /dev/null +++ b/files/de/conflicting/tools/index.html @@ -0,0 +1,10 @@ +--- +title: Index +slug: conflicting/Tools +tags: + - Index + - Tools +translation_of: Tools/Index +original_slug: Tools/Index +--- +
{{ToolsSidebar}}

{{Index("/de/docs/Tools")}}

diff --git a/files/de/tools/index/index.html b/files/de/tools/index/index.html deleted file mode 100644 index 7505b123b1..0000000000 --- a/files/de/tools/index/index.html +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: Index -slug: Tools/Index -tags: - - Index - - Tools -translation_of: Tools/Index ---- -
{{ToolsSidebar}}

{{Index("/de/docs/Tools")}}

diff --git a/files/es/_redirects.txt b/files/es/_redirects.txt index f62d9cc572..7465e846fa 100644 --- a/files/es/_redirects.txt +++ b/files/es/_redirects.txt @@ -1543,6 +1543,7 @@ /es/docs/Web/API/Element/onwheel /es/docs/Web/API/GlobalEventHandlers/onwheel /es/docs/Web/API/ElementosHTMLparaVideo /es/docs/Web/API/HTMLVideoElement /es/docs/Web/API/Event/createEvent /es/docs/Web/API/Document/createEvent +/es/docs/Web/API/EventSource/onopen /es/docs/Web/API/EventSource/open_event /es/docs/Web/API/Fetch_API/Conceptos_basicos /es/docs/Web/API/Fetch_API/Basic_concepts /es/docs/Web/API/Fetch_API/Utilizando_Fetch /es/docs/Web/API/Fetch_API/Using_Fetch /es/docs/Web/API/File/fileName /es/docs/conflicting/Web/API/File/name @@ -1954,6 +1955,7 @@ /es/docs/Web/HTML/Elementos_en_línea /es/docs/Web/HTML/Inline_elements /es/docs/Web/HTML/Gestión_del_foco_en_HTML /es/docs/Web/API/Document/hasFocus /es/docs/Web/HTML/Imagen_con_CORS_habilitado /es/docs/Web/HTML/CORS_enabled_image +/es/docs/Web/HTML/Index /es/docs/conflicting/Web/HTML /es/docs/Web/HTML/Microdatos /es/docs/Web/HTML/Microdata /es/docs/Web/HTML/Optimizing_your_pages_for_speculative_parsing /es/docs/Glossary/speculative_parsing /es/docs/Web/HTML/Referencia /es/docs/Web/HTML/Reference @@ -1961,7 +1963,7 @@ /es/docs/Web/HTML/Transision_adaptativa_DASH /es/docs/Web/Media/DASH_Adaptive_Streaming_for_HTML_5_Video /es/docs/Web/HTML/anipular_video_por_medio_de_canvas /es/docs/Web/API/Canvas_API/Manipulating_video_using_canvas /es/docs/Web/HTML/microformatos /es/docs/Web/HTML/microformats -/es/docs/Web/HTML/Índice /es/docs/Web/HTML/Index +/es/docs/Web/HTML/Índice /es/docs/conflicting/Web/HTML /es/docs/Web/HTTP/Access_control_CORS /es/docs/Web/HTTP/CORS /es/docs/Web/HTTP/Basics_of_HTTP/Datos_URIs /es/docs/Web/HTTP/Basics_of_HTTP/Data_URIs /es/docs/Web/HTTP/Basics_of_HTTP/Identificación_recursos_en_la_Web /es/docs/Web/HTTP/Basics_of_HTTP/Identifying_resources_on_the_Web @@ -2533,6 +2535,7 @@ /es/docs/Web/Reference/Events/transitionend /es/docs/Web/API/HTMLElement/transitionend_event /es/docs/Web/Reference/Events/wheel /es/docs/Web/API/Element/wheel_event /es/docs/Web/SVG/Element/glifo /es/docs/Web/SVG/Element/glyph +/es/docs/Web/SVG/Index /es/docs/conflicting/Web/SVG /es/docs/Web/SVG/Tutorial/Introducción /es/docs/Web/SVG/Tutorial/Introduction /es/docs/Web/Security/Same-origin_politica /es/docs/Web/Security/Same-origin_policy /es/docs/Web/Security/Securing_your_site/desactivar_autocompletado_formulario /es/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion diff --git a/files/es/_wikihistory.json b/files/es/_wikihistory.json index 6156c5aff5..7cbcbe886f 100644 --- a/files/es/_wikihistory.json +++ b/files/es/_wikihistory.json @@ -6474,7 +6474,7 @@ "Jabi" ] }, - "Web/API/EventSource/onopen": { + "Web/API/EventSource/open_event": { "modified": "2019-03-23T22:03:59.180Z", "contributors": [ "Hoosep" @@ -15038,13 +15038,6 @@ "WriestTavo" ] }, - "Web/HTML/Index": { - "modified": "2019-01-16T22:12:02.767Z", - "contributors": [ - "raecillacastellana", - "pekechis" - ] - }, "Web/HTML/Inline_elements": { "modified": "2019-03-23T22:46:15.359Z", "contributors": [ @@ -20480,13 +20473,6 @@ "jorge_castro" ] }, - "Web/SVG/Index": { - "modified": "2019-01-16T22:36:49.773Z", - "contributors": [ - "jwhitlock", - "ComplementosMozilla" - ] - }, "Web/SVG/SVG_1.1_Support_in_Firefox": { "modified": "2019-03-23T23:43:25.545Z", "contributors": [ @@ -21559,6 +21545,13 @@ "wbamberg" ] }, + "conflicting/Web/HTML": { + "modified": "2019-01-16T22:12:02.767Z", + "contributors": [ + "raecillacastellana", + "pekechis" + ] + }, "conflicting/Web/HTML/Element": { "modified": "2020-01-21T22:36:54.135Z", "contributors": [ @@ -21823,6 +21816,13 @@ "totopizzahn" ] }, + "conflicting/Web/SVG": { + "modified": "2019-01-16T22:36:49.773Z", + "contributors": [ + "jwhitlock", + "ComplementosMozilla" + ] + }, "conflicting/Web/Web_Components/Using_custom_elements": { "modified": "2019-03-23T22:21:51.809Z", "contributors": [ diff --git a/files/es/conflicting/web/html/index.html b/files/es/conflicting/web/html/index.html new file mode 100644 index 0000000000..f99a5c972d --- /dev/null +++ b/files/es/conflicting/web/html/index.html @@ -0,0 +1,9 @@ +--- +title: Índice de la documentación HTML +slug: conflicting/Web/HTML +tags: + - HTML +translation_of: Web/HTML/Index +original_slug: Web/HTML/Index +--- +

{{Index("/es/docs/Web/HTML")}}

diff --git a/files/es/conflicting/web/svg/index.html b/files/es/conflicting/web/svg/index.html new file mode 100644 index 0000000000..274e4ad49c --- /dev/null +++ b/files/es/conflicting/web/svg/index.html @@ -0,0 +1,7 @@ +--- +title: SVG documentation index +slug: conflicting/Web/SVG +translation_of: Web/SVG/Index +original_slug: Web/SVG/Index +--- +

{{Index("/en-US/docs/Web/SVG")}}

diff --git a/files/es/web/api/eventsource/onopen/index.html b/files/es/web/api/eventsource/onopen/index.html deleted file mode 100644 index 59ee6537dd..0000000000 --- a/files/es/web/api/eventsource/onopen/index.html +++ /dev/null @@ -1,52 +0,0 @@ ---- -title: EventSource.onopen -slug: Web/API/EventSource/onopen -translation_of: Web/API/EventSource/onopen ---- -
{{APIRef('WebSockets API')}}
- -

La propiedad onopen de la interfaz  {{domxref("EventSource")}}  es un {{event("Event_handlers", "event handler")}} llamado cuando un evento  {{event("open")}} es recibido, esto pasa cuando la conexión fue solo abierta.

- -

Syntax

- -
eventSource.onopen = function
- -

Ejemplos

- -
evtSource.onopen = function() {
-  console.log("Connection to server opened.");
-};
- -
-

Nota: Tu puedes encontrar un ejemplo completo en GitHub — ve Simple SSE demo using PHP.

-
- -

Especificaciones

- - - - - - - - - - - - - - -
EspecificaciónEstadoComentario
{{SpecName('HTML WHATWG', "comms.html#handler-eventsource-onopen", "onopen")}}{{Spec2('HTML WHATWG')}}Initial definition
- - - -

Compatibilidad con navegadores

- -{{Compat("api.EventSource.onopen")}} - -

Mira también

- - diff --git a/files/es/web/api/eventsource/open_event/index.html b/files/es/web/api/eventsource/open_event/index.html new file mode 100644 index 0000000000..ea7b4d5d98 --- /dev/null +++ b/files/es/web/api/eventsource/open_event/index.html @@ -0,0 +1,53 @@ +--- +title: EventSource.onopen +slug: Web/API/EventSource/open_event +translation_of: Web/API/EventSource/onopen +original_slug: Web/API/EventSource/onopen +--- +
{{APIRef('WebSockets API')}}
+ +

La propiedad onopen de la interfaz  {{domxref("EventSource")}}  es un {{event("Event_handlers", "event handler")}} llamado cuando un evento  {{event("open")}} es recibido, esto pasa cuando la conexión fue solo abierta.

+ +

Syntax

+ +
eventSource.onopen = function
+ +

Ejemplos

+ +
evtSource.onopen = function() {
+  console.log("Connection to server opened.");
+};
+ +
+

Nota: Tu puedes encontrar un ejemplo completo en GitHub — ve Simple SSE demo using PHP.

+
+ +

Especificaciones

+ + + + + + + + + + + + + + +
EspecificaciónEstadoComentario
{{SpecName('HTML WHATWG', "comms.html#handler-eventsource-onopen", "onopen")}}{{Spec2('HTML WHATWG')}}Initial definition
+ + + +

Compatibilidad con navegadores

+ +{{Compat("api.EventSource.onopen")}} + +

Mira también

+ + diff --git a/files/es/web/html/index/index.html b/files/es/web/html/index/index.html deleted file mode 100644 index 388b7b4d96..0000000000 --- a/files/es/web/html/index/index.html +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: Índice de la documentación HTML -slug: Web/HTML/Index -tags: - - HTML -translation_of: Web/HTML/Index -original_slug: Web/HTML/Índice ---- -

{{Index("/es/docs/Web/HTML")}}

diff --git a/files/es/web/svg/index/index.html b/files/es/web/svg/index/index.html deleted file mode 100644 index a9cf2d3736..0000000000 --- a/files/es/web/svg/index/index.html +++ /dev/null @@ -1,6 +0,0 @@ ---- -title: SVG documentation index -slug: Web/SVG/Index -translation_of: Web/SVG/Index ---- -

{{Index("/en-US/docs/Web/SVG")}}

diff --git a/files/fr/_redirects.txt b/files/fr/_redirects.txt index 2f4624d9d5..f18598385c 100644 --- a/files/fr/_redirects.txt +++ b/files/fr/_redirects.txt @@ -214,7 +214,7 @@ /fr/docs/Apprendre/HTML/Tableaux/Basics /fr/docs/Learn/HTML/Tables/Basics /fr/docs/Apprendre/HTML/Tableaux/Structuring_planet_data /fr/docs/Learn/HTML/Tables/Structuring_planet_data /fr/docs/Apprendre/HTML/Écrire_une_simple_page_HTML /fr/docs/conflicting/Learn/Getting_started_with_the_web -/fr/docs/Apprendre/Index /fr/docs/Learn/Index +/fr/docs/Apprendre/Index /fr/docs/conflicting/Learn /fr/docs/Apprendre/Infrastructure /fr/docs/Learn/Common_questions /fr/docs/Apprendre/JavaScript /fr/docs/Learn/JavaScript /fr/docs/Apprendre/JavaScript/Building_blocks /fr/docs/Learn/JavaScript/Building_blocks @@ -1262,6 +1262,7 @@ /fr/docs/Firefox_8_for_developers /fr/docs/Mozilla/Firefox/Releases/8 /fr/docs/Firefox_9_for_developers /fr/docs/Mozilla/Firefox/Releases/9 /fr/docs/Firefox_pour_les_développeurs /fr/docs/Mozilla/Firefox/Releases +/fr/docs/Games/Index /fr/docs/conflicting/Games /fr/docs/Games/Workflows /fr/docs/Games/Tutorials /fr/docs/Games/Workflows/2D_Breakout_game_pure_JavaScript /fr/docs/Games/Tutorials/2D_Breakout_game_pure_JavaScript /fr/docs/Games/Workflows/2D_Breakout_game_pure_JavaScript/Build_the_brick_field /fr/docs/Games/Tutorials/2D_Breakout_game_pure_JavaScript/Build_the_brick_field @@ -1473,7 +1474,7 @@ /fr/docs/Glossaire/Identificateur /fr/docs/Glossary/Identifier /fr/docs/Glossaire/Image_matricielle /fr/docs/Glossary/Raster_image /fr/docs/Glossaire/Immuable /fr/docs/Glossary/Immutable -/fr/docs/Glossaire/Index /fr/docs/Glossary/Index +/fr/docs/Glossaire/Index /fr/docs/conflicting/Glossary /fr/docs/Glossaire/IndexedDB /fr/docs/Glossary/IndexedDB /fr/docs/Glossaire/Injection_SQL /fr/docs/Glossary/SQL_Injection /fr/docs/Glossaire/Input_method_editor /fr/docs/Glossary/Input_method_editor @@ -1747,6 +1748,7 @@ /fr/docs/Glossary/Client_hints /fr/docs/Web/HTTP/Client_hints /fr/docs/Glossary/Gaia /fr/docs/orphaned/Glossary/Gaia /fr/docs/Glossary/Gonk /fr/docs/orphaned/Glossary/Gonk +/fr/docs/Glossary/Index /fr/docs/conflicting/Glossary /fr/docs/Glossary/Modern_web_apps /fr/docs/orphaned/Glossary/Modern_web_apps /fr/docs/Glossary/Node/réseau /fr/docs/Glossary/Node/networking /fr/docs/Glossary/Origine /fr/docs/Glossary/Origin @@ -2014,7 +2016,7 @@ /fr/docs/HTTP/Headers/Vary /fr/docs/Web/HTTP/Headers/Vary /fr/docs/HTTP/Headers/WWW-Authenticate /fr/docs/Web/HTTP/Headers/WWW-Authenticate /fr/docs/HTTP/Headers/X-Frame-Options /fr/docs/Web/HTTP/Headers/X-Frame-Options -/fr/docs/HTTP/Index /fr/docs/Web/HTTP/Index +/fr/docs/HTTP/Index /fr/docs/conflicting/Web/HTTP /fr/docs/HTTP/Méthode /fr/docs/Web/HTTP/Methods /fr/docs/HTTP/Méthode/CONNECT /fr/docs/Web/HTTP/Methods/CONNECT /fr/docs/HTTP/Méthode/DELETE /fr/docs/Web/HTTP/Methods/DELETE @@ -2964,7 +2966,7 @@ /fr/docs/Jeux /fr/docs/Games /fr/docs/Jeux/Anatomie /fr/docs/Games/Anatomy /fr/docs/Jeux/Exemples /fr/docs/Games/Examples -/fr/docs/Jeux/Index /fr/docs/Games/Index +/fr/docs/Jeux/Index /fr/docs/conflicting/Games /fr/docs/Jeux/Introduction /fr/docs/Games/Introduction /fr/docs/Jeux/Introduction_to_HTML5_Game_Gevelopment_(summary) /fr/docs/Games/Introduction_to_HTML5_Game_Development /fr/docs/Jeux/Publier_jeux /fr/docs/Games/Publishing_games @@ -2997,6 +2999,7 @@ /fr/docs/Learn/CSS/First_steps/Qu_est_ce_que_CSS /fr/docs/Learn/CSS/First_steps/What_is_CSS /fr/docs/Learn/CSS/Styling_text/Mise_en_forme_des_liens /fr/docs/Learn/CSS/Styling_text/Styling_links /fr/docs/Learn/CSS/Styling_text/initiation-mise-en-forme-du-texte /fr/docs/Learn/CSS/Styling_text/Fundamentals +/fr/docs/Learn/Index /fr/docs/conflicting/Learn /fr/docs/Learn/JavaScript/Asynchronous/Async_await /fr/docs/conflicting/Learn/JavaScript/Asynchronous/Promises /fr/docs/Learn/JavaScript/Asynchronous/Choosing_the_right_approach /fr/docs/conflicting/Learn/JavaScript/Asynchronous /fr/docs/Learn/JavaScript/Asynchronous/Concepts /fr/docs/conflicting/Learn/JavaScript/Asynchronous/Introducing @@ -3083,6 +3086,7 @@ /fr/docs/Mozilla/Add-ons/WebExtensions/Differences_entre_les_implementations_api /fr/docs/Mozilla/Add-ons/WebExtensions/Differences_between_API_implementations /fr/docs/Mozilla/Add-ons/WebExtensions/Exemples /fr/docs/Mozilla/Add-ons/WebExtensions/Examples /fr/docs/Mozilla/Add-ons/WebExtensions/Incompatibilités_Chrome /fr/docs/Mozilla/Add-ons/WebExtensions/Chrome_incompatibilities +/fr/docs/Mozilla/Add-ons/WebExtensions/Index /fr/docs/conflicting/Mozilla/Add-ons/WebExtensions /fr/docs/Mozilla/Add-ons/WebExtensions/Intercepter_requêtes_HTTP /fr/docs/Mozilla/Add-ons/WebExtensions/Intercept_HTTP_requests /fr/docs/Mozilla/Add-ons/WebExtensions/Travailler_avec_l_API_Tabs /fr/docs/Mozilla/Add-ons/WebExtensions/Working_with_the_Tabs_API /fr/docs/Mozilla/Add-ons/WebExtensions/Using_the_JavaScript_APIs /fr/docs/Mozilla/Add-ons/WebExtensions/API @@ -3219,7 +3223,7 @@ /fr/docs/Outils/Eyedropper /fr/docs/Tools/Eyedropper /fr/docs/Outils/Firefox_OS_Simulator_clone /fr/docs/Tools/Firefox_OS_Simulator_clone /fr/docs/Outils/Frise_chronologique /fr/docs/conflicting/Tools/Performance/Waterfall -/fr/docs/Outils/Index /fr/docs/Tools/Index +/fr/docs/Outils/Index /fr/docs/conflicting/Tools /fr/docs/Outils/Inspecteur /fr/docs/Tools/Page_Inspector /fr/docs/Outils/Inspecteur/3-pane_mode /fr/docs/Tools/Page_Inspector/3-pane_mode /fr/docs/Outils/Inspecteur/Comment /fr/docs/Tools/Page_Inspector/How_to @@ -3404,6 +3408,7 @@ /fr/docs/Tools/Debugger/How_to/Break_on_a_DOM_event /fr/docs/Tools/Debugger/Break_on_DOM_mutation /fr/docs/Tools/Debugger/How_to/Examine,_modify,_and_watch_variables /fr/docs/conflicting/Tools/Debugger/How_to/Set_Watch_Expressions /fr/docs/Tools/Debugger/Keyboard_shortcuts /fr/docs/orphaned/Tools/Debugger/Keyboard_shortcuts +/fr/docs/Tools/Index /fr/docs/conflicting/Tools /fr/docs/Tools/Page_Inspector/How_to/Examiner_et_éditer_le_code_HTML /fr/docs/Tools/Page_Inspector/How_to/Examine_and_edit_HTML /fr/docs/Tools/Page_Inspector/Keyboard_shortcuts /fr/docs/orphaned/Tools/Page_Inspector/Keyboard_shortcuts /fr/docs/Tools/Web_Console/Keyboard_shortcuts /fr/docs/orphaned/Tools/Web_Console/Keyboard_shortcuts @@ -3646,6 +3651,7 @@ /fr/docs/Web/API/Event.stopPropagation /fr/docs/Web/API/Event/stopPropagation /fr/docs/Web/API/Event/Comparaison_des_cibles_d_évènements /fr/docs/Web/API/Event/Comparison_of_Event_Targets /fr/docs/Web/API/Event/createEvent /fr/docs/conflicting/Web/API/Document/createEvent +/fr/docs/Web/API/EventSource/onopen /fr/docs/Web/API/EventSource/open_event /fr/docs/Web/API/EventTarget/attachEvent /fr/docs/Web/API/EventTarget/addEventListener /fr/docs/Web/API/EventTarget/detachEvent /fr/docs/Web/API/EventTarget/removeEventListener /fr/docs/Web/API/EventTarget/fireEvent /fr/docs/Web/API/EventTarget/dispatchEvent @@ -4504,6 +4510,7 @@ /fr/docs/Web/HTML/HTML5/Liste_des_éléments_HTML5 /fr/docs/conflicting/Web/HTML/Element /fr/docs/Web/HTML/Image_avec_ressources_origines_multiples_CORS_activees /fr/docs/Web/HTML/CORS_enabled_image /fr/docs/Web/HTML/Images_avec_le_contrôle_d_accès_HTTP /fr/docs/Web/HTML/CORS_enabled_image +/fr/docs/Web/HTML/Index /fr/docs/conflicting/Web/HTML /fr/docs/Web/HTML/Inline_elemente /fr/docs/Web/HTML/Inline_elements /fr/docs/Web/HTML/Introduction /fr/docs/Learn/HTML/Introduction_to_HTML /fr/docs/Web/HTML/Introduction_to_HTML5 /fr/docs/orphaned/Web/Guide/HTML/HTML5/Introduction_to_HTML5 @@ -4534,6 +4541,7 @@ /fr/docs/Web/HTTP/Detection_du_navigateur_en_utilisant_le_user_agent /fr/docs/Web/HTTP/Browser_detection_using_the_user_agent /fr/docs/Web/HTTP/FAQ_sur_le_préchargement_des_liens /fr/docs/Web/HTTP/Link_prefetching_FAQ /fr/docs/Web/HTTP/Headers/Serveur /fr/docs/Web/HTTP/Headers/Server +/fr/docs/Web/HTTP/Index /fr/docs/conflicting/Web/HTTP /fr/docs/Web/HTTP/Méthode /fr/docs/Web/HTTP/Methods /fr/docs/Web/HTTP/Méthode/CONNECT /fr/docs/Web/HTTP/Methods/CONNECT /fr/docs/Web/HTTP/Méthode/DELETE /fr/docs/Web/HTTP/Methods/DELETE @@ -5498,6 +5506,7 @@ /fr/docs/Web/MathML/Exemples /fr/docs/Web/MathML/Examples /fr/docs/Web/MathML/Exemples/Dériver_la_Formule_Quadratique /fr/docs/Web/MathML/Examples/Deriving_the_Quadratic_Formula /fr/docs/Web/MathML/Exemples/MathML_Theoreme_de_Pythagore /fr/docs/Web/MathML/Examples/MathML_Pythagorean_Theorem +/fr/docs/Web/MathML/Index /fr/docs/conflicting/Web/MathML /fr/docs/Web/Media/Formats/Questions_sur_le_soutien /fr/docs/Web/Media/Formats/Support_issues /fr/docs/Web/Media/Formats/Types_des_images /fr/docs/Web/Media/Formats/Image_types /fr/docs/Web/Performance/Budgets_de_performance /fr/docs/Web/Performance/Performance_budgets @@ -5517,6 +5526,7 @@ /fr/docs/Web/Reference/API /fr/docs/orphaned/Web/Reference/API /fr/docs/Web/SVG/Application_d_effets_SVG_a_du_contenu_HTML /fr/docs/Web/SVG/Applying_SVG_effects_to_HTML_content /fr/docs/Web/SVG/Element/cercle /fr/docs/Web/SVG/Element/circle +/fr/docs/Web/SVG/Index /fr/docs/conflicting/Web/SVG /fr/docs/Web/SVG/SVG_en_tant_qu_image /fr/docs/Web/SVG/SVG_as_an_Image /fr/docs/Web/SVG/Sources_compatibilite /fr/docs/Web/SVG/Compatibility_sources /fr/docs/Web/SVG/Tutoriel /fr/docs/Web/SVG/Tutorial @@ -5594,6 +5604,7 @@ /fr/docs/Web/XPath/Fonctions/translate /fr/docs/Web/XPath/Functions/translate /fr/docs/Web/XPath/Fonctions/true /fr/docs/Web/XPath/Functions/true /fr/docs/Web/XPath/Fonctions/unparsed-entity-url /fr/docs/Web/XPath/Functions/unparsed-entity-url +/fr/docs/Web/XSLT/Index /fr/docs/conflicting/Web/XSLT /fr/docs/Web/XSLT/Interface_XSLT_JS_dans_Gecko /fr/docs/Web/XSLT/XSLT_JS_interface_in_Gecko /fr/docs/Web/XSLT/Interface_XSLT_JS_dans_Gecko/Définition_de_paramètres /fr/docs/Web/XSLT/XSLT_JS_interface_in_Gecko/Setting_Parameters /fr/docs/Web/XSLT/Interface_XSLT_JS_dans_Gecko/Exemple_avancé /fr/docs/Web/XSLT/XSLT_JS_interface_in_Gecko/Advanced_Example @@ -5607,7 +5618,7 @@ /fr/docs/Web/XSLT/L'interface_XSLT_JavaScript_dans_Gecko/Les_liaisons_JavaScript_XSLT /fr/docs/Web/XSLT/XSLT_JS_interface_in_Gecko/JavaScript_XSLT_Bindings /fr/docs/Web/XSLT/L'interface_XSLT_JavaScript_dans_Gecko/Ressources /fr/docs/Web/XSLT/XSLT_JS_interface_in_Gecko/Resources /fr/docs/Web/XSLT/Paramètres_des_instructions_de_traitement /fr/docs/Web/XSLT/PI_Parameters -/fr/docs/Web/XSLT/Sommaire /fr/docs/Web/XSLT/Index +/fr/docs/Web/XSLT/Sommaire /fr/docs/conflicting/Web/XSLT /fr/docs/Web/XSLT/Transformations_XML_avec_XSLT /fr/docs/Web/XSLT/Transforming_XML_with_XSLT /fr/docs/Web/XSLT/Transformations_XML_avec_XSLT/Autres_ressources /fr/docs/Web/XSLT/Transforming_XML_with_XSLT/For_Further_Reading /fr/docs/Web/XSLT/Transformations_XML_avec_XSLT/La_référence_XSLT_XPath_de_Netscape /fr/docs/Web/XSLT/Transforming_XML_with_XSLT/The_Netscape_XSLT_XPath_Reference diff --git a/files/fr/_wikihistory.json b/files/fr/_wikihistory.json index 7032f73e7a..db7fabbb59 100644 --- a/files/fr/_wikihistory.json +++ b/files/fr/_wikihistory.json @@ -29,13 +29,6 @@ "BNedry" ] }, - "Games/Index": { - "modified": "2019-01-16T21:55:43.323Z", - "contributors": [ - "wbamberg", - "xdelatour" - ] - }, "Games/Introduction": { "modified": "2019-04-23T09:34:16.784Z", "contributors": [ @@ -1715,12 +1708,6 @@ "xdelatour" ] }, - "Glossary/Index": { - "modified": "2019-01-16T21:55:44.075Z", - "contributors": [ - "xdelatour" - ] - }, "Glossary/IndexedDB": { "modified": "2019-03-23T22:46:35.134Z", "contributors": [ @@ -4794,12 +4781,6 @@ "tonybengue" ] }, - "Learn/Index": { - "modified": "2020-07-16T22:33:36.900Z", - "contributors": [ - "SphinxKnight" - ] - }, "Learn/JavaScript": { "modified": "2020-07-16T22:29:38.759Z", "contributors": [ @@ -9328,12 +9309,6 @@ "RoyalPanda" ] }, - "Mozilla/Add-ons/WebExtensions/Index": { - "modified": "2019-03-18T21:01:44.832Z", - "contributors": [ - "hellosct1" - ] - }, "Mozilla/Add-ons/WebExtensions/Interact_with_the_clipboard": { "modified": "2019-07-03T05:46:49.789Z", "contributors": [ @@ -10666,13 +10641,6 @@ "xdelatour" ] }, - "Tools/Index": { - "modified": "2020-07-16T22:36:03.885Z", - "contributors": [ - "wbamberg", - "xdelatour" - ] - }, "Tools/JSON_viewer": { "modified": "2020-07-16T22:36:31.458Z", "contributors": [ @@ -15556,7 +15524,7 @@ "Plotisateur" ] }, - "Web/API/EventSource/onopen": { + "Web/API/EventSource/open_event": { "modified": "2020-10-15T22:17:18.152Z", "contributors": [ "SphinxKnight", @@ -32084,13 +32052,6 @@ "SphinxKnight" ] }, - "Web/HTML/Index": { - "modified": "2019-01-16T18:47:13.379Z", - "contributors": [ - "SphinxKnight", - "tregagnon" - ] - }, "Web/HTML/Inline_elements": { "modified": "2019-04-06T13:04:18.081Z", "contributors": [ @@ -32917,14 +32878,6 @@ "mmahouachi" ] }, - "Web/HTTP/Index": { - "modified": "2019-03-23T22:26:53.499Z", - "contributors": [ - "tonybengue", - "SphinxKnight", - "xdelatour" - ] - }, "Web/HTTP/Link_prefetching_FAQ": { "modified": "2019-03-23T23:46:22.581Z", "contributors": [ @@ -40091,12 +40044,6 @@ "Powlow" ] }, - "Web/MathML/Index": { - "modified": "2019-01-16T22:05:50.107Z", - "contributors": [ - "xdelatour" - ] - }, "Web/Media": { "modified": "2019-03-18T21:32:54.694Z", "contributors": [ @@ -41020,12 +40967,6 @@ "Nothus" ] }, - "Web/SVG/Index": { - "modified": "2019-01-16T21:57:35.980Z", - "contributors": [ - "xdelatour" - ] - }, "Web/SVG/SVG_animation_with_SMIL": { "modified": "2019-08-24T09:55:45.297Z", "contributors": [ @@ -42141,12 +42082,6 @@ "Fredchat" ] }, - "Web/XSLT/Index": { - "modified": "2019-06-17T11:21:18.591Z", - "contributors": [ - "Arzak656" - ] - }, "Web/XSLT/PI_Parameters": { "modified": "2019-03-23T23:44:06.266Z", "contributors": [ @@ -42318,6 +42253,19 @@ "dattaz" ] }, + "conflicting/Games": { + "modified": "2019-01-16T21:55:43.323Z", + "contributors": [ + "wbamberg", + "xdelatour" + ] + }, + "conflicting/Glossary": { + "modified": "2019-01-16T21:55:44.075Z", + "contributors": [ + "xdelatour" + ] + }, "conflicting/Glossary/Chrome": { "modified": "2019-03-23T23:48:48.795Z", "contributors": [ @@ -42351,7 +42299,7 @@ ] }, "conflicting/Learn": { - "modified": "2020-07-16T22:22:13.196Z", + "modified": "2020-07-16T22:33:36.900Z", "contributors": [ "SphinxKnight" ] @@ -42744,6 +42692,12 @@ "Sheppy" ] }, + "conflicting/Mozilla/Add-ons/WebExtensions": { + "modified": "2019-03-18T21:01:44.832Z", + "contributors": [ + "hellosct1" + ] + }, "conflicting/Mozilla/Add-ons/WebExtensions/API/menus/overrideContext": { "modified": "2019-07-03T07:58:27.877Z", "contributors": [ @@ -42756,6 +42710,13 @@ "hellosct1" ] }, + "conflicting/Tools": { + "modified": "2020-07-16T22:36:03.885Z", + "contributors": [ + "wbamberg", + "xdelatour" + ] + }, "conflicting/Tools/Debugger/How_to/Set_Watch_Expressions": { "modified": "2020-07-16T22:35:12.981Z", "contributors": [ @@ -43481,6 +43442,13 @@ "Fredchat" ] }, + "conflicting/Web/HTML": { + "modified": "2019-01-16T18:47:13.379Z", + "contributors": [ + "SphinxKnight", + "tregagnon" + ] + }, "conflicting/Web/HTML/Element": { "modified": "2019-03-23T23:39:45.493Z", "contributors": [ @@ -43499,6 +43467,14 @@ "xdelatour" ] }, + "conflicting/Web/HTTP": { + "modified": "2019-03-23T22:26:53.499Z", + "contributors": [ + "tonybengue", + "SphinxKnight", + "xdelatour" + ] + }, "conflicting/Web/HTTP/Basics_of_HTTP/MIME_types": { "modified": "2020-04-19T02:52:23.292Z", "contributors": [ @@ -43878,6 +43854,12 @@ "SphinxKnight" ] }, + "conflicting/Web/MathML": { + "modified": "2019-01-16T22:05:50.107Z", + "contributors": [ + "xdelatour" + ] + }, "conflicting/Web/Progressive_web_apps": { "modified": "2019-03-18T20:52:18.657Z", "contributors": [ @@ -43935,6 +43917,12 @@ "JeffD" ] }, + "conflicting/Web/SVG": { + "modified": "2019-01-16T21:57:35.980Z", + "contributors": [ + "xdelatour" + ] + }, "conflicting/Web/Web_Components": { "modified": "2020-10-15T22:12:01.555Z", "contributors": [ @@ -43951,6 +43939,12 @@ "Fredchat" ] }, + "conflicting/Web/XSLT": { + "modified": "2019-06-17T11:21:18.591Z", + "contributors": [ + "Arzak656" + ] + }, "orphaned/Glossary/Gaia": { "modified": "2019-03-23T22:42:05.161Z", "contributors": [ diff --git a/files/fr/conflicting/games/index.md b/files/fr/conflicting/games/index.md new file mode 100644 index 0000000000..a2f1287d53 --- /dev/null +++ b/files/fr/conflicting/games/index.md @@ -0,0 +1,11 @@ +--- +title: Index +slug: conflicting/Games +tags: + - Meta +translation_of: Games/Index +original_slug: Games/Index +--- +{{GamesSidebar}}{{IncludeSubnav("/fr/docs/Jeux")}} + +{{Index("/fr/docs/Jeux")}} diff --git a/files/fr/conflicting/glossary/index.md b/files/fr/conflicting/glossary/index.md new file mode 100644 index 0000000000..84c7e9bb13 --- /dev/null +++ b/files/fr/conflicting/glossary/index.md @@ -0,0 +1,11 @@ +--- +title: Index +slug: conflicting/Glossary +tags: + - Glossaire + - Index + - Navigation +translation_of: Glossary/Index +original_slug: Glossary/Index +--- +{{Index("/fr/docs/Glossaire")}} diff --git a/files/fr/conflicting/learn/index.md b/files/fr/conflicting/learn/index.md new file mode 100644 index 0000000000..71cdb8736f --- /dev/null +++ b/files/fr/conflicting/learn/index.md @@ -0,0 +1,12 @@ +--- +title: Index +slug: conflicting/Learn +tags: + - Index + - Learn + - MDN + - Meta +translation_of: Learn/Index +original_slug: Learn/Index +--- +{{Index("/fr/docs/Apprendre")}} diff --git a/files/fr/conflicting/mozilla/add-ons/webextensions/index.md b/files/fr/conflicting/mozilla/add-ons/webextensions/index.md new file mode 100644 index 0000000000..7236a454ab --- /dev/null +++ b/files/fr/conflicting/mozilla/add-ons/webextensions/index.md @@ -0,0 +1,11 @@ +--- +title: Index +slug: conflicting/Mozilla/Add-ons/WebExtensions +tags: + - Add-ons + - Index + - WebExtensions +translation_of: Mozilla/Add-ons/WebExtensions/Index +original_slug: Mozilla/Add-ons/WebExtensions/Index +--- +{{AddonSidebar}}{{Index("/fr/Add-ons/WebExtensions")}} diff --git a/files/fr/conflicting/tools/index.html b/files/fr/conflicting/tools/index.html new file mode 100644 index 0000000000..afaa168566 --- /dev/null +++ b/files/fr/conflicting/tools/index.html @@ -0,0 +1,9 @@ +--- +title: Index +slug: conflicting/Tools +tags: + - Outils +translation_of: Tools/Index +original_slug: Tools/Index +--- +
{{ToolsSidebar}}

{{Index("/fr/docs/Outils")}}

diff --git a/files/fr/conflicting/web/html/index.md b/files/fr/conflicting/web/html/index.md new file mode 100644 index 0000000000..14022f7307 --- /dev/null +++ b/files/fr/conflicting/web/html/index.md @@ -0,0 +1,10 @@ +--- +title: Index de la documentation HTML +slug: conflicting/Web/HTML +tags: + - HTML + - Index +translation_of: Web/HTML/Index +original_slug: Web/HTML/Index +--- +{{Index("/fr/docs/Web/HTML")}} diff --git a/files/fr/conflicting/web/http/index.md b/files/fr/conflicting/web/http/index.md new file mode 100644 index 0000000000..655176157f --- /dev/null +++ b/files/fr/conflicting/web/http/index.md @@ -0,0 +1,16 @@ +--- +title: Index +slug: conflicting/Web/HTTP +tags: + - HTTP + - Index +translation_of: Web/HTTP/Index +original_slug: Web/HTTP/Index +--- +{{HTTPSidebar}} + +## Pages MDN HTTP + +Cette page liste toutes les pages de MDN sur le HTTP avec leur résumé et balises. + +{{Index("fr/docs/Web/HTTP")}} diff --git a/files/fr/conflicting/web/mathml/index.md b/files/fr/conflicting/web/mathml/index.md new file mode 100644 index 0000000000..f3bb5bd189 --- /dev/null +++ b/files/fr/conflicting/web/mathml/index.md @@ -0,0 +1,9 @@ +--- +title: Index de la documentation MathML +slug: conflicting/Web/MathML +tags: + - MathML +translation_of: Web/MathML/Index +original_slug: Web/MathML/Index +--- +{{Index("/fr/docs/Web/MathML")}} diff --git a/files/fr/conflicting/web/svg/index.md b/files/fr/conflicting/web/svg/index.md new file mode 100644 index 0000000000..b645f9da52 --- /dev/null +++ b/files/fr/conflicting/web/svg/index.md @@ -0,0 +1,9 @@ +--- +title: Index de la documentation SVG +slug: conflicting/Web/SVG +tags: + - SVG +translation_of: Web/SVG/Index +original_slug: Web/SVG/Index +--- +{{Index("/fr/docs/Web/SVG")}} diff --git a/files/fr/conflicting/web/xslt/index.md b/files/fr/conflicting/web/xslt/index.md new file mode 100644 index 0000000000..9c09d87728 --- /dev/null +++ b/files/fr/conflicting/web/xslt/index.md @@ -0,0 +1,9 @@ +--- +title: Sommaire +slug: conflicting/Web/XSLT +translation_of: Web/XSLT/Index +original_slug: Web/XSLT/Index +--- +{{XSLTRef}}{{QuickLinksWithSubpages("/fr/docs/Web/XSLT")}} + +{{Index("/fr/docs/Web/XSLT")}} diff --git a/files/fr/games/index/index.md b/files/fr/games/index/index.md deleted file mode 100644 index e71dad980f..0000000000 --- a/files/fr/games/index/index.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: Index -slug: Games/Index -tags: - - Meta -translation_of: Games/Index -original_slug: Jeux/Index ---- -{{GamesSidebar}}{{IncludeSubnav("/fr/docs/Jeux")}} - -{{Index("/fr/docs/Jeux")}} diff --git a/files/fr/glossary/index/index.md b/files/fr/glossary/index/index.md deleted file mode 100644 index 4cdb0f3a01..0000000000 --- a/files/fr/glossary/index/index.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: Index -slug: Glossary/Index -tags: - - Glossaire - - Index - - Navigation -translation_of: Glossary/Index -original_slug: Glossaire/Index ---- -{{Index("/fr/docs/Glossaire")}} diff --git a/files/fr/learn/index/index.md b/files/fr/learn/index/index.md deleted file mode 100644 index 9edb6a5134..0000000000 --- a/files/fr/learn/index/index.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: Index -slug: Learn/Index -tags: - - Index - - Learn - - MDN - - Meta -translation_of: Learn/Index -original_slug: Apprendre/Index ---- -{{Index("/fr/docs/Apprendre")}} diff --git a/files/fr/mozilla/add-ons/webextensions/index/index.md b/files/fr/mozilla/add-ons/webextensions/index/index.md deleted file mode 100644 index 1631e2d620..0000000000 --- a/files/fr/mozilla/add-ons/webextensions/index/index.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: Index -slug: Mozilla/Add-ons/WebExtensions/Index -tags: - - Add-ons - - Index - - WebExtensions -translation_of: Mozilla/Add-ons/WebExtensions/Index ---- -{{AddonSidebar}}{{Index("/fr/Add-ons/WebExtensions")}} diff --git a/files/fr/tools/index/index.html b/files/fr/tools/index/index.html deleted file mode 100644 index 427a08ab27..0000000000 --- a/files/fr/tools/index/index.html +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: Index -slug: Tools/Index -tags: - - Outils -translation_of: Tools/Index -original_slug: Outils/Index ---- -
{{ToolsSidebar}}

{{Index("/fr/docs/Outils")}}

diff --git a/files/fr/web/api/eventsource/onopen/index.md b/files/fr/web/api/eventsource/onopen/index.md deleted file mode 100644 index 8cd75bbcb1..0000000000 --- a/files/fr/web/api/eventsource/onopen/index.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -title: EventSource.onopen -slug: Web/API/EventSource/onopen -tags: - - API - - Event Handler - - EventSource - - Propriété - - Reference -translation_of: Web/API/EventSource/onopen ---- -{{APIRef('Server Sent Events')}} - -La propriété **`onopen`** de l'interface {{domxref("EventSource")}} est un {{event("Event_handlers", "event handler")}} qui est appelé lorsqu'un est évènement {{event("open")}} est reçu, indiquant que la connexion vient d'être établie. - -## Syntaxe - - eventSource.onopen = function - -## Exemples - -```js -evtSource.onopen = function() { -  console.log("Connexion au serveur établie."); -}; -``` - -> **Note :** Vous pouvez trouver un exemple complet sur GitHub — voir [Simple SSE demo using PHP.](https://github.com/mdn/dom-examples/tree/master/server-sent-events) - -## Spécifications - -| Spécification | Statut | Commentaires | -| -------------------------------------------------------------------------------------------------------- | -------------------------------- | -------------------- | -| {{SpecName('HTML WHATWG', "comms.html#handler-eventsource-onopen", "onopen")}} | {{Spec2('HTML WHATWG')}} | Définition initiale. | - -## Compatibilité des navigateurs - -{{Compat("api.EventSource.onopen")}} - -## Voir aussi - -- {{domxref("EventSource")}} diff --git a/files/fr/web/api/eventsource/open_event/index.md b/files/fr/web/api/eventsource/open_event/index.md new file mode 100644 index 0000000000..44b9be5821 --- /dev/null +++ b/files/fr/web/api/eventsource/open_event/index.md @@ -0,0 +1,43 @@ +--- +title: EventSource.onopen +slug: Web/API/EventSource/open_event +tags: + - API + - Event Handler + - EventSource + - Propriété + - Reference +translation_of: Web/API/EventSource/onopen +original_slug: Web/API/EventSource/onopen +--- +{{APIRef('Server Sent Events')}} + +La propriété **`onopen`** de l'interface {{domxref("EventSource")}} est un {{event("Event_handlers", "event handler")}} qui est appelé lorsqu'un est évènement {{event("open")}} est reçu, indiquant que la connexion vient d'être établie. + +## Syntaxe + + eventSource.onopen = function + +## Exemples + +```js +evtSource.onopen = function() { +  console.log("Connexion au serveur établie."); +}; +``` + +> **Note :** Vous pouvez trouver un exemple complet sur GitHub — voir [Simple SSE demo using PHP.](https://github.com/mdn/dom-examples/tree/master/server-sent-events) + +## Spécifications + +| Spécification | Statut | Commentaires | +| -------------------------------------------------------------------------------------------------------- | -------------------------------- | -------------------- | +| {{SpecName('HTML WHATWG', "comms.html#handler-eventsource-onopen", "onopen")}} | {{Spec2('HTML WHATWG')}} | Définition initiale. | + +## Compatibilité des navigateurs + +{{Compat("api.EventSource.onopen")}} + +## Voir aussi + +- {{domxref("EventSource")}} diff --git a/files/fr/web/html/index/index.md b/files/fr/web/html/index/index.md deleted file mode 100644 index 73f68028a6..0000000000 --- a/files/fr/web/html/index/index.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: Index de la documentation HTML -slug: Web/HTML/Index -tags: - - HTML - - Index -translation_of: Web/HTML/Index ---- -{{Index("/fr/docs/Web/HTML")}} diff --git a/files/fr/web/http/index/index.md b/files/fr/web/http/index/index.md deleted file mode 100644 index da1d0de1ff..0000000000 --- a/files/fr/web/http/index/index.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: Index -slug: Web/HTTP/Index -tags: - - HTTP - - Index -translation_of: Web/HTTP/Index ---- -{{HTTPSidebar}} - -## Pages MDN HTTP - -Cette page liste toutes les pages de MDN sur le HTTP avec leur résumé et balises. - -{{Index("fr/docs/Web/HTTP")}} diff --git a/files/fr/web/mathml/index/index.md b/files/fr/web/mathml/index/index.md deleted file mode 100644 index 36ce8ae063..0000000000 --- a/files/fr/web/mathml/index/index.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: Index de la documentation MathML -slug: Web/MathML/Index -tags: - - MathML -translation_of: Web/MathML/Index ---- -{{Index("/fr/docs/Web/MathML")}} diff --git a/files/fr/web/svg/index/index.md b/files/fr/web/svg/index/index.md deleted file mode 100644 index 50edd31d3b..0000000000 --- a/files/fr/web/svg/index/index.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: Index de la documentation SVG -slug: Web/SVG/Index -tags: - - SVG -translation_of: Web/SVG/Index ---- -{{Index("/fr/docs/Web/SVG")}} diff --git a/files/fr/web/xslt/index/index.md b/files/fr/web/xslt/index/index.md deleted file mode 100644 index 0e4fb850a3..0000000000 --- a/files/fr/web/xslt/index/index.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: Sommaire -slug: Web/XSLT/Index -translation_of: Web/XSLT/Index -original_slug: Web/XSLT/Sommaire ---- -{{XSLTRef}}{{QuickLinksWithSubpages("/fr/docs/Web/XSLT")}} - -{{Index("/fr/docs/Web/XSLT")}} diff --git a/files/ja/_redirects.txt b/files/ja/_redirects.txt index f4b7a44b99..3bd3759ed7 100644 --- a/files/ja/_redirects.txt +++ b/files/ja/_redirects.txt @@ -1869,6 +1869,7 @@ /ja/docs/Firefox_9_for_developers /ja/docs/Mozilla/Firefox/Releases/9 /ja/docs/Focus_management_in_HTML /ja/docs/Web/API/Document/hasFocus /ja/docs/Full_page_zoom /ja/docs/Mozilla/Firefox/Releases/3/Full_page_zoom +/ja/docs/Games/Index /ja/docs/conflicting/Games /ja/docs/Games/Introduction_to_HTML5_Game_Gevelopment_(summary) /ja/docs/Games/Introduction_to_HTML5_Game_Development /ja/docs/Games/Workflows /ja/docs/Games/Tutorials /ja/docs/Games/Workflows/2D_Breakout_game_pure_JavaScript /ja/docs/Games/Tutorials/2D_Breakout_game_pure_JavaScript @@ -1891,6 +1892,7 @@ /ja/docs/Glossary/DTD /ja/docs/Glossary/Doctype /ja/docs/Glossary/Global_attribute /ja/docs/Web/HTML/Global_attributes /ja/docs/Glossary/Header /ja/docs/Glossary/HTTP_header +/ja/docs/Glossary/Index /ja/docs/conflicting/Glossary /ja/docs/Glossary/POP3 /ja/docs/Glossary/POP /ja/docs/Glossary/SSL_Glossary /ja/docs/Glossary/SSL /ja/docs/Glossary/Signature/セキュリティ /ja/docs/Glossary/Signature/Security @@ -2693,6 +2695,7 @@ /ja/docs/Learn/HTML/Forms/Your_first_HTML_form /ja/docs/Learn/Forms/Your_first_form /ja/docs/Learn/HTML/Forms/Your_first_HTML_form/Example /ja/docs/Learn/Forms/Your_first_form/Example /ja/docs/Learn/HTML/Introduction_to_HTML/高度なテキスト成型 /ja/docs/Learn/HTML/Introduction_to_HTML/Advanced_text_formatting +/ja/docs/Learn/Index /ja/docs/conflicting/Learn /ja/docs/Learn/JavaScript/Asynchronous/Concepts /ja/docs/Learn/JavaScript/Asynchronous/Introducing /ja/docs/Learn/JavaScript/Objects/Inheritance /ja/docs/Learn/JavaScript/Objects/Classes_in_JavaScript /ja/docs/Learn/JavaScript/Objects/Object-oriented_JS /ja/docs/conflicting/Learn/JavaScript/Objects/Classes_in_JavaScript @@ -2785,6 +2788,7 @@ /ja/docs/Mozilla/Add-ons/WebExtensions/API/devtools.inspectedWindow/tabId /ja/docs/Mozilla/Add-ons/WebExtensions/API/devtools/inspectedWindow/tabId /ja/docs/Mozilla/Add-ons/WebExtensions/API/devtools.network /ja/docs/Mozilla/Add-ons/WebExtensions/API/devtools/network /ja/docs/Mozilla/Add-ons/WebExtensions/API/devtools.panels /ja/docs/Mozilla/Add-ons/WebExtensions/API/devtools/panels +/ja/docs/Mozilla/Add-ons/WebExtensions/Index /ja/docs/conflicting/Mozilla/Add-ons/WebExtensions /ja/docs/Mozilla/Add-ons/WebExtensions/ThunderbirdにおけるWebExtensionsによるアドイン開発 /ja/docs/Mozilla/Add-ons/WebExtensions/Developing_WebExtensions_for_Thunderbird /ja/docs/Mozilla/Add-ons/WebExtensions/Using_the_JavaScript_APIs /ja/docs/Mozilla/Add-ons/WebExtensions/API /ja/docs/Mozilla/Add-ons/WebExtensions/Walkthrough /ja/docs/Mozilla/Add-ons/WebExtensions/Your_second_WebExtension @@ -2938,6 +2942,7 @@ /ja/docs/Tools/Debugger_(before_Firefox_52)/Keyboard_shortcuts /ja/docs/orphaned/Tools/Debugger_(before_Firefox_52)/Keyboard_shortcuts /ja/docs/Tools/Debugger_(before_Firefox_52)/Settings /ja/docs/orphaned/Tools/Debugger_(before_Firefox_52)/Settings /ja/docs/Tools/Debugger_(before_Firefox_52)/UI_Tour /ja/docs/orphaned/Tools/Debugger_(before_Firefox_52)/UI_Tour +/ja/docs/Tools/Index /ja/docs/conflicting/Tools /ja/docs/Tools/Memory/Comparing_heap_snapshots /ja/docs/Tools/Memory/Basic_operations /ja/docs/Tools/Memory/Open_the_Memory_tool /ja/docs/Tools/Memory/Basic_operations /ja/docs/Tools/Memory/Take_a_heap_snapshot /ja/docs/Tools/Memory/Basic_operations @@ -3098,6 +3103,8 @@ /ja/docs/Web/API/Event/button /ja/docs/Web/API/MouseEvent/button /ja/docs/Web/API/Event/createEvent /ja/docs/Web/API/Document/createEvent /ja/docs/Web/API/EventHandler /ja/docs/Web/Events/Event_handlers +/ja/docs/Web/API/EventSource/onerror /ja/docs/Web/API/EventSource/error_event +/ja/docs/Web/API/EventSource/onmessage /ja/docs/Web/API/EventSource/message_event /ja/docs/Web/API/EventTarget.addEventListener /ja/docs/Web/API/EventTarget/addEventListener /ja/docs/Web/API/EventTarget.dispatchEvent /ja/docs/Web/API/EventTarget/dispatchEvent /ja/docs/Web/API/EventTarget.removeEventListener /ja/docs/Web/API/EventTarget/removeEventListener @@ -3180,6 +3187,7 @@ /ja/docs/Web/API/IndexedDB_API/Basic_Concepts_Behind_IndexedDB /ja/docs/Web/API/IndexedDB_API/Basic_Terminology /ja/docs/Web/API/MediaCapabilitiesInfo /ja/docs/Web/API/MediaCapabilities/encodingInfo /ja/docs/Web/API/MediaDevices/ondevicechange /ja/docs/Web/API/MediaDevices/devicechange_event +/ja/docs/Web/API/MediaQueryList/onchange /ja/docs/Web/API/MediaQueryList/change_event /ja/docs/Web/API/MediaRecorder_API /ja/docs/Web/API/MediaStream_Recording_API /ja/docs/Web/API/MediaStreamConstraints /ja/docs/conflicting/Web/API/MediaDevices/getUserMedia /ja/docs/Web/API/MouseEvent/which /ja/docs/Web/API/UIEvent/which @@ -3634,6 +3642,7 @@ /ja/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_checkbox_role /ja/docs/Web/Accessibility/ARIA/Roles/checkbox_role /ja/docs/Web/Accessibility/ARIA/widgets/overview /ja/docs/Web/Accessibility/ARIA/widgets /ja/docs/Web/Accessibility/Accessibility_FAQ /ja/docs/Web/Accessibility/FAQ +/ja/docs/Web/Accessibility/Index /ja/docs/conflicting/Web/Accessibility /ja/docs/Web/Apps/Build/Manipulating_media /ja/docs/Web/Guide/Audio_and_video_delivery /ja/docs/Web/Apps/Build/Manipulating_media/Adding_captions_and_subtitles_to_HTML5_video /ja/docs/Web/Guide/Audio_and_video_delivery/Adding_captions_and_subtitles_to_HTML5_video /ja/docs/Web/Apps/Build/Manipulating_media/Live_streaming_web_audio_and_video /ja/docs/Web/Guide/Audio_and_video_delivery/Live_streaming_web_audio_and_video @@ -4008,6 +4017,7 @@ /ja/docs/Web/Guide/HTML/Introduction /ja/docs/Learn/HTML/Introduction_to_HTML /ja/docs/Web/Guide/HTML/Obsolete_things_to_avoid /ja/docs/Learn/HTML/Introduction_to_HTML /ja/docs/Web/Guide/HTML/Using_HTML_sections_and_outlines /ja/docs/orphaned/Web/Guide/HTML/Using_HTML_sections_and_outlines +/ja/docs/Web/Guide/Index /ja/docs/conflicting/Web/Guide /ja/docs/Web/Guide/Localizations_and_character_encodings /ja/docs/orphaned/Web/Guide/Localizations_and_character_encodings /ja/docs/Web/Guide/Performance/Using_web_workers /ja/docs/Web/API/Web_Workers_API/Using_web_workers /ja/docs/Web/Guide/User_experience/Using_the_Page_Visibility_API /ja/docs/Web/API/Page_Visibility_API @@ -4111,6 +4121,7 @@ /ja/docs/Web/HTML/HTML_Elements/strong /ja/docs/Web/HTML/Element/strong /ja/docs/Web/HTML/HTML_Elements/title /ja/docs/Web/HTML/Element/title /ja/docs/Web/HTML/HTML_Elements/var /ja/docs/Web/HTML/Element/var +/ja/docs/Web/HTML/Index /ja/docs/conflicting/Web/HTML /ja/docs/Web/HTML/Introduction /ja/docs/Learn/HTML/Introduction_to_HTML /ja/docs/Web/HTML/Introduction_to_HTML5 /ja/docs/orphaned/Web/Guide/HTML/HTML5/Introduction_to_HTML5 /ja/docs/Web/HTML/Optimizing_your_pages_for_speculative_parsing /ja/docs/Glossary/speculative_parsing @@ -4141,6 +4152,7 @@ /ja/docs/Web/HTTP/HTTP_response_codes /ja/docs/Web/HTTP/Status /ja/docs/Web/HTTP/Headers/Feature-Policy/vr /ja/docs/Web/HTTP/Headers/Feature-Policy/xr-spatial-tracking /ja/docs/Web/HTTP/Headers/Feature-Policy/xr /ja/docs/conflicting/Web/HTTP/Headers/Feature-Policy/xr-spatial-tracking +/ja/docs/Web/HTTP/Index /ja/docs/conflicting/Web/HTTP /ja/docs/Web/HTTP/Proxy_servers_and_tunneling/Proxy_Auto-Configuration_(PAC)_file /ja/docs/Web/HTTP/Proxy_servers_and_tunneling/Proxy_Auto-Configuration_PAC_file /ja/docs/Web/HTTP/Response_codes /ja/docs/Web/HTTP/Status /ja/docs/Web/HTTP/Response_codes/204 /ja/docs/Web/HTTP/Status/204 @@ -4398,6 +4410,7 @@ /ja/docs/Web/JavaScript/Typed_arrays/Uint32Array /ja/docs/Web/JavaScript/Reference/Global_objects/Uint32Array /ja/docs/Web/JavaScript/Typed_arrays/Uint8Array /ja/docs/Web/JavaScript/Reference/Global_objects/Uint8Array /ja/docs/Web/Manifest/serviceworker /ja/docs/orphaned/Web/Manifest/serviceworker +/ja/docs/Web/MathML/Index /ja/docs/conflicting/Web/MathML /ja/docs/Web/Progressive_web_apps/Advantages /ja/docs/Web/Progressive_web_apps/Introduction /ja/docs/Web/Progressive_web_apps/Responsive /ja/docs/Web/Progressive_web_apps /ja/docs/Web/Progressive_web_apps/Responsive/Media_types /ja/docs/conflicting/Web/CSS/Media_Queries/Using_media_queries @@ -4435,6 +4448,7 @@ /ja/docs/Web/Reference/Events/vrdisplayconnected /ja/docs/Web/API/Window/vrdisplayconnect_event /ja/docs/Web/Reference/Events/vrdisplaydisconnected /ja/docs/Web/API/Window/vrdisplaydisconnect_event /ja/docs/Web/Reference/Events/vrdisplaypresentchange /ja/docs/Web/API/Window/vrdisplaypresentchange_event +/ja/docs/Web/SVG/Index /ja/docs/conflicting/Web/SVG /ja/docs/Web/Security/CSP /ja/docs/Web/HTTP/CSP /ja/docs/Web/Security/CSP/CSP_policy_directives /ja/docs/Web/HTTP/Headers/Content-Security-Policy /ja/docs/Web/Security/CSP/Default_CSP_restrictions /ja/docs/Web/HTTP/Headers/Content-Security-Policy @@ -4467,6 +4481,7 @@ /ja/docs/Web/Web_Components/Custom_Elements /ja/docs/Web/Web_Components/Using_custom_elements /ja/docs/Web/Web_Components/HTML_Imports /ja/docs/conflicting/Web/Web_Components /ja/docs/Web/Web_Components/Status_in_Firefox /ja/docs/orphaned/Web/Web_Components/Status_in_Firefox +/ja/docs/Web/XPath/Index /ja/docs/conflicting/Web/XPath /ja/docs/Web/XSLT/Elements /ja/docs/Web/XSLT/Element /ja/docs/Web/XSLT/Elements/apply-imports /ja/docs/Web/XSLT/Element/apply-imports /ja/docs/Web/XSLT/Elements/apply-templates /ja/docs/Web/XSLT/Element/apply-templates @@ -4503,6 +4518,7 @@ /ja/docs/Web/XSLT/Elements/variable /ja/docs/Web/XSLT/Element/variable /ja/docs/Web/XSLT/Elements/when /ja/docs/Web/XSLT/Element/when /ja/docs/Web/XSLT/Elements/with-param /ja/docs/Web/XSLT/Element/with-param +/ja/docs/Web/XSLT/Index /ja/docs/conflicting/Web/XSLT /ja/docs/Web/XSLT/The_XSLT_JavaScript_Interface_in_Gecko /ja/docs/Web/XSLT/XSLT_JS_interface_in_Gecko /ja/docs/Web/XSLT/The_XSLT_JavaScript_Interface_in_Gecko/Advanced_Example /ja/docs/Web/XSLT/XSLT_JS_interface_in_Gecko/Advanced_Example /ja/docs/Web/XSLT/The_XSLT_JavaScript_Interface_in_Gecko/Basic_Example /ja/docs/Web/XSLT/XSLT_JS_interface_in_Gecko/Basic_Example @@ -4521,6 +4537,7 @@ /ja/docs/WebAPI/Proximity /ja/docs/Web/API/Proximity_Events /ja/docs/WebAPI/Using_Web_Notifications /ja/docs/Web/API/Notifications_API/Using_the_Notifications_API /ja/docs/WebAPI/Using_geolocation /ja/docs/Web/API/Geolocation_API +/ja/docs/WebAssembly/Index /ja/docs/conflicting/WebAssembly /ja/docs/WebGL /ja/docs/Web/API/WebGL_API /ja/docs/WebGL/Adding_2D_content_to_a_WebGL_context /ja/docs/Web/API/WebGL_API/Tutorial/Adding_2D_content_to_a_WebGL_context /ja/docs/WebGL/Animating_objects_with_WebGL /ja/docs/Web/API/WebGL_API/Tutorial/Animating_objects_with_WebGL @@ -4617,7 +4634,7 @@ /ja/docs/XPath/Functions/translate /ja/docs/Web/XPath/Functions/translate /ja/docs/XPath/Functions/true /ja/docs/Web/XPath/Functions/true /ja/docs/XPath/Functions/unparsed-entity-url /ja/docs/Web/XPath/Functions/unparsed-entity-url -/ja/docs/XPath/Index /ja/docs/Web/XPath/Index +/ja/docs/XPath/Index /ja/docs/conflicting/Web/XPath /ja/docs/XPath/Snippets /ja/docs/Web/XPath/Snippets /ja/docs/XPath:Axes /ja/docs/Web/XPath/Axes /ja/docs/XPath:Functions /ja/docs/Web/XPath/Functions @@ -4687,7 +4704,7 @@ /ja/docs/XSLT/Elements/variable /ja/docs/Web/XSLT/Element/variable /ja/docs/XSLT/Elements/when /ja/docs/Web/XSLT/Element/when /ja/docs/XSLT/Elements/with-param /ja/docs/Web/XSLT/Element/with-param -/ja/docs/XSLT/Index /ja/docs/Web/XSLT/Index +/ja/docs/XSLT/Index /ja/docs/conflicting/Web/XSLT /ja/docs/XSLT/PI_Parameters /ja/docs/Web/XSLT/PI_Parameters /ja/docs/XSLT/The_XSLT_JavaScript_Interface_in_Gecko /ja/docs/Web/XSLT/XSLT_JS_interface_in_Gecko /ja/docs/XSLT/The_XSLT_JavaScript_Interface_in_Gecko/Advanced_Example /ja/docs/Web/XSLT/XSLT_JS_interface_in_Gecko/Advanced_Example diff --git a/files/ja/_wikihistory.json b/files/ja/_wikihistory.json index e42e93574b..6b0e4a264b 100644 --- a/files/ja/_wikihistory.json +++ b/files/ja/_wikihistory.json @@ -29,13 +29,6 @@ "Uemmra3" ] }, - "Games/Index": { - "modified": "2019-01-16T21:55:46.834Z", - "contributors": [ - "wbamberg", - "Marsf" - ] - }, "Games/Introduction": { "modified": "2019-03-23T22:51:04.568Z", "contributors": [ @@ -1821,13 +1814,6 @@ "Wind1808" ] }, - "Glossary/Index": { - "modified": "2019-01-16T21:36:54.645Z", - "contributors": [ - "mfuji09", - "x2357" - ] - }, "Glossary/IndexedDB": { "modified": "2019-03-18T21:40:55.276Z", "contributors": [ @@ -5140,12 +5126,6 @@ "karaage-kun" ] }, - "Learn/Index": { - "modified": "2020-07-16T22:33:38.849Z", - "contributors": [ - "silverskyvicto" - ] - }, "Learn/JavaScript": { "modified": "2020-12-12T21:01:57.465Z", "contributors": [ @@ -7517,12 +7497,6 @@ "kyokutyo" ] }, - "Mozilla/Add-ons/WebExtensions/Index": { - "modified": "2020-03-07T04:25:12.950Z", - "contributors": [ - "mfuji09" - ] - }, "Mozilla/Add-ons/WebExtensions/Interact_with_the_clipboard": { "modified": "2019-05-20T05:14:06.954Z", "contributors": [ @@ -9230,13 +9204,6 @@ "silverskyvicto" ] }, - "Tools/Index": { - "modified": "2020-07-16T22:36:05.417Z", - "contributors": [ - "wbamberg", - "Marsf" - ] - }, "Tools/JSON_viewer": { "modified": "2020-07-16T22:36:31.583Z", "contributors": [ @@ -14440,13 +14407,13 @@ "k-kuwahara" ] }, - "Web/API/EventSource/onerror": { + "Web/API/EventSource/error_event": { "modified": "2020-10-15T22:22:24.575Z", "contributors": [ "k-kuwahara" ] }, - "Web/API/EventSource/onmessage": { + "Web/API/EventSource/message_event": { "modified": "2020-10-15T22:22:24.577Z", "contributors": [ "k-kuwahara" @@ -17951,22 +17918,22 @@ "ethertank" ] }, - "Web/API/MediaQueryList/matches": { - "modified": "2020-10-15T21:59:32.651Z", + "Web/API/MediaQueryList/change_event": { + "modified": "2020-10-15T21:59:30.222Z", "contributors": [ "mfuji09", "Marsf" ] }, - "Web/API/MediaQueryList/media": { - "modified": "2020-10-15T21:59:28.975Z", + "Web/API/MediaQueryList/matches": { + "modified": "2020-10-15T21:59:32.651Z", "contributors": [ "mfuji09", "Marsf" ] }, - "Web/API/MediaQueryList/onchange": { - "modified": "2020-10-15T21:59:30.222Z", + "Web/API/MediaQueryList/media": { + "modified": "2020-10-15T21:59:28.975Z", "contributors": [ "mfuji09", "Marsf" @@ -26493,12 +26460,6 @@ "Marsf" ] }, - "Web/Accessibility/Index": { - "modified": "2019-03-23T22:41:12.085Z", - "contributors": [ - "Marsf" - ] - }, "Web/Accessibility/Keyboard-navigable_JavaScript_widgets": { "modified": "2019-09-04T08:46:02.292Z", "contributors": [ @@ -33354,14 +33315,6 @@ "Wind1808" ] }, - "Web/Guide/Index": { - "modified": "2020-12-07T13:42:04.312Z", - "contributors": [ - "peterbe", - "mfuji09", - "silverskyvicto" - ] - }, "Web/Guide/Introduction_to_Web_development": { "modified": "2020-05-04T12:39:54.645Z", "contributors": [ @@ -35214,13 +35167,6 @@ "eltociear" ] }, - "Web/HTML/Index": { - "modified": "2020-09-19T11:13:50.506Z", - "contributors": [ - "mfuji09", - "Marsf" - ] - }, "Web/HTML/Inline_elements": { "modified": "2019-04-15T20:58:44.936Z", "contributors": [ @@ -36521,12 +36467,6 @@ "kurimaru" ] }, - "Web/HTTP/Index": { - "modified": "2019-03-18T21:35:45.067Z", - "contributors": [ - "mfuji09" - ] - }, "Web/HTTP/Link_prefetching_FAQ": { "modified": "2020-01-12T13:11:34.893Z", "contributors": [ @@ -46124,12 +46064,6 @@ "cosmology233" ] }, - "Web/MathML/Index": { - "modified": "2019-01-16T21:55:31.944Z", - "contributors": [ - "Marsf" - ] - }, "Web/Media": { "modified": "2020-10-24T14:12:13.318Z", "contributors": [ @@ -46858,12 +46792,6 @@ "teoli" ] }, - "Web/SVG/Index": { - "modified": "2019-01-16T21:55:52.943Z", - "contributors": [ - "Marsf" - ] - }, "Web/SVG/Namespaces_Crash_Course": { "modified": "2019-03-23T23:49:34.244Z", "contributors": [ @@ -47714,13 +47642,6 @@ "silverskyvicto" ] }, - "Web/XPath/Index": { - "modified": "2019-03-30T15:46:42.224Z", - "contributors": [ - "silverskyvicto", - "ExE-Boss" - ] - }, "Web/XPath/Introduction_to_using_XPath_in_JavaScript": { "modified": "2019-03-23T23:54:12.896Z", "contributors": [ @@ -48019,13 +47940,6 @@ "silverskyvicto" ] }, - "Web/XSLT/Index": { - "modified": "2019-03-18T20:50:34.547Z", - "contributors": [ - "mfuji09", - "silverskyvicto" - ] - }, "Web/XSLT/PI_Parameters": { "modified": "2019-03-18T20:50:34.245Z", "contributors": [ @@ -48198,12 +48112,6 @@ "ukyo" ] }, - "WebAssembly/Index": { - "modified": "2019-03-18T21:24:03.527Z", - "contributors": [ - "silverskyvicto" - ] - }, "WebAssembly/Loading_and_running": { "modified": "2019-03-23T22:13:00.551Z", "contributors": [ @@ -48256,12 +48164,32 @@ "silverskyvicto" ] }, + "conflicting/Games": { + "modified": "2019-01-16T21:55:46.834Z", + "contributors": [ + "wbamberg", + "Marsf" + ] + }, + "conflicting/Glossary": { + "modified": "2019-01-16T21:36:54.645Z", + "contributors": [ + "mfuji09", + "x2357" + ] + }, "conflicting/Glossary/Plugin": { "modified": "2019-03-18T21:35:38.258Z", "contributors": [ "momdo" ] }, + "conflicting/Learn": { + "modified": "2020-07-16T22:33:38.849Z", + "contributors": [ + "silverskyvicto" + ] + }, "conflicting/Learn/JavaScript/Objects/Classes_in_JavaScript": { "modified": "2020-12-06T14:17:48.495Z", "contributors": [ @@ -48285,6 +48213,19 @@ "Uemmra3" ] }, + "conflicting/Mozilla/Add-ons/WebExtensions": { + "modified": "2020-03-07T04:25:12.950Z", + "contributors": [ + "mfuji09" + ] + }, + "conflicting/Tools": { + "modified": "2020-07-16T22:36:05.417Z", + "contributors": [ + "wbamberg", + "Marsf" + ] + }, "conflicting/Web/API/AudioTrackList/addtrack_event": { "modified": "2020-10-15T22:19:07.769Z", "contributors": [ @@ -48541,6 +48482,12 @@ "Wind1808" ] }, + "conflicting/Web/Accessibility": { + "modified": "2019-03-23T22:41:12.085Z", + "contributors": [ + "Marsf" + ] + }, "conflicting/Web/Accessibility/ARIA/Roles/alert_role": { "modified": "2019-03-18T21:24:32.583Z", "contributors": [ @@ -48584,6 +48531,27 @@ "mfuji09" ] }, + "conflicting/Web/Guide": { + "modified": "2020-12-07T13:42:04.312Z", + "contributors": [ + "peterbe", + "mfuji09", + "silverskyvicto" + ] + }, + "conflicting/Web/HTML": { + "modified": "2020-09-19T11:13:50.506Z", + "contributors": [ + "mfuji09", + "Marsf" + ] + }, + "conflicting/Web/HTTP": { + "modified": "2019-03-18T21:35:45.067Z", + "contributors": [ + "mfuji09" + ] + }, "conflicting/Web/HTTP/Headers/Feature-Policy/xr-spatial-tracking": { "modified": "2020-08-12T12:42:41.854Z", "contributors": [ @@ -48591,12 +48559,44 @@ "tamura4278" ] }, + "conflicting/Web/MathML": { + "modified": "2019-01-16T21:55:31.944Z", + "contributors": [ + "Marsf" + ] + }, + "conflicting/Web/SVG": { + "modified": "2019-01-16T21:55:52.943Z", + "contributors": [ + "Marsf" + ] + }, "conflicting/Web/Web_Components": { "modified": "2020-10-15T22:23:11.378Z", "contributors": [ "reodog" ] }, + "conflicting/Web/XPath": { + "modified": "2019-03-30T15:46:42.224Z", + "contributors": [ + "silverskyvicto", + "ExE-Boss" + ] + }, + "conflicting/Web/XSLT": { + "modified": "2019-03-18T20:50:34.547Z", + "contributors": [ + "mfuji09", + "silverskyvicto" + ] + }, + "conflicting/WebAssembly": { + "modified": "2019-03-18T21:24:03.527Z", + "contributors": [ + "silverskyvicto" + ] + }, "orphaned/Building_a_Mozilla_Distribution": { "modified": "2019-03-23T23:49:07.062Z", "contributors": [ diff --git a/files/ja/conflicting/games/index.html b/files/ja/conflicting/games/index.html new file mode 100644 index 0000000000..f0d8b472be --- /dev/null +++ b/files/ja/conflicting/games/index.html @@ -0,0 +1,12 @@ +--- +title: ゲーム開発関連ドキュメントの索引 +slug: conflicting/Games +tags: + - Games + - Index +translation_of: Games/Index +original_slug: Games/Index +--- +
{{GamesSidebar}}
{{IncludeSubnav("/ja/docs/Games")}}
+ +

{{Index("/ja/docs/Games")}}

diff --git a/files/ja/conflicting/glossary/index.html b/files/ja/conflicting/glossary/index.html new file mode 100644 index 0000000000..acdc1de061 --- /dev/null +++ b/files/ja/conflicting/glossary/index.html @@ -0,0 +1,12 @@ +--- +title: 索引 +slug: conflicting/Glossary +tags: + - Glossary + - Index + - MDN Meta + - Navigation +translation_of: Glossary/Index +original_slug: Glossary/Index +--- +

{{Index("/ja/docs/Glossary")}}

diff --git a/files/ja/conflicting/learn/index.html b/files/ja/conflicting/learn/index.html new file mode 100644 index 0000000000..9c78d9dcac --- /dev/null +++ b/files/ja/conflicting/learn/index.html @@ -0,0 +1,11 @@ +--- +title: インデックス +slug: conflicting/Learn +tags: + - MDN Meta + - インデックス + - 学習 +translation_of: Learn/Index +original_slug: Learn/Index +--- +

{{Index("/ja/docs/Learn")}}

diff --git a/files/ja/conflicting/mozilla/add-ons/webextensions/index.html b/files/ja/conflicting/mozilla/add-ons/webextensions/index.html new file mode 100644 index 0000000000..06b5e82b73 --- /dev/null +++ b/files/ja/conflicting/mozilla/add-ons/webextensions/index.html @@ -0,0 +1,15 @@ +--- +title: 索引 +slug: conflicting/Mozilla/Add-ons/WebExtensions +tags: + - Add-ons + - Index + - WebExtensions + - アドオン + - 索引 +translation_of: Mozilla/Add-ons/WebExtensions/Index +original_slug: Mozilla/Add-ons/WebExtensions/Index +--- +
{{AddonSidebar}}
+ +
{{Index("/ja/docs/Mozilla/Add-ons/WebExtensions")}}
diff --git a/files/ja/conflicting/tools/index.html b/files/ja/conflicting/tools/index.html new file mode 100644 index 0000000000..1d1bad64e0 --- /dev/null +++ b/files/ja/conflicting/tools/index.html @@ -0,0 +1,10 @@ +--- +title: 開発ツール関連ドキュメントの索引 +slug: conflicting/Tools +tags: + - Index + - Tools +translation_of: Tools/Index +original_slug: Tools/Index +--- +
{{ToolsSidebar}}

{{Index("/ja/docs/Tools")}}

diff --git a/files/ja/conflicting/web/accessibility/index.html b/files/ja/conflicting/web/accessibility/index.html new file mode 100644 index 0000000000..93a56991bc --- /dev/null +++ b/files/ja/conflicting/web/accessibility/index.html @@ -0,0 +1,12 @@ +--- +title: アクセシビリティ関連ドキュメントの索引 +slug: conflicting/Web/Accessibility +tags: + - Accessibility + - Index +translation_of: Web/Accessibility/Index +original_slug: Web/Accessibility/Index +--- +

このドキュメントは、Mozilla Developer Network サイト上の、すべてのアクセシビリティの記事へのリンクの一覧を提供します。

+ +

{{Index("/ja/docs/Web/Accessibility")}}

diff --git a/files/ja/conflicting/web/guide/index.html b/files/ja/conflicting/web/guide/index.html new file mode 100644 index 0000000000..a5d6cd1488 --- /dev/null +++ b/files/ja/conflicting/web/guide/index.html @@ -0,0 +1,12 @@ +--- +title: 索引 +slug: conflicting/Web/Guide +tags: + - Index + - ガイド +translation_of: Web/Guide/Index +original_slug: Web/Guide/Index +--- +
{{MDNSidebar}}{{IncludeSubnav("/ja/docs/MDN")}}
+ +

{{Index("/ja/docs/Web/Guide")}}

diff --git a/files/ja/conflicting/web/html/index.html b/files/ja/conflicting/web/html/index.html new file mode 100644 index 0000000000..5f9ada989f --- /dev/null +++ b/files/ja/conflicting/web/html/index.html @@ -0,0 +1,11 @@ +--- +title: HTML ドキュメントの索引 +slug: conflicting/Web/HTML +tags: + - HTML + - Index + - MDN Meta +translation_of: Web/HTML/Index +original_slug: Web/HTML/Index +--- +

{{Index("/ja/docs/Web/HTML")}} 利用可能なすべての HTML に関する文書の包括的な索引リストです。

diff --git a/files/ja/conflicting/web/http/index.html b/files/ja/conflicting/web/http/index.html new file mode 100644 index 0000000000..aa400e86e2 --- /dev/null +++ b/files/ja/conflicting/web/http/index.html @@ -0,0 +1,14 @@ +--- +title: 索引 +slug: conflicting/Web/HTTP +tags: + - HTTP + - Index +translation_of: Web/HTTP/Index +original_slug: Web/HTTP/Index +--- +
{{HTTPSidebar}}
+ +

このページは概要やタグに沿った MDN のすべての HTTP ページの一覧です。

+ +

{{Index("/ja/docs/Web/HTTP")}}

diff --git a/files/ja/conflicting/web/mathml/index.html b/files/ja/conflicting/web/mathml/index.html new file mode 100644 index 0000000000..06d9c020b2 --- /dev/null +++ b/files/ja/conflicting/web/mathml/index.html @@ -0,0 +1,10 @@ +--- +title: MathML 関連ドキュメントの索引 +slug: conflicting/Web/MathML +tags: + - Index + - MathML +translation_of: Web/MathML/Index +original_slug: Web/MathML/Index +--- +

{{Index("/ja/docs/Web/MathML")}}

diff --git a/files/ja/conflicting/web/svg/index.html b/files/ja/conflicting/web/svg/index.html new file mode 100644 index 0000000000..e0b02812c4 --- /dev/null +++ b/files/ja/conflicting/web/svg/index.html @@ -0,0 +1,10 @@ +--- +title: SVG 関連ドキュメントの索引 +slug: conflicting/Web/SVG +tags: + - Index + - SVG +translation_of: Web/SVG/Index +original_slug: Web/SVG/Index +--- +

{{Index("/ja/docs/Web/SVG")}}

diff --git a/files/ja/conflicting/web/xpath/index.html b/files/ja/conflicting/web/xpath/index.html new file mode 100644 index 0000000000..dbe896db2c --- /dev/null +++ b/files/ja/conflicting/web/xpath/index.html @@ -0,0 +1,16 @@ +--- +title: Index +slug: conflicting/Web/XPath +tags: + - Index + - Reference + - XPath + - XSLT +translation_of: Web/XPath/Index +original_slug: Web/XPath/Index +--- +

{{Index("/ja/docs/Web/XPath")}}

+ +
+

{{QuickLinksWithSubpages("/ja/docs/Web/XPath")}}

+
diff --git a/files/ja/conflicting/web/xslt/index.html b/files/ja/conflicting/web/xslt/index.html new file mode 100644 index 0000000000..6cec119901 --- /dev/null +++ b/files/ja/conflicting/web/xslt/index.html @@ -0,0 +1,13 @@ +--- +title: Index +slug: conflicting/Web/XSLT +tags: + - Index + - XSLT + - リファレンス +translation_of: Web/XSLT/Index +original_slug: Web/XSLT/Index +--- +

{{XSLTRef}}{{QuickLinksWithSubpages("/ja/docs/Web/XSLT")}}

+ +

{{Index("/ja/docs/XSLT")}}

diff --git a/files/ja/conflicting/webassembly/index.html b/files/ja/conflicting/webassembly/index.html new file mode 100644 index 0000000000..cb88ce4a63 --- /dev/null +++ b/files/ja/conflicting/webassembly/index.html @@ -0,0 +1,12 @@ +--- +title: Index +slug: conflicting/WebAssembly +tags: + - Index + - WebAssembly +translation_of: WebAssembly/Index +original_slug: WebAssembly/Index +--- +
{{WebAssemblySidebar}}
+ +

{{Index("/ja/docs/WebAssembly")}}

diff --git a/files/ja/games/index/index.html b/files/ja/games/index/index.html deleted file mode 100644 index 6879d6d0ef..0000000000 --- a/files/ja/games/index/index.html +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: ゲーム開発関連ドキュメントの索引 -slug: Games/Index -tags: - - Games - - Index -translation_of: Games/Index ---- -
{{GamesSidebar}}
{{IncludeSubnav("/ja/docs/Games")}}
- -

{{Index("/ja/docs/Games")}}

diff --git a/files/ja/glossary/index/index.html b/files/ja/glossary/index/index.html deleted file mode 100644 index 57b963f40b..0000000000 --- a/files/ja/glossary/index/index.html +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: 索引 -slug: Glossary/Index -tags: - - Glossary - - Index - - MDN Meta - - Navigation -translation_of: Glossary/Index ---- -

{{Index("/ja/docs/Glossary")}}

diff --git a/files/ja/learn/index/index.html b/files/ja/learn/index/index.html deleted file mode 100644 index 0c842ca444..0000000000 --- a/files/ja/learn/index/index.html +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: インデックス -slug: Learn/Index -tags: - - MDN Meta - - インデックス - - 学習 -translation_of: Learn/Index ---- -

{{Index("/ja/docs/Learn")}}

diff --git a/files/ja/mozilla/add-ons/webextensions/index/index.html b/files/ja/mozilla/add-ons/webextensions/index/index.html deleted file mode 100644 index ec4a9066f7..0000000000 --- a/files/ja/mozilla/add-ons/webextensions/index/index.html +++ /dev/null @@ -1,14 +0,0 @@ ---- -title: 索引 -slug: Mozilla/Add-ons/WebExtensions/Index -tags: - - Add-ons - - Index - - WebExtensions - - アドオン - - 索引 -translation_of: Mozilla/Add-ons/WebExtensions/Index ---- -
{{AddonSidebar}}
- -
{{Index("/ja/docs/Mozilla/Add-ons/WebExtensions")}}
diff --git a/files/ja/tools/index/index.html b/files/ja/tools/index/index.html deleted file mode 100644 index 092c03076e..0000000000 --- a/files/ja/tools/index/index.html +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: 開発ツール関連ドキュメントの索引 -slug: Tools/Index -tags: - - Index - - Tools -translation_of: Tools/Index ---- -
{{ToolsSidebar}}

{{Index("/ja/docs/Tools")}}

diff --git a/files/ja/web/accessibility/index/index.html b/files/ja/web/accessibility/index/index.html deleted file mode 100644 index 3e2035d320..0000000000 --- a/files/ja/web/accessibility/index/index.html +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: アクセシビリティ関連ドキュメントの索引 -slug: Web/Accessibility/Index -tags: - - Accessibility - - Index -translation_of: Web/Accessibility/Index ---- -

このドキュメントは、Mozilla Developer Network サイト上の、すべてのアクセシビリティの記事へのリンクの一覧を提供します。

- -

{{Index("/ja/docs/Web/Accessibility")}}

diff --git a/files/ja/web/api/eventsource/error_event/index.html b/files/ja/web/api/eventsource/error_event/index.html new file mode 100644 index 0000000000..31df170d43 --- /dev/null +++ b/files/ja/web/api/eventsource/error_event/index.html @@ -0,0 +1,66 @@ +--- +title: EventSource.onerror +slug: Web/API/EventSource/error_event +tags: + - API + - EventSource + - Server-sent events + - イベントハンドラ + - プロパティ + - リファレンス +translation_of: Web/API/EventSource/onerror +original_slug: Web/API/EventSource/onerror +--- +
{{APIRef('WebSockets API')}}
+ + + +

{{domxref("EventSource")}} インターフェースのonerror プロパティは、エラーが発生し、EventSource オブジェクトに対して {{event("error")}} が送出されたときに呼び出される {{event("Event_handlers", "event handler")}} です。

+ +

構文

+ +
eventSource.onerror = function
+ +

+ +
evtSource.onerror = function() {
+  console.log("EventSource failed.");
+};
+ +
+

メモ: 完全な例を GitHub から見つけることができます — PHP を用いた簡単な SSE のデモ を参照。

+
+ +

仕様

+ + + + + + + + + + + + + + +
仕様ステータスコメント
{{SpecName('HTML WHATWG', "comms.html#handler-eventsource-onerror", "onerror")}}{{Spec2('HTML WHATWG')}}初期定義
+ + + +

ブラウザ互換性

+ +
+ + +

{{Compat("api.EventSource.onerror")}}

+
+ +

関連情報

+ + diff --git a/files/ja/web/api/eventsource/message_event/index.html b/files/ja/web/api/eventsource/message_event/index.html new file mode 100644 index 0000000000..6b35ddf7d2 --- /dev/null +++ b/files/ja/web/api/eventsource/message_event/index.html @@ -0,0 +1,70 @@ +--- +title: EventSource.onmessage +slug: Web/API/EventSource/message_event +tags: + - API + - EventSource + - Server-sent events + - onmessage + - イベントハンドラ + - プロパティ + - リファレンス +translation_of: Web/API/EventSource/onmessage +original_slug: Web/API/EventSource/onmessage +--- +
{{APIRef('WebSockets API')}}
+ +

{{domxref("EventSource")}} インターフェースの onmessage プロパティは、メッセージイベントが受信されたとき、つまりソースからメッセージが送信されたときに呼び出される {{event("Event_handlers", "event handler")}} です。

+ +

onmessage イベントハンドラのイベントオブジェクトの型は {{domxref("MessageEvent")}} です。

+ +

構文

+ +
eventSource.onmessage = function
+ +

+ +
evtSource.onmessage = function(e) {
+  var newElement = document.createElement("li");
+
+  newElement.textContent = "message: " + e.data;
+  eventList.appendChild(newElement);
+}
+ +
+

メモ: 完全な例を GitHub から見つけることができます — PHP を用いた簡単な SSE のデモ を参照。

+
+ +

仕様

+ + + + + + + + + + + + + + +
仕様ステータスコメント
{{SpecName('HTML WHATWG', "comms.html#handler-eventsource-onmessage", "onmessage")}}{{Spec2('HTML WHATWG')}}初期定義
+ + + +

ブラウザ互換性

+ +
+ + +

{{Compat("api.EventSource.onmessage")}}

+
+ +

関連情報

+ + diff --git a/files/ja/web/api/eventsource/onerror/index.html b/files/ja/web/api/eventsource/onerror/index.html deleted file mode 100644 index 1629027780..0000000000 --- a/files/ja/web/api/eventsource/onerror/index.html +++ /dev/null @@ -1,65 +0,0 @@ ---- -title: EventSource.onerror -slug: Web/API/EventSource/onerror -tags: - - API - - EventSource - - Server-sent events - - イベントハンドラ - - プロパティ - - リファレンス -translation_of: Web/API/EventSource/onerror ---- -
{{APIRef('WebSockets API')}}
- - - -

{{domxref("EventSource")}} インターフェースのonerror プロパティは、エラーが発生し、EventSource オブジェクトに対して {{event("error")}} が送出されたときに呼び出される {{event("Event_handlers", "event handler")}} です。

- -

構文

- -
eventSource.onerror = function
- -

- -
evtSource.onerror = function() {
-  console.log("EventSource failed.");
-};
- -
-

メモ: 完全な例を GitHub から見つけることができます — PHP を用いた簡単な SSE のデモ を参照。

-
- -

仕様

- - - - - - - - - - - - - - -
仕様ステータスコメント
{{SpecName('HTML WHATWG', "comms.html#handler-eventsource-onerror", "onerror")}}{{Spec2('HTML WHATWG')}}初期定義
- - - -

ブラウザ互換性

- -
- - -

{{Compat("api.EventSource.onerror")}}

-
- -

関連情報

- - diff --git a/files/ja/web/api/eventsource/onmessage/index.html b/files/ja/web/api/eventsource/onmessage/index.html deleted file mode 100644 index 0b0f8c7c6b..0000000000 --- a/files/ja/web/api/eventsource/onmessage/index.html +++ /dev/null @@ -1,69 +0,0 @@ ---- -title: EventSource.onmessage -slug: Web/API/EventSource/onmessage -tags: - - API - - EventSource - - Server-sent events - - onmessage - - イベントハンドラ - - プロパティ - - リファレンス -translation_of: Web/API/EventSource/onmessage ---- -
{{APIRef('WebSockets API')}}
- -

{{domxref("EventSource")}} インターフェースの onmessage プロパティは、メッセージイベントが受信されたとき、つまりソースからメッセージが送信されたときに呼び出される {{event("Event_handlers", "event handler")}} です。

- -

onmessage イベントハンドラのイベントオブジェクトの型は {{domxref("MessageEvent")}} です。

- -

構文

- -
eventSource.onmessage = function
- -

- -
evtSource.onmessage = function(e) {
-  var newElement = document.createElement("li");
-
-  newElement.textContent = "message: " + e.data;
-  eventList.appendChild(newElement);
-}
- -
-

メモ: 完全な例を GitHub から見つけることができます — PHP を用いた簡単な SSE のデモ を参照。

-
- -

仕様

- - - - - - - - - - - - - - -
仕様ステータスコメント
{{SpecName('HTML WHATWG', "comms.html#handler-eventsource-onmessage", "onmessage")}}{{Spec2('HTML WHATWG')}}初期定義
- - - -

ブラウザ互換性

- -
- - -

{{Compat("api.EventSource.onmessage")}}

-
- -

関連情報

- - diff --git a/files/ja/web/api/mediaquerylist/change_event/index.html b/files/ja/web/api/mediaquerylist/change_event/index.html new file mode 100644 index 0000000000..388dad93d3 --- /dev/null +++ b/files/ja/web/api/mediaquerylist/change_event/index.html @@ -0,0 +1,73 @@ +--- +title: MediaQueryList.onchange +slug: Web/API/MediaQueryList/change_event +tags: + - API + - CSSOM View + - Event Handler + - MediaQueryList + - Property + - Reference + - onchange + - イベントハンドラー + - プロパティ + - メディアクエリ +translation_of: Web/API/MediaQueryList/onchange +original_slug: Web/API/MediaQueryList/onchange +--- +

{{APIRef("CSSOM")}}

+ +

onchange は {{DOMxRef("MediaQueryList")}} インターフェイスのプロパティで、 {{domxref("MediaQueryList/change_event", "change")}} イベントが発行されたとき、すなわちメディアクエリの対応の状態が変化したときに呼び出される関数を表します。イベントオブジェクトは {{DOMxRef("MediaQueryListEvent")}} のインスタンスであり、古いブラウザーからは後方互換性のために MediaListQuery のインスタンスと解釈されます。

+ +

構文

+ +
MediaQueryList.onchange = function() { ... };
+ +

+ +
var mql = window.matchMedia('(max-width: 600px)');
+
+mql.addEventListener( "change", (e) => {
+    if (e.matches) {
+    /* ビューポートが 600 ピクセル幅以下 */
+    console.log('This is a narrow screen — less than 600px wide.')
+  } else {
+    /* ビューポートが 600 ピクセル幅より広い */
+    console.log('This is a wide screen — more than 600px wide.')
+  }
+})
+
+
+ +

仕様書

+ + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName("CSSOM View", "#dom-mediaquerylist-onchange", "onchange")}}{{Spec2("CSSOM View")}}初回定義
+ +

ブラウザーの互換性

+ +

{{Compat("api.MediaQueryList.onchange")}}

+ +

関連情報

+ + diff --git a/files/ja/web/api/mediaquerylist/onchange/index.html b/files/ja/web/api/mediaquerylist/onchange/index.html deleted file mode 100644 index 5539cdd3c7..0000000000 --- a/files/ja/web/api/mediaquerylist/onchange/index.html +++ /dev/null @@ -1,72 +0,0 @@ ---- -title: MediaQueryList.onchange -slug: Web/API/MediaQueryList/onchange -tags: - - API - - CSSOM View - - Event Handler - - MediaQueryList - - Property - - Reference - - onchange - - イベントハンドラー - - プロパティ - - メディアクエリ -translation_of: Web/API/MediaQueryList/onchange ---- -

{{APIRef("CSSOM")}}

- -

onchange は {{DOMxRef("MediaQueryList")}} インターフェイスのプロパティで、 {{domxref("MediaQueryList/change_event", "change")}} イベントが発行されたとき、すなわちメディアクエリの対応の状態が変化したときに呼び出される関数を表します。イベントオブジェクトは {{DOMxRef("MediaQueryListEvent")}} のインスタンスであり、古いブラウザーからは後方互換性のために MediaListQuery のインスタンスと解釈されます。

- -

構文

- -
MediaQueryList.onchange = function() { ... };
- -

- -
var mql = window.matchMedia('(max-width: 600px)');
-
-mql.addEventListener( "change", (e) => {
-    if (e.matches) {
-    /* ビューポートが 600 ピクセル幅以下 */
-    console.log('This is a narrow screen — less than 600px wide.')
-  } else {
-    /* ビューポートが 600 ピクセル幅より広い */
-    console.log('This is a wide screen — more than 600px wide.')
-  }
-})
-
-
- -

仕様書

- - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName("CSSOM View", "#dom-mediaquerylist-onchange", "onchange")}}{{Spec2("CSSOM View")}}初回定義
- -

ブラウザーの互換性

- -

{{Compat("api.MediaQueryList.onchange")}}

- -

関連情報

- - diff --git a/files/ja/web/guide/index/index.html b/files/ja/web/guide/index/index.html deleted file mode 100644 index 9f0d683123..0000000000 --- a/files/ja/web/guide/index/index.html +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: 索引 -slug: Web/Guide/Index -tags: - - Index - - ガイド -translation_of: Web/Guide/Index ---- -
{{MDNSidebar}}{{IncludeSubnav("/ja/docs/MDN")}}
- -

{{Index("/ja/docs/Web/Guide")}}

diff --git a/files/ja/web/html/index/index.html b/files/ja/web/html/index/index.html deleted file mode 100644 index eadaa1c4d0..0000000000 --- a/files/ja/web/html/index/index.html +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: HTML ドキュメントの索引 -slug: Web/HTML/Index -tags: - - HTML - - Index - - MDN Meta -translation_of: Web/HTML/Index ---- -

{{Index("/ja/docs/Web/HTML")}} 利用可能なすべての HTML に関する文書の包括的な索引リストです。

diff --git a/files/ja/web/http/index/index.html b/files/ja/web/http/index/index.html deleted file mode 100644 index acbf54eb38..0000000000 --- a/files/ja/web/http/index/index.html +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: 索引 -slug: Web/HTTP/Index -tags: - - HTTP - - Index -translation_of: Web/HTTP/Index ---- -
{{HTTPSidebar}}
- -

このページは概要やタグに沿った MDN のすべての HTTP ページの一覧です。

- -

{{Index("/ja/docs/Web/HTTP")}}

diff --git a/files/ja/web/mathml/index/index.html b/files/ja/web/mathml/index/index.html deleted file mode 100644 index a32dfa6b75..0000000000 --- a/files/ja/web/mathml/index/index.html +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: MathML 関連ドキュメントの索引 -slug: Web/MathML/Index -tags: - - Index - - MathML -translation_of: Web/MathML/Index ---- -

{{Index("/ja/docs/Web/MathML")}}

diff --git a/files/ja/web/svg/index/index.html b/files/ja/web/svg/index/index.html deleted file mode 100644 index 84bc4161f7..0000000000 --- a/files/ja/web/svg/index/index.html +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: SVG 関連ドキュメントの索引 -slug: Web/SVG/Index -tags: - - Index - - SVG -translation_of: Web/SVG/Index ---- -

{{Index("/ja/docs/Web/SVG")}}

diff --git a/files/ja/web/xpath/index/index.html b/files/ja/web/xpath/index/index.html deleted file mode 100644 index e90e8fb344..0000000000 --- a/files/ja/web/xpath/index/index.html +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: Index -slug: Web/XPath/Index -tags: - - Index - - Reference - - XPath - - XSLT -translation_of: Web/XPath/Index ---- -

{{Index("/ja/docs/Web/XPath")}}

- -
-

{{QuickLinksWithSubpages("/ja/docs/Web/XPath")}}

-
diff --git a/files/ja/web/xslt/index/index.html b/files/ja/web/xslt/index/index.html deleted file mode 100644 index 91bb5362a3..0000000000 --- a/files/ja/web/xslt/index/index.html +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: Index -slug: Web/XSLT/Index -tags: - - Index - - XSLT - - リファレンス -translation_of: Web/XSLT/Index ---- -

{{XSLTRef}}{{QuickLinksWithSubpages("/ja/docs/Web/XSLT")}}

- -

{{Index("/ja/docs/XSLT")}}

diff --git a/files/ja/webassembly/index/index.html b/files/ja/webassembly/index/index.html deleted file mode 100644 index dd2f92d0e9..0000000000 --- a/files/ja/webassembly/index/index.html +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: Index -slug: WebAssembly/Index -tags: - - Index - - WebAssembly -translation_of: WebAssembly/Index ---- -
{{WebAssemblySidebar}}
- -

{{Index("/ja/docs/WebAssembly")}}

diff --git a/files/ko/_redirects.txt b/files/ko/_redirects.txt index a69d0e95b6..80407fb56b 100644 --- a/files/ko/_redirects.txt +++ b/files/ko/_redirects.txt @@ -196,6 +196,7 @@ /ko/docs/Firefox_3_for_developers /ko/docs/Mozilla/Firefox/Releases/3 /ko/docs/Focus_management_in_HTML /ko/docs/Web/API/Document/hasFocus /ko/docs/Full_page_zoom /ko/docs/Mozilla/Firefox/Releases/3/Full_page_zoom +/ko/docs/Games/Index /ko/docs/conflicting/Games /ko/docs/Games/Tutorials/2D_breakout_game_Phaser/득점 /ko/docs/Games/Tutorials/2D_breakout_game_Phaser/The_score /ko/docs/Games/Tutorials/순수한_자바스크립트를_이용한_2D_벽돌깨기_게임 /ko/docs/Games/Tutorials/2D_Breakout_game_pure_JavaScript /ko/docs/Games/Tutorials/순수한_자바스크립트를_이용한_2D_벽돌깨기_게임/Bounce_off_the_walls /ko/docs/Games/Tutorials/2D_Breakout_game_pure_JavaScript/Bounce_off_the_walls @@ -210,6 +211,7 @@ /ko/docs/Games/Tutorials/순수한_자바스크립트를_이용한_2D_벽돌깨기_게임/캔버스_생성과_그리기 /ko/docs/Games/Tutorials/2D_Breakout_game_pure_JavaScript/Create_the_Canvas_and_draw_on_it /ko/docs/Glossary/Client_hints /ko/docs/Web/HTTP/Client_hints /ko/docs/Glossary/Header /ko/docs/Glossary/HTTP_header +/ko/docs/Glossary/Index /ko/docs/conflicting/Glossary /ko/docs/Glossary/Transmission_Control_Protocol_(TCP) /ko/docs/conflicting/Glossary/TCP /ko/docs/Glossary/동적_프로그래밍_언어 /ko/docs/Glossary/Dynamic_programming_language /ko/docs/Glossary/배열 /ko/docs/Glossary/array @@ -313,6 +315,7 @@ /ko/docs/Learn/HTML/Forms/Your_first_HTML_form /ko/docs/Learn/Forms/Your_first_form /ko/docs/Learn/HTML/Howto/데이터_속성_사용하기 /ko/docs/Learn/HTML/Howto/Use_data_attributes /ko/docs/Learn/HTML/Multimedia_and_embedding/ideo_and_audio_content /ko/docs/Learn/HTML/Multimedia_and_embedding/Video_and_audio_content +/ko/docs/Learn/Index /ko/docs/conflicting/Learn /ko/docs/Learn/JavaScript/Asynchronous/Async_await /ko/docs/conflicting/Learn/JavaScript/Asynchronous/Promises /ko/docs/Learn/JavaScript/Asynchronous/Concepts /ko/docs/conflicting/Learn/JavaScript/Asynchronous/Introducing /ko/docs/Learn/JavaScript/Asynchronous/Timeouts_and_intervals /ko/docs/conflicting/Learn/JavaScript/Asynchronous @@ -612,6 +615,7 @@ /ko/docs/Web/Guide/HTML/폼/HTML_폼_구성_방법 /ko/docs/Learn/Forms/How_to_structure_a_web_form /ko/docs/Web/Guide/HTML/폼/My_first_HTML_form /ko/docs/Learn/Forms/Your_first_form /ko/docs/Web/Guide/HTML/폼/Sending_and_retrieving_form_data /ko/docs/Learn/Forms/Sending_and_retrieving_form_data +/ko/docs/Web/Guide/Index /ko/docs/conflicting/Web/Guide /ko/docs/Web/Guide/XML_파싱_및_직렬화 /ko/docs/Web/Guide/Parsing_and_serializing_XML /ko/docs/Web/Guide/그래픽 /ko/docs/Web/Guide/Graphics /ko/docs/Web/HTML/Canvas /ko/docs/Web/API/Canvas_API @@ -642,11 +646,13 @@ /ko/docs/Web/HTML/Global_attributes/클래스 /ko/docs/Web/HTML/Global_attributes/class /ko/docs/Web/HTML/HTML5/HTML5_element_list /ko/docs/Web/HTML/Element /ko/docs/Web/HTML/HTML에서_폼 /ko/docs/Learn/Forms +/ko/docs/Web/HTML/Index /ko/docs/conflicting/Web/HTML /ko/docs/Web/HTML/Introduction /ko/docs/Learn/HTML/Introduction_to_HTML /ko/docs/Web/HTTP/Access_control_CORS /ko/docs/Web/HTTP/CORS /ko/docs/Web/HTTP/Access_control_CORS/Errors /ko/docs/Web/HTTP/CORS/Errors /ko/docs/Web/HTTP/Access_control_CORS/Errors/CORSDidNotSucceed /ko/docs/Web/HTTP/CORS/Errors/CORSDidNotSucceed /ko/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Complete_list_of_MIME_types /ko/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types +/ko/docs/Web/HTTP/Index /ko/docs/conflicting/Web/HTTP /ko/docs/Web/HTTP/User_agent를_이용한_브라우저_감지 /ko/docs/Web/HTTP/Browser_detection_using_the_user_agent /ko/docs/Web/HTTP/상태_코드 /ko/docs/Web/HTTP/Status /ko/docs/Web/JavaScript/About /ko/docs/Web/JavaScript/About_JavaScript diff --git a/files/ko/_wikihistory.json b/files/ko/_wikihistory.json index 6c67d4c18d..b811cae08e 100644 --- a/files/ko/_wikihistory.json +++ b/files/ko/_wikihistory.json @@ -13,12 +13,6 @@ "kom2727" ] }, - "Games/Index": { - "modified": "2020-12-05T03:39:50.081Z", - "contributors": [ - "movegun1027" - ] - }, "Games/Introduction": { "modified": "2019-06-03T20:16:02.213Z", "contributors": [ @@ -574,12 +568,6 @@ "HyunSeob" ] }, - "Glossary/Index": { - "modified": "2019-05-26T04:17:19.834Z", - "contributors": [ - "alattalatta" - ] - }, "Glossary/Internet": { "modified": "2019-10-29T12:34:29.654Z", "contributors": [ @@ -1867,12 +1855,6 @@ "byoung_hyun" ] }, - "Learn/Index": { - "modified": "2020-07-16T22:33:40.026Z", - "contributors": [ - "alattalatta" - ] - }, "Learn/JavaScript": { "modified": "2020-12-01T10:05:39.249Z", "contributors": [ @@ -9915,13 +9897,6 @@ "gblue1223" ] }, - "Web/Guide/Index": { - "modified": "2020-12-07T13:40:57.143Z", - "contributors": [ - "peterbe", - "alattalatta" - ] - }, "Web/Guide/Mobile": { "modified": "2019-05-30T06:59:50.297Z", "contributors": [ @@ -11092,12 +11067,6 @@ "alattalatta" ] }, - "Web/HTML/Index": { - "modified": "2020-01-19T02:45:39.384Z", - "contributors": [ - "alattalatta" - ] - }, "Web/HTML/Inline_elements": { "modified": "2020-02-12T03:45:21.056Z", "contributors": [ @@ -11717,12 +11686,6 @@ "Simtu" ] }, - "Web/HTTP/Index": { - "modified": "2020-02-05T12:28:02.372Z", - "contributors": [ - "alattalatta" - ] - }, "Web/HTTP/Messages": { "modified": "2019-03-18T20:59:38.193Z", "contributors": [ @@ -17342,6 +17305,18 @@ "limkukhyun" ] }, + "conflicting/Games": { + "modified": "2020-12-05T03:39:50.081Z", + "contributors": [ + "movegun1027" + ] + }, + "conflicting/Glossary": { + "modified": "2019-05-26T04:17:19.834Z", + "contributors": [ + "alattalatta" + ] + }, "conflicting/Glossary/TCP": { "modified": "2020-01-12T14:32:05.700Z", "contributors": [ @@ -17349,10 +17324,9 @@ ] }, "conflicting/Learn": { - "modified": "2020-07-16T22:22:13.258Z", + "modified": "2020-07-16T22:33:40.026Z", "contributors": [ - "Netaras", - "KwanHong_Lee66" + "alattalatta" ] }, "conflicting/Learn/CSS/Building_blocks": { @@ -17581,13 +17555,22 @@ ] }, "conflicting/Web/Guide": { - "modified": "2019-03-23T23:41:47.329Z", + "modified": "2020-12-07T13:40:57.143Z", "contributors": [ - "teoli", - "Jiyoon", - "Unixcruiser", - "Netaras", - "Sebuls" + "peterbe", + "alattalatta" + ] + }, + "conflicting/Web/HTML": { + "modified": "2020-01-19T02:45:39.384Z", + "contributors": [ + "alattalatta" + ] + }, + "conflicting/Web/HTTP": { + "modified": "2020-02-05T12:28:02.372Z", + "contributors": [ + "alattalatta" ] }, "conflicting/Web/JavaScript/Guide": { diff --git a/files/ko/conflicting/games/index.html b/files/ko/conflicting/games/index.html new file mode 100644 index 0000000000..88c9158fdc --- /dev/null +++ b/files/ko/conflicting/games/index.html @@ -0,0 +1,11 @@ +--- +title: Index +slug: conflicting/Games +tags: + - Meta +translation_of: Games/Index +original_slug: Games/Index +--- +
{{GamesSidebar}}
+ +

{{Index("/en-US/docs/Games")}}

diff --git a/files/ko/conflicting/glossary/index.html b/files/ko/conflicting/glossary/index.html new file mode 100644 index 0000000000..e27f7b7ce2 --- /dev/null +++ b/files/ko/conflicting/glossary/index.html @@ -0,0 +1,12 @@ +--- +title: Index +slug: conflicting/Glossary +tags: + - Glossary + - Index + - MDN Meta + - Navigation +translation_of: Glossary/Index +original_slug: Glossary/Index +--- +

{{Index("/ko/docs/Glossary")}}

diff --git a/files/ko/conflicting/learn/index.html b/files/ko/conflicting/learn/index.html new file mode 100644 index 0000000000..828ba7b7fa --- /dev/null +++ b/files/ko/conflicting/learn/index.html @@ -0,0 +1,11 @@ +--- +title: Index +slug: conflicting/Learn +tags: + - Index + - Learn + - MDN Meta +translation_of: Learn/Index +original_slug: Learn/Index +--- +

{{Index("/ko/docs/Learn")}}

diff --git a/files/ko/conflicting/web/guide/index.html b/files/ko/conflicting/web/guide/index.html new file mode 100644 index 0000000000..2ae329dcdc --- /dev/null +++ b/files/ko/conflicting/web/guide/index.html @@ -0,0 +1,12 @@ +--- +title: Index +slug: conflicting/Web/Guide +tags: + - Guide + - Index +translation_of: Web/Guide/Index +original_slug: Web/Guide/Index +--- +
{{MDNSidebar}}{{IncludeSubnav("/ko/docs/MDN")}}
+ +

{{Index("/ko/docs/Web/Guide")}}

diff --git a/files/ko/conflicting/web/html/index.html b/files/ko/conflicting/web/html/index.html new file mode 100644 index 0000000000..98a0225d2a --- /dev/null +++ b/files/ko/conflicting/web/html/index.html @@ -0,0 +1,11 @@ +--- +title: HTML documentation index +slug: conflicting/Web/HTML +tags: + - HTML + - Index + - MDN Meta +translation_of: Web/HTML/Index +original_slug: Web/HTML/Index +--- +

{{Index("/ko/docs/Web/HTML")}} 전체 HTML 문서의 목록입니다.

diff --git a/files/ko/conflicting/web/http/index.html b/files/ko/conflicting/web/http/index.html new file mode 100644 index 0000000000..b52d63cc82 --- /dev/null +++ b/files/ko/conflicting/web/http/index.html @@ -0,0 +1,12 @@ +--- +title: HTTP 색인 +slug: conflicting/Web/HTTP +tags: + - HTTP + - Index +translation_of: Web/HTTP/Index +original_slug: Web/HTTP/Index +--- +
{{HTTPSidebar}}
+ +

{{Index("/ko/docs/Web/HTTP")}}

diff --git a/files/ko/games/index/index.html b/files/ko/games/index/index.html deleted file mode 100644 index 5d36376f6e..0000000000 --- a/files/ko/games/index/index.html +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: Index -slug: Games/Index -tags: - - Meta -translation_of: Games/Index ---- -
{{GamesSidebar}}
- -

{{Index("/en-US/docs/Games")}}

diff --git a/files/ko/glossary/index/index.html b/files/ko/glossary/index/index.html deleted file mode 100644 index f7edc11916..0000000000 --- a/files/ko/glossary/index/index.html +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: Index -slug: Glossary/Index -tags: - - Glossary - - Index - - MDN Meta - - Navigation -translation_of: Glossary/Index ---- -

{{Index("/ko/docs/Glossary")}}

diff --git a/files/ko/learn/index/index.html b/files/ko/learn/index/index.html deleted file mode 100644 index ef35585b45..0000000000 --- a/files/ko/learn/index/index.html +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: Index -slug: Learn/Index -tags: - - Index - - Learn - - MDN Meta -translation_of: Learn/Index ---- -

{{Index("/ko/docs/Learn")}}

diff --git a/files/ko/web/guide/index/index.html b/files/ko/web/guide/index/index.html deleted file mode 100644 index 1d121dfb94..0000000000 --- a/files/ko/web/guide/index/index.html +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: Index -slug: Web/Guide/Index -tags: - - Guide - - Index -translation_of: Web/Guide/Index ---- -
{{MDNSidebar}}{{IncludeSubnav("/ko/docs/MDN")}}
- -

{{Index("/ko/docs/Web/Guide")}}

diff --git a/files/ko/web/html/index/index.html b/files/ko/web/html/index/index.html deleted file mode 100644 index dde859c07d..0000000000 --- a/files/ko/web/html/index/index.html +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: HTML documentation index -slug: Web/HTML/Index -tags: - - HTML - - Index - - MDN Meta -translation_of: Web/HTML/Index ---- -

{{Index("/ko/docs/Web/HTML")}} 전체 HTML 문서의 목록입니다.

diff --git a/files/ko/web/http/index/index.html b/files/ko/web/http/index/index.html deleted file mode 100644 index ffd7a593f4..0000000000 --- a/files/ko/web/http/index/index.html +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: HTTP 색인 -slug: Web/HTTP/Index -tags: - - HTTP - - Index -translation_of: Web/HTTP/Index ---- -
{{HTTPSidebar}}
- -

{{Index("/ko/docs/Web/HTTP")}}

diff --git a/files/pt-br/_redirects.txt b/files/pt-br/_redirects.txt index 3363b351ae..91690e911a 100644 --- a/files/pt-br/_redirects.txt +++ b/files/pt-br/_redirects.txt @@ -517,6 +517,7 @@ /pt-BR/docs/Web/API/Element/accessKey /pt-BR/docs/Web/API/HTMLElement/accessKey /pt-BR/docs/Web/API/Element/addEventListener /pt-BR/docs/Web/API/EventTarget/addEventListener /pt-BR/docs/Web/API/Event/Comparativo_entre_Event_Targets /pt-BR/docs/Web/API/Event/Comparison_of_Event_Targets +/pt-BR/docs/Web/API/EventSource/onerror /pt-BR/docs/Web/API/EventSource/error_event /pt-BR/docs/Web/API/Fetch_API/Uso_de_busca_Cross-global /pt-BR/docs/Web/API/Fetch_API/Cross-global_fetch_usage /pt-BR/docs/Web/API/FileReader/onload /pt-BR/docs/Web/API/FileReader/load_event /pt-BR/docs/Web/API/FullscreenOptions /pt-BR/docs/orphaned/Web/API/FullscreenOptions diff --git a/files/pt-br/_wikihistory.json b/files/pt-br/_wikihistory.json index c050bf05f2..6041ed758b 100644 --- a/files/pt-br/_wikihistory.json +++ b/files/pt-br/_wikihistory.json @@ -5001,7 +5001,7 @@ "ronrother" ] }, - "Web/API/EventSource/onerror": { + "Web/API/EventSource/error_event": { "modified": "2019-03-18T21:30:45.574Z", "contributors": [ "ronrother" diff --git a/files/pt-br/web/api/eventsource/error_event/index.html b/files/pt-br/web/api/eventsource/error_event/index.html new file mode 100644 index 0000000000..9f0407f3f4 --- /dev/null +++ b/files/pt-br/web/api/eventsource/error_event/index.html @@ -0,0 +1,122 @@ +--- +title: EventSource.onerror +slug: Web/API/EventSource/error_event +translation_of: Web/API/EventSource/onerror +original_slug: Web/API/EventSource/onerror +--- +
{{APIRef('WebSockets API')}}
+ +
 
+ +

A propriedade onerror da interface {{domxref("EventSource")}} é um {{event("Event_handlers", "event handler")}} chamado quando um erro ocorre e um evento {{event("error")}} é despachado para o objeto EventSource.

+ +

Sintaxe

+ +
eventSource.onerror = function
+ +

Exemplos

+ +
evtSource.onerror = function() {
+  console.log("EventSource failed.");
+};
+ +
+

Nota: Você pode encontrar um exemplo completo no GitHub — veja Simple SSE demo using PHP.

+
+ +

Especificações

+ + + + + + + + + + + + + + +
EspecificaçãoStatusComentário
{{SpecName('HTML WHATWG', "comms.html#handler-eventsource-onerror", "onerror")}}{{Spec2('HTML WHATWG')}}Definição inicial
+ + + +

Compatibilidade com navegadores

+ +
{{CompatibilityTable}}
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari
Suporte a EventSource6{{CompatNo}}{{CompatGeckoDesktop("6.0")}}{{CompatNo}}{{CompatVersionUnknown}}5
Disponibilidade em workers compartilhados e dedicados[1]{{CompatVersionUnknown}}{{CompatNo}}{{CompatGeckoDesktop("53.0")}}{{CompatNo}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Suporte a EventSource4.445{{CompatNo}}124.1
Disponibilidade em workers compartilhados e dedicados[1]{{CompatVersionUnknown}}{{CompatGeckoMobile("53.0")}}{{CompatNo}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +

[1] Mas ainda não em service workers.

+ +

Veja também

+ + diff --git a/files/pt-br/web/api/eventsource/onerror/index.html b/files/pt-br/web/api/eventsource/onerror/index.html deleted file mode 100644 index 6221e01bd0..0000000000 --- a/files/pt-br/web/api/eventsource/onerror/index.html +++ /dev/null @@ -1,121 +0,0 @@ ---- -title: EventSource.onerror -slug: Web/API/EventSource/onerror -translation_of: Web/API/EventSource/onerror ---- -
{{APIRef('WebSockets API')}}
- -
 
- -

A propriedade onerror da interface {{domxref("EventSource")}} é um {{event("Event_handlers", "event handler")}} chamado quando um erro ocorre e um evento {{event("error")}} é despachado para o objeto EventSource.

- -

Sintaxe

- -
eventSource.onerror = function
- -

Exemplos

- -
evtSource.onerror = function() {
-  console.log("EventSource failed.");
-};
- -
-

Nota: Você pode encontrar um exemplo completo no GitHub — veja Simple SSE demo using PHP.

-
- -

Especificações

- - - - - - - - - - - - - - -
EspecificaçãoStatusComentário
{{SpecName('HTML WHATWG', "comms.html#handler-eventsource-onerror", "onerror")}}{{Spec2('HTML WHATWG')}}Definição inicial
- - - -

Compatibilidade com navegadores

- -
{{CompatibilityTable}}
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari
Suporte a EventSource6{{CompatNo}}{{CompatGeckoDesktop("6.0")}}{{CompatNo}}{{CompatVersionUnknown}}5
Disponibilidade em workers compartilhados e dedicados[1]{{CompatVersionUnknown}}{{CompatNo}}{{CompatGeckoDesktop("53.0")}}{{CompatNo}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Suporte a EventSource4.445{{CompatNo}}124.1
Disponibilidade em workers compartilhados e dedicados[1]{{CompatVersionUnknown}}{{CompatGeckoMobile("53.0")}}{{CompatNo}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
-
- -

[1] Mas ainda não em service workers.

- -

Veja também

- - diff --git a/files/ru/_redirects.txt b/files/ru/_redirects.txt index 377cf27043..076f9409bb 100644 --- a/files/ru/_redirects.txt +++ b/files/ru/_redirects.txt @@ -290,6 +290,7 @@ /ru/docs/Sample_.htaccess_file /ru/docs/Learn/Server-side/Apache_Configuration_htaccess /ru/docs/Tools/Debugger/How_to/Отладка_кода_внутри_eval /ru/docs/Tools/Debugger/How_to/Debug_eval_sources /ru/docs/Tools/Debugger/How_to/Работа_с_минифицированным_кодом /ru/docs/Tools/Debugger/How_to/Pretty-print_a_minified_file +/ru/docs/Tools/Index /ru/docs/conflicting/Tools /ru/docs/Tools/Page_Inspector/How_to/Otkrytie_Inspektora /ru/docs/Tools/Page_Inspector/How_to/Open_the_Inspector /ru/docs/Tools/Page_Inspector/How_to/Vybor_elementa /ru/docs/Tools/Page_Inspector/How_to/Select_an_element /ru/docs/Tools/Page_Inspector/How_to/Исследовать_event_listeners /ru/docs/Tools/Page_Inspector/How_to/Examine_event_listeners diff --git a/files/ru/_wikihistory.json b/files/ru/_wikihistory.json index d6c88836f4..a348d4fe1e 100644 --- a/files/ru/_wikihistory.json +++ b/files/ru/_wikihistory.json @@ -5037,14 +5037,6 @@ "vm10111957r" ] }, - "Tools/Index": { - "modified": "2020-07-16T22:36:06.095Z", - "contributors": [ - "wbamberg", - "Aleksej", - "Mingun" - ] - }, "Tools/Keyboard_shortcuts": { "modified": "2020-11-06T04:42:55.218Z", "contributors": [ @@ -24053,6 +24045,14 @@ "uleming" ] }, + "conflicting/Tools": { + "modified": "2020-07-16T22:36:06.095Z", + "contributors": [ + "wbamberg", + "Aleksej", + "Mingun" + ] + }, "conflicting/Tools/Performance": { "modified": "2020-07-16T22:35:29.176Z", "contributors": [ diff --git a/files/ru/conflicting/tools/index.html b/files/ru/conflicting/tools/index.html new file mode 100644 index 0000000000..6af7016701 --- /dev/null +++ b/files/ru/conflicting/tools/index.html @@ -0,0 +1,9 @@ +--- +title: Индекс +slug: conflicting/Tools +tags: + - инструменты +translation_of: Tools/Index +original_slug: Tools/Index +--- +
{{ToolsSidebar}}

{{Index("/ru/docs/Tools")}}

diff --git a/files/ru/tools/index/index.html b/files/ru/tools/index/index.html deleted file mode 100644 index b9d3f33dbb..0000000000 --- a/files/ru/tools/index/index.html +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: Индекс -slug: Tools/Index -tags: - - инструменты -translation_of: Tools/Index ---- -
{{ToolsSidebar}}

{{Index("/ru/docs/Tools")}}

diff --git a/files/zh-cn/_redirects.txt b/files/zh-cn/_redirects.txt index 5724992b1b..73596ab89d 100644 --- a/files/zh-cn/_redirects.txt +++ b/files/zh-cn/_redirects.txt @@ -1191,8 +1191,8 @@ /zh-CN/docs/Server-sent_events/EventSource /zh-CN/docs/Web/API/EventSource /zh-CN/docs/Server-sent_events/EventSource/EventSource /zh-CN/docs/Web/API/EventSource/EventSource /zh-CN/docs/Server-sent_events/EventSource/close /zh-CN/docs/Web/API/EventSource/close -/zh-CN/docs/Server-sent_events/EventSource/onerror /zh-CN/docs/Web/API/EventSource/onerror -/zh-CN/docs/Server-sent_events/EventSource/onopen /zh-CN/docs/Web/API/EventSource/onopen +/zh-CN/docs/Server-sent_events/EventSource/onerror /zh-CN/docs/Web/API/EventSource/error_event +/zh-CN/docs/Server-sent_events/EventSource/onopen /zh-CN/docs/Web/API/EventSource/open_event /zh-CN/docs/Server-sent_events/Using_server-sent_events /zh-CN/docs/Web/API/Server-sent_events/Using_server-sent_events /zh-CN/docs/Site_Compatibility_for_Firefox_19 /zh-CN/docs/Mozilla/Firefox/Releases/19/Site_compatibility /zh-CN/docs/Site_Compatibility_for_Firefox_21 /zh-CN/docs/Mozilla/Firefox/Releases/21/Site_compatibility @@ -1333,6 +1333,8 @@ /zh-CN/docs/Web/API/Event/isChar /zh-CN/docs/Web/API/UIEvent/isChar /zh-CN/docs/Web/API/Event/pageY /zh-CN/docs/conflicting/Web/API/MouseEvent/pageY /zh-CN/docs/Web/API/Event/禁用时间冒泡 /zh-CN/docs/Web/API/Event/cancelBubble +/zh-CN/docs/Web/API/EventSource/onerror /zh-CN/docs/Web/API/EventSource/error_event +/zh-CN/docs/Web/API/EventSource/onopen /zh-CN/docs/Web/API/EventSource/open_event /zh-CN/docs/Web/API/EventTarget.dispatchEvent /zh-CN/docs/Web/API/EventTarget/dispatchEvent /zh-CN/docs/Web/API/EventTarget.removeEventListener /zh-CN/docs/Web/API/EventTarget/removeEventListener /zh-CN/docs/Web/API/FetchController /zh-CN/docs/Web/API/AbortController @@ -2014,6 +2016,7 @@ /zh-CN/docs/Web/HTML/Global_attributes/x-ms-加速装置键 /zh-CN/docs/Web/HTML/Global_attributes/x-ms-acceleratorkey /zh-CN/docs/Web/HTML/Global_attributes/x-ms-格式-检测 /zh-CN/docs/Web/HTML/Global_attributes/x-ms-format-detection /zh-CN/docs/Web/HTML/Global_attributes/摩缺 /zh-CN/docs/Web/HTML/Global_attributes/accesskey +/zh-CN/docs/Web/HTML/Index /zh-CN/docs/conflicting/Web/HTML /zh-CN/docs/Web/HTML/Inline_elemente /zh-CN/docs/Web/HTML/Inline_elements /zh-CN/docs/Web/HTML/Introduction /zh-CN/docs/learn/HTML/Introduction_to_HTML /zh-CN/docs/Web/HTML/Optimizing_your_pages_for_speculative_parsing /zh-CN/docs/Glossary/speculative_parsing diff --git a/files/zh-cn/_wikihistory.json b/files/zh-cn/_wikihistory.json index 81df0cfbad..3fd874797f 100644 --- a/files/zh-cn/_wikihistory.json +++ b/files/zh-cn/_wikihistory.json @@ -12997,13 +12997,13 @@ "Char-Ten" ] }, - "Web/API/EventSource/onerror": { + "Web/API/EventSource/error_event": { "modified": "2019-03-23T22:09:23.181Z", "contributors": [ "Char-Ten" ] }, - "Web/API/EventSource/onopen": { + "Web/API/EventSource/open_event": { "modified": "2019-03-23T22:16:16.621Z", "contributors": [ "kameii" @@ -32750,13 +32750,6 @@ "pans9" ] }, - "Web/HTML/Index": { - "modified": "2019-03-21T11:52:09.419Z", - "contributors": [ - "RainSlide", - "xcffl" - ] - }, "Web/HTML/Inline_elements": { "modified": "2020-08-05T19:04:54.777Z", "contributors": [ @@ -47559,6 +47552,13 @@ "wbamberg" ] }, + "conflicting/Web/HTML": { + "modified": "2019-03-21T11:52:09.419Z", + "contributors": [ + "RainSlide", + "xcffl" + ] + }, "conflicting/Web/HTML/Element": { "modified": "2020-01-10T02:18:08.432Z", "contributors": [ diff --git a/files/zh-cn/conflicting/web/html/index.html b/files/zh-cn/conflicting/web/html/index.html new file mode 100644 index 0000000000..0329d96704 --- /dev/null +++ b/files/zh-cn/conflicting/web/html/index.html @@ -0,0 +1,10 @@ +--- +title: HTML 文档索引 +slug: conflicting/Web/HTML +tags: + - HTML + - 索引 +translation_of: Web/HTML/Index +original_slug: Web/HTML/Index +--- +

{{Index("/zh-CN/docs/Web/HTML")}} 所有可用的 HTML 文档的综合索引列表。

diff --git a/files/zh-cn/web/api/eventsource/error_event/index.html b/files/zh-cn/web/api/eventsource/error_event/index.html new file mode 100644 index 0000000000..eb69418af9 --- /dev/null +++ b/files/zh-cn/web/api/eventsource/error_event/index.html @@ -0,0 +1,56 @@ +--- +title: EventSource.onerror +slug: Web/API/EventSource/error_event +translation_of: Web/API/EventSource/onerror +original_slug: Web/API/EventSource/onerror +--- +
{{APIRef('WebSockets API')}}
+ +
 
+ + +

{{domxref("EventSource")}} 的属性 onerror 是当发生错误且这个错误事件({{event("error")}} )被EventSource触发时调用的一个事件处理函数({{event("Event_handlers", "event handler")}})

+ +

语法

+ +
eventSource.onerror = function
+ +

例子

+ +
evtSource.onerror = function() {
+  console.log("EventSource failed.");
+};
+ +
+

Note: 你可以在Github上查看这个完整例子: Simple SSE demo using PHP.

+
+ +

规范

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', "comms.html#handler-eventsource-onerror", "onerror")}}{{Spec2('HTML WHATWG')}}Initial definition
+ + + +

浏览器兼容性

+ +{{Compat("api.EventSource.onerror")}} + +

相关链接

+ + diff --git a/files/zh-cn/web/api/eventsource/onerror/index.html b/files/zh-cn/web/api/eventsource/onerror/index.html deleted file mode 100644 index 991d194795..0000000000 --- a/files/zh-cn/web/api/eventsource/onerror/index.html +++ /dev/null @@ -1,56 +0,0 @@ ---- -title: EventSource.onerror -slug: Web/API/EventSource/onerror -translation_of: Web/API/EventSource/onerror -original_slug: Server-sent_events/EventSource/onerror ---- -
{{APIRef('WebSockets API')}}
- -
 
- - -

{{domxref("EventSource")}} 的属性 onerror 是当发生错误且这个错误事件({{event("error")}} )被EventSource触发时调用的一个事件处理函数({{event("Event_handlers", "event handler")}})

- -

语法

- -
eventSource.onerror = function
- -

例子

- -
evtSource.onerror = function() {
-  console.log("EventSource failed.");
-};
- -
-

Note: 你可以在Github上查看这个完整例子: Simple SSE demo using PHP.

-
- -

规范

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', "comms.html#handler-eventsource-onerror", "onerror")}}{{Spec2('HTML WHATWG')}}Initial definition
- - - -

浏览器兼容性

- -{{Compat("api.EventSource.onerror")}} - -

相关链接

- - diff --git a/files/zh-cn/web/api/eventsource/onopen/index.html b/files/zh-cn/web/api/eventsource/onopen/index.html deleted file mode 100644 index 20ca54d1f4..0000000000 --- a/files/zh-cn/web/api/eventsource/onopen/index.html +++ /dev/null @@ -1,57 +0,0 @@ ---- -title: EventSource.onopen -slug: Web/API/EventSource/onopen -tags: - - API - - Event Handler - - EventSource -translation_of: Web/API/EventSource/onopen -original_slug: Server-sent_events/EventSource/onopen ---- -
{{APIRef('WebSockets API')}}
- -

{{domxref("EventSource")}}接口的 onopen 属性是一个 {{event("Event_handlers", "event handler")}} ,它在收到{{event("open")}} 事件时被调用,在那时,连接刚被打开。

- -

语法

- -
eventSource.onopen = function
- -

示例

- -
evtSource.onopen = function() {
-  console.log("Connection to server opened.");
-};
- -
-

注意 :你可以在 GitHub 上看到一个完整的示例— 请看 使用php的SSE(服务器发送事件)demo。

-
- -

规范

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', "comms.html#handler-eventsource-onopen", "onopen")}}{{Spec2('HTML WHATWG')}}Initial definition
- - - -

浏览器兼容性

- -{{Compat("api.EventSource.onopen")}} - -

相关链接

- - diff --git a/files/zh-cn/web/api/eventsource/open_event/index.html b/files/zh-cn/web/api/eventsource/open_event/index.html new file mode 100644 index 0000000000..64214dbd2f --- /dev/null +++ b/files/zh-cn/web/api/eventsource/open_event/index.html @@ -0,0 +1,57 @@ +--- +title: EventSource.onopen +slug: Web/API/EventSource/open_event +tags: + - API + - Event Handler + - EventSource +translation_of: Web/API/EventSource/onopen +original_slug: Web/API/EventSource/onopen +--- +
{{APIRef('WebSockets API')}}
+ +

{{domxref("EventSource")}}接口的 onopen 属性是一个 {{event("Event_handlers", "event handler")}} ,它在收到{{event("open")}} 事件时被调用,在那时,连接刚被打开。

+ +

语法

+ +
eventSource.onopen = function
+ +

示例

+ +
evtSource.onopen = function() {
+  console.log("Connection to server opened.");
+};
+ +
+

注意 :你可以在 GitHub 上看到一个完整的示例— 请看 使用php的SSE(服务器发送事件)demo。

+
+ +

规范

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', "comms.html#handler-eventsource-onopen", "onopen")}}{{Spec2('HTML WHATWG')}}Initial definition
+ + + +

浏览器兼容性

+ +{{Compat("api.EventSource.onopen")}} + +

相关链接

+ + diff --git a/files/zh-cn/web/html/index/index.html b/files/zh-cn/web/html/index/index.html deleted file mode 100644 index baae41e64c..0000000000 --- a/files/zh-cn/web/html/index/index.html +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: HTML 文档索引 -slug: Web/HTML/Index -tags: - - HTML - - 索引 -translation_of: Web/HTML/Index ---- -

{{Index("/zh-CN/docs/Web/HTML")}} 所有可用的 HTML 文档的综合索引列表。

-- cgit v1.2.3-54-g00ecf