diff --git a/files/en-us/web/api/abstractworker/index.html b/files/en-us/web/api/abstractworker/index.html index 3ff7a7a67673806..c1c65d7d95ce77b 100644 --- a/files/en-us/web/api/abstractworker/index.html +++ b/files/en-us/web/api/abstractworker/index.html @@ -37,7 +37,7 @@
This code snippet demonstrates the creation of a new Worker
using the {{domxref("Worker.Worker", "Worker()")}} constructor; it also shows how to then send a message to the worker.
var myWorker = new Worker('worker.js'); +var myWorker = new Worker('worker.js'); first.onchange = function() { myWorker.postMessage([first.value, second.value]); diff --git a/files/en-us/web/api/abstractworker/onerror/index.html b/files/en-us/web/api/abstractworker/onerror/index.html index 9b843e6509c9d28..0f0654964a9e205 100644 --- a/files/en-us/web/api/abstractworker/onerror/index.html +++ b/files/en-us/web/api/abstractworker/onerror/index.html @@ -17,7 +17,7 @@Syntax
-myWorker.onerror = function() { ... };+myWorker.onerror = function() { ... };Example
diff --git a/files/en-us/web/api/addresserrors/addressline/index.html b/files/en-us/web/api/addresserrors/addressline/index.html index 5ee0c6ddc12ea8d..2c4838cb97f1c7e 100644 --- a/files/en-us/web/api/addresserrors/addressline/index.html +++ b/files/en-us/web/api/addresserrors/addressline/index.html @@ -19,7 +19,7 @@Syntax
-var addressLineError = AddressErrors.addressLine;+var addressLineError = AddressErrors.addressLine;Value
diff --git a/files/en-us/web/api/addresserrors/city/index.html b/files/en-us/web/api/addresserrors/city/index.html index e18c6806b30b3c8..9e29f0d0bf15dff 100644 --- a/files/en-us/web/api/addresserrors/city/index.html +++ b/files/en-us/web/api/addresserrors/city/index.html @@ -20,7 +20,7 @@Syntax
-var cityError = AddressErrors.city;+var cityError = AddressErrors.city;Value
diff --git a/files/en-us/web/api/addresserrors/country/index.html b/files/en-us/web/api/addresserrors/country/index.html index 3195b5ce2eb4461..064e8c10ff62009 100644 --- a/files/en-us/web/api/addresserrors/country/index.html +++ b/files/en-us/web/api/addresserrors/country/index.html @@ -19,7 +19,7 @@Syntax
-var countryError = AddressErrors.country;+var countryError = AddressErrors.country;Value
diff --git a/files/en-us/web/api/addresserrors/dependentlocality/index.html b/files/en-us/web/api/addresserrors/dependentlocality/index.html index 43658593acd6d34..5f1782153c79178 100644 --- a/files/en-us/web/api/addresserrors/dependentlocality/index.html +++ b/files/en-us/web/api/addresserrors/dependentlocality/index.html @@ -20,7 +20,7 @@Syntax
-var localityError = AddressErrors.dependentLocality;+var localityError = AddressErrors.dependentLocality;Value
diff --git a/files/en-us/web/api/addresserrors/languagecode/index.html b/files/en-us/web/api/addresserrors/languagecode/index.html index 59fbe256de41d39..bc02a8d25424f8d 100644 --- a/files/en-us/web/api/addresserrors/languagecode/index.html +++ b/files/en-us/web/api/addresserrors/languagecode/index.html @@ -21,7 +21,7 @@Syntax
-var languageError = AddressErrors.languageCode;+var languageError = AddressErrors.languageCode;Value
diff --git a/files/en-us/web/api/addresserrors/organization/index.html b/files/en-us/web/api/addresserrors/organization/index.html index 1479eb9d5d3d16d..edf0cf21b89642c 100644 --- a/files/en-us/web/api/addresserrors/organization/index.html +++ b/files/en-us/web/api/addresserrors/organization/index.html @@ -20,7 +20,7 @@Syntax
-var organizationError = AddressErrors.organization;+var organizationError = AddressErrors.organization;Value
diff --git a/files/en-us/web/api/addresserrors/phone/index.html b/files/en-us/web/api/addresserrors/phone/index.html index 783bc4c680f0a17..efb50525a1a0a11 100644 --- a/files/en-us/web/api/addresserrors/phone/index.html +++ b/files/en-us/web/api/addresserrors/phone/index.html @@ -23,7 +23,7 @@Syntax
-var phoneError = AddressErrors.phone;+var phoneError = AddressErrors.phone;Value
diff --git a/files/en-us/web/api/addresserrors/postalcode/index.html b/files/en-us/web/api/addresserrors/postalcode/index.html index a05bfa8fe123fd9..ceb80a86869b888 100644 --- a/files/en-us/web/api/addresserrors/postalcode/index.html +++ b/files/en-us/web/api/addresserrors/postalcode/index.html @@ -24,7 +24,7 @@Syntax
-var postcodeError = AddressErrors.postCode;+var postcodeError = AddressErrors.postCode;Value
diff --git a/files/en-us/web/api/addresserrors/recipient/index.html b/files/en-us/web/api/addresserrors/recipient/index.html index 3928e0faf76f229..2ac517a03b5a591 100644 --- a/files/en-us/web/api/addresserrors/recipient/index.html +++ b/files/en-us/web/api/addresserrors/recipient/index.html @@ -20,7 +20,7 @@Syntax
-var recipientError = AddressErrors.recipient;+var recipientError = AddressErrors.recipient;Value
diff --git a/files/en-us/web/api/addresserrors/region/index.html b/files/en-us/web/api/addresserrors/region/index.html index 108cac74007ecf4..795f04ce4e8a795 100644 --- a/files/en-us/web/api/addresserrors/region/index.html +++ b/files/en-us/web/api/addresserrors/region/index.html @@ -21,7 +21,7 @@Syntax
-var regionError = AddressErrors.region;+var regionError = AddressErrors.region;Value
diff --git a/files/en-us/web/api/addresserrors/regioncode/index.html b/files/en-us/web/api/addresserrors/regioncode/index.html index 1c5cbb2b3e8e7c5..282efb6e63a1c10 100644 --- a/files/en-us/web/api/addresserrors/regioncode/index.html +++ b/files/en-us/web/api/addresserrors/regioncode/index.html @@ -21,7 +21,7 @@Syntax
-var regionCodeError = AddressErrors.regionCode;+var regionCodeError = AddressErrors.regionCode;Value
diff --git a/files/en-us/web/api/addresserrors/sortingcode/index.html b/files/en-us/web/api/addresserrors/sortingcode/index.html index 5075d40d3f123c8..a51033fe22bcb1e 100644 --- a/files/en-us/web/api/addresserrors/sortingcode/index.html +++ b/files/en-us/web/api/addresserrors/sortingcode/index.html @@ -21,7 +21,7 @@Syntax
-var sortingCodeError = AddressErrors.sortingCode;+var sortingCodeError = AddressErrors.sortingCode;Value
diff --git a/files/en-us/web/api/angle_instanced_arrays/drawarraysinstancedangle/index.html b/files/en-us/web/api/angle_instanced_arrays/drawarraysinstancedangle/index.html index 26a7a40053a189a..a3658271683618e 100644 --- a/files/en-us/web/api/angle_instanced_arrays/drawarraysinstancedangle/index.html +++ b/files/en-us/web/api/angle_instanced_arrays/drawarraysinstancedangle/index.html @@ -19,7 +19,7 @@Syntax
-void ext.drawArraysInstancedANGLE(mode, first, count, primcount); +void ext.drawArraysInstancedANGLE(mode, first, count, primcount);Parameters
diff --git a/files/en-us/web/api/angle_instanced_arrays/drawelementsinstancedangle/index.html b/files/en-us/web/api/angle_instanced_arrays/drawelementsinstancedangle/index.html index d0ea1dc2fc85478..d37a42e78e60d2a 100644 --- a/files/en-us/web/api/angle_instanced_arrays/drawelementsinstancedangle/index.html +++ b/files/en-us/web/api/angle_instanced_arrays/drawelementsinstancedangle/index.html @@ -19,7 +19,7 @@Syntax
-void ext.drawElementsInstancedANGLE(mode, count, type, offset, primcount); +void ext.drawElementsInstancedANGLE(mode, count, type, offset, primcount);Parameters
diff --git a/files/en-us/web/api/angle_instanced_arrays/vertexattribdivisorangle/index.html b/files/en-us/web/api/angle_instanced_arrays/vertexattribdivisorangle/index.html index ccec0b321a8663f..dba1164138e3e0e 100644 --- a/files/en-us/web/api/angle_instanced_arrays/vertexattribdivisorangle/index.html +++ b/files/en-us/web/api/angle_instanced_arrays/vertexattribdivisorangle/index.html @@ -19,7 +19,7 @@Syntax
-void ext.vertexAttribDivisorANGLE(index, divisor); +void ext.vertexAttribDivisorANGLE(index, divisor);Parameters
diff --git a/files/en-us/web/api/attr/localname/index.html b/files/en-us/web/api/attr/localname/index.html index 1b74fe9c57834fb..54847cafdcc1c09 100644 --- a/files/en-us/web/api/attr/localname/index.html +++ b/files/en-us/web/api/attr/localname/index.html @@ -19,7 +19,7 @@Syntax
-name = attribute.localName +name = attribute.localNameReturn value
diff --git a/files/en-us/web/api/attr/namespaceuri/index.html b/files/en-us/web/api/attr/namespaceuri/index.html index 7099fa622c2cd4f..56157e3cc52e774 100644 --- a/files/en-us/web/api/attr/namespaceuri/index.html +++ b/files/en-us/web/api/attr/namespaceuri/index.html @@ -20,7 +20,7 @@Syntax
namespace = attribute.namespaceURI+ class="brush: js">namespace = attribute.namespaceURIExample
diff --git a/files/en-us/web/api/attr/prefix/index.html b/files/en-us/web/api/attr/prefix/index.html index 94c30280f981c32..058febc5c8afd72 100644 --- a/files/en-us/web/api/attr/prefix/index.html +++ b/files/en-us/web/api/attr/prefix/index.html @@ -18,7 +18,7 @@Syntax
-string = attribute.prefix +string = attribute.prefixExamples
diff --git a/files/en-us/web/api/audiocontext/audiocontext/index.html b/files/en-us/web/api/audiocontext/audiocontext/index.html index 0d5faec3a0987ba..89f351603915135 100644 --- a/files/en-us/web/api/audiocontext/audiocontext/index.html +++ b/files/en-us/web/api/audiocontext/audiocontext/index.html @@ -23,7 +23,7 @@Syntax
-var audioCtx = new AudioContext(); +var audioCtx = new AudioContext(); var audioCtx = new AudioContext(options);diff --git a/files/en-us/web/api/audiocontext/baselatency/index.html b/files/en-us/web/api/audiocontext/baselatency/index.html index ef1aebe30c690cb..f1e3901f7416e2d 100644 --- a/files/en-us/web/api/audiocontext/baselatency/index.html +++ b/files/en-us/web/api/audiocontext/baselatency/index.html @@ -27,7 +27,7 @@Syntax
var baseLatency = audioCtx.baseLatency;+ class="brush: js">var baseLatency = audioCtx.baseLatency;Value
@@ -35,7 +35,7 @@Value
Example
-// default latency ("interactive") +// default latency ("interactive") const audioCtx1 = new AudioContext(); console.log(audioCtx1.baseLatency); // 0.00 diff --git a/files/en-us/web/api/audiocontext/createjavascriptnode/index.html b/files/en-us/web/api/audiocontext/createjavascriptnode/index.html index e3cada8f7aea30b..e69eb74f597933a 100644 --- a/files/en-us/web/api/audiocontext/createjavascriptnode/index.html +++ b/files/en-us/web/api/audiocontext/createjavascriptnode/index.html @@ -26,7 +26,7 @@Syntax
-var jsNode = audioCtx.createJavaScriptNode(bufferSize, numInputChannels, numOutputChannels); +var jsNode = audioCtx.createJavaScriptNode(bufferSize, numInputChannels, numOutputChannels);Parameters
diff --git a/files/en-us/web/api/audiocontext/createmediastreamdestination/index.html b/files/en-us/web/api/audiocontext/createmediastreamdestination/index.html index 842b874c806fb5b..08c2404facedd25 100644 --- a/files/en-us/web/api/audiocontext/createmediastreamdestination/index.html +++ b/files/en-us/web/api/audiocontext/createmediastreamdestination/index.html @@ -22,7 +22,7 @@Syntax
-var audioCtx = new AudioContext(); +var audioCtx = new AudioContext(); var destination = audioCtx.createMediaStreamDestination();Returns
@@ -37,7 +37,7 @@Examples
From here, you can play and save the opus file.
-<!DOCTYPE html> +<!DOCTYPE html> <html> <head> <title>createMediaStreamDestination() demo</title> diff --git a/files/en-us/web/api/audiocontext/createmediastreamsource/index.html b/files/en-us/web/api/audiocontext/createmediastreamsource/index.html index 3fcc1dca56a958c..f14b342cab93263 100644 --- a/files/en-us/web/api/audiocontext/createmediastreamsource/index.html +++ b/files/en-us/web/api/audiocontext/createmediastreamsource/index.html @@ -29,7 +29,7 @@Syntax
audioSourceNode = audioContext.createMediaStreamSource(stream);+ class="brush: js">audioSourceNode = audioContext.createMediaStreamSource(stream);Parameters
diff --git a/files/en-us/web/api/audiocontext/createmediastreamtracksource/index.html b/files/en-us/web/api/audiocontext/createmediastreamtracksource/index.html index f80031a724e2e02..fa21a037591a1cb 100644 --- a/files/en-us/web/api/audiocontext/createmediastreamtracksource/index.html +++ b/files/en-us/web/api/audiocontext/createmediastreamtracksource/index.html @@ -32,7 +32,7 @@Syntax
var audioCtx = new AudioContext(); + class="brush: js">var audioCtx = new AudioContext(); var track = audioCtx.createMediaStreamTrackSource(track);Parameters
diff --git a/files/en-us/web/api/audiocontext/getoutputtimestamp/index.html b/files/en-us/web/api/audiocontext/getoutputtimestamp/index.html index 7692e50514b9cf6..b1a1df9302f6f53 100644 --- a/files/en-us/web/api/audiocontext/getoutputtimestamp/index.html +++ b/files/en-us/web/api/audiocontext/getoutputtimestamp/index.html @@ -36,7 +36,7 @@Syntax
var timestamp = AudioContext.getOutputTimestamp()+ class="brush: js">var timestamp = AudioContext.getOutputTimestamp()Parameters
diff --git a/files/en-us/web/api/audiocontext/index.html b/files/en-us/web/api/audiocontext/index.html index 8e5611e4075c44c..ddfcd2a5cfebd34 100644 --- a/files/en-us/web/api/audiocontext/index.html +++ b/files/en-us/web/api/audiocontext/index.html @@ -61,11 +61,11 @@Examples
Basic audio context declaration:
-var audioCtx = new AudioContext();+var audioCtx = new AudioContext();Cross browser variant:
-var AudioContext = window.AudioContext || window.webkitAudioContext; +var AudioContext = window.AudioContext || window.webkitAudioContext; var audioCtx = new AudioContext(); var oscillatorNode = audioCtx.createOscillator(); diff --git a/files/en-us/web/api/audiocontext/outputlatency/index.html b/files/en-us/web/api/audiocontext/outputlatency/index.html index baebaea5bb9fa51..f5dd448412b164c 100644 --- a/files/en-us/web/api/audiocontext/outputlatency/index.html +++ b/files/en-us/web/api/audiocontext/outputlatency/index.html @@ -24,7 +24,7 @@Syntax
-var outputLatency = audioCtx.outputLatency; +var outputLatency = audioCtx.outputLatency;Value
@@ -33,7 +33,7 @@Value
Example
-const audioCtx = new AudioContext(); +const audioCtx = new AudioContext(); console.log(audioCtx.outputLatency);Specifications
diff --git a/files/en-us/web/api/audiocontext/resume/index.html b/files/en-us/web/api/audiocontext/resume/index.html index a6e20bd8d2e3ea9..ac99c2da44719b2 100644 --- a/files/en-us/web/api/audiocontext/resume/index.html +++ b/files/en-us/web/api/audiocontext/resume/index.html @@ -21,7 +21,7 @@Syntax
-completePromise = audioContext.resume(); +completePromise = audioContext.resume();Parameters
diff --git a/files/en-us/web/api/audiocontext/suspend/index.html b/files/en-us/web/api/audiocontext/suspend/index.html index 90f9270553427f7..556d0eced5ad22a 100644 --- a/files/en-us/web/api/audiocontext/suspend/index.html +++ b/files/en-us/web/api/audiocontext/suspend/index.html @@ -18,7 +18,7 @@Syntax
-var audioCtx = new AudioContext(); +var audioCtx = new AudioContext(); audioCtx.suspend().then(function() { ... });@@ -30,7 +30,7 @@Example
The following snippet is taken from our AudioContext states demo (see it running live.) When the suspend/resume button is clicked, the {{domxref("BaseAudioContext/state", "AudioContext.state")}} is queried — if it is
-running
,suspend()
is called; if it issuspended
, {{domxref("AudioContext/resume", "resume()")}} is called. In each case, the text label of the button is updated as appropriate once the promise resolves.susresBtn.onclick = function() { +susresBtn.onclick = function() { if(audioCtx.state === 'running') { audioCtx.suspend().then(function() { susresBtn.textContent = 'Resume context'; diff --git a/files/en-us/web/api/audiocontextoptions/latencyhint/index.html b/files/en-us/web/api/audiocontextoptions/latencyhint/index.html index 109e7da5acae5f8..9efad2a4264e90e 100644 --- a/files/en-us/web/api/audiocontextoptions/latencyhint/index.html +++ b/files/en-us/web/api/audiocontextoptions/latencyhint/index.html @@ -27,7 +27,7 @@Syntax
-audioContextOptions.latencyHint = "interactive"; +audioContextOptions.latencyHint = "interactive"; audioContextOptions.latencyHint = 0.2; var latencyHint = audioContextOptions.latencyHint;diff --git a/files/en-us/web/api/audiocontextoptions/samplerate/index.html b/files/en-us/web/api/audiocontextoptions/samplerate/index.html index 789b52f8398bf5a..17ee7d5a742e713 100644 --- a/files/en-us/web/api/audiocontextoptions/samplerate/index.html +++ b/files/en-us/web/api/audiocontextoptions/samplerate/index.html @@ -27,7 +27,7 @@Syntax
-audioContextOptions.sampleRate = 44100; +audioContextOptions.sampleRate = 44100; var sampleRate = audioContextOptions.sampleRate;diff --git a/files/en-us/web/api/audiodestinationnode/index.html b/files/en-us/web/api/audiodestinationnode/index.html index 17394c564c3fd6d..abc8ed1afbbe8d9 100644 --- a/files/en-us/web/api/audiodestinationnode/index.html +++ b/files/en-us/web/api/audiodestinationnode/index.html @@ -58,7 +58,7 @@Example
There is no complex set up for using an
-AudioDestinationNode
— by default, this represents the output of the user's system (e.g. their speakers), so you can get it hooked up inside an audio graph using only a few lines of code:var audioCtx = new AudioContext(); +var audioCtx = new AudioContext(); var source = audioCtx.createMediaElementSource(myMediaElement); source.connect(gainNode); gainNode.connect(audioCtx.destination);diff --git a/files/en-us/web/api/backgroundfetchmanager/fetch/index.html b/files/en-us/web/api/backgroundfetchmanager/fetch/index.html index c6eef5c2fbc394b..7dfaf6b3c343086 100644 --- a/files/en-us/web/api/backgroundfetchmanager/fetch/index.html +++ b/files/en-us/web/api/backgroundfetchmanager/fetch/index.html @@ -17,7 +17,7 @@Syntax
-var backgroundFetchRegistration = BackgroundFetchManager.fetch();+var backgroundFetchRegistration = BackgroundFetchManager.fetch();Parameters
diff --git a/files/en-us/web/api/backgroundfetchmanager/get/index.html b/files/en-us/web/api/backgroundfetchmanager/get/index.html index 712a56f27ec5bf7..abe1cc45955806f 100644 --- a/files/en-us/web/api/backgroundfetchmanager/get/index.html +++ b/files/en-us/web/api/backgroundfetchmanager/get/index.html @@ -17,7 +17,7 @@Syntax
-var backgroundFetchRegistration = BackgroundFetchManager.get();+var backgroundFetchRegistration = BackgroundFetchManager.get();Parameters
diff --git a/files/en-us/web/api/backgroundfetchmanager/getids/index.html b/files/en-us/web/api/backgroundfetchmanager/getids/index.html index db9e8bc6d92f1bc..dc4741e3dba2353 100644 --- a/files/en-us/web/api/backgroundfetchmanager/getids/index.html +++ b/files/en-us/web/api/backgroundfetchmanager/getids/index.html @@ -17,7 +17,7 @@Syntax
-var stringArray = BackgroundFetchManager.getIds();+var stringArray = BackgroundFetchManager.getIds();Parameters
diff --git a/files/en-us/web/api/baseaudiocontext/audioworklet/index.html b/files/en-us/web/api/baseaudiocontext/audioworklet/index.html index 81eb0979b34d1b7..67508902676b04d 100644 --- a/files/en-us/web/api/baseaudiocontext/audioworklet/index.html +++ b/files/en-us/web/api/baseaudiocontext/audioworklet/index.html @@ -22,7 +22,7 @@Syntax
-baseAudioContextInstance.audioWorklet; +baseAudioContextInstance.audioWorklet;Value
diff --git a/files/en-us/web/api/baseaudiocontext/createanalyser/index.html b/files/en-us/web/api/baseaudiocontext/createanalyser/index.html index 8b5ab50429ada7e..fc5e1a7b771aa74 100644 --- a/files/en-us/web/api/baseaudiocontext/createanalyser/index.html +++ b/files/en-us/web/api/baseaudiocontext/createanalyser/index.html @@ -24,7 +24,7 @@Syntax
var analyserNode = baseAudioContext.createAnalyser();+ class="brush: js">var analyserNode = baseAudioContext.createAnalyser();Returns
diff --git a/files/en-us/web/api/baseaudiocontext/createbiquadfilter/index.html b/files/en-us/web/api/baseaudiocontext/createbiquadfilter/index.html index be8ac88b1b9a94e..6f2f22bbda0758f 100644 --- a/files/en-us/web/api/baseaudiocontext/createbiquadfilter/index.html +++ b/files/en-us/web/api/baseaudiocontext/createbiquadfilter/index.html @@ -20,7 +20,7 @@Syntax
-baseAudioContext.createBiquadFilter();+baseAudioContext.createBiquadFilter();Returns
diff --git a/files/en-us/web/api/baseaudiocontext/createbuffer/index.html b/files/en-us/web/api/baseaudiocontext/createbuffer/index.html index 49f4893ad3138d7..c2595448d7e371e 100644 --- a/files/en-us/web/api/baseaudiocontext/createbuffer/index.html +++ b/files/en-us/web/api/baseaudiocontext/createbuffer/index.html @@ -38,7 +38,7 @@Syntax
var buffer = baseAudioContext.createBuffer(numOfchannels, length, sampleRate);+ class="brush: js">var buffer = baseAudioContext.createBuffer(numOfchannels, length, sampleRate);Parameters
diff --git a/files/en-us/web/api/baseaudiocontext/createbuffersource/index.html b/files/en-us/web/api/baseaudiocontext/createbuffersource/index.html index f2ef5a5652d11e4..62f513b2fd81c3d 100644 --- a/files/en-us/web/api/baseaudiocontext/createbuffersource/index.html +++ b/files/en-us/web/api/baseaudiocontext/createbuffersource/index.html @@ -25,7 +25,7 @@Syntax
var source = baseAudioContext.createBufferSource();+ class="brush: js">var source = baseAudioContext.createBufferSource();Returns
@@ -45,7 +45,7 @@Example
the source. -var audioCtx = new (window.AudioContext || window.webkitAudioContext)(); +var audioCtx = new (window.AudioContext || window.webkitAudioContext)(); var button = document.querySelector('button'); var pre = document.querySelector('pre'); var myScript = document.querySelector('script'); diff --git a/files/en-us/web/api/baseaudiocontext/createchannelmerger/index.html b/files/en-us/web/api/baseaudiocontext/createchannelmerger/index.html index ead9d48cbf3fa71..dad134b9926ccd0 100644 --- a/files/en-us/web/api/baseaudiocontext/createchannelmerger/index.html +++ b/files/en-us/web/api/baseaudiocontext/createchannelmerger/index.html @@ -20,7 +20,7 @@Syntax
baseAudioContext.createChannelMerger(numberOfInputs);+ class="brush: js">baseAudioContext.createChannelMerger(numberOfInputs);Parameters
diff --git a/files/en-us/web/api/baseaudiocontext/createchannelsplitter/index.html b/files/en-us/web/api/baseaudiocontext/createchannelsplitter/index.html index d6ed94b3c199968..c3feb472ecc0fd6 100644 --- a/files/en-us/web/api/baseaudiocontext/createchannelsplitter/index.html +++ b/files/en-us/web/api/baseaudiocontext/createchannelsplitter/index.html @@ -21,7 +21,7 @@Syntax
baseAudioContext.createChannelSplitter(numberOfOutputs);+ class="brush: js">baseAudioContext.createChannelSplitter(numberOfOutputs);Parameters
diff --git a/files/en-us/web/api/baseaudiocontext/createconstantsource/index.html b/files/en-us/web/api/baseaudiocontext/createconstantsource/index.html index 3bede4ea1317708..20f7c7953116792 100644 --- a/files/en-us/web/api/baseaudiocontext/createconstantsource/index.html +++ b/files/en-us/web/api/baseaudiocontext/createconstantsource/index.html @@ -22,7 +22,7 @@Syntax
var constantSourceNode = AudioContext.createConstantSource()+ class="brush: js">var constantSourceNode = AudioContext.createConstantSource()Parameters
diff --git a/files/en-us/web/api/baseaudiocontext/createconvolver/index.html b/files/en-us/web/api/baseaudiocontext/createconvolver/index.html index 4009124ba799b13..9e873a973dcbce1 100644 --- a/files/en-us/web/api/baseaudiocontext/createconvolver/index.html +++ b/files/en-us/web/api/baseaudiocontext/createconvolver/index.html @@ -22,7 +22,7 @@Syntax
-baseAudioContext.createConvolver();+baseAudioContext.createConvolver();Returns
diff --git a/files/en-us/web/api/baseaudiocontext/createdelay/index.html b/files/en-us/web/api/baseaudiocontext/createdelay/index.html index 78b469f37c03184..8d4c55f363a29a0 100644 --- a/files/en-us/web/api/baseaudiocontext/createdelay/index.html +++ b/files/en-us/web/api/baseaudiocontext/createdelay/index.html @@ -19,7 +19,7 @@Syntax
var delayNode = audioCtx.createDelay(maxDelayTime);+ class="brush: js">var delayNode = audioCtx.createDelay(maxDelayTime);Parameters
diff --git a/files/en-us/web/api/baseaudiocontext/createdynamicscompressor/index.html b/files/en-us/web/api/baseaudiocontext/createdynamicscompressor/index.html index 6bd3b261854b991..7e3f9ed01fee100 100644 --- a/files/en-us/web/api/baseaudiocontext/createdynamicscompressor/index.html +++ b/files/en-us/web/api/baseaudiocontext/createdynamicscompressor/index.html @@ -27,7 +27,7 @@Syntax
-baseAudioCtx.createDynamicsCompressor();+baseAudioCtx.createDynamicsCompressor();Returns
@@ -42,7 +42,7 @@Example
href="https://github.com/mdn/webaudio-examples/tree/master/compressor-example">view the source code). -// Create a MediaElementAudioSourceNode +// Create a MediaElementAudioSourceNode // Feed the HTMLMediaElement into it var source = audioCtx.createMediaElementSource(myAudio); diff --git a/files/en-us/web/api/baseaudiocontext/creategain/index.html b/files/en-us/web/api/baseaudiocontext/creategain/index.html index bdd2124183c4120..017ba28bb3da713 100644 --- a/files/en-us/web/api/baseaudiocontext/creategain/index.html +++ b/files/en-us/web/api/baseaudiocontext/creategain/index.html @@ -22,7 +22,7 @@Syntax
var gainNode = AudioContext.createGain();+ class="brush: js">var gainNode = AudioContext.createGain();Return value
@@ -42,11 +42,11 @@Example
href="https://github.com/mdn/voice-change-o-matic/blob/gh-pages/scripts/app.js">view source.) -<div> +<div> <button class="mute">Mute button</button> </div>-var audioCtx = new (window.AudioContext || window.webkitAudioContext)(); +var audioCtx = new (window.AudioContext || window.webkitAudioContext)(); var gainNode = audioCtx.createGain(); var mute = document.querySelector('.mute'); var source; diff --git a/files/en-us/web/api/baseaudiocontext/createiirfilter/index.html b/files/en-us/web/api/baseaudiocontext/createiirfilter/index.html index 8abe689b7c41080..0d34fd9c67053be 100644 --- a/files/en-us/web/api/baseaudiocontext/createiirfilter/index.html +++ b/files/en-us/web/api/baseaudiocontext/createiirfilter/index.html @@ -23,7 +23,7 @@Syntax
var iirFilter = AudioContext.createIIRFilter(feedforward, feedback);+ class="brush: js">var iirFilter = AudioContext.createIIRFilter(feedforward, feedback);Parameters
diff --git a/files/en-us/web/api/baseaudiocontext/createoscillator/index.html b/files/en-us/web/api/baseaudiocontext/createoscillator/index.html index 2ae65e7fa508720..88f7eb39412a0a6 100644 --- a/files/en-us/web/api/baseaudiocontext/createoscillator/index.html +++ b/files/en-us/web/api/baseaudiocontext/createoscillator/index.html @@ -19,7 +19,7 @@Syntax
var oscillatorNode = audioCtx.createOscillator();+ class="brush: js">var oscillatorNode = audioCtx.createOscillator();Returns
diff --git a/files/en-us/web/api/baseaudiocontext/createpanner/index.html b/files/en-us/web/api/baseaudiocontext/createpanner/index.html index 64ef265dff602eb..a67711c2d346f5f 100644 --- a/files/en-us/web/api/baseaudiocontext/createpanner/index.html +++ b/files/en-us/web/api/baseaudiocontext/createpanner/index.html @@ -23,7 +23,7 @@Syntax
-baseAudioCtx.createPanner();+baseAudioCtx.createPanner();Returns
@@ -55,7 +55,7 @@Example
{{domxref("AudioListener.setOrientation()")}}) if it still supports those but not the new properties. -// set up listener and panner position information +// set up listener and panner position information var WIDTH = window.innerWidth; var HEIGHT = window.innerHeight; diff --git a/files/en-us/web/api/baseaudiocontext/createperiodicwave/index.html b/files/en-us/web/api/baseaudiocontext/createperiodicwave/index.html index 2469981f8df72ec..37a0f38bbf8f79b 100644 --- a/files/en-us/web/api/baseaudiocontext/createperiodicwave/index.html +++ b/files/en-us/web/api/baseaudiocontext/createperiodicwave/index.html @@ -21,7 +21,7 @@Syntax
var wave = AudioContext.createPeriodicWave(real, imag[, constraints]);+ class="brush: js">var wave = AudioContext.createPeriodicWave(real, imag[, constraints]);Returns
diff --git a/files/en-us/web/api/baseaudiocontext/createscriptprocessor/index.html b/files/en-us/web/api/baseaudiocontext/createscriptprocessor/index.html index 92796a7b9c213fa..c26a2dbed07d3af 100644 --- a/files/en-us/web/api/baseaudiocontext/createscriptprocessor/index.html +++ b/files/en-us/web/api/baseaudiocontext/createscriptprocessor/index.html @@ -25,7 +25,7 @@Syntax
var scriptProcessor = audioCtx.createScriptProcessor(bufferSize, numberOfInputChannels, numberOfOutputChannels);+ class="brush: js">var scriptProcessor = audioCtx.createScriptProcessor(bufferSize, numberOfInputChannels, numberOfOutputChannels);Parameters
diff --git a/files/en-us/web/api/baseaudiocontext/createstereopanner/index.html b/files/en-us/web/api/baseaudiocontext/createstereopanner/index.html index f0edfd4debf3c33..15cb157712b31ea 100644 --- a/files/en-us/web/api/baseaudiocontext/createstereopanner/index.html +++ b/files/en-us/web/api/baseaudiocontext/createstereopanner/index.html @@ -22,7 +22,7 @@Syntax
-baseAudioContext.createStereoPanner();+baseAudioContext.createStereoPanner();Returns
diff --git a/files/en-us/web/api/baseaudiocontext/createwaveshaper/index.html b/files/en-us/web/api/baseaudiocontext/createwaveshaper/index.html index 1fe4dc695a68d1b..dc08b7186014432 100644 --- a/files/en-us/web/api/baseaudiocontext/createwaveshaper/index.html +++ b/files/en-us/web/api/baseaudiocontext/createwaveshaper/index.html @@ -20,7 +20,7 @@Syntax
-baseAudioCtx.createWaveShaper();+baseAudioCtx.createWaveShaper();Returns
diff --git a/files/en-us/web/api/baseaudiocontext/currenttime/index.html b/files/en-us/web/api/baseaudiocontext/currenttime/index.html index 8dc6ca618ae1063..526cdbcbc58eb03 100644 --- a/files/en-us/web/api/baseaudiocontext/currenttime/index.html +++ b/files/en-us/web/api/baseaudiocontext/currenttime/index.html @@ -18,7 +18,7 @@Syntax
-var curTime = baseAudioContext.currentTime; +var curTime = baseAudioContext.currentTime;Example
diff --git a/files/en-us/web/api/baseaudiocontext/decodeaudiodata/index.html b/files/en-us/web/api/baseaudiocontext/decodeaudiodata/index.html index 376721870f44e36..5a98a56898f348d 100644 --- a/files/en-us/web/api/baseaudiocontext/decodeaudiodata/index.html +++ b/files/en-us/web/api/baseaudiocontext/decodeaudiodata/index.html @@ -29,12 +29,12 @@Syntax
Older callback syntax:
baseAudioContext.decodeAudioData(ArrayBuffer, successCallback, errorCallback);+ class="brush: js">baseAudioContext.decodeAudioData(ArrayBuffer, successCallback, errorCallback);Newer promise-based syntax:
Promise<decodedData> baseAudioContext.decodeAudioData(ArrayBuffer);+ class="brush: js">Promise<decodedData> baseAudioContext.decodeAudioData(ArrayBuffer);Parameters
@@ -87,7 +87,7 @@Older callback syntax
the source.) -// define variables +// define variables var audioCtx = new (window.AudioContext || window.webkitAudioContext)(); var source; @@ -145,7 +145,7 @@Older callback syntax
New promise-based syntax
-ctx.decodeAudioData(audioData).then(function(decodedData) { +ctx.decodeAudioData(audioData).then(function(decodedData) { // use the decoded data here });diff --git a/files/en-us/web/api/baseaudiocontext/destination/index.html b/files/en-us/web/api/baseaudiocontext/destination/index.html index 8c6130865e6963f..c653453433ac315 100644 --- a/files/en-us/web/api/baseaudiocontext/destination/index.html +++ b/files/en-us/web/api/baseaudiocontext/destination/index.html @@ -19,7 +19,7 @@Syntax
-baseAudioContext.destination; +baseAudioContext.destination;Value
diff --git a/files/en-us/web/api/baseaudiocontext/listener/index.html b/files/en-us/web/api/baseaudiocontext/listener/index.html index 62b09e6fb6a40c3..826b50c8781afd1 100644 --- a/files/en-us/web/api/baseaudiocontext/listener/index.html +++ b/files/en-us/web/api/baseaudiocontext/listener/index.html @@ -19,7 +19,7 @@Syntax
-baseAudioContext.listener; +baseAudioContext.listener;Value
diff --git a/files/en-us/web/api/baseaudiocontext/onstatechange/index.html b/files/en-us/web/api/baseaudiocontext/onstatechange/index.html index dc756ac1612ca3f..7446020f87256ad 100644 --- a/files/en-us/web/api/baseaudiocontext/onstatechange/index.html +++ b/files/en-us/web/api/baseaudiocontext/onstatechange/index.html @@ -23,7 +23,7 @@Syntax
baseAudioContext.onstatechange = function() { ... };+ class="brush: js">baseAudioContext.onstatechange = function() { ... };Example
@@ -33,7 +33,7 @@Example
live.) Theonstatechange
handler is used to log the current {{domxref("BaseAudioContext.state", "state")}} to the console every time it changes. -audioCtx.onstatechange = function() { +audioCtx.onstatechange = function() { console.log(audioCtx.state); }diff --git a/files/en-us/web/api/baseaudiocontext/samplerate/index.html b/files/en-us/web/api/baseaudiocontext/samplerate/index.html index 5908509b0133daf..a986ad829fe477c 100644 --- a/files/en-us/web/api/baseaudiocontext/samplerate/index.html +++ b/files/en-us/web/api/baseaudiocontext/samplerate/index.html @@ -20,7 +20,7 @@Syntax
-baseAudioContext.sampleRate; +baseAudioContext.sampleRate;Value
diff --git a/files/en-us/web/api/baseaudiocontext/state/index.html b/files/en-us/web/api/baseaudiocontext/state/index.html index b1aead69a0dcb30..bbde534668ddd63 100644 --- a/files/en-us/web/api/baseaudiocontext/state/index.html +++ b/files/en-us/web/api/baseaudiocontext/state/index.html @@ -20,7 +20,7 @@Syntax
-baseAudioContext.state;+baseAudioContext.state;Value
diff --git a/files/en-us/web/api/bluetooth/getavailability/index.html b/files/en-us/web/api/bluetooth/getavailability/index.html index 850e44d1f877077..ac6cd40938f21cf 100644 --- a/files/en-us/web/api/bluetooth/getavailability/index.html +++ b/files/en-us/web/api/bluetooth/getavailability/index.html @@ -27,7 +27,7 @@Syntax
-var readerPromise = Bluetooth.getAvailability(); +var readerPromise = Bluetooth.getAvailability();Parameters
@@ -47,7 +47,7 @@Examples
The following snippet prints out a message in the console specifying whether or not Bluetooth is supported:
-navigator.bluetooth.getAvailability().then(available => { +navigator.bluetooth.getAvailability().then(available => { if (available) console.log("This device supports Bluetooth!"); else diff --git a/files/en-us/web/api/bluetooth/getdevices/index.html b/files/en-us/web/api/bluetooth/getdevices/index.html index ad3a88407d5efa1..34ffb97e4618b93 100644 --- a/files/en-us/web/api/bluetooth/getdevices/index.html +++ b/files/en-us/web/api/bluetooth/getdevices/index.html @@ -26,7 +26,7 @@Syntax
-var readerPromise = Bluetooth.getDevices(); +var readerPromise = Bluetooth.getDevices();Parameters
diff --git a/files/en-us/web/api/bluetooth/index.html b/files/en-us/web/api/bluetooth/index.html index 87e523e41dd2670..d0af954339aed4b 100644 --- a/files/en-us/web/api/bluetooth/index.html +++ b/files/en-us/web/api/bluetooth/index.html @@ -18,7 +18,7 @@Interface
-interface Bluetooth : EventTarget { +interface Bluetooth : EventTarget { Promise<boolean> getAvailability(); attribute EventHandler onavailabilitychanged; [SameObject] diff --git a/files/en-us/web/api/bluetooth/onavailabilitychanged/index.html b/files/en-us/web/api/bluetooth/onavailabilitychanged/index.html index 31a577e3d7cfa02..6d4c38f7329cc2f 100644 --- a/files/en-us/web/api/bluetooth/onavailabilitychanged/index.html +++ b/files/en-us/web/api/bluetooth/onavailabilitychanged/index.html @@ -16,7 +16,7 @@Syntax
-Bluetooth.onavailabilitychanged = functionRef; +Bluetooth.onavailabilitychanged = functionRef;Value
diff --git a/files/en-us/web/api/bluetooth/referringdevice/index.html b/files/en-us/web/api/bluetooth/referringdevice/index.html index 2786277e0d726a0..186284bb199acf0 100644 --- a/files/en-us/web/api/bluetooth/referringdevice/index.html +++ b/files/en-us/web/api/bluetooth/referringdevice/index.html @@ -16,7 +16,7 @@Syntax
-Bluetooth.referringDevice+Bluetooth.referringDeviceValue
diff --git a/files/en-us/web/api/bluetooth/requestdevice/index.html b/files/en-us/web/api/bluetooth/requestdevice/index.html index 31b680932ed6bed..82a88d94d76aef7 100644 --- a/files/en-us/web/api/bluetooth/requestdevice/index.html +++ b/files/en-us/web/api/bluetooth/requestdevice/index.html @@ -18,7 +18,7 @@Syntax
-Bluetooth.requestDevice([options]) +Bluetooth.requestDevice([options]) .then(function(bluetoothDevice) { ... })Returns
diff --git a/files/en-us/web/api/bluetoothremotegattserver/connect/index.html b/files/en-us/web/api/bluetoothremotegattserver/connect/index.html index 85eca0784f808e7..17f216d754ebe04 100644 --- a/files/en-us/web/api/bluetoothremotegattserver/connect/index.html +++ b/files/en-us/web/api/bluetoothremotegattserver/connect/index.html @@ -19,7 +19,7 @@Syntax
-BluetoothRemoteGATTServer.connect() +BluetoothRemoteGATTServer.connect() .then(function(bluetoothRemoteGATTServer) { ... })Returns
diff --git a/files/en-us/web/api/bluetoothremotegattserver/connected/index.html b/files/en-us/web/api/bluetoothremotegattserver/connected/index.html index e0d33ad66b2a9ae..9bccc94bf7363f8 100644 --- a/files/en-us/web/api/bluetoothremotegattserver/connected/index.html +++ b/files/en-us/web/api/bluetoothremotegattserver/connected/index.html @@ -20,7 +20,7 @@Syntax
var connected = BluetoothRemoteGATTServer.connected+ class="brush: js">var connected = BluetoothRemoteGATTServer.connectedSpecifications
diff --git a/files/en-us/web/api/bluetoothremotegattserver/device/index.html b/files/en-us/web/api/bluetoothremotegattserver/device/index.html index 2e935443f230062..3ed9b6ad63fa2e2 100644 --- a/files/en-us/web/api/bluetoothremotegattserver/device/index.html +++ b/files/en-us/web/api/bluetoothremotegattserver/device/index.html @@ -17,7 +17,7 @@Syntax
var device = BluetoothRemoteGATTServer.device+ class="brush: js">var device = BluetoothRemoteGATTServer.deviceSpecifications
diff --git a/files/en-us/web/api/bluetoothremotegattserver/disconnect/index.html b/files/en-us/web/api/bluetoothremotegattserver/disconnect/index.html index de266a1c569bf9d..a1ee03b2a293b8e 100644 --- a/files/en-us/web/api/bluetoothremotegattserver/disconnect/index.html +++ b/files/en-us/web/api/bluetoothremotegattserver/disconnect/index.html @@ -18,7 +18,7 @@Syntax
-BluetoothRemoteGATTServer.disconnect()+BluetoothRemoteGATTServer.disconnect()Returns
diff --git a/files/en-us/web/api/bluetoothremotegattserver/getprimaryservice/index.html b/files/en-us/web/api/bluetoothremotegattserver/getprimaryservice/index.html index ef614fb1d59153e..c1bb4040f153612 100644 --- a/files/en-us/web/api/bluetoothremotegattserver/getprimaryservice/index.html +++ b/files/en-us/web/api/bluetoothremotegattserver/getprimaryservice/index.html @@ -20,7 +20,7 @@Syntax
BluetoothRemoteGATTServer.getPrimaryService(bluetoothServiceUUID).then(function(bluetoothGATTService) { ... })+ class="brush: js">BluetoothRemoteGATTServer.getPrimaryService(bluetoothServiceUUID).then(function(bluetoothGATTService) { ... })Returns
diff --git a/files/en-us/web/api/bluetoothremotegattserver/getprimaryservices/index.html b/files/en-us/web/api/bluetoothremotegattserver/getprimaryservices/index.html index 33d9a1d6d078d0d..2f061daba328b72 100644 --- a/files/en-us/web/api/bluetoothremotegattserver/getprimaryservices/index.html +++ b/files/en-us/web/api/bluetoothremotegattserver/getprimaryservices/index.html @@ -20,7 +20,7 @@Syntax
BluetoothRemoteGATTServer.getPrimaryServices(bluetoothServiceUUID).then(function(bluetoothGATTServices) { ... })+ class="brush: js">BluetoothRemoteGATTServer.getPrimaryServices(bluetoothServiceUUID).then(function(bluetoothGATTServices) { ... })Returns
diff --git a/files/en-us/web/api/bluetoothremotegattserver/index.html b/files/en-us/web/api/bluetoothremotegattserver/index.html index d653309784562c1..fccea40e9e77c9f 100644 --- a/files/en-us/web/api/bluetoothremotegattserver/index.html +++ b/files/en-us/web/api/bluetoothremotegattserver/index.html @@ -25,7 +25,7 @@Interface
-interface BluetoothRemoteGATTServer { +interface BluetoothRemoteGATTServer { readonly attribute BluetoothDevice device; readonly attribute boolean connected; diff --git a/files/en-us/web/api/broadcastchannel/broadcastchannel/index.html b/files/en-us/web/api/broadcastchannel/broadcastchannel/index.html index e76ab6d9ebd7b53..19b4aca893a017d 100644 --- a/files/en-us/web/api/broadcastchannel/broadcastchannel/index.html +++ b/files/en-us/web/api/broadcastchannel/broadcastchannel/index.html @@ -20,7 +20,7 @@Syntax
channel = new BroadcastChannel(channel);+ class="brush: js"> channel = new BroadcastChannel(channel);Values
diff --git a/files/en-us/web/api/broadcastchannel/close/index.html b/files/en-us/web/api/broadcastchannel/close/index.html index 05d153a89df4511..3c29932beac06bb 100644 --- a/files/en-us/web/api/broadcastchannel/close/index.html +++ b/files/en-us/web/api/broadcastchannel/close/index.html @@ -21,7 +21,7 @@Syntax
-var str = channel.close(); +var str = channel.close();Example
diff --git a/files/en-us/web/api/broadcastchannel/message_event/index.html b/files/en-us/web/api/broadcastchannel/message_event/index.html index c258e8f6007e446..16e88a2f16db360 100644 --- a/files/en-us/web/api/broadcastchannel/message_event/index.html +++ b/files/en-us/web/api/broadcastchannel/message_event/index.html @@ -43,12 +43,12 @@Live example
Sender
--<h1>Sender</h1> +<h1>Sender</h1> <label for="message">Type a message to broadcast:</label><br/> <textarea id="message" name="message" rows="1" cols="40">Hello</textarea> <button id="broadcast-message" type="button">Broadcast message</button>-body { +body { border: 1px solid black; padding: .5rem; height: 150px; @@ -74,7 +74,7 @@Sender
}const channel = new BroadcastChannel('example-channel'); +const channel = new BroadcastChannel('example-channel'); const messageControl = document.querySelector('#message'); const broadcastMessageButton = document.querySelector('#broadcast-message'); @@ -86,10 +86,10 @@Sender
Receiver 1
--<h1>Receiver 1</h1> +<h1>Receiver 1</h1> <div id="received"></div>-body { +body { border: 1px solid black; padding: .5rem; height: 100px; @@ -103,7 +103,7 @@Receiver 1
const channel = new BroadcastChannel('example-channel'); +const channel = new BroadcastChannel('example-channel'); channel.addEventListener('message', (event) => { received.textContent = event.data; });@@ -111,10 +111,10 @@Receiver 1
Receiver 2
--<h1>Receiver 2</h1> +<h1>Receiver 2</h1> <div id="received"></div>-body { +body { border: 1px solid black; padding: .5rem; height: 100px; @@ -128,7 +128,7 @@Receiver 2
const channel = new BroadcastChannel('example-channel'); +const channel = new BroadcastChannel('example-channel'); channel.addEventListener('message', (event) => { received.textContent = event.data; });diff --git a/files/en-us/web/api/broadcastchannel/name/index.html b/files/en-us/web/api/broadcastchannel/name/index.html index 675e4b8e15ba440..f2201ab3986623b 100644 --- a/files/en-us/web/api/broadcastchannel/name/index.html +++ b/files/en-us/web/api/broadcastchannel/name/index.html @@ -21,7 +21,7 @@Syntax
-var str = channel.name; +var str = channel.name;Examples
diff --git a/files/en-us/web/api/broadcastchannel/onmessage/index.html b/files/en-us/web/api/broadcastchannel/onmessage/index.html index f23a16eae2b2d98..740500df142e057 100644 --- a/files/en-us/web/api/broadcastchannel/onmessage/index.html +++ b/files/en-us/web/api/broadcastchannel/onmessage/index.html @@ -22,7 +22,7 @@Syntax
-channel.onmessage = function; +channel.onmessage = function;Values
diff --git a/files/en-us/web/api/broadcastchannel/onmessageerror/index.html b/files/en-us/web/api/broadcastchannel/onmessageerror/index.html index 6e7435e275209a9..f8de2a1d3bfa4c2 100644 --- a/files/en-us/web/api/broadcastchannel/onmessageerror/index.html +++ b/files/en-us/web/api/broadcastchannel/onmessageerror/index.html @@ -21,7 +21,7 @@Syntax
-bc.onmessageerror = function() { ... };+bc.onmessageerror = function() { ... };Specifications
diff --git a/files/en-us/web/api/broadcastchannel/postmessage/index.html b/files/en-us/web/api/broadcastchannel/postmessage/index.html index 17f561d6c6fdc90..a8240953e89191c 100644 --- a/files/en-us/web/api/broadcastchannel/postmessage/index.html +++ b/files/en-us/web/api/broadcastchannel/postmessage/index.html @@ -22,7 +22,7 @@Syntax
-var str = channel.postMessage(object); +var str = channel.postMessage(object);Specifications
diff --git a/files/en-us/web/api/bytelengthqueuingstrategy/bytelengthqueuingstrategy/index.html b/files/en-us/web/api/bytelengthqueuingstrategy/bytelengthqueuingstrategy/index.html index 08d5a90e7078a96..dabd1018c77a100 100644 --- a/files/en-us/web/api/bytelengthqueuingstrategy/bytelengthqueuingstrategy/index.html +++ b/files/en-us/web/api/bytelengthqueuingstrategy/bytelengthqueuingstrategy/index.html @@ -18,7 +18,7 @@Syntax
var byteLengthQueuingStrategy = new ByteLengthQueuingStrategy({highWaterMark});+ class="brush: js">var byteLengthQueuingStrategy = new ByteLengthQueuingStrategy({highWaterMark});Parameters
diff --git a/files/en-us/web/api/bytelengthqueuingstrategy/size/index.html b/files/en-us/web/api/bytelengthqueuingstrategy/size/index.html index 1802ea976a83189..1945265ac31244a 100644 --- a/files/en-us/web/api/bytelengthqueuingstrategy/size/index.html +++ b/files/en-us/web/api/bytelengthqueuingstrategy/size/index.html @@ -19,7 +19,7 @@Syntax
+ class="brush: js">var size =
byteLengthQueuingStrategy.size(chunk);var size =
byteLengthQueuingStrategy.size(chunk);Parameters
diff --git a/files/en-us/web/api/childnode/after/index.html b/files/en-us/web/api/childnode/after/index.html index f6716a5e14e8ece..a0ed1aeea9ce48e 100644 --- a/files/en-us/web/api/childnode/after/index.html +++ b/files/en-us/web/api/childnode/after/index.html @@ -18,7 +18,7 @@Syntax
-[Throws, Unscopable] +[Throws, Unscopable] void ChildNode.after((Node or DOMString)... nodes);diff --git a/files/en-us/web/api/childnode/before/index.html b/files/en-us/web/api/childnode/before/index.html index 55364cd1fa3040e..ccbaaf135e2a523 100644 --- a/files/en-us/web/api/childnode/before/index.html +++ b/files/en-us/web/api/childnode/before/index.html @@ -18,7 +18,7 @@Syntax
-[Throws, Unscopable] +[Throws, Unscopable] void ChildNode.before((Node or DOMString)... nodes);diff --git a/files/en-us/web/api/childnode/remove/index.html b/files/en-us/web/api/childnode/remove/index.html index 1756830ce1edd85..7606eaccd2aecef 100644 --- a/files/en-us/web/api/childnode/remove/index.html +++ b/files/en-us/web/api/childnode/remove/index.html @@ -15,19 +15,19 @@Syntax
-node.remove(); +node.remove();Example
Using
-remove()
<div id="div-01">Here is div-01</div> +<div id="div-01">Here is div-01</div> <div id="div-02">Here is div-02</div> <div id="div-03">Here is div-03</div>-var el = document.getElementById('div-02'); +var el = document.getElementById('div-02'); el.remove(); // Removes the div with the 'div-02' id@@ -36,7 +36,7 @@
ChildNode.remove()
is unscoThe
-remove()
method is not scoped into thewith
statement. See {{jsxref("Symbol.unscopables")}} for more information.with(node) { +with(node) { remove(); } // ReferenceError: remove is not defined@@ -46,7 +46,7 @@Polyfill
You can polyfill the
-remove()
method in Internet Explorer 9 and higher with the following code:// from:https://github.com/jserz/js_piece/blob/master/DOM/ChildNode/remove()/remove().md +// from:https://github.com/jserz/js_piece/blob/master/DOM/ChildNode/remove()/remove().md (function (arr) { arr.forEach(function (item) { if (item.hasOwnProperty('remove')) { diff --git a/files/en-us/web/api/childnode/replacewith/index.html b/files/en-us/web/api/childnode/replacewith/index.html index b648d9902be1359..d53c39b717ec550 100644 --- a/files/en-us/web/api/childnode/replacewith/index.html +++ b/files/en-us/web/api/childnode/replacewith/index.html @@ -17,7 +17,7 @@Syntax
-[Throws, Unscopable] +[Throws, Unscopable] void ChildNode.replaceWith((Node or DOMString)... nodes);@@ -39,7 +39,7 @@Examples
Using
-replaceWith()
var parent = document.createElement("div"); +var parent = document.createElement("div"); var child = document.createElement("p"); parent.appendChild(child); var span = document.createElement("span"); @@ -56,7 +56,7 @@
ChildNode.replaceWith()
ThereplaceWith()
method is not scoped into thewith
statement. See {{jsxref("Symbol.unscopables")}} for more information. -with(node) { +with(node) { replaceWith("foo"); } // ReferenceError: replaceWith is not defined@@ -66,7 +66,7 @@Polyfill
You can polyfill the
-replaceWith()
method in Internet Explorer 10+ and higher with the following code:function ReplaceWithPolyfill() { +function ReplaceWithPolyfill() { 'use-strict'; // For safari, and IE > 10 var parent = this.parentNode, i = arguments.length, currentNode; if (!parent) return; diff --git a/files/en-us/web/api/clipboardevent/clipboarddata/index.html b/files/en-us/web/api/clipboardevent/clipboarddata/index.html index e663ca211eb4768..bd927659ebfc8da 100644 --- a/files/en-us/web/api/clipboardevent/clipboarddata/index.html +++ b/files/en-us/web/api/clipboardevent/clipboarddata/index.html @@ -32,7 +32,7 @@Syntax
data = ClipboardEvent.clipboardData+ class="brush: js">data = ClipboardEvent.clipboardDataSpecifications
diff --git a/files/en-us/web/api/clipboardevent/clipboardevent/index.html b/files/en-us/web/api/clipboardevent/clipboardevent/index.html index 5957673a4c65672..17f6e896cf7e356 100644 --- a/files/en-us/web/api/clipboardevent/clipboardevent/index.html +++ b/files/en-us/web/api/clipboardevent/clipboardevent/index.html @@ -22,7 +22,7 @@Syntax
-var clipboardEvent = new ClipboardEvent(type[, options]); +var clipboardEvent = new ClipboardEvent(type[, options]);Parameters
diff --git a/files/en-us/web/api/console_api/index.html b/files/en-us/web/api/console_api/index.html index f470b5d6404a42b..4de93687f7e8953 100644 --- a/files/en-us/web/api/console_api/index.html +++ b/files/en-us/web/api/console_api/index.html @@ -39,7 +39,7 @@Interfaces
Examples
-let myString = 'Hello world'; +let myString = 'Hello world'; // Output "Hello world" to the console console.log(myString)diff --git a/files/en-us/web/api/credentialscontainer/create/index.html b/files/en-us/web/api/credentialscontainer/create/index.html index 42bbef9d15eed49..f6639c5817bc8b7 100644 --- a/files/en-us/web/api/credentialscontainer/create/index.html +++ b/files/en-us/web/api/credentialscontainer/create/index.html @@ -24,7 +24,7 @@Syntax
var promise = CredentialsContainer.create([options])+ class="brush: js">var promise = CredentialsContainer.create([options])Parameters
diff --git a/files/en-us/web/api/credentialscontainer/get/index.html b/files/en-us/web/api/credentialscontainer/get/index.html index f9b06e7f42ad188..ce68c2aae3921b2 100644 --- a/files/en-us/web/api/credentialscontainer/get/index.html +++ b/files/en-us/web/api/credentialscontainer/get/index.html @@ -35,7 +35,7 @@Syntax
-var promise = CredentialsContainer.get([options])+var promise = CredentialsContainer.get([options])Parameters
diff --git a/files/en-us/web/api/credentialscontainer/preventsilentaccess/index.html b/files/en-us/web/api/credentialscontainer/preventsilentaccess/index.html index 5057d03076ff567..07017aedd4eb931 100644 --- a/files/en-us/web/api/credentialscontainer/preventsilentaccess/index.html +++ b/files/en-us/web/api/credentialscontainer/preventsilentaccess/index.html @@ -31,7 +31,7 @@Syntax
var Promise = CredentialsContainer.preventSilentAccess()+ class="brush: js">var Promise = CredentialsContainer.preventSilentAccess()Parameters
diff --git a/files/en-us/web/api/credentialscontainer/store/index.html b/files/en-us/web/api/credentialscontainer/store/index.html index 5b6045b49c4a8b0..4ca5f4861dfce0f 100644 --- a/files/en-us/web/api/credentialscontainer/store/index.html +++ b/files/en-us/web/api/credentialscontainer/store/index.html @@ -25,7 +25,7 @@Syntax
CredentialsContainer.store(Credential).then(function(Credential) { ... } )+ class="brush: js">CredentialsContainer.store(Credential).then(function(Credential) { ... } )Parameters
@@ -47,7 +47,7 @@Storing a pa
This code would be executed after a user signs up or logs in and the server confirms the credential is correct.
-// Check if the browser supports password credentials (and the Credential Management API) +// Check if the browser supports password credentials (and the Credential Management API) if ("PasswordCredential" in window) { let credential = new PasswordCredential({ id: "example-username", diff --git a/files/en-us/web/api/csskeyframesrule/appendrule/index.html b/files/en-us/web/api/csskeyframesrule/appendrule/index.html index 3cd3f03df48f0b9..c4795a5b29c5700 100644 --- a/files/en-us/web/api/csskeyframesrule/appendrule/index.html +++ b/files/en-us/web/api/csskeyframesrule/appendrule/index.html @@ -15,7 +15,7 @@Syntax
-CSSKeyframesRule.appendRule(rule);+CSSKeyframesRule.appendRule(rule);Parameters
diff --git a/files/en-us/web/api/csskeyframesrule/cssrules/index.html b/files/en-us/web/api/csskeyframesrule/cssrules/index.html index f01ddae3c62f122..954415c490fdb90 100644 --- a/files/en-us/web/api/csskeyframesrule/cssrules/index.html +++ b/files/en-us/web/api/csskeyframesrule/cssrules/index.html @@ -15,7 +15,7 @@Syntax
-var cssRules = CSSKeyframesRule.cssRules;+var cssRules = CSSKeyframesRule.cssRules;Value
A {{domxref('CSSRuleList')}}.
diff --git a/files/en-us/web/api/csskeyframesrule/deleterule/index.html b/files/en-us/web/api/csskeyframesrule/deleterule/index.html index 82a2cb97effef6b..4bf9460b6a17308 100644 --- a/files/en-us/web/api/csskeyframesrule/deleterule/index.html +++ b/files/en-us/web/api/csskeyframesrule/deleterule/index.html @@ -15,7 +15,7 @@Syntax
-CSSKeyframesRule.deleteRule(select);+CSSKeyframesRule.deleteRule(select);Parameters
diff --git a/files/en-us/web/api/csskeyframesrule/findrule/index.html b/files/en-us/web/api/csskeyframesrule/findrule/index.html index b4bda118606350e..05b3312070dff21 100644 --- a/files/en-us/web/api/csskeyframesrule/findrule/index.html +++ b/files/en-us/web/api/csskeyframesrule/findrule/index.html @@ -15,7 +15,7 @@Syntax
-CSSKeyframesRule.findRule(select);+CSSKeyframesRule.findRule(select);Parameters
diff --git a/files/en-us/web/api/csskeyframesrule/name/index.html b/files/en-us/web/api/csskeyframesrule/name/index.html index a47c5e9e8a45a63..7991ec5dfdbdbf1 100644 --- a/files/en-us/web/api/csskeyframesrule/name/index.html +++ b/files/en-us/web/api/csskeyframesrule/name/index.html @@ -15,7 +15,7 @@Syntax
-var name = CSSKeyframesRule.name; +var name = CSSKeyframesRule.name; CSSKeyframesRule.name = name;Value
diff --git a/files/en-us/web/api/cssmathinvert/cssmathinvert/index.html b/files/en-us/web/api/cssmathinvert/cssmathinvert/index.html index 10398753eb25626..23ac3365bc08bde 100644 --- a/files/en-us/web/api/cssmathinvert/cssmathinvert/index.html +++ b/files/en-us/web/api/cssmathinvert/cssmathinvert/index.html @@ -19,7 +19,7 @@Syntax
var CSSMathInvert = new CSSMathInvert(arg);+ class="brush: js">var CSSMathInvert = new CSSMathInvert(arg);Parameters
diff --git a/files/en-us/web/api/cssmathinvert/value/index.html b/files/en-us/web/api/cssmathinvert/value/index.html index 3856c88cf3ff6d1..63ff92c6fdc0a4c 100644 --- a/files/en-us/web/api/cssmathinvert/value/index.html +++ b/files/en-us/web/api/cssmathinvert/value/index.html @@ -19,7 +19,7 @@Syntax
var cssNumericValue = CSSMathInvert.value;+ class="brush: js">var cssNumericValue = CSSMathInvert.value;Value
diff --git a/files/en-us/web/api/cssmathmin/cssmathmin/index.html b/files/en-us/web/api/cssmathmin/cssmathmin/index.html index 78e1dd80135df2b..9d93c1622143a38 100644 --- a/files/en-us/web/api/cssmathmin/cssmathmin/index.html +++ b/files/en-us/web/api/cssmathmin/cssmathmin/index.html @@ -19,7 +19,7 @@Syntax
var CSSMathMin = new CSSMathMin(args);+ class="brush: js">var CSSMathMin = new CSSMathMin(args);Parameters
diff --git a/files/en-us/web/api/cssmathmin/values/index.html b/files/en-us/web/api/cssmathmin/values/index.html index e835032a272ffc2..354d33848842b52 100644 --- a/files/en-us/web/api/cssmathmin/values/index.html +++ b/files/en-us/web/api/cssmathmin/values/index.html @@ -20,7 +20,7 @@Syntax
var cssNumericArray = CSSMathMin.values;+ class="brush: js">var cssNumericArray = CSSMathMin.values;Value
diff --git a/files/en-us/web/api/cssmathproduct/cssmathproduct/index.html b/files/en-us/web/api/cssmathproduct/cssmathproduct/index.html index 7d8bff36ed6417a..e9e7368edbf9387 100644 --- a/files/en-us/web/api/cssmathproduct/cssmathproduct/index.html +++ b/files/en-us/web/api/cssmathproduct/cssmathproduct/index.html @@ -20,7 +20,7 @@Syntax
var CSSMathProduct = new CSSMathProduct(args)+ class="brush: js">var CSSMathProduct = new CSSMathProduct(args)Parameters
diff --git a/files/en-us/web/api/cssmathproduct/values/index.html b/files/en-us/web/api/cssmathproduct/values/index.html index 8229665c2f06ddd..bbd0c3864acb613 100644 --- a/files/en-us/web/api/cssmathproduct/values/index.html +++ b/files/en-us/web/api/cssmathproduct/values/index.html @@ -22,7 +22,7 @@Syntax
var cssNumericArray = CSSMathProduct.values;+ class="brush: js">var cssNumericArray = CSSMathProduct.values;Value
diff --git a/files/en-us/web/api/cssmediarule/media/index.html b/files/en-us/web/api/cssmediarule/media/index.html index 4801b494b86a4cc..fd97a06c8d707c5 100644 --- a/files/en-us/web/api/cssmediarule/media/index.html +++ b/files/en-us/web/api/cssmediarule/media/index.html @@ -20,7 +20,7 @@Syntax
var media = CSSMediaRule.media;+ class="brush: js">var media = CSSMediaRule.media;Value
a {{domxref("MediaList")}}
diff --git a/files/en-us/web/api/cssnamespacerule/namespaceuri/index.html b/files/en-us/web/api/cssnamespacerule/namespaceuri/index.html index f3b0a1403529311..ec8731da8a50fb1 100644 --- a/files/en-us/web/api/cssnamespacerule/namespaceuri/index.html +++ b/files/en-us/web/api/cssnamespacerule/namespaceuri/index.html @@ -15,7 +15,7 @@Syntax
-var namespaceURI = CSSNamespaceRule.namespaceURI+var namespaceURI = CSSNamespaceRule.namespaceURIReturns
diff --git a/files/en-us/web/api/cssnamespacerule/prefix/index.html b/files/en-us/web/api/cssnamespacerule/prefix/index.html index 664367a1e9fc05a..24e29af089060ba 100644 --- a/files/en-us/web/api/cssnamespacerule/prefix/index.html +++ b/files/en-us/web/api/cssnamespacerule/prefix/index.html @@ -15,7 +15,7 @@Syntax
-var prefix = CSSNamespaceRule.prefix+var prefix = CSSNamespaceRule.prefixReturns
diff --git a/files/en-us/web/api/cssnumericvalue/div/index.html b/files/en-us/web/api/cssnumericvalue/div/index.html index a1aa501fa37020c..b8bea7a6f6a283c 100644 --- a/files/en-us/web/api/cssnumericvalue/div/index.html +++ b/files/en-us/web/api/cssnumericvalue/div/index.html @@ -20,7 +20,7 @@Syntax
var cssNumericValue = CSSNumericValue.div(number);+ class="brush: js">var cssNumericValue = CSSNumericValue.div(number);Parameters
diff --git a/files/en-us/web/api/cssnumericvalue/mul/index.html b/files/en-us/web/api/cssnumericvalue/mul/index.html index 77ac961024a8ab6..b83de0de154a5eb 100644 --- a/files/en-us/web/api/cssnumericvalue/mul/index.html +++ b/files/en-us/web/api/cssnumericvalue/mul/index.html @@ -20,7 +20,7 @@Syntax
var cssMathProduct = CSSNumericValue.mul(number);+ class="brush: js">var cssMathProduct = CSSNumericValue.mul(number);Parameters
diff --git a/files/en-us/web/api/cssnumericvalue/parse/index.html b/files/en-us/web/api/cssnumericvalue/parse/index.html index c0709b24ab9e1e6..3401e14732c26b5 100644 --- a/files/en-us/web/api/cssnumericvalue/parse/index.html +++ b/files/en-us/web/api/cssnumericvalue/parse/index.html @@ -20,7 +20,7 @@Syntax
var cssNumericValue = CSSNumericValue.parse(cssText);+ class="brush: js">var cssNumericValue = CSSNumericValue.parse(cssText);Parameters
diff --git a/files/en-us/web/api/cssnumericvalue/tosum/index.html b/files/en-us/web/api/cssnumericvalue/tosum/index.html index 06eaabbea0a6a35..e9073efeaac28f6 100644 --- a/files/en-us/web/api/cssnumericvalue/tosum/index.html +++ b/files/en-us/web/api/cssnumericvalue/tosum/index.html @@ -20,7 +20,7 @@Syntax
var cssMathSum = CSSNumericValue.toSum(units);+ class="brush: js">var cssMathSum = CSSNumericValue.toSum(units);Parameters
diff --git a/files/en-us/web/api/cssskew/ax/index.html b/files/en-us/web/api/cssskew/ax/index.html index 7ffd9a03bda3cd0..ba16a87b78403e0 100644 --- a/files/en-us/web/api/cssskew/ax/index.html +++ b/files/en-us/web/api/cssskew/ax/index.html @@ -19,7 +19,7 @@Syntax
-var skewax = CSSSkew.ax;+var skewax = CSSSkew.ax;Value
diff --git a/files/en-us/web/api/cssskew/ay/index.html b/files/en-us/web/api/cssskew/ay/index.html index 2e341c150daeb19..0cc5ffb62a56db2 100644 --- a/files/en-us/web/api/cssskew/ay/index.html +++ b/files/en-us/web/api/cssskew/ay/index.html @@ -19,7 +19,7 @@Syntax
-var skeway = CSSSkew.ay;+var skeway = CSSSkew.ay;Value
diff --git a/files/en-us/web/api/cssskew/cssskew/index.html b/files/en-us/web/api/cssskew/cssskew/index.html index d8fc84a3a513dad..ae89885513fae33 100644 --- a/files/en-us/web/api/cssskew/cssskew/index.html +++ b/files/en-us/web/api/cssskew/cssskew/index.html @@ -22,7 +22,7 @@Syntax
var CSSSkew = new CSSSkew(ax, ay);+ class="brush: js">var CSSSkew = new CSSSkew(ax, ay);Parameters
diff --git a/files/en-us/web/api/cssstylesheet/addrule/index.html b/files/en-us/web/api/cssstylesheet/addrule/index.html index a5ee42536f9d5b0..77f8f07694ad971 100644 --- a/files/en-us/web/api/cssstylesheet/addrule/index.html +++ b/files/en-us/web/api/cssstylesheet/addrule/index.html @@ -28,7 +28,7 @@Syntax
var result = cssStyleSheet.addRule(selector, styleBlock, index);+ class="brush: js">var result = cssStyleSheet.addRule(selector, styleBlock, index);Parameters
diff --git a/files/en-us/web/api/cssstylesheet/cssrules/index.html b/files/en-us/web/api/cssstylesheet/cssrules/index.html index 97d89216cbd4712..be3bea868c4e7de 100644 --- a/files/en-us/web/api/cssstylesheet/cssrules/index.html +++ b/files/en-us/web/api/cssstylesheet/cssrules/index.html @@ -25,7 +25,7 @@Syntax
var rules = cssStyleSheet.cssRules;+ class="brush: js">var rules = cssStyleSheet.cssRules;Value
diff --git a/files/en-us/web/api/cssstylesheet/deleterule/index.html b/files/en-us/web/api/cssstylesheet/deleterule/index.html index 9f08ddfcb5810d8..7e882bfad5c7eb2 100644 --- a/files/en-us/web/api/cssstylesheet/deleterule/index.html +++ b/files/en-us/web/api/cssstylesheet/deleterule/index.html @@ -25,7 +25,7 @@Syntax
-cssStyleSheet.deleteRule(index) +cssStyleSheet.deleteRule(index)Parameters
diff --git a/files/en-us/web/api/cssstylesheet/insertrule/index.html b/files/en-us/web/api/cssstylesheet/insertrule/index.html index 3c91602c5de5888..dfab42329eb10c6 100644 --- a/files/en-us/web/api/cssstylesheet/insertrule/index.html +++ b/files/en-us/web/api/cssstylesheet/insertrule/index.html @@ -25,7 +25,7 @@Syntax
stylesheet.insertRule(rule [, index])+ class="brush: js">stylesheet.insertRule(rule [, index])Parameters
diff --git a/files/en-us/web/api/cssstylesheet/ownerrule/index.html b/files/en-us/web/api/cssstylesheet/ownerrule/index.html index 2e27e12e29dad3c..ac211e25e9bec26 100644 --- a/files/en-us/web/api/cssstylesheet/ownerrule/index.html +++ b/files/en-us/web/api/cssstylesheet/ownerrule/index.html @@ -28,7 +28,7 @@Syntax
var ownerRule = cssStyleSheet.ownerRule;+ class="brush: js">var ownerRule = cssStyleSheet.ownerRule;Value
diff --git a/files/en-us/web/api/cssstylesheet/removerule/index.html b/files/en-us/web/api/cssstylesheet/removerule/index.html index 515e779a2fe6adf..7d4b819937ed22f 100644 --- a/files/en-us/web/api/cssstylesheet/removerule/index.html +++ b/files/en-us/web/api/cssstylesheet/removerule/index.html @@ -34,7 +34,7 @@Syntax
-cssStyleSheet.removeRule(index) +cssStyleSheet.removeRule(index)Parameters
diff --git a/files/en-us/web/api/cssstylesheet/rules/index.html b/files/en-us/web/api/cssstylesheet/rules/index.html index 584dba719efc21f..fdf836990af8639 100644 --- a/files/en-us/web/api/cssstylesheet/rules/index.html +++ b/files/en-us/web/api/cssstylesheet/rules/index.html @@ -36,7 +36,7 @@Syntax
var rules = cssStyleSheet.rules;+ class="brush: js">var rules = cssStyleSheet.rules;Value
diff --git a/files/en-us/web/api/customelementregistry/define/index.html b/files/en-us/web/api/customelementregistry/define/index.html index c41e6f4936ef73e..2470e6b4ab92bc5 100644 --- a/files/en-us/web/api/customelementregistry/define/index.html +++ b/files/en-us/web/api/customelementregistry/define/index.html @@ -26,7 +26,7 @@Syntax
-customElements.define(name, constructor, options); +customElements.define(name, constructor, options);Parameters
diff --git a/files/en-us/web/api/customelementregistry/get/index.html b/files/en-us/web/api/customelementregistry/get/index.html index 3781f8c9b03b145..493f26650b9e73a 100644 --- a/files/en-us/web/api/customelementregistry/get/index.html +++ b/files/en-us/web/api/customelementregistry/get/index.html @@ -19,7 +19,7 @@Syntax
-constructor = customElements.get(name); +constructor = customElements.get(name);Parameters
@@ -37,7 +37,7 @@Return value
Examples
-customElements.define('my-paragraph', +customElements.define('my-paragraph', class extends HTMLElement { constructor() { let templateContent = document.getElementById('my-paragraph').content; diff --git a/files/en-us/web/api/customelementregistry/upgrade/index.html b/files/en-us/web/api/customelementregistry/upgrade/index.html index 32e9f9e6c9e83c1..d80df7d28160a26 100644 --- a/files/en-us/web/api/customelementregistry/upgrade/index.html +++ b/files/en-us/web/api/customelementregistry/upgrade/index.html @@ -19,7 +19,7 @@Syntax
-customElements.upgrade(root); +customElements.upgrade(root);Parameters
diff --git a/files/en-us/web/api/customelementregistry/whendefined/index.html b/files/en-us/web/api/customelementregistry/whendefined/index.html index 3757c0a8d71da1f..92241ff8c19f355 100644 --- a/files/en-us/web/api/customelementregistry/whendefined/index.html +++ b/files/en-us/web/api/customelementregistry/whendefined/index.html @@ -19,7 +19,7 @@Syntax
customElements.whenDefined(name): Promise<CustomElementConstructor>;+ class="brush: js">customElements.whenDefined(name): Promise<CustomElementConstructor>;Parameters
@@ -65,7 +65,7 @@Examples
make up a menu are defined. The menu displays placeholder content until the actual menu content is ready to display. -<nav id="menu-container"> +<nav id="menu-container"> <div class="menu-placeholder">Loading...</div> <nav-menu> <menu-item>Item 1</menu-item> @@ -76,7 +76,7 @@-Examples
</nav>const container = document.getElementById('menu-container'); +const container = document.getElementById('menu-container'); const placeholder = container.querySelector('.menu-placeholder'); // Fetch all the children of menu that are not yet defined. const undefinedElements = container.querySelectorAll(':not(:defined)'); diff --git a/files/en-us/web/api/customevent/customevent/index.html b/files/en-us/web/api/customevent/customevent/index.html index 3a1cef6a5887b5c..204144a40eb89a0 100644 --- a/files/en-us/web/api/customevent/customevent/index.html +++ b/files/en-us/web/api/customevent/customevent/index.html @@ -18,7 +18,7 @@Syntax
event = new CustomEvent(typeArg, customEventInit);+ class="brush: js"> event = new CustomEvent(typeArg, customEventInit);Parameters
diff --git a/files/en-us/web/api/customevent/detail/index.html b/files/en-us/web/api/customevent/detail/index.html index 997bd240c872911..e7c52a35784f138 100644 --- a/files/en-us/web/api/customevent/detail/index.html +++ b/files/en-us/web/api/customevent/detail/index.html @@ -20,7 +20,7 @@Syntax
let myDetail = customEventInstance.detail;+ class="brush: js"> let myDetail = customEventInstance.detail;Return value
@@ -28,7 +28,7 @@Return value
Example
-// add an appropriate event listener +// add an appropriate event listener obj.addEventListener("cat", function(e) { process(e.detail) }); // create and dispatch the event diff --git a/files/en-us/web/api/customevent/initcustomevent/index.html b/files/en-us/web/api/customevent/initcustomevent/index.html index 3beb9e41f43058a..61c03e65d7fc17b 100644 --- a/files/en-us/web/api/customevent/initcustomevent/index.html +++ b/files/en-us/web/api/customevent/initcustomevent/index.html @@ -31,7 +31,7 @@Syntax
-event.initCustomEvent(type, canBubble, cancelable, detail); +event.initCustomEvent(type, canBubble, cancelable, detail);Parameters
diff --git a/files/en-us/web/api/datatransfer/addelement/index.html b/files/en-us/web/api/datatransfer/addelement/index.html index dcab735a96f73c1..f21fdf7cba03fae 100644 --- a/files/en-us/web/api/datatransfer/addelement/index.html +++ b/files/en-us/web/api/datatransfer/addelement/index.html @@ -21,7 +21,7 @@Syntax
-void dataTransfer.addElement(el); +void dataTransfer.addElement(el);Arguments
diff --git a/files/en-us/web/api/datatransfer/cleardata/index.html b/files/en-us/web/api/datatransfer/cleardata/index.html index 70e8818b6c1dd0d..8e20aa668df6c99 100644 --- a/files/en-us/web/api/datatransfer/cleardata/index.html +++ b/files/en-us/web/api/datatransfer/cleardata/index.html @@ -30,7 +30,7 @@Syntax
-DataTransfer.clearData([format]); +DataTransfer.clearData([format]);Parameters
@@ -51,7 +51,7 @@Example
HTML
-<span class="tweaked" id="source" draggable="true"> +<span class="tweaked" id="source" draggable="true"> Select this element, drag it to the Drop Zone and then release the selection to move the element. </span> <span class="tweaked" id="target">Drop Zone</span> @@ -61,7 +61,7 @@HTML
CSS
-span.tweaked { +span.tweaked { display: inline-block; margin: 1em 0; padding: 1em 2em; @@ -79,7 +79,7 @@CSS
JavaScript
-window.addEventListener('DOMContentLoaded', function () { +window.addEventListener('DOMContentLoaded', function () { // Select HTML elements var draggable = document.getElementById('source'); var dropable = document.getElementById('target'); diff --git a/files/en-us/web/api/datatransfer/datatransfer/index.html b/files/en-us/web/api/datatransfer/datatransfer/index.html index 9c85afd86583600..8527bfba361db8b 100644 --- a/files/en-us/web/api/datatransfer/datatransfer/index.html +++ b/files/en-us/web/api/datatransfer/datatransfer/index.html @@ -17,7 +17,7 @@Syntax
var dataTrans = new DataTransfer()+ class="brush: js">var dataTrans = new DataTransfer()Parameters
diff --git a/files/en-us/web/api/datatransfer/dropeffect/index.html b/files/en-us/web/api/datatransfer/dropeffect/index.html index 4eda6386df968fd..7e40896f338826f 100644 --- a/files/en-us/web/api/datatransfer/dropeffect/index.html +++ b/files/en-us/web/api/datatransfer/dropeffect/index.html @@ -37,7 +37,7 @@Syntax
-dataTransfer.dropEffect; +dataTransfer.dropEffect;Values
diff --git a/files/en-us/web/api/datatransfer/effectallowed/index.html b/files/en-us/web/api/datatransfer/effectallowed/index.html index 4f023ad569d6e5c..eb71fd499204198 100644 --- a/files/en-us/web/api/datatransfer/effectallowed/index.html +++ b/files/en-us/web/api/datatransfer/effectallowed/index.html @@ -29,7 +29,7 @@Syntax
-dataTransfer.effectAllowed; +dataTransfer.effectAllowed;Values
diff --git a/files/en-us/web/api/datatransfer/files/index.html b/files/en-us/web/api/datatransfer/files/index.html index c0f2d6f384986ce..d0dd84e305c534e 100644 --- a/files/en-us/web/api/datatransfer/files/index.html +++ b/files/en-us/web/api/datatransfer/files/index.html @@ -19,7 +19,7 @@Syntax
-dataTransfer.files; +dataTransfer.files;Return value
diff --git a/files/en-us/web/api/datatransfer/getdata/index.html b/files/en-us/web/api/datatransfer/getdata/index.html index a1a4d2d48de7db0..521a7f0b5c06d2e 100644 --- a/files/en-us/web/api/datatransfer/getdata/index.html +++ b/files/en-us/web/api/datatransfer/getdata/index.html @@ -19,7 +19,7 @@Syntax
-dataTransfer.getData(format); +dataTransfer.getData(format);Arguments
diff --git a/files/en-us/web/api/datatransfer/items/index.html b/files/en-us/web/api/datatransfer/items/index.html index f0d0f8203d860dd..efb89a2e32e5747 100644 --- a/files/en-us/web/api/datatransfer/items/index.html +++ b/files/en-us/web/api/datatransfer/items/index.html @@ -17,7 +17,7 @@Syntax
-itemList = dataTransfer.items; +itemList = dataTransfer.items;Return value
diff --git a/files/en-us/web/api/datatransfer/mozcleardataat/index.html b/files/en-us/web/api/datatransfer/mozcleardataat/index.html index c4efb8229ad2e7e..d419472c70777ce 100644 --- a/files/en-us/web/api/datatransfer/mozcleardataat/index.html +++ b/files/en-us/web/api/datatransfer/mozcleardataat/index.html @@ -28,7 +28,7 @@Syntax
-void dataTransfer.mozClearDataAt([type], index); +void dataTransfer.mozClearDataAt([type], index);Arguments
diff --git a/files/en-us/web/api/datatransfer/mozcursor/index.html b/files/en-us/web/api/datatransfer/mozcursor/index.html index 18198e54f5c4102..9f62309440b1349 100644 --- a/files/en-us/web/api/datatransfer/mozcursor/index.html +++ b/files/en-us/web/api/datatransfer/mozcursor/index.html @@ -35,7 +35,7 @@Syntax
-dataTransfer.mozCursor; +dataTransfer.mozCursor;Return value
diff --git a/files/en-us/web/api/datatransfer/mozgetdataat/index.html b/files/en-us/web/api/datatransfer/mozgetdataat/index.html index f28dab2f86b8ca1..1df9c79f845962c 100644 --- a/files/en-us/web/api/datatransfer/mozgetdataat/index.html +++ b/files/en-us/web/api/datatransfer/mozgetdataat/index.html @@ -22,7 +22,7 @@Syntax
-nsIVariant dataTransfer.mozGetDataAt([type], index); +nsIVariant dataTransfer.mozGetDataAt([type], index);Arguments
diff --git a/files/en-us/web/api/datatransfer/mozitemcount/index.html b/files/en-us/web/api/datatransfer/mozitemcount/index.html index 916881e205cb261..026b3ca2e12df54 100644 --- a/files/en-us/web/api/datatransfer/mozitemcount/index.html +++ b/files/en-us/web/api/datatransfer/mozitemcount/index.html @@ -22,7 +22,7 @@Syntax
-dataTransfer.mozItemCount; +dataTransfer.mozItemCount;Return value
diff --git a/files/en-us/web/api/datatransfer/mozsetdataat/index.html b/files/en-us/web/api/datatransfer/mozsetdataat/index.html index 4aeb26de03d0462..21c9584fad7a9bc 100644 --- a/files/en-us/web/api/datatransfer/mozsetdataat/index.html +++ b/files/en-us/web/api/datatransfer/mozsetdataat/index.html @@ -35,7 +35,7 @@Syntax
-void dataTransfer.mozSetDataAt([type], data, index); +void dataTransfer.mozSetDataAt([type], data, index);Arguments
diff --git a/files/en-us/web/api/datatransfer/mozsourcenode/index.html b/files/en-us/web/api/datatransfer/mozsourcenode/index.html index 61aa510e536f2b6..c803a03a02baf92 100644 --- a/files/en-us/web/api/datatransfer/mozsourcenode/index.html +++ b/files/en-us/web/api/datatransfer/mozsourcenode/index.html @@ -24,7 +24,7 @@Syntax
-dataTransfer.mozSourceNode; +dataTransfer.mozSourceNode;Return value
diff --git a/files/en-us/web/api/datatransfer/moztypesat/index.html b/files/en-us/web/api/datatransfer/moztypesat/index.html index 5ead04336a51170..e31acb58f9dd226 100644 --- a/files/en-us/web/api/datatransfer/moztypesat/index.html +++ b/files/en-us/web/api/datatransfer/moztypesat/index.html @@ -21,7 +21,7 @@Syntax
-nsIVariant dataTransfer.mozTypesAt(index); +nsIVariant dataTransfer.mozTypesAt(index);Arguments
diff --git a/files/en-us/web/api/datatransfer/mozusercancelled/index.html b/files/en-us/web/api/datatransfer/mozusercancelled/index.html index 803f19b12e70428..63674ab7babc928 100644 --- a/files/en-us/web/api/datatransfer/mozusercancelled/index.html +++ b/files/en-us/web/api/datatransfer/mozusercancelled/index.html @@ -24,7 +24,7 @@Syntax
-dataTransfer.mozUserCancelled; +dataTransfer.mozUserCancelled;Return value
diff --git a/files/en-us/web/api/datatransfer/setdata/index.html b/files/en-us/web/api/datatransfer/setdata/index.html index a39d9aa7913d1f7..0d7359c6f7cb4cb 100644 --- a/files/en-us/web/api/datatransfer/setdata/index.html +++ b/files/en-us/web/api/datatransfer/setdata/index.html @@ -23,7 +23,7 @@Syntax
-void dataTransfer.setData(format, data); +void dataTransfer.setData(format, data);Arguments
diff --git a/files/en-us/web/api/datatransfer/setdragimage/index.html b/files/en-us/web/api/datatransfer/setdragimage/index.html index e3e75b5932b0f24..f9ba7bf4485f231 100644 --- a/files/en-us/web/api/datatransfer/setdragimage/index.html +++ b/files/en-us/web/api/datatransfer/setdragimage/index.html @@ -28,7 +28,7 @@Syntax
-void dataTransfer.setDragImage(img | element, xOffset, yOffset); +void dataTransfer.setDragImage(img | element, xOffset, yOffset);Arguments
diff --git a/files/en-us/web/api/datatransfer/types/index.html b/files/en-us/web/api/datatransfer/types/index.html index e04926e4b4dc83c..90b9370ad8d2617 100644 --- a/files/en-us/web/api/datatransfer/types/index.html +++ b/files/en-us/web/api/datatransfer/types/index.html @@ -21,7 +21,7 @@Syntax
-dataTransfer.types; +dataTransfer.types;Return value
diff --git a/files/en-us/web/api/device_memory_api/index.html b/files/en-us/web/api/device_memory_api/index.html index 2233457760597ac..a66405e64847a3e 100644 --- a/files/en-us/web/api/device_memory_api/index.html +++ b/files/en-us/web/api/device_memory_api/index.html @@ -16,7 +16,7 @@JavaScript API
You may query the approximate amount of RAM a device has by retrieving {{DOMxRef("Navigator.deviceMemory")}}
-var RAM = navigator.deviceMemory;+var RAM = navigator.deviceMemory;Client Hints
diff --git a/files/en-us/web/api/domhighrestimestamp/index.html b/files/en-us/web/api/domhighrestimestamp/index.html index 9013e44a32aeafb..0a071f41c6262ad 100644 --- a/files/en-us/web/api/domhighrestimestamp/index.html +++ b/files/en-us/web/api/domhighrestimestamp/index.html @@ -25,7 +25,7 @@Reduced time precision
To offer protection against timing attacks and fingerprinting, the precision of time stamps might get rounded depending on browser settings. In Firefox, the
-privacy.reduceTimerPrecision
preference is enabled by default and defaults to 20 µs in Firefox 59; in 60 it will be 2ms.// reduced time precision (2ms) in Firefox 60 +// reduced time precision (2ms) in Firefox 60 event.timeStamp // 1519211809934 // 1519211810362 @@ -78,7 +78,7 @@Example
To determine how much time has elapsed since a particular point in your code, you can do something like this:
-let startTime = performance.now(); +let startTime = performance.now(); /* ... do things for a while ... */ diff --git a/files/en-us/web/api/dompointinit/w/index.html b/files/en-us/web/api/dompointinit/w/index.html index 6892f365d5a8e3a..84b5d04ea3c7ded 100644 --- a/files/en-us/web/api/dompointinit/w/index.html +++ b/files/en-us/web/api/dompointinit/w/index.html @@ -22,7 +22,7 @@Syntax
-var DOMPointInit = { +var DOMPointInit = { w: wPerspective }; diff --git a/files/en-us/web/api/dompointinit/x/index.html b/files/en-us/web/api/dompointinit/x/index.html index 88714a8186eb105..f485b7010970697 100644 --- a/files/en-us/web/api/dompointinit/x/index.html +++ b/files/en-us/web/api/dompointinit/x/index.html @@ -26,7 +26,7 @@Syntax
-var DOMPointInit = { +var DOMPointInit = { x: xPos }; diff --git a/files/en-us/web/api/dompointinit/y/index.html b/files/en-us/web/api/dompointinit/y/index.html index 0277e1a34f7be12..28f498d405d8c18 100644 --- a/files/en-us/web/api/dompointinit/y/index.html +++ b/files/en-us/web/api/dompointinit/y/index.html @@ -26,7 +26,7 @@Syntax
-var DOMPointInit = { +var DOMPointInit = { y: yPos }; diff --git a/files/en-us/web/api/dompointinit/z/index.html b/files/en-us/web/api/dompointinit/z/index.html index 11099651b770a94..bb5e9ff29e44c6b 100644 --- a/files/en-us/web/api/dompointinit/z/index.html +++ b/files/en-us/web/api/dompointinit/z/index.html @@ -30,7 +30,7 @@Syntax
-var DOMPointInit = { +var DOMPointInit = { z: zPos }; diff --git a/files/en-us/web/api/effecttiming/delay/index.html b/files/en-us/web/api/effecttiming/delay/index.html index 1b0b5ffec031376..ff735a4c95d300b 100644 --- a/files/en-us/web/api/effecttiming/delay/index.html +++ b/files/en-us/web/api/effecttiming/delay/index.html @@ -35,7 +35,7 @@Syntax
-var timingProperties = { +var timingProperties = { delay: delayInMilliseconds }; diff --git a/files/en-us/web/api/effecttiming/direction/index.html b/files/en-us/web/api/effecttiming/direction/index.html index 947b7fa967c17ef..e3b52de75bc3463 100644 --- a/files/en-us/web/api/effecttiming/direction/index.html +++ b/files/en-us/web/api/effecttiming/direction/index.html @@ -36,7 +36,7 @@Syntax
-var timingProperties = { +var timingProperties = { direction: "normal" | "reverse" | "alternate" | "alternate-reverse" }; @@ -72,7 +72,7 @@Examples
Key example, Alice waves her arm up and down by passing her analternate
value for herdirection
property: -// Get Alice's arm, and wave it up and down +// Get Alice's arm, and wave it up and down document.getElementById("alice_arm").animate([ { transform: 'rotate(10deg)' }, { transform: 'rotate(-40deg)' } diff --git a/files/en-us/web/api/effecttiming/duration/index.html b/files/en-us/web/api/effecttiming/duration/index.html index 8b8927d42078190..323c7670bb45195 100644 --- a/files/en-us/web/api/effecttiming/duration/index.html +++ b/files/en-us/web/api/effecttiming/duration/index.html @@ -36,7 +36,7 @@Syntax
-var timingProperties = { +var timingProperties = { duration: durationInMilliseconds | "auto" }; diff --git a/files/en-us/web/api/effecttiming/easing/index.html b/files/en-us/web/api/effecttiming/easing/index.html index af269650f8fb2e2..24d122cbbb6ccf5 100644 --- a/files/en-us/web/api/effecttiming/easing/index.html +++ b/files/en-us/web/api/effecttiming/easing/index.html @@ -38,7 +38,7 @@Syntax
-var timingProperties = { +var timingProperties = { easing: {{cssxref("single-transition-timing-function")}} } diff --git a/files/en-us/web/api/effecttiming/enddelay/index.html b/files/en-us/web/api/effecttiming/enddelay/index.html index 86c311906f8985f..aced63935e4ca99 100644 --- a/files/en-us/web/api/effecttiming/enddelay/index.html +++ b/files/en-us/web/api/effecttiming/enddelay/index.html @@ -46,7 +46,7 @@Syntax
-var timingProperties = { +var timingProperties = { endDelay: delayInMilliseconds } diff --git a/files/en-us/web/api/effecttiming/fill/index.html b/files/en-us/web/api/effecttiming/fill/index.html index dced2776ce4dcfc..66183fbc9e26bc5 100644 --- a/files/en-us/web/api/effecttiming/fill/index.html +++ b/files/en-us/web/api/effecttiming/fill/index.html @@ -45,7 +45,7 @@Syntax
-var timingProperties = { +var timingProperties = { fill: "none" | "forwards" | "backwards" | "both" | "auto" }diff --git a/files/en-us/web/api/effecttiming/iterations/index.html b/files/en-us/web/api/effecttiming/iterations/index.html index 0320e3059d0b4f7..8b35cef46203a7d 100644 --- a/files/en-us/web/api/effecttiming/iterations/index.html +++ b/files/en-us/web/api/effecttiming/iterations/index.html @@ -38,7 +38,7 @@Syntax
-var timingProperties = { +var timingProperties = { iterations: numberOfIterations }; diff --git a/files/en-us/web/api/effecttiming/iterationstart/index.html b/files/en-us/web/api/effecttiming/iterationstart/index.html index 37b5b7ed1b77f2c..f1a3ec87ee9a416 100644 --- a/files/en-us/web/api/effecttiming/iterationstart/index.html +++ b/files/en-us/web/api/effecttiming/iterationstart/index.html @@ -36,7 +36,7 @@Syntax
-var timingProperties = { +var timingProperties = { iterationStart = iterationNumber }; diff --git a/files/en-us/web/api/ext_disjoint_timer_query/beginqueryext/index.html b/files/en-us/web/api/ext_disjoint_timer_query/beginqueryext/index.html index 21fcdaab481faa1..872e719c618f84b 100644 --- a/files/en-us/web/api/ext_disjoint_timer_query/beginqueryext/index.html +++ b/files/en-us/web/api/ext_disjoint_timer_query/beginqueryext/index.html @@ -15,7 +15,7 @@Syntax
-void ext.beginQueryEXT(target, query); +void ext.beginQueryEXT(target, query);Parameters
@@ -35,7 +35,7 @@Return value
Examples
-var ext = gl.getExtension('EXT_disjoint_timer_query'); +var ext = gl.getExtension('EXT_disjoint_timer_query'); var query = ext.createQueryEXT(); ext.beginQueryEXT(ext.TIME_ELAPSED_EXT, query); diff --git a/files/en-us/web/api/ext_disjoint_timer_query/createqueryext/index.html b/files/en-us/web/api/ext_disjoint_timer_query/createqueryext/index.html index bec75186dd9ecb0..96c2cd8ed379b9c 100644 --- a/files/en-us/web/api/ext_disjoint_timer_query/createqueryext/index.html +++ b/files/en-us/web/api/ext_disjoint_timer_query/createqueryext/index.html @@ -17,7 +17,7 @@Syntax
-WebGLTimerQueryEXT ext.createQueryEXT(); +WebGLTimerQueryEXT ext.createQueryEXT();Parameters
@@ -30,7 +30,7 @@Return value
Examples
-var ext = gl.getExtension('EXT_disjoint_timer_query'); +var ext = gl.getExtension('EXT_disjoint_timer_query'); var query = ext.createQueryExt();diff --git a/files/en-us/web/api/ext_disjoint_timer_query/deletequeryext/index.html b/files/en-us/web/api/ext_disjoint_timer_query/deletequeryext/index.html index 5381ffa2dcddc9e..5082cd67e9b1eda 100644 --- a/files/en-us/web/api/ext_disjoint_timer_query/deletequeryext/index.html +++ b/files/en-us/web/api/ext_disjoint_timer_query/deletequeryext/index.html @@ -16,7 +16,7 @@Syntax
-void ext.deleteQueryEXT(query); +void ext.deleteQueryEXT(query);Parameters
@@ -32,7 +32,7 @@Return value
Examples
-var ext = gl.getExtension('EXT_disjoint_timer_query'); +var ext = gl.getExtension('EXT_disjoint_timer_query'); var query = ext.createQueryEXT(); // ... diff --git a/files/en-us/web/api/ext_disjoint_timer_query/endqueryext/index.html b/files/en-us/web/api/ext_disjoint_timer_query/endqueryext/index.html index 9dc4d5ea7d079a4..0ad5d08ec22fa4e 100644 --- a/files/en-us/web/api/ext_disjoint_timer_query/endqueryext/index.html +++ b/files/en-us/web/api/ext_disjoint_timer_query/endqueryext/index.html @@ -15,7 +15,7 @@Syntax
-void ext.endQueryEXT(target); +void ext.endQueryEXT(target);Parameters
@@ -32,7 +32,7 @@Return value
Examples
-var ext = gl.getExtension('EXT_disjoint_timer_query'); +var ext = gl.getExtension('EXT_disjoint_timer_query'); var query = ext.createQueryEXT(); ext.beginQueryEXT(ext.TIME_ELAPSED_EXT, query); diff --git a/files/en-us/web/api/ext_disjoint_timer_query/getqueryext/index.html b/files/en-us/web/api/ext_disjoint_timer_query/getqueryext/index.html index a0ee23c1556b944..65ffdcc90327766 100644 --- a/files/en-us/web/api/ext_disjoint_timer_query/getqueryext/index.html +++ b/files/en-us/web/api/ext_disjoint_timer_query/getqueryext/index.html @@ -16,7 +16,7 @@Syntax
-any ext.getQueryEXT(target, pname); +any ext.getQueryEXT(target, pname);Parameters
@@ -45,7 +45,7 @@Return value
Examples
-var ext = gl.getExtension('EXT_disjoint_timer_query'); +var ext = gl.getExtension('EXT_disjoint_timer_query'); var startQuery = ext.createQueryEXT(); ext.queryCounterEXT(startQuery, ext.TIMESTAMP_EXT); diff --git a/files/en-us/web/api/ext_disjoint_timer_query/getqueryobjectext/index.html b/files/en-us/web/api/ext_disjoint_timer_query/getqueryobjectext/index.html index 288423b1f31a10d..dd7b8de3d13a49b 100644 --- a/files/en-us/web/api/ext_disjoint_timer_query/getqueryobjectext/index.html +++ b/files/en-us/web/api/ext_disjoint_timer_query/getqueryobjectext/index.html @@ -16,7 +16,7 @@Syntax
-any ext.getQueryObjectEXT(query, pname); +any ext.getQueryObjectEXT(query, pname);Parameters
@@ -42,7 +42,7 @@Return value
Examples
-var ext = gl.getExtension('EXT_disjoint_timer_query'); +var ext = gl.getExtension('EXT_disjoint_timer_query'); var query = ext.createQueryEXT(); ext.beginQueryEXT(ext.TIME_ELAPSED_EXT, query); diff --git a/files/en-us/web/api/ext_disjoint_timer_query/index.html b/files/en-us/web/api/ext_disjoint_timer_query/index.html index e30aec2e24a8995..1929a56d72af172 100644 --- a/files/en-us/web/api/ext_disjoint_timer_query/index.html +++ b/files/en-us/web/api/ext_disjoint_timer_query/index.html @@ -83,7 +83,7 @@Methods
Examples
-var ext = gl.getExtension('EXT_disjoint_timer_query'); +var ext = gl.getExtension('EXT_disjoint_timer_query');Specifications
diff --git a/files/en-us/web/api/ext_disjoint_timer_query/isqueryext/index.html b/files/en-us/web/api/ext_disjoint_timer_query/isqueryext/index.html index 44f09e73d70b6b9..10221e5a1f60777 100644 --- a/files/en-us/web/api/ext_disjoint_timer_query/isqueryext/index.html +++ b/files/en-us/web/api/ext_disjoint_timer_query/isqueryext/index.html @@ -16,7 +16,7 @@Syntax
-GLBoolean ext.isQueryEXT(query); +GLBoolean ext.isQueryEXT(query);Parameters
@@ -34,7 +34,7 @@Return value
Examples
-var ext = gl.getExtension('EXT_disjoint_timer_query'); +var ext = gl.getExtension('EXT_disjoint_timer_query'); var query = ext.createQueryEXT(); // ... diff --git a/files/en-us/web/api/ext_disjoint_timer_query/querycounterext/index.html b/files/en-us/web/api/ext_disjoint_timer_query/querycounterext/index.html index 20b1dc1ca184f3b..e5049e502d38a99 100644 --- a/files/en-us/web/api/ext_disjoint_timer_query/querycounterext/index.html +++ b/files/en-us/web/api/ext_disjoint_timer_query/querycounterext/index.html @@ -16,7 +16,7 @@Syntax
-void ext.queryCounterEXT(query, target); +void ext.queryCounterEXT(query, target);Parameters
@@ -36,7 +36,7 @@Return value
Examples
-var ext = gl.getExtension('EXT_disjoint_timer_query'); +var ext = gl.getExtension('EXT_disjoint_timer_query'); var startQuery = ext.createQueryEXT(); var endQuery = ext.createQueryEXT(); ext.queryCounterEXT(startQuery, ext.TIMESTAMP_EXT); diff --git a/files/en-us/web/api/featurepolicy/allowedfeatures/index.html b/files/en-us/web/api/featurepolicy/allowedfeatures/index.html index 5b2d3b3bcdaf6d7..a860c44a9e17861 100644 --- a/files/en-us/web/api/featurepolicy/allowedfeatures/index.html +++ b/files/en-us/web/api/featurepolicy/allowedfeatures/index.html @@ -20,7 +20,7 @@Syntax
-const allowed = FeaturePolicy.allowedFeatures() +const allowed = FeaturePolicy.allowedFeatures()Parameters
diff --git a/files/en-us/web/api/featurepolicy/allowsfeature/index.html b/files/en-us/web/api/featurepolicy/allowsfeature/index.html index c70fde788667adf..9537881d4ac9c38 100644 --- a/files/en-us/web/api/featurepolicy/allowsfeature/index.html +++ b/files/en-us/web/api/featurepolicy/allowsfeature/index.html @@ -12,13 +12,13 @@Syntax
-const allowed = FeaturePolicy.allowsFeature(<feature>) +const allowed = FeaturePolicy.allowsFeature(<feature>)or
const allowed = FeaturePolicy.allowsFeature(<feature>, <origin>)+ class="brush: js">const allowed = FeaturePolicy.allowsFeature(<feature>, <origin>)Parameters
diff --git a/files/en-us/web/api/featurepolicy/features/index.html b/files/en-us/web/api/featurepolicy/features/index.html index 7bcc5eb085658ad..90512f455b09589 100644 --- a/files/en-us/web/api/featurepolicy/features/index.html +++ b/files/en-us/web/api/featurepolicy/features/index.html @@ -12,7 +12,7 @@Syntax
-const supportedFeatures = FeaturePolicy.features() +const supportedFeatures = FeaturePolicy.features()Parameters
diff --git a/files/en-us/web/api/featurepolicy/getallowlistforfeature/index.html b/files/en-us/web/api/featurepolicy/getallowlistforfeature/index.html index 112e5581b851fd6..2f1191eb5d4606f 100644 --- a/files/en-us/web/api/featurepolicy/getallowlistforfeature/index.html +++ b/files/en-us/web/api/featurepolicy/getallowlistforfeature/index.html @@ -15,7 +15,7 @@Syntax
-const allowlist = FeaturePolicy.getAllowlistForFeature(<feature>) +const allowlist = FeaturePolicy.getAllowlistForFeature(<feature>)Parameter
@@ -41,7 +41,7 @@Example
Feature Policy. Please note that Camera API might be restricted by the Permissions API, if the user did not grant the corresponding permission yet. -// First, get the Feature Policy object +// First, get the Feature Policy object const featurePolicy = document.featurePolicy // Then query feature for specific diff --git a/files/en-us/web/api/fetch_api/cross-global_fetch_usage/index.html b/files/en-us/web/api/fetch_api/cross-global_fetch_usage/index.html index 7e26ac874948b87..59a7b5756179c99 100644 --- a/files/en-us/web/api/fetch_api/cross-global_fetch_usage/index.html +++ b/files/en-us/web/api/fetch_api/cross-global_fetch_usage/index.html @@ -26,7 +26,7 @@The problem
In the past we would resolve the relative URL against the current global, for example:
-let absolute = new URL(relative, window.location.href)+let absolute = new URL(relative, window.location.href)This is not a problem as such. It is just that different APIs that exhibit this kind of behavior were doing it inconsistently with the behavior defined in the spec, which could lead to problems further down the line.
@@ -34,6 +34,6 @@The solution
In Firefox 60 onwards, Mozilla resolves the relative URL against the global that owns the
-fetch()
function being used (see {{bug(1432272)}}). So in the case described above, it is resolved against the iframe's location:let absolute = new URL(relative, frame.contentWindow.location.href)+let absolute = new URL(relative, frame.contentWindow.location.href)There is a lot of discussion in progress about getting new specs to align with this behavior change, to mitigate potential problems going forward.
diff --git a/files/en-us/web/api/fetch_api/using_fetch/index.html b/files/en-us/web/api/fetch_api/using_fetch/index.html index e175796ef10edd4..342dd363a261dcf 100644 --- a/files/en-us/web/api/fetch_api/using_fetch/index.html +++ b/files/en-us/web/api/fetch_api/using_fetch/index.html @@ -31,7 +31,7 @@A basic fetch request is really simple to set up. Have a look at the following code:
-fetch('http://example.com/movies.json') +fetch('http://example.com/movies.json') .then(response => response.json()) .then(data => console.log(data));@@ -52,7 +52,7 @@Supplying request options
See {{domxref("GlobalFetch.fetch","fetch()")}} for the full options available, and more details.
-// Example POST method implementation: +// Example POST method implementation: async function postData(url = '', data = {}) { // Default options are marked with * const response = await fetch(url, { @@ -94,14 +94,14 @@Sending a request with cred
Note:
-Access-Control-Allow-Origin
is prohibited from using a wildcard for requests withcredentials: 'include'
. In such cases, the exact origin must be provided; even if you are using a CORS unblocker extension, the requests will still fail.fetch('https://example.com', { +fetch('https://example.com', { credentials: 'include' });If you only want to send credentials if the request URL is on the same origin as the calling script, add
-credentials: 'same-origin'
.// The calling script is on the origin 'https://example.com' +// The calling script is on the origin 'https://example.com' fetch('https://example.com', { credentials: 'same-origin' @@ -110,7 +110,7 @@Sending a request with cred
To instead ensure browsers don’t include credentials in the request, use
-credentials: 'omit'
.fetch('https://example.com', { +fetch('https://example.com', { credentials: 'omit' })@@ -119,7 +119,7 @@Uploading JSON data
Use {{domxref("GlobalFetch.fetch","fetch()")}} to POST JSON-encoded data.
-const data = { username: 'example' }; +const data = { username: 'example' }; fetch('https://example.com/profile', { method: 'POST', // or 'PUT' @@ -141,7 +141,7 @@Uploading a file
Files can be uploaded using an HTML
-<input type="file" />
input element, {{domxref("FormData.FormData","FormData()")}} and {{domxref("WindowOrWorkerGlobalScope/fetch","fetch()")}}.const formData = new FormData(); +const formData = new FormData(); const fileField = document.querySelector('input[type="file"]'); formData.append('username', 'abc123'); @@ -164,7 +164,7 @@Uploading multiple files
Files can be uploaded using an HTML
-<input type="file" multiple />
input element, {{domxref("FormData.FormData","FormData()")}} and {{domxref("GlobalFetch.fetch","fetch()")}}.const formData = new FormData(); +const formData = new FormData(); const photos = document.querySelector('input[type="file"][multiple]'); formData.append('title', 'My Vegas Vacation'); @@ -189,7 +189,7 @@Processing a text file line by line
The chunks that are read from a response are not broken neatly at line boundaries and are Uint8Arrays, not strings. If you want to fetch a text file and process it line by line, it is up to you to handle these complications. The following example shows one way to do this by creating a line iterator (for simplicity, it assumes the text is UTF-8, and doesn't handle fetch errors).
-async function* makeTextFileLineIterator(fileURL) { +async function* makeTextFileLineIterator(fileURL) { const utf8Decoder = new TextDecoder('utf-8'); const response = await fetch(fileURL); const reader = response.body.getReader(); @@ -234,7 +234,7 @@Checking that the fetch was succ
A {{domxref("GlobalFetch.fetch","fetch()")}} promise will reject with a {{jsxref("TypeError")}} when a network error is encountered or CORS is misconfigured on the server-side, although this usually means permission issues or similar — a 404 does not constitute a network error, for example. An accurate check for a successful
-fetch()
would include checking that the promise resolved, then checking that the {{domxref("Response.ok")}} property has a value of true. The code would look something like this:fetch('flowers.jpg') +fetch('flowers.jpg') .then(response => { if (!response.ok) { throw new Error('Network response was not ok'); @@ -253,7 +253,7 @@Supplying your own request object
Instead of passing a path to the resource you want to request into thefetch()
call, you can create a request object using the {{domxref("Request.Request","Request()")}} constructor, and pass that in as afetch()
method argument: -const myHeaders = new Headers(); +const myHeaders = new Headers(); const myRequest = new Request('flowers.jpg', { method: 'GET', @@ -271,7 +271,7 @@Supplying your own request object
Request()
accepts exactly the same parameters as thefetch()
method. You can even pass in an existing request object to create a copy of it: -const anotherRequest = new Request(myRequest, myInit); +const anotherRequest = new Request(myRequest, myInit);This is pretty useful, as request and response bodies are one use only. Making a copy like this allows you to make use of the request/response again while varying the
@@ -284,7 +284,7 @@init
options if desired. The copy must be made before the body is read, and reading the body in the copy will also mark it as read in the original request.Headers
The {{domxref("Headers")}} interface allows you to create your own headers object via the {{domxref("Headers.Headers","Headers()")}} constructor. A headers object is a simple multi-map of names to values:
-const content = 'Hello World'; +const content = 'Hello World'; const myHeaders = new Headers(); myHeaders.append('Content-Type', 'text/plain'); myHeaders.append('Content-Length', content.length.toString()); @@ -293,7 +293,7 @@Headers
The same can be achieved by passing an array of arrays or an object literal to the constructor:
-const myHeaders = new Headers({ +const myHeaders = new Headers({ 'Content-Type': 'text/plain', 'Content-Length': content.length.toString(), 'X-Custom-Header': 'ProcessThisImmediately' @@ -302,7 +302,7 @@Headers
The contents can be queried and retrieved:
-console.log(myHeaders.has('Content-Type')); // true +console.log(myHeaders.has('Content-Type')); // true console.log(myHeaders.has('Set-Cookie')); // false myHeaders.set('Content-Type', 'text/html'); myHeaders.append('X-Custom-Header', 'AnotherValue'); @@ -318,7 +318,7 @@Headers
All of the Headers methods throw a
-TypeError
if a header name is used that is not a valid HTTP Header name. The mutation operations will throw aTypeError
if there is an immutable guard (see below). Otherwise, they fail silently. For example:const myResponse = Response.error(); +const myResponse = Response.error(); try { myResponse.headers.set('Origin', 'http://mybank.com'); } catch (e) { @@ -328,7 +328,7 @@Headers
A good use case for headers is checking whether the content type is correct before you process it further. For example:
-fetch(myRequest) +fetch(myRequest) .then(response => { const contentType = response.headers.get('content-type'); if (!contentType || !contentType.includes('application/json')) { @@ -374,7 +374,7 @@Response objects
They can also be created programmatically via JavaScript, but this is only really useful in {{domxref("ServiceWorker_API", "ServiceWorkers")}}, when you are providing a custom response to a received request using a {{domxref("FetchEvent.respondWith","respondWith()")}} method:
-const myBody = new Blob(); +const myBody = new Blob(); addEventListener('fetch', function(event) { // ServiceWorker intercepting a fetch @@ -419,7 +419,7 @@Body
Request bodies can be set by passing body parameters:
-const form = new FormData(document.getElementById('login-form')); +const form = new FormData(document.getElementById('login-form')); fetch('/login', { method: 'POST', body: form @@ -432,7 +432,7 @@Feature detection
Fetch API support can be detected by checking for the existence of {{domxref("Headers")}}, {{domxref("Request")}}, {{domxref("Response")}} or {{domxref("GlobalFetch.fetch","fetch()")}} on the {{domxref("Window")}} or {{domxref("Worker")}} scope. For example:
-if (window.fetch) { +if (window.fetch) { // run my fetch request here } else { // do something with XMLHttpRequest? diff --git a/files/en-us/web/api/fetchevent/client/index.html b/files/en-us/web/api/fetchevent/client/index.html index 121b6aa54859b69..7c27a86d9783ca4 100644 --- a/files/en-us/web/api/fetchevent/client/index.html +++ b/files/en-us/web/api/fetchevent/client/index.html @@ -27,7 +27,7 @@Syntax
-var myClient = FetchEvent.client;+var myClient = FetchEvent.client;Value
diff --git a/files/en-us/web/api/fetchevent/clientid/index.html b/files/en-us/web/api/fetchevent/clientid/index.html index 0132fdf1cd8f25e..b239362068dfadb 100644 --- a/files/en-us/web/api/fetchevent/clientid/index.html +++ b/files/en-us/web/api/fetchevent/clientid/index.html @@ -22,7 +22,7 @@Syntax
var myClientId = fetchEvent.clientId;+ class="brush: js">var myClientId = fetchEvent.clientId;Value
diff --git a/files/en-us/web/api/fetchevent/fetchevent/index.html b/files/en-us/web/api/fetchevent/fetchevent/index.html index 05d2f55cc758eb2..28ca047cf36d6e7 100644 --- a/files/en-us/web/api/fetchevent/fetchevent/index.html +++ b/files/en-us/web/api/fetchevent/fetchevent/index.html @@ -20,7 +20,7 @@Syntax
var fetchEvent = new FetchEvent(type, init);+ class="brush: js">var fetchEvent = new FetchEvent(type, init);Parameters
diff --git a/files/en-us/web/api/fetchevent/index.html b/files/en-us/web/api/fetchevent/index.html index 38e745379384ee8..f7429c6acbfe69d 100644 --- a/files/en-us/web/api/fetchevent/index.html +++ b/files/en-us/web/api/fetchevent/index.html @@ -55,7 +55,7 @@Examples
This fetch event uses the browser default for non-GET requests. For GET requests it tries to return a match in the cache, and falls back to the network. If it finds a match in the cache, it asynchronously updates the cache for next time.
-self.addEventListener('fetch', event => { +self.addEventListener('fetch', event => { // Let the browser do its default thing // for non-GET requests. if (event.request.method != 'GET') return; diff --git a/files/en-us/web/api/fetchevent/isreload/index.html b/files/en-us/web/api/fetchevent/isreload/index.html index ec6a87812336453..e7d0b0b9a1b63d0 100644 --- a/files/en-us/web/api/fetchevent/isreload/index.html +++ b/files/en-us/web/api/fetchevent/isreload/index.html @@ -23,7 +23,7 @@Syntax
var reloaded = FetchEvent.isReload+ class="brush: js">var reloaded = FetchEvent.isReloadValue
diff --git a/files/en-us/web/api/fetchevent/navigationpreload/index.html b/files/en-us/web/api/fetchevent/navigationpreload/index.html index 603f5498759cd0c..66da87c4434f4d2 100644 --- a/files/en-us/web/api/fetchevent/navigationpreload/index.html +++ b/files/en-us/web/api/fetchevent/navigationpreload/index.html @@ -20,7 +20,7 @@Syntax
var promise = fetchEvent.navigationPreload+ class="brush: js">var promise = fetchEvent.navigationPreloadValue
diff --git a/files/en-us/web/api/fetchevent/preloadresponse/index.html b/files/en-us/web/api/fetchevent/preloadresponse/index.html index c226b54fdf0c7dd..73df7472c001d0e 100644 --- a/files/en-us/web/api/fetchevent/preloadresponse/index.html +++ b/files/en-us/web/api/fetchevent/preloadresponse/index.html @@ -23,7 +23,7 @@Syntax
var expectedResponse = fetchEvent.preloadResponse;+ class="brush: js">var expectedResponse = fetchEvent.preloadResponse;Value
@@ -41,7 +41,7 @@Example
object. If no match is found, the code checks for a preloaded response. Else it fetches a response from the network. -addEventListener('fetch', event => { +addEventListener('fetch', event => { event.respondWith(async function() { // Respond from the cache if we can const cachedResponse = await caches.match(event.request); diff --git a/files/en-us/web/api/fetchevent/replacesclientid/index.html b/files/en-us/web/api/fetchevent/replacesclientid/index.html index 4482c2fcb00f912..2d45a02691fe31b 100644 --- a/files/en-us/web/api/fetchevent/replacesclientid/index.html +++ b/files/en-us/web/api/fetchevent/replacesclientid/index.html @@ -29,7 +29,7 @@Syntax
var myReplacedClientId = fetchEvent.replacesClientId;+ class="brush: js">var myReplacedClientId = fetchEvent.replacesClientId;Value
diff --git a/files/en-us/web/api/fetchevent/request/index.html b/files/en-us/web/api/fetchevent/request/index.html index 86cf9e1a3953ba2..5c6d420d3a0f82e 100644 --- a/files/en-us/web/api/fetchevent/request/index.html +++ b/files/en-us/web/api/fetchevent/request/index.html @@ -25,7 +25,7 @@Syntax
var recentRequest = fetchEvent.request;+ class="brush: js">var recentRequest = fetchEvent.request;Value
diff --git a/files/en-us/web/api/fetchevent/respondwith/index.html b/files/en-us/web/api/fetchevent/respondwith/index.html index a921836b9b32496..15b884a61f4407a 100644 --- a/files/en-us/web/api/fetchevent/respondwith/index.html +++ b/files/en-us/web/api/fetchevent/respondwith/index.html @@ -77,7 +77,7 @@Specifying the final URL of a re
Syntax
-fetchEvent.respondWith( +fetchEvent.respondWith( // Promise that resolves to a Response. );@@ -120,7 +120,7 @@Examples
This fetch event tries to return a response from the cache API, falling back to the network otherwise.
-addEventListener('fetch', event => { +addEventListener('fetch', event => { // Prevent the default, and handle the request ourselves. event.respondWith(async function() { // Try to get the response from a cache. diff --git a/files/en-us/web/api/fetchevent/resultingclientid/index.html b/files/en-us/web/api/fetchevent/resultingclientid/index.html index c30865b35d64791..dbabe91c0b8cf48 100644 --- a/files/en-us/web/api/fetchevent/resultingclientid/index.html +++ b/files/en-us/web/api/fetchevent/resultingclientid/index.html @@ -28,7 +28,7 @@Syntax
var myResultingClientId = fetchEvent.resultingClientId;+ class="brush: js">var myResultingClientId = fetchEvent.resultingClientId;Value
diff --git a/files/en-us/web/api/file_system_access_api/index.html b/files/en-us/web/api/file_system_access_api/index.html index 2ea479ae6d3adb2..3ce56f52390e0d5 100644 --- a/files/en-us/web/api/file_system_access_api/index.html +++ b/files/en-us/web/api/file_system_access_api/index.html @@ -51,7 +51,7 @@Accessing files.
The below code allows the user to choose a file from the file picker and then tests to see whether the handle returned is a file or directory
-// store a reference to our file handle +// store a reference to our file handle let fileHandle; async function getFile() { @@ -69,7 +69,7 @@Accessing files.
The following asynchronous function presents a file picker and once a file is chosen, uses the
-getFile()
method to retrieve the contents.const pickerOpts = { +const pickerOpts = { types: [ { description: 'Images', @@ -94,14 +94,14 @@Accessing directories.
The following example returns a directory handle with the specified name, if the directory does not exist it is created.
-const dirName = 'directoryToGetName'; +const dirName = 'directoryToGetName'; // assuming we have a directory handle: 'currentDirHandle' const subDir = currentDirHandle.getDirectoryHandle(dirName, {create: true});The following asynchronous function uses
-resolve()
to find the path to a chosen file, relative to a specified directory handle.async function returnPathDirectories(directoryHandle) { +async function returnPathDirectories(directoryHandle) { // Get a file handle by showing a file picker: const handle = await self.showOpenFilePicker(); @@ -132,7 +132,7 @@Writing to files.
A user defined {{domxref('Blob')}} is then written to the stream which is subsequently closed.
-async function saveFile() { +async function saveFile() { // create a new handle const newHandle = await window.showSaveFilePicker(); @@ -150,7 +150,7 @@Writing to files.
The following show different examples of options that can be passed into the
-write()
method.// just pass in the data (no options) +// just pass in the data (no options) writableStream.write(data) // writes the data to the stream from the determined position diff --git a/files/en-us/web/api/filerequest/lockedfile/index.html b/files/en-us/web/api/filerequest/lockedfile/index.html index 2e9b78659ff5723..33c5e508aaa64d2 100644 --- a/files/en-us/web/api/filerequest/lockedfile/index.html +++ b/files/en-us/web/api/filerequest/lockedfile/index.html @@ -19,7 +19,7 @@Summary
Syntax
-var lockedFile = instanceOfFileRequest.lockedFile +var lockedFile = instanceOfFileRequest.lockedFileValue
diff --git a/files/en-us/web/api/filesystemfileentry/createwriter/index.html b/files/en-us/web/api/filesystemfileentry/createwriter/index.html index c22acf69203a670..34961da218e1985 100644 --- a/files/en-us/web/api/filesystemfileentry/createwriter/index.html +++ b/files/en-us/web/api/filesystemfileentry/createwriter/index.html @@ -23,7 +23,7 @@Syntax
FileSystemFileEntry.createWriter(successCallback[, errorCallback]);+ class="brush: js">FileSystemFileEntry.createWriter(successCallback[, errorCallback]);Parameters
diff --git a/files/en-us/web/api/filesystemfileentry/file/index.html b/files/en-us/web/api/filesystemfileentry/file/index.html index aba8afbb0764b23..ee4a2f758974cf8 100644 --- a/files/en-us/web/api/filesystemfileentry/file/index.html +++ b/files/en-us/web/api/filesystemfileentry/file/index.html @@ -22,7 +22,7 @@Syntax
FileSystemFileEntry.file(successCallback[, errorCallback]);+ class="brush: js">FileSystemFileEntry.file(successCallback[, errorCallback]);Parameters
diff --git a/files/en-us/web/api/filesystemwritablefilestream/index.html b/files/en-us/web/api/filesystemwritablefilestream/index.html index 310052e4f21e332..69b92e7e4a0da46 100644 --- a/files/en-us/web/api/filesystemwritablefilestream/index.html +++ b/files/en-us/web/api/filesystemwritablefilestream/index.html @@ -36,7 +36,7 @@Examples
A user defined {{domxref('Blob')}} is then written to the stream which is subsequently closed.
-async function saveFile() { +async function saveFile() { // create a new handle const newHandle = await window.showSaveFilePicker(); @@ -54,7 +54,7 @@Examples
The following show different examples of options that can be passed into the
-write()
method.// just pass in the data (no options) +// just pass in the data (no options) writableStream.write(data) // writes the data to the stream from the determined position diff --git a/files/en-us/web/api/filesystemwritablefilestream/seek/index.html b/files/en-us/web/api/filesystemwritablefilestream/seek/index.html index b216a2aa4a7d4b8..89915e5a49ece30 100644 --- a/files/en-us/web/api/filesystemwritablefilestream/seek/index.html +++ b/files/en-us/web/api/filesystemwritablefilestream/seek/index.html @@ -19,7 +19,7 @@Syntax
FileSystemWritableStream.seek(position).then(...);+ class="brush: js">FileSystemWritableStream.seek(position).then(...);Parameters
diff --git a/files/en-us/web/api/filesystemwritablefilestream/truncate/index.html b/files/en-us/web/api/filesystemwritablefilestream/truncate/index.html index a8487f7e1014bf9..afa057b6436b275 100644 --- a/files/en-us/web/api/filesystemwritablefilestream/truncate/index.html +++ b/files/en-us/web/api/filesystemwritablefilestream/truncate/index.html @@ -29,7 +29,7 @@Syntax
FileSystemWritableFileStream.truncate().then(...);+ class="brush: js">FileSystemWritableFileStream.truncate().then(...);Parameters
@@ -53,7 +53,7 @@Exceptions
Examples
-// todo +// todoSpecifications
diff --git a/files/en-us/web/api/filesystemwritablefilestream/write/index.html b/files/en-us/web/api/filesystemwritablefilestream/write/index.html index c426449dc49291a..b0adc04055bb2de 100644 --- a/files/en-us/web/api/filesystemwritablefilestream/write/index.html +++ b/files/en-us/web/api/filesystemwritablefilestream/write/index.html @@ -25,7 +25,7 @@Syntax
FileSystemWritableFileStream.write(data).then(...);+ class="brush: js">FileSystemWritableFileStream.write(data).then(...);Parameters
@@ -77,7 +77,7 @@Examples
A user defined {{domxref('Blob')}} is then written to the stream which is subsequently closed.
-async function saveFile() { +async function saveFile() { // create a new handle const newHandle = await window.showSaveFilePicker(); @@ -96,7 +96,7 @@Examples
The following show different examples of options that can be passed into the
-write()
method.// just pass in the data (no options) +// just pass in the data (no options) writableStream.write(data) // writes the data to the stream from the determined position diff --git a/files/en-us/web/api/fontfaceset/check/index.html b/files/en-us/web/api/fontfaceset/check/index.html index adc7ac476d72612..1fb006c3ddd1cd3 100644 --- a/files/en-us/web/api/fontfaceset/check/index.html +++ b/files/en-us/web/api/fontfaceset/check/index.html @@ -17,7 +17,7 @@Syntax
-bool = aFontFaceSet.check(font); +bool = aFontFaceSet.check(font); bool = aFontFaceSet.check(font, text);@@ -38,7 +38,7 @@Parameters
Examples
-document.fonts.check("12px courier"); // returns true if the font courier is available at 12px +document.fonts.check("12px courier"); // returns true if the font courier is available at 12px document.fonts.check("12px MyFont", "ß"); // returns true if the font 'MyFont' has a ß character.diff --git a/files/en-us/web/api/fontfaceset/load/index.html b/files/en-us/web/api/fontfaceset/load/index.html index d13cb0054f904fa..70eee9b82296f90 100644 --- a/files/en-us/web/api/fontfaceset/load/index.html +++ b/files/en-us/web/api/fontfaceset/load/index.html @@ -17,7 +17,7 @@Syntax
-result = aFontFaceSet.load(font); +result = aFontFaceSet.load(font); result = aFontFaceSet.load(font, text);@@ -41,7 +41,7 @@Parameters
Examples
-// returns a promise that will be fulfilled or rejected according the success to load MyFont +// returns a promise that will be fulfilled or rejected according the success to load MyFont // The code in 'then' can assume the availability of that font. document.fonts.load("12px MyFont", "ß").then(…); diff --git a/files/en-us/web/api/fontfaceset/ready/index.html b/files/en-us/web/api/fontfaceset/ready/index.html index 15ec0e976a4ae7b..3f2811789f6a5f2 100644 --- a/files/en-us/web/api/fontfaceset/ready/index.html +++ b/files/en-us/web/api/fontfaceset/ready/index.html @@ -20,7 +20,7 @@Syntax
-fontFaceSet.ready.then(function(fontFaceSet) { +fontFaceSet.ready.then(function(fontFaceSet) { // ... });diff --git a/files/en-us/web/api/formdataevent/formdata/index.html b/files/en-us/web/api/formdataevent/formdata/index.html index 34ad77a237e79ce..449d73d92401a11 100644 --- a/files/en-us/web/api/formdataevent/formdata/index.html +++ b/files/en-us/web/api/formdataevent/formdata/index.html @@ -18,7 +18,7 @@Syntax
formData = formDataEvent.formData+ class="brush: js">formData = formDataEvent.formDataReturns
diff --git a/files/en-us/web/api/formdataevent/formdataevent/index.html b/files/en-us/web/api/formdataevent/formdataevent/index.html index 3329edc770029fa..e865b2c12720964 100644 --- a/files/en-us/web/api/formdataevent/formdataevent/index.html +++ b/files/en-us/web/api/formdataevent/formdataevent/index.html @@ -17,7 +17,7 @@Syntax
new FormDataEvent(type[, formEventInit]);+ class="brush: js">new FormDataEvent(type[, formEventInit]);Values
diff --git a/files/en-us/web/api/gamepad_api/using_the_gamepad_api/index.html b/files/en-us/web/api/gamepad_api/using_the_gamepad_api/index.html index 3263048168f657e..bd723afbe4b5474 100644 --- a/files/en-us/web/api/gamepad_api/using_the_gamepad_api/index.html +++ b/files/en-us/web/api/gamepad_api/using_the_gamepad_api/index.html @@ -24,7 +24,7 @@Connecting to a gamepad
You can use {{domxref("Window/gamepadconnected_event", "gamepadconnected")}} like this:
-window.addEventListener("gamepadconnected", function(e) { +window.addEventListener("gamepadconnected", function(e) { console.log("Gamepad connected at index %d: %s. %d buttons, %d axes.", e.gamepad.index, e.gamepad.id, e.gamepad.buttons.length, e.gamepad.axes.length); @@ -37,14 +37,14 @@Disconnecting a gamepad
When a gamepad is disconnected, and if a page has previously received data for that gamepad (e.g. {{ domxref("Window/gamepadconnected_event", "gamepadconnected") }}), a second event is dispatched to the focused window, {{ event("gamepaddisconnected") }}:
-window.addEventListener("gamepaddisconnected", function(e) { +window.addEventListener("gamepaddisconnected", function(e) { console.log("Gamepad disconnected from index %d: %s", e.gamepad.index, e.gamepad.id); });The gamepad's {{domxref("Gamepad.index", "index")}} property will be unique per-device connected to the system, even if multiple controllers of the same type are used. The
-index
property also functions as the index into the {{jsxref("Array")}} returned by {{ domxref("Navigator.getGamepads()") }}.var gamepads = {}; +var gamepads = {}; function gamepadHandler(event, connecting) { var gamepad = event.gamepad; @@ -72,7 +72,7 @@Querying the Gamepad object
The {{domxref("Navigator.getGamepads()")}} method returns an array of all devices currently visible to the webpage, as {{ domxref("Gamepad") }} objects (the first value is always
-null
, sonull
will be returned if there are no gamepads connected.) This can then be used to get the same information. For example, the first code example above you be rewritten as shown below:window.addEventListener("gamepadconnected", function(e) { +window.addEventListener("gamepadconnected", function(e) { var gp = navigator.getGamepads()[e.gamepad.index]; console.log("Gamepad connected at index %d: %s. %d buttons, %d axes.", gp.index, gp.id, @@ -106,7 +106,7 @@Using button information
To start with, we declare some variables: The
-gamepadInfo
paragraph that the connection info is written into, theball
that we want to move, thestart
variable that acts as the ID forrequestAnimation Frame
, thea
andb
variables that act as position modifiers for moving the ball, and the shorthand variables that will be used for the {{ domxref("Window.requestAnimationFrame", "requestAnimationFrame()") }} and {{ domxref("Window.cancelAnimationFrame", "cancelAnimationFrame()") }} cross browser forks.var gamepadInfo = document.getElementById("gamepad-info"); +var gamepadInfo = document.getElementById("gamepad-info"); var ball = document.getElementById("ball"); var start; var a = 0; @@ -115,7 +115,7 @@Using button information
Next we use the {{domxref("Window/gamepadconnected_event", "gamepadconnected")}} event to check for a gamepad being connected. When one is connected, we grab the gamepad using {{ domxref("Navigator.getGamepads()") }}
-[0]
, print information about the gamepad into our gamepad infodiv
, and fire thegameLoop()
function that starts the whole ball movement process up.window.addEventListener("gamepadconnected", function(e) { +window.addEventListener("gamepadconnected", function(e) { var gp = navigator.getGamepads()[e.gamepad.index]; gamepadInfo.innerHTML = "Gamepad connected at index " + gp.index + ": " + gp.id + ". It has " + gp.buttons.length + " buttons and " + gp.axes.length + " axes."; @@ -124,7 +124,7 @@Using button information
Now we use the {{domxref("Window/gamepaddisconnected_event", "gamepaddisconnected")}} event to check if the gamepad is disconnected again. If so, we stop the {{DOMxRef("Window.requestAnimationFrame", "requestAnimationFrame()")}} loop (see below) and revert the gamepad information back to what it was originally.
-window.addEventListener("gamepaddisconnected", function(e) { +window.addEventListener("gamepaddisconnected", function(e) { gamepadInfo.innerHTML = "Waiting for gamepad."; cancelRequestAnimationFrame(start); @@ -132,7 +132,7 @@Using button information
Chrome does things differently here. Instead of constantly storing the gamepad's latest state in a variable it only stores a snapshot, so to do the same thing in Chrome you have to keep polling it and then only use the {{ domxref("Gamepad") }} object in code when it is available. We have done this below using {{ domxref("Window.setInterval()") }}; once the object is available the gamepad info is outputted, the game loop is started, and the interval is cleared using {{ domxref("Window.clearInterval()") }}. Note that in older versions of Chrome {{ domxref("Navigator.getGamepads()") }} is implemented with a
-webkit
prefix. We attempt to detect and handle both the prefixed version and the standard version of the function for backwards compatibility.var interval; +var interval; if (!('ongamepadconnected' in window)) { // No gamepad events available, poll instead. @@ -156,7 +156,7 @@Using button information
After all this is done, we use our
-requestAnimationFrame()
to request the next animation frame, runninggameLoop()
again.function buttonPressed(b) { +function buttonPressed(b) { if (typeof(b) == "object") { return b.pressed; } @@ -191,7 +191,7 @@Complete example: Displaying
This example shows how to use the {{ domxref("Gamepad") }} object, as well as the {{ domxref("Window/gamepadconnected_event", "gamepadconnected") }} and {{domxref("Window/gamepaddisconnected_event", "gamepaddisconnected")}} events in order to display the state of all gamepads connected to the system. You can find a working demo and look at the full source code on Github.
-var haveEvents = 'ongamepadconnected' in window; +var haveEvents = 'ongamepadconnected' in window; var controllers = {}; function connecthandler(e) { diff --git a/files/en-us/web/api/gamepadevent/gamepad/index.html b/files/en-us/web/api/gamepadevent/gamepad/index.html index b0f9c334f30b91a..cd9cbd2b2309a3f 100644 --- a/files/en-us/web/api/gamepadevent/gamepad/index.html +++ b/files/en-us/web/api/gamepadevent/gamepad/index.html @@ -17,7 +17,7 @@Syntax
-readonly attribute Gamepad gamepad;+readonly attribute Gamepad gamepad;Example
diff --git a/files/en-us/web/api/gamepadevent/gamepadevent/index.html b/files/en-us/web/api/gamepadevent/gamepadevent/index.html index dd18c4c6cbeeee3..b07482b1adeabd2 100644 --- a/files/en-us/web/api/gamepadevent/gamepadevent/index.html +++ b/files/en-us/web/api/gamepadevent/gamepadevent/index.html @@ -16,7 +16,7 @@Syntax
var gamepadEvent = new GamepadEvent(typeArg, options)+ class="brush: js">var gamepadEvent = new GamepadEvent(typeArg, options)Parameters
diff --git a/files/en-us/web/api/geolocation/clearwatch/index.html b/files/en-us/web/api/geolocation/clearwatch/index.html index c1770d1c923d1a2..e87346df9aea1d9 100644 --- a/files/en-us/web/api/geolocation/clearwatch/index.html +++ b/files/en-us/web/api/geolocation/clearwatch/index.html @@ -18,7 +18,7 @@Syntax
-navigator.geolocation.clearWatch(id);+navigator.geolocation.clearWatch(id);Parameters
@@ -30,7 +30,7 @@Parameters
Example
-var id, target, option; +var id, target, option; function success(pos) { var crd = pos.coords; diff --git a/files/en-us/web/api/geolocation/getcurrentposition/index.html b/files/en-us/web/api/geolocation/getcurrentposition/index.html index cf7f64505258c82..99a93a0dfb1118e 100644 --- a/files/en-us/web/api/geolocation/getcurrentposition/index.html +++ b/files/en-us/web/api/geolocation/getcurrentposition/index.html @@ -19,7 +19,7 @@Syntax
navigator.geolocation.getCurrentPosition(success[, error[, [options]])+ class="brush: js">navigator.geolocation.getCurrentPosition(success[, error[, [options]])Parameters
@@ -45,7 +45,7 @@Parameters
Examples
-var options = { +var options = { enableHighAccuracy: true, timeout: 5000, maximumAge: 0 diff --git a/files/en-us/web/api/geolocation/watchposition/index.html b/files/en-us/web/api/geolocation/watchposition/index.html index 51ebe14e74e9299..87f1bf836257581 100644 --- a/files/en-us/web/api/geolocation/watchposition/index.html +++ b/files/en-us/web/api/geolocation/watchposition/index.html @@ -20,7 +20,7 @@Syntax
navigator.geolocation.watchPosition(success[, error[, options]])+ class="brush: js">navigator.geolocation.watchPosition(success[, error[, options]])Parameters
@@ -43,7 +43,7 @@Return value
Examples
-var id, target, options; +var id, target, options; function success(pos) { var crd = pos.coords; diff --git a/files/en-us/web/api/geolocation_api/using_the_geolocation_api/index.html b/files/en-us/web/api/geolocation_api/using_the_geolocation_api/index.html index 859ecedd588d3b9..0f366e1fb5f54f3 100644 --- a/files/en-us/web/api/geolocation_api/using_the_geolocation_api/index.html +++ b/files/en-us/web/api/geolocation_api/using_the_geolocation_api/index.html @@ -16,7 +16,7 @@The geolocation object
If the object exists, geolocation services are available. You can test for the presence of geolocation thusly:
-if('geolocation' in navigator) { +if('geolocation' in navigator) { /* geolocation is available */ } else { /* geolocation IS NOT available */ @@ -31,7 +31,7 @@Getting the current position
Note: By default, {{domxref("Geolocation.getCurrentPosition","getCurrentPosition()")}} tries to answer as fast as possible with a low accuracy result. It is useful if you need a quick answer regardless of the accuracy. Devices with a GPS, for example, can take a minute or more to get a GPS fix, so less accurate data (IP location or wifi) may be returned to
-getCurrentPosition()
.navigator.geolocation.getCurrentPosition((position) => { +navigator.geolocation.getCurrentPosition((position) => { doSomething(position.coords.latitude, position.coords.longitude); });@@ -45,13 +45,13 @@Watching the current position
Note: You can use {{domxref("Geolocation.watchPosition","watchPosition()")}} without an initial {{domxref("Geolocation.getCurrentPosition","getCurrentPosition()")}} call.
-const watchID = navigator.geolocation.watchPosition((position) => { +const watchID = navigator.geolocation.watchPosition((position) => { doSomething(position.coords.latitude, position.coords.longitude); });The {{domxref("Geolocation.watchPosition","watchPosition()")}} method returns an ID number that can be used to uniquely identify the requested position watcher; you use this value in tandem with the {{domxref("Geolocation.clearWatch","clearWatch()")}} method to stop watching the user's location.
-navigator.geolocation.clearWatch(watchID); +navigator.geolocation.clearWatch(watchID);Fine tuning the response
@@ -62,7 +62,7 @@Fine tuning the response
A call to {{domxref("Geolocation.watchPosition","watchPosition")}} could look like:
-function success(position) { +function success(position) { doSomething(position.coords.latitude, position.coords.longitude); } @@ -86,7 +86,7 @@Describing a position
The
-GeolocationCoordinates
instance contains a number of properties, but the two you'll use most commonly arelatitude
andlongitude
, which are what you need to draw your position on a map. Hence many Geolocation success callbacks look fairly simple:function success(position) { +function success(position) { const latitude = position.coords.latitude; const longitude = position.coords.longitude; @@ -101,7 +101,7 @@Handling errors
You could use it like so:
-function errorCallback(error) { +function errorCallback(error) { alert(`ERROR(${error.code}): ${error.message}`); };@@ -111,7 +111,7 @@Examples
In the following example the Geolocation API is used to retrieve the user's latitude and longitude. If sucessful, the available hyperlink is populated with an
openstreetmap.org
URL that will show their location.-body { +body { padding: 20px; background-color:#ffffc9 } @@ -124,14 +124,14 @@Examples
HTML
-<button id = "find-me">Show my location</button><br/> +<button id = "find-me">Show my location</button><br/> <p id = "status"></p> <a id = "map-link" target="_blank"></a>JavaScript
-function geoFindMe() { +function geoFindMe() { const status = document.querySelector('#status'); const mapLink = document.querySelector('#map-link'); diff --git a/files/en-us/web/api/geolocationcoordinates/accuracy/index.html b/files/en-us/web/api/geolocationcoordinates/accuracy/index.html index 9600ee52007b07c..8be2dc8e9be21aa 100644 --- a/files/en-us/web/api/geolocationcoordinates/accuracy/index.html +++ b/files/en-us/web/api/geolocationcoordinates/accuracy/index.html @@ -18,7 +18,7 @@Syntax
-let acc = geolocationCoordinatesInstance.accuracy +let acc = geolocationCoordinatesInstance.accuracyValue
diff --git a/files/en-us/web/api/geolocationcoordinates/altitude/index.html b/files/en-us/web/api/geolocationcoordinates/altitude/index.html index d89b79c8708a40c..b54a7f50f221e46 100644 --- a/files/en-us/web/api/geolocationcoordinates/altitude/index.html +++ b/files/en-us/web/api/geolocationcoordinates/altitude/index.html @@ -20,7 +20,7 @@Syntax
let alt = geolocationCoordinatesInstance.altitude+ class="brush: js">let alt = geolocationCoordinatesInstance.altitudeValue
diff --git a/files/en-us/web/api/geolocationcoordinates/altitudeaccuracy/index.html b/files/en-us/web/api/geolocationcoordinates/altitudeaccuracy/index.html index b4f1266950422d6..8cfa9504bd31755 100644 --- a/files/en-us/web/api/geolocationcoordinates/altitudeaccuracy/index.html +++ b/files/en-us/web/api/geolocationcoordinates/altitudeaccuracy/index.html @@ -18,7 +18,7 @@Syntax
-let altAcc = geolocationCoordinatesInstance.altitudeAccuracy +let altAcc = geolocationCoordinatesInstance.altitudeAccuracyValue
diff --git a/files/en-us/web/api/geolocationcoordinates/heading/index.html b/files/en-us/web/api/geolocationcoordinates/heading/index.html index f7c4f2a1242c312..d4d41e85f43e9f9 100644 --- a/files/en-us/web/api/geolocationcoordinates/heading/index.html +++ b/files/en-us/web/api/geolocationcoordinates/heading/index.html @@ -24,7 +24,7 @@Syntax
-let heading = geolocationCoordinatesInstance.heading +let heading = geolocationCoordinatesInstance.headingValue
diff --git a/files/en-us/web/api/geolocationcoordinates/longitude/index.html b/files/en-us/web/api/geolocationcoordinates/longitude/index.html index 771956791924e30..4b3f4349b2f9403 100644 --- a/files/en-us/web/api/geolocationcoordinates/longitude/index.html +++ b/files/en-us/web/api/geolocationcoordinates/longitude/index.html @@ -26,7 +26,7 @@Syntax
-let longitude = geolocationCoordinatesInstance.longitude +let longitude = geolocationCoordinatesInstance.longitudeValue
@@ -55,7 +55,7 @@JavaScript
The JavaScript code below creates an event listener so that when the user clicks on a button, the location information is retrieved and displayed.
-let button = document.getElementById("get-location"); +let button = document.getElementById("get-location"); let latText = document.getElementById("latitude"); let longText = document.getElementById("longitude"); @@ -91,7 +91,7 @@HTML
The HTML used to present the results looks like this:
-<p> +<p> Your location is <span id="latitude">0.00</span>° latitude by <span id="longitude">0.00</span>° longitude. </p> diff --git a/files/en-us/web/api/geolocationcoordinates/speed/index.html b/files/en-us/web/api/geolocationcoordinates/speed/index.html index aa7be9619b486fc..970dba679ad37d8 100644 --- a/files/en-us/web/api/geolocationcoordinates/speed/index.html +++ b/files/en-us/web/api/geolocationcoordinates/speed/index.html @@ -17,7 +17,7 @@Syntax
-let speed = geolocationCoordinatesInstance.speed +let speed = geolocationCoordinatesInstance.speedValue
diff --git a/files/en-us/web/api/gyroscope/gyroscope/index.html b/files/en-us/web/api/gyroscope/gyroscope/index.html index 5fc06250d378af5..59b41727a4576a0 100644 --- a/files/en-us/web/api/gyroscope/gyroscope/index.html +++ b/files/en-us/web/api/gyroscope/gyroscope/index.html @@ -24,7 +24,7 @@Syntax
var gyroscope = new Gyroscope([options])+ class="brush: js">var gyroscope = new Gyroscope([options])Parameters
diff --git a/files/en-us/web/api/gyroscope/x/index.html b/files/en-us/web/api/gyroscope/x/index.html index 7b9ef2ec54a030d..887c8f6da4c01d4 100644 --- a/files/en-us/web/api/gyroscope/x/index.html +++ b/files/en-us/web/api/gyroscope/x/index.html @@ -24,7 +24,7 @@Syntax
-var x = gyroscope.x+var x = gyroscope.xValue
diff --git a/files/en-us/web/api/gyroscope/y/index.html b/files/en-us/web/api/gyroscope/y/index.html index 8afb0c584aa4b39..16d92dbdaab6dda 100644 --- a/files/en-us/web/api/gyroscope/y/index.html +++ b/files/en-us/web/api/gyroscope/y/index.html @@ -24,7 +24,7 @@Syntax
-var y = gyroscope.y+var y = gyroscope.yValue
diff --git a/files/en-us/web/api/gyroscope/z/index.html b/files/en-us/web/api/gyroscope/z/index.html index 8c3f397778c7d02..c7aa7321e131dbb 100644 --- a/files/en-us/web/api/gyroscope/z/index.html +++ b/files/en-us/web/api/gyroscope/z/index.html @@ -24,7 +24,7 @@Syntax
-var z = gyroscope.z+var z = gyroscope.zValue
@@ -35,7 +35,7 @@Example
The gyroscope is typically read in the {{domxref('Sensor.onreading')}} event callback. In the example below this occurs sixty times a second.
-let gyroscope = new Gyroscope({frequency: 60}); +let gyroscope = new Gyroscope({frequency: 60}); gyroscope.addEventListener('reading', e => { console.log("Angular velocity along the X-axis " + gyroscope.x); diff --git a/files/en-us/web/api/headers/append/index.html b/files/en-us/web/api/headers/append/index.html index 1610c1813b37f11..e6fc9ee83053018 100644 --- a/files/en-us/web/api/headers/append/index.html +++ b/files/en-us/web/api/headers/append/index.html @@ -28,7 +28,7 @@Syntax
myHeaders.append(name, value);+ class="brush: js">myHeaders.append(name, value);Parameters
diff --git a/files/en-us/web/api/headers/delete/index.html b/files/en-us/web/api/headers/delete/index.html index af4f85008af7564..341a3eb3f9a2911 100644 --- a/files/en-us/web/api/headers/delete/index.html +++ b/files/en-us/web/api/headers/delete/index.html @@ -28,7 +28,7 @@Syntax
-myHeaders.delete(name);+myHeaders.delete(name);Parameters
diff --git a/files/en-us/web/api/headers/entries/index.html b/files/en-us/web/api/headers/entries/index.html index d90c1030fc7b2a8..4244dd0aff82e88 100644 --- a/files/en-us/web/api/headers/entries/index.html +++ b/files/en-us/web/api/headers/entries/index.html @@ -23,7 +23,7 @@Syntax
-headers.entries();+headers.entries();Return value
diff --git a/files/en-us/web/api/headers/get/index.html b/files/en-us/web/api/headers/get/index.html index f02a79a625f1979..0d69c9e3dda3048 100644 --- a/files/en-us/web/api/headers/get/index.html +++ b/files/en-us/web/api/headers/get/index.html @@ -24,7 +24,7 @@Syntax
-myHeaders.get(name);+myHeaders.get(name);Parameters
diff --git a/files/en-us/web/api/headers/has/index.html b/files/en-us/web/api/headers/has/index.html index 541e7fbde29e220..35809994f5249d3 100644 --- a/files/en-us/web/api/headers/has/index.html +++ b/files/en-us/web/api/headers/has/index.html @@ -22,7 +22,7 @@Syntax
-myHeaders.has(name);+myHeaders.has(name);Parameters
@@ -40,12 +40,12 @@Example
Creating an empty
-Headers
object is simple:var myHeaders = new Headers(); // Currently empty+var myHeaders = new Headers(); // Currently emptyYou could add a header to this using {{domxref("Headers.append")}}, then test for the existence of it using
-has()
:myHeaders.append('Content-Type', 'image/jpeg'); +myHeaders.append('Content-Type', 'image/jpeg'); myHeaders.has('Content-Type'); // Returns true myHeaders.has('Accept-Encoding'); // Returns falsediff --git a/files/en-us/web/api/headers/headers/index.html b/files/en-us/web/api/headers/headers/index.html index e90aba4794199f7..088b49219530eed 100644 --- a/files/en-us/web/api/headers/headers/index.html +++ b/files/en-us/web/api/headers/headers/index.html @@ -16,7 +16,7 @@Syntax
var myHeaders = new Headers(init);+ class="brush: js">var myHeaders = new Headers(init);Parameters
@@ -33,11 +33,11 @@Example
Creating an empty
-Headers
object is simple:var myHeaders = new Headers(); // Currently empty+var myHeaders = new Headers(); // Currently emptyYou could add a header to this using {{domxref("Headers.append")}}:
-myHeaders.append('Content-Type', 'image/jpeg'); +myHeaders.append('Content-Type', 'image/jpeg'); myHeaders.get('Content-Type'); // Returns 'image/jpeg'@@ -45,14 +45,14 @@Example
the following snippet we create a new {{domxref("Headers")}} object, adding some headers by passing the constructor an init object as an argument: -var httpHeaders = { 'Content-Type' : 'image/jpeg', 'Accept-Charset' : 'utf-8', 'X-My-Custom-Header' : 'Zeke are cool' }; +var httpHeaders = { 'Content-Type' : 'image/jpeg', 'Accept-Charset' : 'utf-8', 'X-My-Custom-Header' : 'Zeke are cool' }; var myHeaders = new Headers(httpHeaders);You can now create another
Headers
object, passing it the firstHeaders
object as its init object:var secondHeadersObj = new Headers(myHeaders); + class="brush: js">var secondHeadersObj = new Headers(myHeaders); secondHeadersObj.get('Content-Type'); // Would return 'image/jpeg' — it inherits it from the first headers objectSpecifications
diff --git a/files/en-us/web/api/headers/keys/index.html b/files/en-us/web/api/headers/keys/index.html index 6e50a9f0d253646..4b61f43ec64fdc3 100644 --- a/files/en-us/web/api/headers/keys/index.html +++ b/files/en-us/web/api/headers/keys/index.html @@ -22,7 +22,7 @@Syntax
-headers.keys();+headers.keys();Return value
diff --git a/files/en-us/web/api/headers/set/index.html b/files/en-us/web/api/headers/set/index.html index 97d9ca0a390aafd..73f7dd74ecb6867 100644 --- a/files/en-us/web/api/headers/set/index.html +++ b/files/en-us/web/api/headers/set/index.html @@ -28,7 +28,7 @@Syntax
myHeaders.set(name, value);+ class="brush: js">myHeaders.set(name, value);Parameters
diff --git a/files/en-us/web/api/headers/values/index.html b/files/en-us/web/api/headers/values/index.html index 09249cfad7dce27..11a84ad8d90bbbf 100644 --- a/files/en-us/web/api/headers/values/index.html +++ b/files/en-us/web/api/headers/values/index.html @@ -22,7 +22,7 @@Syntax
-headers.values();+headers.values();Return value
diff --git a/files/en-us/web/api/history/back/index.html b/files/en-us/web/api/history/back/index.html index 019c922f28f3a41..83bdb395be45735 100644 --- a/files/en-us/web/api/history/back/index.html +++ b/files/en-us/web/api/history/back/index.html @@ -22,7 +22,7 @@Syntax
-history.back()+history.back()Examples
diff --git a/files/en-us/web/api/history/forward/index.html b/files/en-us/web/api/history/forward/index.html index 8ee8490eebd3c32..bfb718dbf5f902e 100644 --- a/files/en-us/web/api/history/forward/index.html +++ b/files/en-us/web/api/history/forward/index.html @@ -20,7 +20,7 @@Syntax
-history.forward()+history.forward()Examples
diff --git a/files/en-us/web/api/history/go/index.html b/files/en-us/web/api/history/go/index.html index f0455dda261af32..88821b0a2f8269b 100644 --- a/files/en-us/web/api/history/go/index.html +++ b/files/en-us/web/api/history/go/index.html @@ -20,7 +20,7 @@Syntax
-history.go([delta])+history.go([delta])Parameters
@@ -38,24 +38,24 @@Examples
To move back one page (the equivalent of calling {{domxref("History.back", "back()")}}):
-history.go(-1)+history.go(-1)To move forward a page, just like calling {{domxref("History.forward", "forward()")}}:
-history.go(1)+history.go(1)To move forward two pages:
-history.go(2);+history.go(2);To move backwards by two pages:
-history.go(-2);+history.go(-2);And, finally either of the following statements will reload the current page:
-history.go(); +history.go(); history.go(0);Specifications
diff --git a/files/en-us/web/api/history/length/index.html b/files/en-us/web/api/history/length/index.html index 7e087b12482381a..1b9e33a077d5b12 100644 --- a/files/en-us/web/api/history/length/index.html +++ b/files/en-us/web/api/history/length/index.html @@ -19,7 +19,7 @@Syntax
-const length = history.length +const length = history.lengthSpecifications
diff --git a/files/en-us/web/api/history/pushstate/index.html b/files/en-us/web/api/history/pushstate/index.html index 66b34e26672b5ac..a0ea69b584f154c 100644 --- a/files/en-us/web/api/history/pushstate/index.html +++ b/files/en-us/web/api/history/pushstate/index.html @@ -23,7 +23,7 @@Syntax
history.pushState(state, title [, url])+ class="brush: js">history.pushState(state, title [, url])Parameters
@@ -86,7 +86,7 @@Examples
JavaScript
-const state = { 'page_id': 1, 'user_id': 5 } +const state = { 'page_id': 1, 'user_id': 5 } const title = '' const url = 'hello-world.html' @@ -95,7 +95,7 @@JavaScript
Change a query parameter
-const url = new URL(window.location); +const url = new URL(window.location); url.searchParams.set('foo', 'bar'); window.history.pushState({}, '', url);diff --git a/files/en-us/web/api/history/replacestate/index.html b/files/en-us/web/api/history/replacestate/index.html index 4eca6c5c3427220..fc165ac0f578bfb 100644 --- a/files/en-us/web/api/history/replacestate/index.html +++ b/files/en-us/web/api/history/replacestate/index.html @@ -20,7 +20,7 @@Syntax
history.replaceState(stateObj, title, [url])+ class="brush: js">history.replaceState(stateObj, title, [url])Parameters
@@ -44,7 +44,7 @@Examples
Suppose https://www.mozilla.org/foo.html executes the following JavaScript:
const stateObj = { foo: 'bar' }; + class="brush: js line-numbers language-js">
const stateObj = { foo: 'bar' }; history.pushState(stateObj, '', 'bar.html');
The explanation of these two lines above can be found in the Examples JavaScript:
+ class="brush: js line-numbers language-js">history.replaceState(stateObj, '', 'bar2.html');
history.replaceState(stateObj, '', 'bar2.html');
This will cause the URL bar to display
https://www.mozilla.org/bar2.html
, but won't cause the browser diff --git a/files/en-us/web/api/history/scrollrestoration/index.html b/files/en-us/web/api/history/scrollrestoration/index.html index e7cc5b061f78175..9b47e9675b0ca0b 100644 --- a/files/en-us/web/api/history/scrollrestoration/index.html +++ b/files/en-us/web/api/history/scrollrestoration/index.html @@ -18,7 +18,7 @@Syntax
const scrollRestore = history.scrollRestoration+ class="brush: js">const scrollRestore = history.scrollRestorationValues
diff --git a/files/en-us/web/api/history/state/index.html b/files/en-us/web/api/history/state/index.html index b0b019a22d088ef..5ebd5ee7060a824 100644 --- a/files/en-us/web/api/history/state/index.html +++ b/files/en-us/web/api/history/state/index.html @@ -18,7 +18,7 @@Syntax
const currentState = history.state+ class="brush: js">const currentState = history.stateValue
diff --git a/files/en-us/web/api/html_drag_and_drop_api/index.html b/files/en-us/web/api/html_drag_and_drop_api/index.html index a5632e512fa826b..c5c266b369ebb13 100644 --- a/files/en-us/web/api/html_drag_and_drop_api/index.html +++ b/files/en-us/web/api/html_drag_and_drop_api/index.html @@ -110,7 +110,7 @@Identify what is draggable
Making an element draggable requires adding the {{htmlattrxref("draggable")}} attribute and the {{domxref("GlobalEventHandlers.ondragstart","ondragstart")}} global event handler, as shown in the following code sample:
-<script> +<script> function dragstart_handler(ev) { // Add the target element's id to the data transfer object ev.dataTransfer.setData("text/plain", ev.target.id); @@ -139,7 +139,7 @@Define the drag's data
Each {{domxref("DragEvent","drag event")}} has a {{domxref("DragEvent.dataTransfer","dataTransfer")}} property that holds the event's data. This property (which is a {{domxref("DataTransfer")}} object) also has methods to manage drag data. The {{domxref("DataTransfer.setData","setData()")}} method is used to add an item to the drag data, as shown in the following example.
-function dragstart_handler(ev) { +function dragstart_handler(ev) { // Add different types of drag data ev.dataTransfer.setData("text/plain", ev.target.innerText); ev.dataTransfer.setData("text/html", ev.target.outerHTML); @@ -156,7 +156,7 @@Define the drag image
By default, the browser supplies an image that appears beside the pointer during a drag operation. However, an application may define a custom image with the {{domxref("DataTransfer.setDragImage","setDragImage()")}} method, as shown in the following example.
-function dragstart_handler(ev) { +function dragstart_handler(ev) { // Create an image and then use it for the drag image. // NOTE: change "example.gif" to a real image URL or the image // will not be created and the default drag image will be used. @@ -188,7 +188,7 @@Define the drag effect
The following example shows how to use this property.
-function dragstart_handler(ev) { +function dragstart_handler(ev) { ev.dataTransfer.dropEffect = "copy"; }@@ -205,7 +205,7 @@Define a drop zone
The following example shows how to use those attributes, and includes basic event handlers for each attribute.
-<script> +<script> function dragover_handler(ev) { ev.preventDefault(); ev.dataTransfer.dropEffect = "move"; @@ -237,7 +237,7 @@Handle the drop effect
The following example shows a drop handler getting the source element's
-id
from the drag data, and then using theid
to move the source element to the drop element:<script> +<script> function dragstart_handler(ev) { // Add the target element's id to the data transfer object ev.dataTransfer.setData("application/my-app", ev.target.id); diff --git a/files/en-us/web/api/htmlaudioelement/audio/index.html b/files/en-us/web/api/htmlaudioelement/audio/index.html index d66389246fb3027..5c99de1de8d7850 100644 --- a/files/en-us/web/api/htmlaudioelement/audio/index.html +++ b/files/en-us/web/api/htmlaudioelement/audio/index.html @@ -22,7 +22,7 @@Syntax
audioObj = new Audio(url);+ class="brush: js">audioObj = new Audio(url);Parameters
diff --git a/files/en-us/web/api/htmlbuttonelement/labels/index.html b/files/en-us/web/api/htmlbuttonelement/labels/index.html index bff6effc2217367..1fde128d83b6dfc 100644 --- a/files/en-us/web/api/htmlbuttonelement/labels/index.html +++ b/files/en-us/web/api/htmlbuttonelement/labels/index.html @@ -15,7 +15,7 @@Syntax
-var labelElements = button.labels; +var labelElements = button.labels;Return value
diff --git a/files/en-us/web/api/htmlformelement/acceptcharset/index.html b/files/en-us/web/api/htmlformelement/acceptcharset/index.html index 16bcb4e4ac7b4f3..fcd92d235ec76ee 100644 --- a/files/en-us/web/api/htmlformelement/acceptcharset/index.html +++ b/files/en-us/web/api/htmlformelement/acceptcharset/index.html @@ -19,7 +19,7 @@Syntax
-var string = form.acceptCharset; +var string = form.acceptCharset; form.acceptCharset = stringdiff --git a/files/en-us/web/api/htmlformelement/action/index.html b/files/en-us/web/api/htmlformelement/action/index.html index c1ef04d0bb94f2f..df2a27612884d01 100644 --- a/files/en-us/web/api/htmlformelement/action/index.html +++ b/files/en-us/web/api/htmlformelement/action/index.html @@ -21,7 +21,7 @@;
Syntax
-var string = form.action; +var string = form.action; form.action = string;diff --git a/files/en-us/web/api/htmlformelement/elements/index.html b/files/en-us/web/api/htmlformelement/elements/index.html index 7746303521f11c2..dd00270ae34f527 100644 --- a/files/en-us/web/api/htmlformelement/elements/index.html +++ b/files/en-us/web/api/htmlformelement/elements/index.html @@ -34,7 +34,7 @@Syntax
-nodeList = HTMLFormElement.elements +nodeList = HTMLFormElement.elementsValue
diff --git a/files/en-us/web/api/htmlformelement/enctype/index.html b/files/en-us/web/api/htmlformelement/enctype/index.html index 5696f2a71db4a19..aeccf4303f2df04 100644 --- a/files/en-us/web/api/htmlformelement/enctype/index.html +++ b/files/en-us/web/api/htmlformelement/enctype/index.html @@ -27,7 +27,7 @@Syntax
-var string = form.enctype; +var string = form.enctype; form.enctype = string;diff --git a/files/en-us/web/api/htmlformelement/index.html b/files/en-us/web/api/htmlformelement/index.html index 99b4f72bf2ef543..97e1eee96fdb768 100644 --- a/files/en-us/web/api/htmlformelement/index.html +++ b/files/en-us/web/api/htmlformelement/index.html @@ -149,7 +149,7 @@Examples
Creating a new form element, modifying its attributes, then submitting it:
-const f = document.createElement("form"); // Create a form +const f = document.createElement("form"); // Create a form document.body.appendChild(f); // Add it to the document body f.action = "/cgi-bin/some.cgi"; // Add action and method attributes f.method = "POST"; @@ -158,7 +158,7 @@Examples
Extract information from a
-<form>
element and set some of its attributes:<form name="formA" action="/cgi-bin/test" method="post"> +<form name="formA" action="/cgi-bin/test" method="post"> <p>Press "Info" for form details, or "Set" to change those details.</p> <p> <button type="button" onclick="getFormInfo();">Info</button> @@ -191,7 +191,7 @@Examples
Submit a
-<form>
into a new window:<!doctype html> +<!doctype html> <html> <head> <meta charset="utf-8"> diff --git a/files/en-us/web/api/htmlformelement/length/index.html b/files/en-us/web/api/htmlformelement/length/index.html index f4b03e432a27242..708c032e8ab28a7 100644 --- a/files/en-us/web/api/htmlformelement/length/index.html +++ b/files/en-us/web/api/htmlformelement/length/index.html @@ -28,7 +28,7 @@Syntax
-numControls = form.length; +numControls = form.length;Value
diff --git a/files/en-us/web/api/htmlformelement/method/index.html b/files/en-us/web/api/htmlformelement/method/index.html index eab705a289dcc50..7f240170f826741 100644 --- a/files/en-us/web/api/htmlformelement/method/index.html +++ b/files/en-us/web/api/htmlformelement/method/index.html @@ -18,7 +18,7 @@Syntax
-var string = form.method; +var string = form.method; form.method = string;diff --git a/files/en-us/web/api/htmlformelement/name/index.html b/files/en-us/web/api/htmlformelement/name/index.html index 2a19d5a6e598dea..8220e21ad856b64 100644 --- a/files/en-us/web/api/htmlformelement/name/index.html +++ b/files/en-us/web/api/htmlformelement/name/index.html @@ -22,7 +22,7 @@Syntax
-var string = form.name; +var string = form.name; form.name = string;Example
diff --git a/files/en-us/web/api/htmlformelement/reportvalidity/index.html b/files/en-us/web/api/htmlformelement/reportvalidity/index.html index 8f58945573c49e1..5b05218b5db9b87 100644 --- a/files/en-us/web/api/htmlformelement/reportvalidity/index.html +++ b/files/en-us/web/api/htmlformelement/reportvalidity/index.html @@ -17,7 +17,7 @@Syntax
-HTMLFormElement.reportValidity() +HTMLFormElement.reportValidity()Return value
diff --git a/files/en-us/web/api/htmlformelement/requestsubmit/index.html b/files/en-us/web/api/htmlformelement/requestsubmit/index.html index 0a49d0a32ecf7ea..2fe616677dc1b6e 100644 --- a/files/en-us/web/api/htmlformelement/requestsubmit/index.html +++ b/files/en-us/web/api/htmlformelement/requestsubmit/index.html @@ -22,7 +22,7 @@Syntax
htmlFormElement.requestSubmit(submitter);+ class="brush: js">htmlFormElement.requestSubmit(submitter);Parameters
diff --git a/files/en-us/web/api/htmlformelement/reset/index.html b/files/en-us/web/api/htmlformelement/reset/index.html index fe2cd1cd0b55ee0..6821cd868fa0d5a 100644 --- a/files/en-us/web/api/htmlformelement/reset/index.html +++ b/files/en-us/web/api/htmlformelement/reset/index.html @@ -22,7 +22,7 @@Syntax
-HTMLFormElement.reset() +HTMLFormElement.reset()Example
diff --git a/files/en-us/web/api/htmlformelement/reset_event/index.html b/files/en-us/web/api/htmlformelement/reset_event/index.html index 94f87890ff06646..b84f9f51dda9e23 100644 --- a/files/en-us/web/api/htmlformelement/reset_event/index.html +++ b/files/en-us/web/api/htmlformelement/reset_event/index.html @@ -40,7 +40,7 @@Examples
HTML
-<form id="form"> +<form id="form"> <label>Test field: <input type="text"></label> <br><br> <button type="reset">Reset form</button> @@ -49,7 +49,7 @@