Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: flaws in web/api/h* batch 1 #3082

Merged
merged 3 commits into from
Mar 16, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions files/en-us/web/api/hashchangeevent/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ <h2 id="Properties">Properties</h2>
<p><em>This interface also inherits the properties of its parent, {{domxref("Event")}}.</em></p>

<dl>
<dt>{{domxref("HashChangeEvent.newURL")}} {{readonlyInline}} {{gecko_minversion_inline("6.0")}}</dt>
<dt>{{domxref("HashChangeEvent.newURL")}} {{readonlyInline}}</dt>
<dd>The new URL to which the window is navigating.</dd>
<dt>{{domxref("HashChangeEvent.oldURL")}} {{readonlyInline}} {{gecko_minversion_inline("6.0")}}</dt>
<dt>{{domxref("HashChangeEvent.oldURL")}} {{readonlyInline}}</dt>
<dd>The previous URL from which the window was navigated.</dd>
</dl>

Expand Down Expand Up @@ -65,7 +65,7 @@ <h3 id="Basic_example">Basic example</h3>

<h2 id="Polyfill">Polyfill</h2>

<p>There are several fallback scripts listed on the <a href="https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-Browser-Polyfills">Modernizr GitHub page</a>. Basically, those scripts check the {{domxref("HTMLHyperlinkElementUtils.hash", "location.hash")}} at a regular interval. Here is a version that allows only one handler to be bound to the {{domxref("WindowEventHandlers.onhashchange", "onhashchange")}} property:</p>
<p>There are several fallback scripts listed on the <a href="https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-Browser-Polyfills">Modernizr GitHub page</a>. Basically, those scripts check the {{domxref("HTMLAnchorElement/hash", "location.hash")}} at a regular interval. Here is a version that allows only one handler to be bound to the {{domxref("WindowEventHandlers.onhashchange", "onhashchange")}} property:</p>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this ought to be going to /en-US/docs/Web/API/Window/location, but I suppose it's not any more broken like this than it was before :).

nschonni marked this conversation as resolved.
Show resolved Hide resolved

<pre class="brush: js">;(function(window) {

Expand Down
16 changes: 8 additions & 8 deletions files/en-us/web/api/headers/append/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
title: Headers.append()
slug: Web/API/Headers/append
tags:
- API
- Append
- Experimental
- Fetch
- Method
- Reference
- API
- Append
- Experimental
- Fetch
- Method
- Reference
---
<div>{{APIRef("Fetch")}}</div>

Expand Down Expand Up @@ -89,8 +89,8 @@ <h2 id="Browser_compatibility">Browser compatibility</h2>
<h2 id="See_also">See also</h2>

<ul>
<li><a href="/en-US/docs/Web/API/ServiceWorker_API">ServiceWorker API</a></li>
<li><a href="/en-US/docs/Web/HTTP/Access_control_CORS">HTTP access control (CORS)</a>
<li><a href="/en-US/docs/Web/API/Service_Worker_API">ServiceWorker API</a></li>
<li><a href="/en-US/docs/Web/HTTP/CORS">HTTP access control (CORS)</a>
</li>
<li><a href="/en-US/docs/Web/HTTP">HTTP</a></li>
</ul>
16 changes: 8 additions & 8 deletions files/en-us/web/api/headers/delete/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
title: Headers.delete()
slug: Web/API/Headers/delete
tags:
- API
- Experimental
- Fetch
- Method
- Reference
- delete
- API
- Experimental
- Fetch
- Method
- Reference
- delete
---
<div>{{APIRef("Fetch")}}</div>

Expand Down Expand Up @@ -83,8 +83,8 @@ <h2 id="Browser_compatibility">Browser compatibility</h2>
<h2 id="See_also">See also</h2>

<ul>
<li><a href="/en-US/docs/Web/API/ServiceWorker_API">ServiceWorker API</a></li>
<li><a href="/en-US/docs/Web/HTTP/Access_control_CORS">HTTP access control (CORS)</a>
<li><a href="/en-US/docs/Web/API/Service_Worker_API">ServiceWorker API</a></li>
<li><a href="/en-US/docs/Web/HTTP/CORS">HTTP access control (CORS)</a>
</li>
<li><a href="/en-US/docs/Web/HTTP">HTTP</a></li>
</ul>
16 changes: 8 additions & 8 deletions files/en-us/web/api/headers/entries/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
title: Headers.entries()
slug: Web/API/Headers/entries
tags:
- API
- Experimental
- Fetch API
- Headers
- Method
- Reference
- API
- Experimental
- Fetch API
- Headers
- Method
- Reference
---
<div>{{APIRef}}</div>

Expand Down Expand Up @@ -54,8 +54,8 @@ <h2 id="Browser_compatibility">Browser compatibility</h2>
<h2 id="See_also">See also</h2>

<ul>
<li><a href="/en-US/docs/Web/API/ServiceWorker_API">ServiceWorker API</a></li>
<li><a href="/en-US/docs/Web/HTTP/Access_control_CORS">HTTP access control (CORS)</a>
<li><a href="/en-US/docs/Web/API/Service_Worker_API">ServiceWorker API</a></li>
<li><a href="/en-US/docs/Web/HTTP/CORS">HTTP access control (CORS)</a>
</li>
<li><a href="/en-US/docs/Web/HTTP">HTTP</a></li>
</ul>
18 changes: 9 additions & 9 deletions files/en-us/web/api/headers/get/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
title: Headers.get()
slug: Web/API/Headers/get
tags:
- API
- Experimental
- Fetch
- Headers
- Method
- Reference
- get
- API
- Experimental
- Fetch
- Headers
- Method
- Reference
- get
---
<div>{{APIRef("Fetch")}}</div>

Expand Down Expand Up @@ -94,8 +94,8 @@ <h2 id="Browser_compatibility">Browser compatibility</h2>
<h2 id="See_also">See also</h2>

<ul>
<li><a href="/en-US/docs/Web/API/ServiceWorker_API">ServiceWorker API</a></li>
<li><a href="/en-US/docs/Web/HTTP/Access_control_CORS">HTTP access control (CORS)</a>
<li><a href="/en-US/docs/Web/API/Service_Worker_API">ServiceWorker API</a></li>
<li><a href="/en-US/docs/Web/HTTP/CORS">HTTP access control (CORS)</a>
</li>
<li><a href="/en-US/docs/Web/HTTP">HTTP</a></li>
</ul>
4 changes: 2 additions & 2 deletions files/en-us/web/api/headers/getall/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ <h2 id="Browser_compatibility">Browser compatibility</h2>
<h2 id="See_also">See also</h2>

<ul>
<li><a href="/en-US/docs/Web/API/ServiceWorker_API">ServiceWorker API</a></li>
<li><a href="/en-US/docs/Web/HTTP/Access_control_CORS">HTTP access control (CORS)</a></li>
<li><a href="/en-US/docs/Web/API/Service_Worker_API">ServiceWorker API</a></li>
<li><a href="/en-US/docs/Web/HTTP/CORS">HTTP access control (CORS)</a></li>
<li><a href="/en-US/docs/Web/HTTP">HTTP</a></li>
</ul>
17 changes: 8 additions & 9 deletions files/en-us/web/api/headers/has/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
title: Headers.has()
slug: Web/API/Headers/has
tags:
- API
- Experimental
- Fetch
- Method
- Reference
- has
- API
- Experimental
- Fetch
- Method
- Reference
- has
---
<div>{{APIRef("Fetch")}}</div>

Expand Down Expand Up @@ -74,8 +74,7 @@ <h2 id="Browser_compatibility">Browser compatibility</h2>
<h2 id="See_also">See also</h2>

<ul>
<li><a href="/en-US/docs/Web/API/ServiceWorker_API">ServiceWorker API</a></li>
<li><a href="/en-US/docs/Web/HTTP/Access_control_CORS">HTTP access control (CORS)</a>
</li>
<li><a href="/en-US/docs/Web/API/Service_Worker_API">ServiceWorker API</a></li>
<li><a href="/en-US/docs/Web/HTTP/CORS">HTTP access control (CORS)</a></li>
<li><a href="/en-US/docs/Web/HTTP">HTTP</a></li>
</ul>
14 changes: 7 additions & 7 deletions files/en-us/web/api/headers/headers/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
title: Headers()
slug: Web/API/Headers/Headers
tags:
- API
- Constructor
- Experimental
- Fetch
- Reference
- API
- Constructor
- Experimental
- Fetch
- Reference
---
<div>{{APIRef("Fetch")}}</div>

Expand Down Expand Up @@ -79,8 +79,8 @@ <h2 id="Browser_compatibility">Browser compatibility</h2>
<h2 id="See_also">See also</h2>

<ul>
<li><a href="/en-US/docs/Web/API/ServiceWorker_API">ServiceWorker API</a></li>
<li><a href="/en-US/docs/Web/HTTP/Access_control_CORS">HTTP access control (CORS)</a>
<li><a href="/en-US/docs/Web/API/Service_Worker_API">ServiceWorker API</a></li>
<li><a href="/en-US/docs/Web/HTTP/CORS">HTTP access control (CORS)</a>
</li>
<li><a href="/en-US/docs/Web/HTTP">HTTP</a></li>
</ul>
4 changes: 2 additions & 2 deletions files/en-us/web/api/headers/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ <h2 id="Browser_compatibility">Browser compatibility</h2>
<h2 id="See_also">See also</h2>

<ul>
<li><a href="/en-US/docs/Web/API/ServiceWorker_API">ServiceWorker API</a></li>
<li><a href="/en-US/docs/Web/HTTP/Access_control_CORS">HTTP access control (CORS)</a></li>
<li><a href="/en-US/docs/Web/API/Service_Worker_API">ServiceWorker API</a></li>
<li><a href="/en-US/docs/Web/HTTP/CORS">HTTP access control (CORS)</a></li>
<li><a href="/en-US/docs/Web/HTTP">HTTP</a></li>
</ul>
16 changes: 8 additions & 8 deletions files/en-us/web/api/headers/keys/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
title: Headers.keys()
slug: Web/API/Headers/keys
tags:
- API
- Experimental
- Fetch API
- Headers
- Method
- Reference
- API
- Experimental
- Fetch API
- Headers
- Method
- Reference
---
<div>{{APIRef}}</div>

Expand Down Expand Up @@ -53,8 +53,8 @@ <h2 id="Browser_compatibility">Browser compatibility</h2>
<h2 id="See_also">See also</h2>

<ul>
<li><a href="/en-US/docs/Web/API/ServiceWorker_API">ServiceWorker API</a></li>
<li><a href="/en-US/docs/Web/HTTP/Access_control_CORS">HTTP access control (CORS)</a>
<li><a href="/en-US/docs/Web/API/Service_Worker_API">ServiceWorker API</a></li>
<li><a href="/en-US/docs/Web/HTTP/CORS">HTTP access control (CORS)</a>
</li>
<li><a href="/en-US/docs/Web/HTTP">HTTP</a></li>
</ul>
16 changes: 8 additions & 8 deletions files/en-us/web/api/headers/set/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
title: Headers.set()
slug: Web/API/Headers/set
tags:
- API
- Experimental
- Fetch
- Method
- Reference
- set
- API
- Experimental
- Fetch
- Method
- Reference
- set
---
<div>{{APIRef("Fetch")}}</div>

Expand Down Expand Up @@ -93,8 +93,8 @@ <h2 id="Browser_compatibility">Browser compatibility</h2>
<h2 id="See_also">See also</h2>

<ul>
<li><a href="/en-US/docs/Web/API/ServiceWorker_API">ServiceWorker API</a></li>
<li><a href="/en-US/docs/Web/HTTP/Access_control_CORS">HTTP access control (CORS)</a>
<li><a href="/en-US/docs/Web/API/Service_Worker_API">ServiceWorker API</a></li>
<li><a href="/en-US/docs/Web/HTTP/CORS">HTTP access control (CORS)</a>
</li>
<li><a href="/en-US/docs/Web/HTTP">HTTP</a></li>
</ul>
16 changes: 8 additions & 8 deletions files/en-us/web/api/headers/values/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
title: Headers.values()
slug: Web/API/Headers/values
tags:
- API
- Experimental
- Fetch API
- Headers
- Method
- Reference
- API
- Experimental
- Fetch API
- Headers
- Method
- Reference
---
<div>{{APIRef}}</div>

Expand Down Expand Up @@ -53,8 +53,8 @@ <h2 id="Browser_compatibility">Browser compatibility</h2>
<h2 id="See_also">See also</h2>

<ul>
<li><a href="/en-US/docs/Web/API/ServiceWorker_API">ServiceWorker API</a></li>
<li><a href="/en-US/docs/Web/HTTP/Access_control_CORS">HTTP access control (CORS)</a>
<li><a href="/en-US/docs/Web/API/Service_Worker_API">ServiceWorker API</a></li>
<li><a href="/en-US/docs/Web/HTTP/CORS">HTTP access control (CORS)</a>
</li>
<li><a href="/en-US/docs/Web/HTTP">HTTP</a></li>
</ul>
20 changes: 10 additions & 10 deletions files/en-us/web/api/history/replacestate/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
title: History.replaceState()
slug: Web/API/History/replaceState
tags:
- API
- HTML DOM
- History
- History API
- Method
- Reference
- API
- HTML DOM
- History
- History API
- Method
- Reference
---
<div>{{APIRef("History API")}}</div>

Expand Down Expand Up @@ -44,19 +44,19 @@ <h2 id="Examples">Examples</h2>
<p>Suppose https://www.mozilla.org/foo.html executes the following JavaScript:</p>

<pre
class="brush: js line-numbers language-js"><code class="language-js"><span class="keyword token">const </span>stateObj <span class="operator token">=</span> <span class="punctuation token">{</span> foo<span class="punctuation token">:</span> '<span class="string token">bar'</span> <span class="punctuation token">}</span><span class="punctuation token">;</span>
history<span class="punctuation token">.</span><span class="function token">pushState</span><span class="punctuation token">(</span>stateObj<span class="punctuation token">,</span> <span class="string token">''</span><span class="punctuation token">,</span> '<span class="string token">bar.html'</span><span class="punctuation token">)</span><span class="punctuation token">;</span></code></pre>
class="brush: js line-numbers language-js">const stateObj = { foo: 'bar' };
history.pushState(stateObj, '', 'bar.html');</pre>

<p>The explanation of these two lines above can be found in the <a
href="/en-US/docs/Web/API/History_API/Working_with_the_History_API#Example_of_pushState_method">Example
href="/en-US/docs/Web/API/History_API/Working_with_the_History_API#example_of_pushstate_method">Example
of <code>pushState()</code> method</a> section of the <a
href="/en-US/docs/Web/API/History_API/Working_with_the_History_API">Working with the
History API</a> article. Then suppose
<code>https://www.mozilla.org/bar.html</code> executes the following
JavaScript:</p>

<pre
class="brush: js line-numbers language-js"><code class="language-js">history<span class="punctuation token">.</span><span class="function token">replaceState</span><span class="punctuation token">(</span>stateObj<span class="punctuation token">,</span> <span class="string token">''</span><span class="punctuation token">,</span> '<span class="string token">bar2.html'</span><span class="punctuation token">)</span><span class="punctuation token">;</span></code></pre>
class="brush: js line-numbers language-js">history.replaceState(stateObj, '', 'bar2.html');</pre>

<p>This will cause the URL bar to display
<code>https://www.mozilla.org/bar2.html</code>, but won't cause the browser
Expand Down
4 changes: 2 additions & 2 deletions files/en-us/web/api/history_api/example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
---
<p>This is an example of an AJAX website composed only of three pages (<em>first_page.php</em>, <em>second_page.php</em> and <em>third_page.php</em>). To see how it works, please create the following files (or git clone <a href="https://github.com/giabao/mdn-ajax-nav-example">https://github.com/giabao/mdn-ajax-nav-example.git</a> ):</p>

<div class="note" id="const_compatibility"><strong>Note:</strong> For fully integrating the {{HTMLElement("form")}} elements within this <em>mechanism</em>, please take a look at the paragraph <a href="/en-US/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest#Submitting_forms_and_uploading_files">Submitting forms and uploading files</a>.</div>
<div class="note" id="const_compatibility"><strong>Note:</strong> For fully integrating the {{HTMLElement("form")}} elements within this <em>mechanism</em>, please take a look at the paragraph <a href="/en-US/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest#submitting_forms_and_uploading_files">Submitting forms and uploading files</a>.</div>

<p><strong>first_page.php</strong>:</p>

Expand Down Expand Up @@ -408,5 +408,5 @@ <h2 id="See_also">See also</h2>

<ul>
<li>{{ domxref("window.history") }}</li>
<li>{{ domxref("window.onpopstate") }}</li>
<li>{{ domxref("WindowEventHandlers.onpopstate") }}</li>
</ul>
2 changes: 1 addition & 1 deletion files/en-us/web/api/history_api/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ <h3 id="References">References</h3>

<ul>
<li>{{ domxref("window.history") }}</li>
<li>{{ domxref("window.onpopstate") }}</li>
<li>{{ domxref("WindowEventHandlers.onpopstate") }}</li>
</ul>

<h3 id="Guides">Guides</h3>
Expand Down
Loading