-
Notifications
You must be signed in to change notification settings - Fork 22.5k
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
Fixes to subnav #3165
Fixes to subnav #3165
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
<p>{{SubpagesWithSummaries}}</p> | ||
|
||
<div class="hidden"> | ||
<p>Please claim the role you want to work on by adding your name after the role's name: (old pages are linked from <a href="/en-US/docs/">https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques</a>). Ones for which the first draft is completed have been removed from the below list.</p> | ||
<p>Please claim the role you want to work on by adding your name after the role's name: (old pages are linked from <a href="/en-US/docs/Web">https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques</a>). Ones for which the first draft is completed have been removed from the below list.</p> | ||
|
||
<ul> | ||
<li><a href="/en-US/docs/Web/Accessibility/ARIA/Roles/Alertdialog_Role">alertdialog</a></li> | ||
|
@@ -77,7 +77,7 @@ | |
</div> | ||
|
||
|
||
<h6 id="Subnav">Subnav</h6> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed heading, not used. |
||
|
||
|
||
<section id="Quick_links"> | ||
<ol> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ <h2 id="DOM_event_handler_List">Registering event listeners</h2> | |
|
||
<p>There are 3 ways to register event handlers for a DOM element.</p> | ||
|
||
<h3 id="EventTarget.addEventListener">{{domxref("EventTarget.addEventListener")}}</h3> | ||
<h3 id="EventTarget.addEventListener">EventTarget.addEventListener</h3> | ||
|
||
<pre class="brush: js">// Assuming myButton is a button element | ||
myButton.addEventListener('click', greet, false) | ||
|
@@ -34,22 +34,27 @@ <h3 id="EventTarget.addEventListener">{{domxref("EventTarget.addEventListener")} | |
<p>This is the method you should use in modern web pages.</p> | ||
|
||
<div class="notecard note"> | ||
<p><strong>Note:</strong> Internet Explorer 6–8 didn't support this method, offering a similar {{domxref("EventTarget.addEventListener")}} API instead. For cross-browser compatibility, use one of the many JavaScript libraries available.</p> | ||
<h4>Note</h4> | ||
<p>Internet Explorer 6–8 didn't support this method, offering a similar {{domxref("EventTarget.addEventListener")}} API instead. For cross-browser compatibility, use one of the many JavaScript libraries available.</p> | ||
</div> | ||
|
||
<p>More details can be found on the {{domxref("EventTarget.addEventListener")}} reference page.</p> | ||
|
||
<h3 id="HTML_attribute"><a href="/en-US/docs/Learn/JavaScript/Building_blocks/Events#inline_event_handlers_—_don't_use_these">HTML attribute</a></h3> | ||
<h3 id="HTML_attribute">HTML attribute</h3> | ||
|
||
<pre class="brush: html"><button onclick="alert('Hello world!')"> | ||
</pre> | ||
|
||
<p>The JavaScript code in the attribute is passed the Event object via the <code>event</code> parameter. <a href="http://dev.w3.org/html5/spec/webappapis.html#the-event-handler-processing-algorithm">The return value is treated in a special way, described in the HTML specification</a>.</p> | ||
|
||
<div class="notecard warning"> | ||
<p><strong>Warning:</strong> This method should be avoided! It inflates the markup, and makes it less readable. Concerns of content/structure and behavior are not well-separated, making a bug harder to find.</p> | ||
<h4>Warning</h4> | ||
<p>This method should be avoided! It inflates the markup, and makes it less readable. Concerns of content/structure and behavior are not well-separated, making a bug harder to find.</p> | ||
<p>For more information see <a href="/en-US/docs/Learn/JavaScript/Building_blocks/Events#inline_event_handlers_—_don't_use_these">Inline event handlers</a>.</p> | ||
</div> | ||
|
||
|
||
|
||
<h3 id="DOM_element_properties">DOM element properties</h3> | ||
|
||
<pre class="brush: js">// Assuming myButton is a button element | ||
|
@@ -75,11 +80,3 @@ <h2 id="Accessing_Event_interfaces">Accessing Event interfaces</h2> | |
// any function should have an appropriate name, that's what called semantic | ||
table_el.onclick = print | ||
</pre> | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FYI only relevant change in this is to remove this subnav section. The page already has a sidebar macro so this was just ignored. |
||
<h2 id="Subnav">Subnav</h2> | ||
|
||
<ul> | ||
<li><a href="/en-US/docs/Web/API/Document_Object_Model">DOM Reference</a></li> | ||
<li><a href="/en-US/docs/Web/API/Document_Object_Model/Introduction">Introduction to the DOM</a></li> | ||
<li><a href="/en-US/docs/Web/API/Document_Object_Model/Examples">Examples</a></li> | ||
</ul> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
- DOM | ||
- DOM Reference | ||
--- | ||
<div>{{DefaultAPISidebar("DOM")}}</div> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added standard DOM sidebar and removed the subnav section below. |
||
<p>This chapter provides some longer examples of web and XML development using the DOM. Wherever possible, the examples use common APIs, tricks, and patterns in JavaScript for manipulating the document object.</p> | ||
|
||
<h2 id="Example_1_height_and_width">Example 1: height and width</h2> | ||
|
@@ -365,11 +366,3 @@ <h3 id="Notes">Notes</h3> | |
<li>There are a number of other convenience methods belonging to the <a href="/en-US/docs/Web/API/HTMLTableElement#methods">table interface</a> that can be used for creating and modifying tables.</li> | ||
</ul> | ||
|
||
<h2 id="Subnav">Subnav</h2> | ||
|
||
<ul> | ||
<li><a href="/en-US/docs/Web/API/Document_Object_Model">DOM Reference</a></li> | ||
<li><a href="/en-US/docs/Web/API/Document_Object_Model/Introduction">Introduction to the DOM</a></li> | ||
<li><a href="/en-US/docs/Web/API/Document_Object_Model/Events">Events and the DOM</a></li> | ||
<li><a href="/en-US/docs/Web/API/Document_Object_Model/Examples">Examples</a></li> | ||
</ul> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ | |
- Introduction | ||
- Tutorial | ||
--- | ||
<div>{{DefaultAPISidebar("DOM")}}</div> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FYI Added standard DOM sidebar and removed the subnav section below. The sidebar macro was in page, but at bottom. |
||
<p><span class="seoSummary">The <strong>Document Object Model</strong> (<strong>DOM</strong>) is the data representation of the objects that comprise the structure and content of a document on the web. In this guide, we'll briefly introduce the DOM.</span> We'll look at how the DOM represents an {{Glossary("HTML")}} or {{Glossary("XML")}} document in memory and how you use APIs to create web content and applications.</p> | ||
|
||
<h2 id="What_is_the_DOM">What is the DOM?</h2> | ||
|
@@ -239,14 +240,3 @@ <h2 id="Testing_the_DOM_API">Testing the DOM API</h2> | |
<img src="dom_ref_introduction_to_the_dom.gif"></figure> | ||
|
||
<p>In this example, the drop-down menus dynamically update such DOM—accessible aspects of the web page as its background color (<code>bgColor</code>), the color of the hyperlinks (<code>aLink</code>), and color of the text (<code>text</code>). However, you design your test pages, testing the interfaces as you read about them is an important part of learning how to use the DOM effectively.</p> | ||
|
||
<h2 id="Subnav">Subnav</h2> | ||
|
||
<ul> | ||
<li><a href="/en-US/docs/Web/API/Document_Object_Model">DOM Reference</a></li> | ||
<li><a href="/en-US/docs/Web/API/Document_Object_Model/Introduction">Introduction to the DOM</a></li> | ||
<li><a href="/en-US/docs/Web/API/Document_Object_Model/Events">Events and the DOM</a></li> | ||
<li><a href="/en-US/docs/Web/API/Document_Object_Model/Examples">Examples</a></li> | ||
</ul> | ||
|
||
<div>{{DefaultAPISidebar("DOM")}}</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI removed layout crap in old doc. Also turned the "subnav" into quicklinks, removing the link back to this doc.