Search completed in 1.20 seconds.
<title>: The Document Title element - HTML: Hypertext Markup Language
The HTML
Title element (<
title>) defines the document's
title that is shown in a browser's
title bar or a page's tab. It only contains text; tags within the element are ignored. <
title>Grandma's Heavy Metal Festival Journal</
title> Content categories Metadata content. Permitted content Text that is not inter-element whitespace. Tag omission Both opening and closing tags are required. Note that leaving off </
title> should cause the browser to ignore the rest of the page. Permitted parents A <head> element that contains no other <
title> element. Implicit ARIA role No corresponding role Permitted ARIA roles No role permitted. ...
...-element whitespace. Tag omission Both opening and closing tags are required. Note that leaving off </
title> should cause the browser to ignore the rest of the page. Permitted parents A <head> element that contains no other <
title> element. Implicit ARIA role No corresponding role Permitted ARIA roles No role permitted. DOM interface HTML
TitleElement Attributes This element only includes the global attributes. Usage notes The <
title> element is always used within a page's <head> block. Page
titles and SEO The contents of a page
title can have significant implications for search engine optimization (SEO). In general, a longer, descriptive
title performs better than short or generic
titles. The content of the
title is one of ...
... used within a page's <head> block. Page
titles and SEO The contents of a page
title can have significant implications for search engine optimization (SEO). In general, a longer, descriptive
title performs better than short or generic
titles. The content of the
title is one of the components used by search engine algorithms to decide the order in which to list pages in search results. Also, the
title is the initial "hook" by which you grab the attention of readers glancing at the search results page. A few guidelines and tips for composing good
titles: Avoid one- or two-word
titles. Use a descriptive phrase, or a term-definition pairing for glossary or reference-style pages. Search engines typically display about the first 55-60 characters of a page
title. Text beyond that may be lost, s...
...And 6 more matches
Adding captions and subtitles to HTML5 video - Developer guides
In other articles we looked at how to build a cross browser video player using the HTMLMediaElement and Window.fullScreen APIs, and also at how to style the player. This article will take the same player and show how to add captions and sub
titles to it, using the WebVTT format and the <track> element. Captioned video example In this article, we will refer to the Video player with captions example. This example uses an excerpt from the Sintel open movie, created by the Blender Foundation. ...
...h captions example. This example uses an excerpt from the Sintel open movie, created by the Blender Foundation. Note: You can find the source on Github, and also view the example live. HTML5 and Video Captions Before diving into how to add captions to the video player, there are a number of things that we will first mention, which you should be aware of before we start. Captions versus sub
titles Captions and sub
titles are not the same thing: they have significantly different audiences, and convey different information, and it is recommended that you read up on the differences if you are not sure what they are. They are however implemented in the same way technically, so the material in this article will apply to both. For this article we will refer to the text tracks displayed as subt...
...what they are. They are however implemented in the same way technically, so the material in this article will apply to both. For this article we will refer to the text tracks displayed as sub
titles, as their content is aimed at hearing people who have difficulty understanding the language of the film, rather than deaf or hard-of-hearing people. The <track> element HTML5 allows us to specify sub
titles for a video using the <track> element. ...
...And 38 more matches
title - HTML: Hypertext Markup Language
Each U+000A LINE FEED (LF) character represents a line break. ...
...'d like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...b.com/mdn/interactive-examples and send us a pull request. Some typical uses: Labeling <iframe> elements for assistive technology Providing a programmatically associated label for an <input> element as a fallback for a real <label> Labeling controls in data tables Additional semantics are attached to the
title attributes of the <link>, <abbr>, <input>, and <menuitem> elements. Multiline
titles The
title attribute may contain several lines. ...
...And 9 more matches
Correctly Using Titles With External Stylesheets - Archive of obsolete content
External stylesheets are often associated with HTML documents using the <link rel="stylesheeet"> element, but it is important to use the element's
title attribute properly. This is because the
title attribute on a <link rel="stylesheeet"> element makes it either preferred or an alternative style sheet. This can lead to a stylesheet being ignored, which is typically not what an author intends to do. Why
Titles Matter The
title attribute affects how your external stylesheet is applied to a document. ...
... There are three kinds of stylesheets that are possible: persistent, preferred, and alternate stylesheets. ...
...nt makes it either preferred or an alternative style sheet. This can lead to a stylesheet being ignored, which is typically not what an author intends to do. Why
Titles Matter The
title attribute affects how your external stylesheet is applied to a document. In fact, the use of the
title attribute is so significant that HTML 4.01 categorizes stylesheets according to the presence or absence of a
title. By including a
title attribute, you can control whether a particular stylesheet always affects a document, or if it is only used under certain circumstances. There are three kinds of stylesheets that are possible: persistent, preferred, and alternate stylesheets. Authors will be most familiar with persistent stylesheets, of which any number may be applied to a document at once. A persistent st...
...And 4 more matches
<title> — the SVG accessible name element - SVG: Scalable Vector Graphics
The <
title> element provides an accessible, short-text description of any SVG container element or graphics element. Text in a <
title> element is not rendered as part of the graphic, but browsers usually display it as a tooltip. If an element can be described by visible text, it is recommended to reference that text with an aria-labelledby attribute rather than using the <
title> element. Note: For backward compatibility with SVG 1.1, <
title> elements should be the first child element of their parent. ...
...ent can be described by visible text, it is recommended to reference that text with an aria-labelledby attribute rather than using the <
title> element. Note: For backward compatibility with SVG 1.1, <
title> elements should be the first child element of their parent. ...
... by visible text, it is recommended to reference that text with an aria-labelledby attribute rather than using the <
title> element. Note: For backward compatibility with SVG 1.1, <
title> elements should be the first child element of their parent. ...
...And 4 more matches
titlebar - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes | Properties | Methods | Related ] Boxes created with the
titlebar element behave just like a normal window
titlebar: when the element is clicked and dragged, the window moves with it. This element can't be used to change the platform-native
titlebar of normal windows; instead, it's used to create custom
titlebars for chromeless windows. If the
titlebar is in a panel element, dragging it will move the panel. Elements inside the
titlebar usually don't receive any mouse events, so e.g. buttons inside it can't be clicked and textboxes can't be focused with the mouse. ...
...indows; instead, it's used to create custom
titlebars for chromeless windows. If the
titlebar is in a panel element, dragging it will move the panel. Elements inside the
titlebar usually don't receive any mouse events, so e.g. buttons inside it can't be clicked and textboxes can't be focused with the mouse. If you don't want this behavior, you can override it by setting allowevents="true" on the
titlebar element. The
titlebar will send a command event after the move is complete. Examples This XUL file will create a HUD-style window that can be moved with the mouse. It will close if the mouse button is released. ...
... clicked and textboxes can't be focused with the mouse. If you don't want this behavior, you can override it by setting allowevents="true" on the
titlebar element. The
titlebar will send a command event after the move is complete. Examples This XUL file will create a HUD-style window that can be moved with the mouse. It will close if the mouse button is released. ...
...And 3 more matches
title - Archive of obsolete content
It is used to specify the
title of a <channel>, an <image>, an <item>, or a <textinput>. The RSS
title element contain onlyplain text data. NOTE: in Userland's RSS 0.91 there is a 100 character maximum limit. ...
...cify the
title of a <channel>, an <image>, an <item>, or a <textinput>. The RSS
title element contain onlyplain text data. NOTE: in Userland's RSS 0.91 there is a 100 character maximum limit. ...
... a <channel>, an <image>, an <item>, or a <textinput>. The RSS
title element contain onlyplain text data. NOTE: in Userland's RSS 0.91 there is a 100 character maximum limit. ...
...And 2 more matches
HTMLTitleElement - Web APIs
This element inherits all of the properties and methods of the HTMLElement interface. ...
...aco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">HTMLElement</text></a><polyline points="491,25 501,20 501,30 491,25" stroke="#D4DDE4" fill="none"/><line x1="501" y1="25" x2="509" y2="25" stroke="#D4DDE4"/><line x1="509" y1="25" x2="509" y2="90" stroke="#D4DDE4"/><line x1="509" y1="90" x2="492" y2="90" stroke="#D4DDE4"/><a xlink:href="/docs/Web/API/HTML
TitleElement" target="_top"><rect x="331" y="65" width="160" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="411" y="94" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">HTML
TitleElement</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Properties Inherits p...
...th="160" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="411" y="94" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">HTML
TitleElement</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Properties Inherits properties from its parent, HTMLElement. HTML
TitleElement.text Is a DOMString representing the text of the document's
title. Methods No specific method; inherits methods from its parent, HTMLElement. ...
...And 2 more matches
mozbrowsertitlechange
Non-standard This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future. The mozbrowser
titlechange event is fired when the
title of a browser <iframe> (i.e. the contents of the <
title> element) changes. General info Specification Non standard Interface CustomEvent Bubbles Yes Cancelable Yes Target <iframe> Default Action None Properties Property Type Description target Read only EventTarget The browser iframe type Read only DOMString The type of event. bubbles Read only Boolean Whether the...
...e Properties Property Type Description target Read only EventTarget The browser iframe type Read only DOMString The type of event. bubbles Read only Boolean Whether the event normally bubbles or not. cancelable Read only Boolean Whether the event is cancellable or not. ...
... type Read only DOMString The type of event. bubbles Read only Boolean Whether the event normally bubbles or not. cancelable Read only Boolean Whether the event is cancellable or not. detail Read only String The
title of the document. ...
... event. bubbles Read only Boolean Whether the event normally bubbles or not. cancelable Read only Boolean Whether the event is cancellable or not. detail Read only String The
title of the document. ...
Document.title - Web APIs
The document.
title property gets or sets the current
title of the document. Syntax var doc
Title = document.
title; doc
Title is a string containing the document's
title. If the
title was overridden by setting document.
title, it contains that value. Otherwise, it contains the
title specified in the markup (see the Notes below). document.
title = new
Title; new
Title is the new
title of the document. The assignment affects the return value of document.
title, the
title displayed for the document (e.g. in the
titlebar of the window or tab), and it also affects the DOM of the document (e.g. the content of the <
title> element in an HTML document). ...
...n the markup (see the Notes below). document.
title = new
Title; new
Title is the new
title of the document. The assignment affects the return value of document.
title, the
title displayed for the document (e.g. in the
titlebar of the window or tab), and it also affects the DOM of the document (e.g. the content of the <
title> element in an HTML document). Example <!DOCTYPE html> <html> <head> <
title>Hello World!</
title> </head> <body> <script> alert(document.
title); // displays "Hello World!" document.
title = "Goodbye World!"; alert(document.
title); // displays "Goodbye World!" </script> </body> </html> Notes This property applies to HTML, SVG, XUL, and other documents in Gecko. ...
...ple <!DOCTYPE html> <html> <head> <
title>Hello World!</
title> </head> <body> <script> alert(document.
title); // displays "Hello World!" document.
title = "Goodbye World!"; alert(document.
title); // displays "Goodbye World!" </script> </body> </html> Notes This property applies to HTML, SVG, XUL, and other documents in Gecko. For HTML documents the initial value of document.
title is the text content of the <
title> element. For XUL it's the value of the
title attribute of the <xul:window> or other top-level XUL element. In XUL, accessing document.
title before the document is fully loaded has undefined behavior: document.
title may return an empty string and setting document.
title may have no effect. Specifications Specification Status Comment HTML...
... For XUL it's the value of the
title attribute of the <xul:window> or other top-level XUL element. In XUL, accessing document.
title before the document is fully loaded has undefined behavior: document.
title may return an empty string and setting document.
title may have no effect. Specifications Specification Status Comment HTML Living StandardThe definition of 'document.
title' in that specification. Living Standard ...
titlebar - Archive of obsolete content
The noautohide attribute must be set to true. ...
...The noautohide attribute must be set to true. ...
...The noautohide attribute must be set to true. ...
SVGTitleElement - Web APIs
The SVG
TitleElement interface corresponds to the <
title> element. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 23.333333333333332%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 140" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25 121,20 121,30 111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2=...
...onaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">SVGElement</text></a><polyline points="481,25 491,20 491,30 481,25" stroke="#D4DDE4" fill="none"/><line x1="491" y1="25" x2="499" y2="25" stroke="#D4DDE4"/><line x1="499" y1="25" x2="499" y2="90" stroke="#D4DDE4"/><line x1="499" y1="90" x2="482" y2="90" stroke="#D4DDE4"/><a xlink:href="/docs/Web/API/SVG
TitleElement" target="_top"><rect x="331" y="65" width="150" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text x="406" y="94" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">SVG
TitleElement</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Properties This interf...
...: all;} Properties This interface doesn't implement any specific properties, but inherits properties from its parent interface, SVGElement. Methods This interface doesn't implement any specific methods, but inherits methods from its parent interface, SVGElement. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 2The definition of 'SVG
TitleElement' in that specification. Candidate Recommendation Removed inheritance from SVGLangSpace and SVGStylable. Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'SVG
TitleElement' in that specification. Recommendation Initial definition ...
toolbarbutton.title - Archive of obsolete content
<< XUL Reference home
title Type: string This functionality only applies when toolbarbutton is used in the Customize Toolbar dialog. The text that is displayed as a button's label when it's in the Customize Toolbar palette. It overrides the value of label, which is used if
title is not set. This does not affect the button's label when it is in a toolbar, which remains determined by the label attribute. ...
...
title Type: string This functionality only applies when toolbarbutton is used in the Customize Toolbar dialog. The text that is displayed as a button's label when it's in the Customize Toolbar palette. It overrides the value of label, which is used if
title is not set. This does not affect the button's label when it is in a toolbar, which remains determined by the label attribute. ...
-moz-windows-accent-color-in-titlebar - Archive of obsolete content
Note: Since Firefox 58, this media feature is no longer available to web content -- it is only available internally (e.g. to XUL / chrome code). See bug 1396066 for more details. The -moz-windows-accent-color-in-
titlebar Gecko-only CSS media feature can be used to apply styles based on whether accent colors are enabled in Microsoft Windows
titlebars. Syntax <integer> In recent Windows versions (e.g., 10), if accent colors are enabled in window
titlebars, this is 1. Otherwise it's 0. ...
...ows-accent-color-in-
titlebar Gecko-only CSS media feature can be used to apply styles based on whether accent colors are enabled in Microsoft Windows
titlebars. Syntax <integer> In recent Windows versions (e.g., 10), if accent colors are enabled in window
titlebars, this is 1. Otherwise it's 0. ...
HTMLElement.title - Web APIs
The HTMLElement.
title property represents the
title of the element: the text usually displayed in a 'tooltip' popup when the mouse is over the node. Syntax var str = element.
title; element.
title = str; Example const link = document.createElement('a'); link.innerText = 'grapes'; link.href = 'https://en.wikipedia.org/wiki/Grape'; link.
title = 'Wikipedia page on grapes'; Specifications Specification Status Comment HTML Living StandardThe definition of '
title' in that specification. Living Standard No change from Document Object Model (DOM) Level 2 HTML Specification. Document Object Model (DOM) Level 2 HTML SpecificationThe definition of '
title' in that specification. Obsolete No change from Document Object Model (DOM) Level 1 Specification...
... Obsolete Initial definition. ...
MediaMetadata.title - Web APIs
The
title property of the MediaMetaData interface returns or sets the
title of the media to be played. Syntax var
title = mediaMetaData.
title mediaMetaData.
title =
title Value A String containing the
title of the media. Specifications Specification Status Comment Media Session StandardThe definition of '
title' in that specification. Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...efinition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
xlink:title - SVG: Scalable Vector Graphics
The xlink:
title attribute is used to describe the meaning of a link or resource in a human-readable fashion. The use of this information is highly dependent on the type of processing being done. It may be used, for example, to make
titles available to applications used by visually impaired users, or to create a table of links, or to present help text that appears when a user lets a mouse pointer hover over a starting resource. Note: New content should use a <
title> child element rather than a xlink:
title attribute. These elements are using this attribute: <a>, <altGlyph>, <animate>, <animateColor>, <animateMotion>, <animateTransform>, <color-profile>, <cursor>, <feImage>, <filter>, <font-face-uri>, <glyphRef>, <image>, <linearGradient>, <mpath>, <pattern>, <radialGradient>, <script>, <se...
... Specifications Specification Status Comment Scalable Vector Graphics (SVG) 2The definition of 'seed' in that specification. Candidate Recommendation Deprecated the attribute and made it only apply to <a>, <image>, <linearGradient>, <pattern>, <radialGradient>, <script>, <textPath>, and <use> Scalab...
activetitlebarcolor - Archive of obsolete content
<< XUL Reference home active
titlebarcolor Type: color string Specify background color of the window's
titlebar when it is active (foreground). Moreover this hides separator between
titlebar and window contents. This only affects Mac OS X. ...
drawintitlebar - Archive of obsolete content
<< XUL Reference home drawin
titlebar Type: boolean If this attribute is true, the top of the window's content area will begin at the top edge of the
title bar, instead of below the
title bar. This allows the window to draw in the
title bar. This is supported only from window elements, and is ignored on platforms that don't support drawing into the
title bar. ...
inactivetitlebarcolor - Archive of obsolete content
<< XUL Reference home inactive
titlebarcolor Type: color string Specify background color of the window's
titlebar when it is inactive (background). Moreover this hides separator between
titlebar and window contents. This affects only on Mac OS X. ...
mail.tabs.drawInTitlebar
Starting in Thunderbird 17.0, the tabs are drawn in the
title bar. The old behavior can be restored by setting the preference mail.tabs.drawIn
Titlebar to false. Type:boolean Default value: true Exists by default: yes Application support:Thunderbird 17.0 Status: Active; last updated 2012-09-17 Introduction: Pushed to Daily on 2012-08-08 Bugs: bug 771816 Values true (default) The tabs are drawn in the
title bar of the mail program. false The tabs are drawn in a separate tab bar, and the
title bar shows the
title of the current tab (e.g. the subject of the currently selected mail). ...
Notification.title - Web APIs
Note: This feature is available in Web Workers. The
title read-only property of the Notification interface indicates the
title of the notification, as specified in the
title parameter of the Notification() constructor. Syntax var
title = Notification.
title; Value A DOMString. Examples function spawnNotification(theBody,theIcon,the
Title) { var options = { body: theBody, icon: theIcon } var n = new Notification(the
Title,options); console.log(n.
title) } Specifications Specification Status Comment Notifications APIThe definition of '
title' in that specification. Living Standard Living standard ...
StyleSheet.title - Web APIs
The
title property of the StyleSheet interface returns the advisory
title of the current style sheet. The
title is often specified in the ownerNode. Specifications Specification Status Comment CSS Object Model (CSSOM)The definition of 'StyleSheet:
title' in that specification. Working Draft ...
nsIPromptService
n on out parameters and JavaScript refer to Working with out parameters. Implemented by: @mozilla.org/embedcomp/prompt-service;1. ...
...lla.org/embedcomp/prompt-service;1. ...
... .getService(Components.interfaces.nsIPromptService); Method overview void alert(in nsIDOMWindow aParent, in wstring aDialog
Title, in wstring aText); void alertCheck(in nsIDOMWindow aParent, in wstring aDialog
Title, in wstring aText, in wstring aCheckMsg, inout boolean aCheckState); boolean confirm(in nsIDOMWindow aParent, in wstring aDialog
Title, in wstring aText); boolean confirmCheck(in nsIDOMWindow aParent, in wstring aDialog
Title, in wstring aText, in wstring aCheckMsg, inout boolean aCheckState); PRInt32 confirmEx(in nsIDOMWindow aParent,in wstring aDialog
Title,in wstring aText, in unsigned long aButtonFlags,in wstring aButton0
Title, in wstring aButton1
Title,in wstring aButton2
Title,in wstring aCheckMsg, inout bool...
...And 33 more matches
What is RSS - Archive of obsolete content
hare that local copy. They can put it on their website. They can even re-syndicate it. And more. If you don't want any of that done, then don't put it in a non-password-protected RSS feed, and, of course, don't make the password public. News web sites use RSS to provide everyone with a list of their newest articles. ...
...y can put it on their website. They can even re-syndicate it. And more. If you don't want any of that done, then don't put it in a non-password-protected RSS feed, and, of course, don't make the password public. News web sites use RSS to provide everyone with a list of their newest articles. ...
...ws web sites use RSS to provide everyone with a list of their newest articles. ...
...And 22 more matches
Text labels and names - Accessibility
tive technology users can easily discover what its purpose is. A dialog box is generally denoted by an ARIA role="dialog" or role="alertdialog"; you can use the aria-label or aria-labelledby attributes to provide a label. Examples The following example shows a simple dialog box, defined as such using role="dialog" and labelled using aria-labelledby. ...
...se is. A dialog box is generally denoted by an ARIA role="dialog" or role="alertdialog"; you can use the aria-label or aria-labelledby attributes to provide a label. Examples The following example shows a simple dialog box, defined as such using role="dialog" and labelled using aria-labelledby. ...
...e label text: <div role="dialog" aria-label="Personal details updated confirmation"> <p>Your personal details were successfully updated. ...
...And 18 more matches
Mozilla’s UAAG evaluation report
mentation, almost all requirements satisfied G: Good Implementation, most important requirements satisfied P: Poor Implementation, some requirements satisfied and/or difficult for user to access feature NI: Not Implemented NR: Not Rated NA: Not Applicable Document under construction Guideline 1. Support input and output device-independence. Checkpoint
Title Status Notes/plans 1.1 Full keyboard access. (P1) VG We have some remaining bugs, and some keyboard usability issues, but in general Mozilla now has keyboard equivalents for almost everything. Most browsers do not allow the user to select text with the keyboard alone. We intend to do this with a caret browsing feature. 1.2 Activate event handlers. (P1) P ...
...ng feature. 1.2 Activate event handlers. (P1) P onMouseOver, onMouseDown, onMouseUp, onMouseMove, onClick, onDBClick: no keyboard support onFocus and onBlur: Cannot be activated with pointer 1.3 Provide text messages. (P1) C Status line and alert boxes used to convey messages and alerts Guideline 2. Ensure user access to all content. Checkpoint
Title Status Notes/plans Checkpoint
Title Status Notes/plans 2.1 Render content according to specification. (P1) VG Renders HTML, CSS, and a number of graphic image formats. Does not contradict current specifications for HTML and CSS rendering. 2.2 Provide text view. (P1) C Also known as view source. 2.3 Render conditional content. (P1...
...ng to specification. (P1) VG Renders HTML, CSS, and a number of graphic image formats. Does not contradict current specifications for HTML and CSS rendering. 2.2 Provide text view. (P1) C Also known as view source. 2.3 Render conditional content. (P1) VG ALT for IMG: rendered when images turned off. See meta bug 41924 for open issues with the ALT attribute. ...
...And 15 more matches
places/bookmarks - Archive of obsolete content
ved bookmark item represents only a snapshot of state at a specific time. The module does not automatically sync up a Bookmark instance with ongoing changes to that item in the database from the same add-on, other add-ons, or the user. ...
... instance to the Bookmarks database // and store the emitter let emitter = save(bookmark); // Listen for events emitter.on("data", function (saved, inputItem) { // on a "data" event, an item has been updated, passing in the // latest snapshot from the server as `saved` (with properties // such as `updated` and `id`), as well as the initial input // item as `inputItem` console.log(saved.
title === inputItem.
title); // true console.log(saved !== inputItem); // true console.log(inputItem === bookmark); // true }).on("end", function (savedItems, inputItems) { // Similar to "data" events, except "end" is an aggregate of // all progress events, with ordered arrays as `savedItems` // and `inputItems` }); Creating several bookmarks with a new group let { Bookmark, Group, save } = ...
... inputItem); // true console.log(inputItem === bookmark); // true }).on("end", function (savedItems, inputItems) { // Similar to "data" events, except "end" is an aggregate of // all progress events, with ordered arrays as `savedItems` // and `inputItems` }); Creating several bookmarks with a new group let { Bookmark, Group, save } = require("sdk/places/bookmarks"); let group = Group({
title: "Guitars" }); let bookmarks = [ Bookmark({
title: "Ran", url: "http://ranguitars.com", group: group }), Bookmark({
title: "Ibanez", url: "http://ibanez.com", group: group }), Bookmark({
title: "ESP", url: "http://espguitars.com", group: group }) ]; // Save `bookmarks` array -- notice we don't have `group` in the array, // although it needs to be saved since all bookmarks are children // o...
...And 13 more matches
ui/toolbar - Archive of obsolete content
Showing and hiding toolbars By default, a toolbar is shown when it is created, although you can specify that a toolbar should be hidden initially by passing hidden:true as an option in its constructor. After that, though, you can't show or h...
...r that, though, you can't show or hide the toolbar programmatically. Toolbars get a close button at the right-hand side, and users can show or hide the toolbar using the Firefox "View/Toolbars" menu, alongside built-in toolbars like the Bookmarks Toolbar. Hidden state persists even over create/destroy cycles: if a toolbar is created, then hidden, then destroyed, and another toolbar with the same
title is then created, the new toolbar will be in the hidden state. Toolbar events Toolbars get attach and detach events when their content is loaded and unloaded, and show and hide events when the uses shows or hides them. Working with multiple browser windows There's only a single toolbar for all browser windows, so operations like show and hide work across all browser windows. If you need to cus...
...em. Working with multiple browser windows There's only a single toolbar for all browser windows, so operations like show and hide work across all browser windows. If you need to customize content for a particular browser window, you can do that by messaging the window-specific Frame hosted by that toolbar. Globals Constructors Toolbar(options) Creates a toolbar. The only mandatory option is
title, but for the toolbar to contain any actual content, the items parameter must also be supplied, and must contain at least object. This add-on creates a toolbar containing one button and a frame: var { ActionButton } = require('sdk/ui/button/action'); var { Frame } = require("sdk/ui/frame"); var { Toolbar } = require("sdk/ui/toolbar"); var button = ActionButton({ id: "my-button", label: "my-b...
...And 13 more matches
Places Developer Guide
.getService(Ci.nsIIOService) .newURI("http://www.mozilla.com", null, null); var bookmarkId = bookmarks.insertBookmark( bookmarks.toolbarFolder, // The id of the folder the bookmark will be placed in. bookmarkURI, // The URI of the bookmark - an nsIURI object. bookmarks.DEFAULT_INDEX, // The position of the bookmark in its parent folder. "my bookmark
title"); // The
title of the bookmark. Creating a Folder var folderId = bookmarks.createFolder( bookmarks.toolbarFolder, // The id of the folder the new folder will be placed in. "my folder
title", // The
title of the new folder. bookmarks.DEFAULT_INDEX); // The position of the new folder in its parent folder. Creating a Separator var separatorId = bookmarks.insertSeparator( bookm...
...sIIOService); var siteURI = IOService.newURI("http://www.mozilla.com", null, null); var feedURI = IOService.newURI("http://www.mozilla.org/news.rdf", null, null); var livemarks = Cc["@mozilla.org/browser/livemark-service;2"] .getService(Ci.nsILivemarkService); livemarks.createLivemark(bookmarks.toolbarFolder, // The id of the folder the livemark will be placed in "My Livemark
Title", // The
title of the livemark siteURI, // The URI of the site. A nsIURI object. feedURI, // The URI of the actual feed. A nsIURI object. bookmarks.DEFAULT_INDEX); // The position of the livemark in its parent folder. Accessing Bookmarks and Related Items Accessing Item Properties For all items: String getItem
Title(aItemId) - Returns an ite...
... // The
title of the livemark siteURI, // The URI of the site. A nsIURI object. feedURI, // The URI of the actual feed. A nsIURI object. bookmarks.DEFAULT_INDEX); // The position of the livemark in its parent folder. ...
...And 13 more matches
Rich-Text Editing in Mozilla - Developer guides
gure 4 : Executing Rich Editing Commands HTML: <button onclick="doRichEditCommand('bold')" style="font-weight:bold;">B</button> JavaScript: function doRichEditCommand(aName, aArg){ getIFrameDocument('editorWindow').execCommand(aName,false, aArg); document.getElementById('editorWindow').contentWindow.focus() } Example: a simple but complete Rich Text Editor <!doctype html> <html> <head> <
title>Rich Text Editor</
title> <script type="text/javascript"> var oDoc, sDefTxt; function initDoc() { oDoc = document.getElementById("textBox"); sDefTxt = oDoc.innerHTML; if (document.compForm.switchMode.checked) { setDocMode(true); } } function formatDoc(sCmd, sValue) { if (validateMode()) { document.execCommand(sCmd, false, sValue); oDoc.focus(); } } function validateMode() { if (!docum...
...ts(oDoc.firstChild); oDoc.innerHTML = oContent.toString(); } oDoc.contentEditable = true; } oDoc.focus(); } function printDoc() { if (!validateMode()) { return; } var oPrntWin = window.open("","_blank","width=450,height=470,left=400,top=100,menubar=yes,toolbar=no,location=no,scrollbars=yes"); oPrntWin.document.open(); oPrntWin.document.write("<!doctype html><html><head><
title>Print<\/
title><\/head><body onload=\"print();\">" + oDoc.innerHTML + "<\/body><\/html>"); oPrntWin.document.close(); } </script> <style type="text/css"> .intLink { cursor: pointer; } img.intLink { border: 0; } #toolBar1 select { font-size:10px; } #textBox { width: 540px; height: 200px; border: 1px #000000 solid; padding: 12px; overflow: scroll; } #textBox #sourceText { padding: 0; ...
...tyle> </head> <body onload="initDoc();"> <form name="compForm" method="post" action="sample.php" onsubmit="if(validateMode()){this.myDoc.value=oDoc.innerHTML;return true;}return false;"> <input type="hidden" name="myDoc"> <div id="toolBar1"> <select onchange="formatDoc('formatblock',this[this.selectedIndex].value);this.selectedIndex=0;"> <option selected>- formatting -</option> <option value="h1">
Title 1 <h1></option> <option value="h2">
Title 2 <h2></option> <option value="h3">
Title 3 <h3></option> <option value="h4">
Title 4 <h4></option> <option value="h5">
Title 5 <h5></option> <option value="h6">Sub
title <h6></option> <option value="p">Paragraph <p></option> <option value="pre">Preformatted <pre></option> </select> <select onchange="formatDoc('f...
...And 13 more matches
Making content editable - Developer guides
w using about:config: user_pref("capability.policy.policynames", "allowclipboard"); user_pref("capability.policy.allowclipboard.sites", "https://www.mozilla.org"); user_pref("capability.policy.allowclipboard.Clipboard.cutcopy", "allAccess"); user_pref("capability.policy.allowclipboard.Clipboard.paste", "allAccess"); Example: A simple but complete rich text editor <!doctype html> <html> <head> <
title>Rich Text Editor</
title> <script type="text/javascript"> var oDoc, sDefTxt; function initDoc() { oDoc = document.getElementById("textBox"); sDefTxt = oDoc.innerHTML; if (document.compForm.switchMode.checked) { setDocMode(true); } } function formatDoc(sCmd, sValue) { if (validateMode()) { document.execCommand(sCmd, false, sValue); oDoc.focus(); } } function validateMode() { if (!docum...
...ts(oDoc.firstChild); oDoc.innerHTML = oContent.toString(); } oDoc.contentEditable = true; } oDoc.focus(); } function printDoc() { if (!validateMode()) { return; } var oPrntWin = window.open("","_blank","width=450,height=470,left=400,top=100,menubar=yes,toolbar=no,location=no,scrollbars=yes"); oPrntWin.document.open(); oPrntWin.document.write("<!doctype html><html><head><
title>Print<\/
title><\/head><body onload=\"print();\">" + oDoc.innerHTML + "<\/body><\/html>"); oPrntWin.document.close(); } </script> <style type="text/css"> .intLink { cursor: pointer; } img.intLink { border: 0; } #toolBar1 select { font-size:10px; } #textBox { width: 540px; height: 200px; border: 1px #000000 solid; padding: 12px; overflow: scroll; } #textBox #sourceText { padding: 0; ...
...tyle> </head> <body onload="initDoc();"> <form name="compForm" method="post" action="sample.php" onsubmit="if(validateMode()){this.myDoc.value=oDoc.innerHTML;return true;}return false;"> <input type="hidden" name="myDoc"> <div id="toolBar1"> <select onchange="formatDoc('formatblock',this[this.selectedIndex].value);this.selectedIndex=0;"> <option selected>- formatting -</option> <option value="h1">
Title 1 <h1></option> <option value="h2">
Title 2 <h2></option> <option value="h3">
Title 3 <h3></option> <option value="h4">
Title 4 <h4></option> <option value="h5">
Title 5 <h5></option> <option value="h6">Sub
title <h6></option> <option value="p">Paragraph <p></option> <option value="pre">Preformatted <pre></option> </select> <select onchange="formatDoc('f...
...And 13 more matches
Index - Archive of obsolete content
Service interface implemented by the nsIMicrosummaryService component, then call its installGenerator() method, passing it an XML document containing the generator. 555 Microsummary XML grammar reference Microsummaries A microsummary generator is an XML document that describes how to pull specific information from a web page to be presented in summary form as a bookmark whose
title changes based on the content of the page it targets. 556 Migrate apps from Internet Explorer to Mozilla When Netscape started the Mozilla browser, it made the conscious decision to support W3C standards. As a result, Mozilla is not fully backwards-compatible with Netscape Navigator 4.x and Microsoft Internet Explorer legacy code; for example, Mozilla does not support <layer>...
...size, except in the other direction. ...
... XUL Reference No summary! 847 disableglobalhistory No summary! 848 disablehistory No summary! 849 disablesecurity XUL Attributes, XUL Reference No summary! 850 dlgtype XUL Attributes, XUL Reference No summary! 851 dragging XUL Attributes, XUL Reference No summary! 852 drawin
titlebar No summary! 853 droppedLinkHandler XUL Attributes, XUL Reference No summary! 854 editable XUL Attributes, XUL Reference No summary! 855 editor.type XUL Attributes, XUL Reference No summary! 856 editortype XUL Attributes, XUL Reference No summary! 857 element XUL Attributes, XUL Referen...
...And 12 more matches
How to structure a web form - Learn web development
le in checkbox-label.html (see it live also). Multiple labels Strictly speaking, you can put multiple labels on a single widget, but this is not a good idea as some assistive technologies can have trouble handling them. In the case of multiple labels, you should nest a widget and its labels inside a single <label> element. ...
...e technologies can have trouble handling them. In the case of multiple labels, you should nest a widget and its labels inside a single <label> element. ...
...
title="required">*</abbr>.</p> <!-- So this: --> <div> <label for="username">Name:</label> <input id="username" type="text" name="username"> <label for="username"><abbr
title="required" aria-label="required">*</abbr></label> </div> <!-- would be better done like this: --> <div> <label for="username"> <span>Name:</span> <input id="username" type="text" name="username"> <abbr
title="required" aria-label="required">*</abbr> </label> </div> <!-- But this is probably best: --> <div> <label for="username">Name: <abbr
title="required" aria-label="required">*</abbr></label> <input id="username" type="text" name="username"> </div> The paragraph at the top states a rule for required elements. The rule must be included before it is used so that sighted users and users of a...
...And 12 more matches
Index - Web APIs
eds read-only property of the Document interface returns a list of the embedded <object> elements within the current document. 906 Document.enableStyleSheetsForSet() API, CSSOM, DOM, Method, NeedsMarkupWork, NeedsSpecTable, Reference Enables the style sheets matching the specified name in the current style sheet set, and disables all other style sheets (except those without a
title, which are always enabled). 907 Document.evaluate() API, DOM, Method, Reference, XPath Returns an XPathResult based on an XPath expression and other given parameters. 908 Document.execCommand() API, DOM, Method, NeedsExample, Reference, editor When an HTML document has been switched to designMode, its document object exposes an execCommand method to run c...
...e API, Animation, AnimationTimeline, Document, DocumentTimeline, Experimental, Property, Reference, Web Animations, timeline, waapi, web animations api The timeline readonly property of the Document interface represents the default timeline of the current document. This timeline is a special instance of DocumentTimeline that is automatically created on page load. 966 Document.
title API, Command API, Document, HTML DOM, NeedsSpecTable, Property, Reference The document.
title property gets or sets the current
title of the document. 967 Document.tooltipNode API, API:Mozilla Extensions, DOM, Draft, Gecko, Mozilla, Non-standard, Property, Reference The Document.tooltipNode property returns the node which is the target of the current <xul:tooltip>. ...
..., HTMLElement, NeedsSpecTable, Property, Reference, Style The HTMLElement.style property is used to get as well as set the inline style of an element. When getting, it returns a CSSStyleDeclaration object that contains a list of all styles properties for that element with values assigned for the attributes that are defined in the element's inline style attribute. 1637 HTMLElement.
title API, HTML DOM, HTMLElement, Property, Reference The HTMLElement.
title property represents the
title of the element: the text usually displayed in a 'tooltip' popup when the mouse is over the node. 1638 HTMLElement: animationcancel event Animation, AnimationEvent, CSS Animations, Event, Reference, animationcancel, events An animationcancel event is fired when a CSS A...
...And 12 more matches
simple-prefs - Archive of obsolete content
ou need to get and set the general browser preferences, use preferences/service. Usage Defining and initializing preferences To define preferences and give them initial values, add a new JSON array called preferences to your package.json file, and give it one entry for each preference: { "fullName": "Example Add-on", ... ...
...e general browser preferences, use preferences/service. Usage Defining and initializing preferences To define preferences and give them initial values, add a new JSON array called preferences to your package.json file, and give it one entry for each preference: { "fullName": "Example Add-on", ... "preferences": [{ "name": "somePreference", "
title": "Some preference
title", "description": "Some short description for the preference", "type": "string", "value": "this is the default string value" }, { "description": "How many of them we have.", "name": "myInteger", "type": "integer", "value": 8, "
title": "How Many?" }] } Each preference is defined by a group of attributes. There are: mand...
...ences must have. Attribute Description type The type of preference, as defined in the "Preference Types" section below. name An identifier for the preference. This is used to access the preference from your add-on: console.log(require("sdk/simple-prefs").prefs.mySettingName); This means that it must be a valid JavaScript identifier.
title This is used as a label for the preference in the Add-ons Manager user interface. Optional Common Attributes These are attributes that all preferences may have: Attribute Description description This appears below the preference
title in the Add-ons Manager UI. value A default value for the preference. Depending on the preference type, thi...
...And 11 more matches
Ajax navigation example - Web APIs
AJAX website composed only of three pages (first_page.php, second_page.php and third_page.php). To see how it works, please create the following files (or git clone https://github.com/giabao/mdn-ajax-nav-example.git ): Note: For fully integrating the <form> elements within this mechanism, please take a look at the paragraph Submitting forms and uploading files. ...
...lements within this mechanism, please take a look at the paragraph Submitting forms and uploading files. first_page.php: <?php $page_
title = "First page"; $as_json = false; if (isset($_GET["view_as"]) && $_GET["view_as"] == "json") { $as_json = true; ob_start(); } else { ?> <!doctype html> <html> <head> <?php include "include/header.php"; echo "<
title>" . $page_
title . ...
...sm, please take a look at the paragraph Submitting forms and uploading files. first_page.php: <?php $page_
title = "First page"; $as_json = false; if (isset($_GET["view_as"]) && $_GET["view_as"] == "json") { $as_json = true; ob_start(); } else { ?> <!doctype html> <html> <head> <?php include "include/header.php"; echo "<
title>" . $page_
title . ...
...And 11 more matches
Localization - Archive of obsolete content
See Limitations below. Localized strings Translated strings are kept in a directory called "locale" under your main add-on directory, one file for each locale. ...
...See Limitations below. Localized strings Translated strings are kept in a directory called "locale" under your main add-on directory, one file for each locale. ...
...See Limitations below. Localized strings Translated strings are kept in a directory called "locale" under your main add-on directory, one file for each locale. ...
...And 10 more matches
Additional Navigation - Archive of obsolete content
le is a common way to filter out specific items. For instance, if items were identified with a type, the data could be filtered to include only items of a particular type. Here is an example triple that we could use in the photos example: <query> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/
title" object="Canal"/> </query> This new triple has a static value for the object attribute instead of a variable reference. You might be able to guess that it will cause a match for only one of the photos, the Canal photo. The others won't be able to match when evaluating the triple. To look closer, here is the data network after only the member has been evaluated: (?start = http://www.xu...
...w.xulplanet.com/rdf/myphotos, ?photo = http://www.xulplanet.com/ndeakin/images/t/obselisk.jpg) When evaluating the triple, the template builder will iterate over the three potential results found so far. For the first result, the value of the ?photo variable 'http://www.xulplanet.com/ndeakin/images/t/palace.jpg' will be used as the subject, the predicate will be 'http://purl.org/dc/elements/1.1/
title', and the object will be 'Canal'. Since there are no variables to fill into the triple, the builder will just confirm that such a triple exists in the datasource. The triple doesn't exist for the first result since the
title for the first photo is 'Palace from Above', so the potential result will be removed from the data. For the second result, such an arc does exist, so the result is kept. Like ...
...m the data. For the second result, such an arc does exist, so the result is kept. Like the first result, there is no arc for the third photo, so it is also removed. The resulting data will look like the following: (?start = http://www.xulplanet.com/rdf/myphotos, ?photo = http://www.xulplanet.com/ndeakin/images/t/canal.jpg) Here is the example. Naturally, we will need to add a binding for the ?
title variable if we wish to display it, or we could just hardcode it since we know the value will be 'Canal'. Usually you won't be filtering on a
title though--you would instead filter on a value that acts like a type. There has to be at least one variable used in a triple in either the subject or the object attributes, or both. You can't have a triple with no variables. That's not an issue though, s...
...And 10 more matches
Examples - Archive of obsolete content
f style.css at the bottom of this page. Examples for "Problems with Inline style and script" Problem 1 <!-- This file should have a .xhtml extension and will generate an error when parsed. --> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US"> <head> <
title>Problem 1 - < in XHTML</
title> <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" /> <script type="text/javascript"> var i = 0; while (++i > 10) { // ... } </script> </head> <body> <h1>Problem 1 - < in XHTML</h1> <p> This document is not well formed due to the use of a raw <. </p> </body> </html> Back to the article Problem ...
... - < in XHTML</h1> <p> This document is not well formed due to the use of a raw <. ...
...ocument is not well formed due to the use of a raw <. ...
...And 10 more matches
Adding Methods to XBL-defined Elements - Archive of obsolete content
ter. In the returned array, the first button is stored in the first array element (getAnonymousNodes(element)[0]), the second button is stored in the second array element and the third button is stored in the third array element. For code inside a binding method, you can pass 'this' as the parameter to getAnonymousNodes(). The next example can be used to create text with a label. ...
...tAnonymousNodes(element)[0]), the second button is stored in the second array element and the third button is stored in the third array element. For code inside a binding method, you can pass 'this' as the parameter to getAnonymousNodes(). The next example can be used to create text with a label. The method 'show
Title' can be used to show or hide the label. ...
...n the third array element. For code inside a binding method, you can pass 'this' as the parameter to getAnonymousNodes(). The next example can be used to create text with a label. The method 'show
Title' can be used to show or hide the label. It works by getting a reference to the
title element using the anonymous array and changing the visibility of it. ...
...And 9 more matches
Getting started with HTML - Learn web development
ect to another page, italicize words, and so on. For example, consider the following line of text: My cat is very grumpy If we wanted the text to stand by itself, we could specify that it is a paragraph by enclosing it in a paragraph (<p>) element: <p>My cat is very grumpy</p> Note: Tags in HTML are case-insensitive. This means they can be written in uppercase or lowercase. For example, a <
title> tag could be written as <
title>, <
TITLE>, <
Title>, <
TiTlE>, etc., and it will work. However, it is best practice to write all tags in lowercase for consistency, readability, and other reasons. Anatomy of an HTML element Let's further explore our paragraph element from the previous section: The anatomy of our element is: The opening tag: This consists of the name of the element (in this ...
...d with opening and closing quote marks. Active learning: Adding attributes to an element Another example of an element is <a>. This stands for anchor. An anchor can make the text it encloses into a hyperlink. Anchors can take a number of attributes, but several are as follows: href: This attribute's value specifies the web address for the link. For example: href="https://www.mozilla.org/".
title: The
title attribute specifies extra information about the link, such as a description of the page that is being linked to. For example,
title="The Mozilla homepage". This appears as a tooltip when a cursor hovers over the element. target: The target attribute specifies the browsing context used to display the link. For example, target="_blank" will display the link in a new tab. If you want to ...
...r the element. target: The target attribute specifies the browsing context used to display the link. For example, target="_blank" will display the link in a new tab. If you want to display the linked content in the current tab, just omit this attribute. Edit the line below in the Input area to turn it into a link to your favorite website. Add the <a> element. Add the href attribute and the
title attribute. Specify the target attribute to open the link in the new tab. You'll be able to see your changes update live in the Output area. You should see a link--that when hovered over--displays the value of the
title attribute, and when clicked, navigates to the web address in the href attribute. Remember that you need to include a space between the element name, and between each attribute. ...
...And 9 more matches
TPS Bookmark Lists
A bookmark asset list is an object with one or more key-value pairs. Each key is the full path for the array of contents specified in the key's value. For example: var bookmarks_after_second_modify = { "menu": [ { uri: "http://www.getfirefox.com/",
title: "Get Firefox" } ], "menu/foldera": [ { uri: "http://mozilla.com",
title: "Mozilla" }, ] }; This describes two bookmarks, one in the "menu" folder, and the other in the "folder1" subfolder of "menu". All bookmark paths must begin with one of the following: "menu": the normal bookmarks menu "toolbar": the bookmarks toolbar "tags": the tags folder "unfiled": the unfiled bookmarks folder "places": the places root folder ("menu", "toolbar", and "unfiled" are all children of this) Sub-folders are preceded with...
...children of this) Sub-folders are preceded with forward slashes, so "menu/folder1" denotes that "folder1" is a sub-folder of "menu". TPS does not support forward slashes as part of a folder name. Folder contents The contents for a folder are given as an array of objects, representing various bookmark types, described below. Bookmark objects Valid properties are: uri: the bookmark uri. Required. ...
...ub-folders are preceded with forward slashes, so "menu/folder1" denotes that "folder1" is a sub-folder of "menu". TPS does not support forward slashes as part of a folder name. Folder contents The contents for a folder are given as an array of objects, representing various bookmark types, described below. Bookmark objects Valid properties are: uri: the bookmark uri. Required.
title: the bookmark
title. Optional. Defaults to the bookmark uri. loadInSidebar: true or false. Optional. Toggles the "load in sidebar" property. description: the bookmark description. Optional. tags: an array of tags for the bookmark. Optional. keyword: the keyword for the bookmark. Optional. after: the
title of the bookmark item expected to be found AFTER this bookmark; used only in verify and modify actions. before: t...
...And 9 more matches
confirm - Archive of obsolete content
It accepts any number of parameters up to 8. ...
...It accepts any number of parameters up to 8. ...
...It accepts any number of parameters up to 8. ...
...And 8 more matches
What’s in the head? Metadata in HTML - Learn web development
Previous Overview: Introduction to HTML Next The head of an HTML document is the part that is not displayed in the web browser when the page is loaded. It contains information such as the page <
title>, links to CSS (if you choose to style your HTML content with CSS), links to custom favicons, and other metadata (data about the HTML, such as the author, and important keywords that describe the document.) In this article we'll cover all of the above and more, in order to give you a good basis for working with markup. Prerequisites: Basic HTML familiarity, as covered in Getting started with HTML. Objective: To learn about the HTML head, its purpose, the most important items it can contain, and what effect it can have on the HTML document. What is the HTML ...
...es: Basic HTML familiarity, as covered in Getting started with HTML. Objective: To learn about the HTML head, its purpose, the most important items it can contain, and what effect it can have on the HTML document. What is the HTML head? Let's revisit the simple HTML document we covered in the previous article: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <
title>My test page</
title> </head> <body> <p>This is my page</p> </body> </html> The HTML head is the contents of the <head> element -- unlike the contents of the <body> element (which are displayed on the page when loaded in a browser), the head's content is not displayed on the page. Instead, the head's job is to contain metadata about the document. In the above example, the head is quite ...
... <p>This is my page</p> </body> </html> The HTML head is the contents of the <head> element -- unlike the contents of the <body> element (which are displayed on the page when loaded in a browser), the head's content is not displayed on the page. Instead, the head's job is to contain metadata about the document. In the above example, the head is quite small: <head> <meta charset="utf-8"> <
title>My test page</
title> </head> In larger pages however, the head can get quite full. Try going to some of your favorite websites and use the developer tools to check out their head contents. Our aim here is not to show you how to use everything that can possibly be put in the head, but rather to teach you how to use the major elements that you'll want to include in the head, and give you some fami...
...And 8 more matches
Client-side storage - Learn web development
of what it is capable of, but we will give you enough to get started. Working through a note storage example Here we'll run you through an example that allows you to store notes in your browser and view and delete them whenever you like, getting you to build it up for yourself and explaining the most fundamental parts of IDB as we go along. The app looks something like this: Each note has a
title and some body text, each individually editable. The JavaScript code we'll go through below has detailed comments to help you understand what's going on. Getting started First of all, make local copies of our index.html, style.css, and index-start.js files into a new directory on your local machine. Have a look at the files. You'll see that the HTML is pretty simple: a web site with a header ...
...e that the HTML is pretty simple: a web site with a header and footer, as well as a main content area that contains a place to display notes, and a form for entering new notes into the database. The CSS provides some simple styling to make it clearer what is going on. The JavaScript file contains five declared constants containing references to the <ul> element the notes will be displayed in, the
title and body <input> elements, the <form> itself, and the <button>. Rename your JavaScript file to index.js. You are now ready to start adding code to it. Database initial set up Now let's look at what we have to do in the first place, to actually set up a database. Below the constant declarations, add the following lines: // Create an instance of a db object for us to store the open dat...
...Here we first grab a reference to the existing database from e.target.result (the event target's result property), which is the request obje...
...And 8 more matches
Creating reftest-based unit tests
ls on doing that. Sorry about this, but the released builds and the nightly builds are built with the "--disable-tests" option and reftest will not work - see bug 369809. Step 2 Open a terminal window. Create a directory (inside Firefox's source code tree) and make that your current directory (i.e. move to that directory). ...
...orry about this, but the released builds and the nightly builds are built with the "--disable-tests" option and reftest will not work - see bug 369809. Step 2 Open a terminal window. Create a directory (inside Firefox's source code tree) and make that your current directory (i.e. move to that directory). ...
... work - see bug 369809. Step 2 Open a terminal window. Create a directory (inside Firefox's source code tree) and make that your current directory (i.e. move to that directory). ...
...And 8 more matches
Displaying Places information using views
r queries whose URIs you plan on changing, you will want to set the view's place property dynamically using JavaScript. Note that in the latter case it is not sufficient to call setAttribute on the element; use the element's place property instead. See Querying Places and Places query URIs for information on query URIs. ...
...aces query URIs for information on query URIs. The following example uses the built-in tree view to display bookmarks whose
titles or URLs contain "mozilla". Remember that, because XUL is XML, any ampersands in query URIs must be written as entity reference & and not simply &. <tree type="places" place="place:terms=mozilla&onlyBookmarked=1&queryType=1"> <treecols> <treecol id="
title" label="My Bookmarks" flex="1" primary="true" /> </treecols> <treechildren /> </tree> The next example does the same as the last but uses JavaScript to set the tree's place attribute: var histServ = Cc["@mozilla.org/browser/nav-history-service;1"]. getService(Ci.nsINavHistoryService); var query = histServ.getNewQuery(); query.searchTerms = "mozilla"; query.onlyBookmarked = true; var ...
...storyResultViewer. Once notified, the view is responsible for updating itself. Note: Starting in Gecko 2.0, nsINavHistoryResultViewer has been replaced by the more powerful nsINavHistoryResultObserver. Tree view Create a built-in tree view by setting the type attribute to "places" on a tree element. The treechildren element should be empty: <tree type="places"> <treecols> <treecol id="
title" flex="1" primary="true" /> <treecol id="url" flex="1" /> </treecols> <treechildren /> </tree> The tree view is implemented in browser/components/places/content/tree.xml. See the tree reference and Trees tutorial for general information about trees. If you would like your tree view to be styled in the same manner that Firefox styles its uses of the view, you should include the followin...
...And 8 more matches
nsINavBookmarksService
ITArray(in nsIURI aURI, in PRInt64Array aResult); Native code only! ...
...(in long long aParentId, in long aIndex); PRTime getItemDateAdded(in long long aItemId); AString getItemGUID(in long long aItemId); Obsolete since Gecko 14.0 long long getItemIdForGUID(in AString aGUID); Obsolete since Gecko 14.0 long getItemIndex(in long long aItemId); PRTime getItemLastModified(in long long aItemId); AUTF8String getItem
Title(in long long aItemId); unsigned short getItemType(in long long aItemId); AString getKeywordForBookmark(in long long aItemId); Obsolete since Gecko 40.0 AString getKeywordForURI(in nsIURI aURI); Obsolete since Gecko 40.0 nsITransaction getRemoveFolderTransaction(in long long aItemId); nsIURI getURIForKeyword(in AString keyword); Obsolete since Gecko 4...
...cko 1.9 void importBookmarksHTMLToFolder(in nsIURI url, in PRInt64 folder); Obsolete since Gecko 1.9 PRInt32 indexOfFolder(in PRInt64 parent, in PRInt64 folder); Obsolete since Gecko 1.9 PRInt32 indexOfItem(in PRInt64 folder, in nsIURI uri); Obsolete since Gecko 1.9 long long insertBookmark(in long long aParentId, in nsIURI aURI, in long aIndex, in AUTF8String a
Title); void insertItem(in PRInt64 folder, in nsIURI item, in PRInt32 index); Obsolete since Gecko 1.9 long long insertSeparator(in long long aParentId, in long aIndex); boolean isBookmarked(in nsIURI aURI); void moveFolder(in PRInt64 folder, in PRInt64 newParent, in PRInt32 index); Obsolete since Gecko 1.9 void moveItem(in long long aItemId, in long long a...
...And 8 more matches
Using IndexedDB - Web APIs
pis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> <h1>IndexedDB Demo: storing blobs, e-publication example</h1> <div class="note"> <p> Works and tested with: </p> <div id="compat"> </div> </div> <div id="msg"> </div> <form id="register-form"> <table> <tbody> <tr> <td> <label for="pub-
title" class="required">
Title: </label> </td> <td> <input type="text" id="pub-
title" name="pub-
title" /> </td> </tr> <tr> <td> <label for="pub-biblioid" class="required"> Bibliographic ID:<br/> <span class="note">(ISBN, ISSN, etc.)</span> ...
...req.onerror = function (evt) { console.error("openDb:", evt.target.errorCode); }; req.onupgradeneeded = function (evt) { console.log("openDb.onupgradeneeded"); var store = evt.currentTarget.result.createObjectStore( DB_STORE_NAME, { keyPath: 'id', autoIncrement: true }); store.createIndex('biblioid', 'biblioid', { unique: true }); store.createIndex('
title', '
title', { unique: false }); store.createIndex('year', 'year', { unique: false }); }; } /** * @param {string} store_name * @param {string} mode either "readonly" or "readwrite" */ function getObjectStore(store_name, mode) { var tx = db.transaction(store_name, mode); return tx.objectStore(store_name); } function clearObjectStore() { var store = getObjec...
...for the data if (cursor) { console.log("displayPubList cursor:", cursor); req = store.get(cursor.key); req.onsuccess = function (evt) { var value = evt.target.result; var list_item = $('<li>' + '[' + cursor.key + '] ' + '(biblioid: ' + value.biblioid + ') ' + value.
title + '</li>'); if (value.year != null) list_item.append(' - ' + value.year); if (value.hasOwnProperty('blob') && typeof value.blob != 'undefined') { var link = $('<a href="' + cursor.key + '">File</a>'); link.on('click', function() { return false; }); link.on('mouseenter', function(evt) { ...
...And 8 more matches
Location - Web APIs
The Location interface represents the location (URL) of the object it is linked to. Changes done on it are reflected on the object it relates to. Both the Document and Window interface have such a linked Location, accessible via Document.location and Window.location respectively. ...
... The Location interface represents the location (URL) of the object it is linked to. Changes done on it are reflected on the object it relates to. Both the Document and Window interface have such a linked Location, accessible via Document.location and Window.location respectively. ...
...ocation interface represents the location (URL) of the object it is linked to. Changes done on it are reflected on the object it relates to. Both the Document and Window interface have such a linked Location, accessible via Document.location and Window.location respectively. ...
...And 8 more matches
Box-shadow generator - CSS: Cascading Style Sheets
tton" data-type="add"> </div> <div class="button" data-type="move-up"> </div> <div class="button" data-type="move-down"> </div> </div> <div id="stack_container"></div> </div> <div id="preview_zone"> <div id="layer_menu" class="col span_12"> <div class="button" id="element" data-type="subject" data-
title="element"> element </div> <div class="button" id="before" data-type="subject" data-
title=":before"> :before <span class="delete" data-type="disable"></span> </div> <div class="button" id="after" data-type="subject" data-
title=":after"> :after <span class="delete" data-ty...
... <div id="obj-element"> <div class="content"> </div> <div id="obj-before"> </div> <div id="obj-after"> </div> </div> </div> </div> </div> <div id="controls" class="group section"> <div class="wrap-left"> <div class="colorpicker category"> <div class="
title"> </div> <div id="colorpicker" class="group"> <div id="gradient" class="gradient"> <div id="gradient_picker"> </div> </div> <div id="hue" data-topic="hue" class="hue"> <div id="hue_selector"> </div> </div> <div class="info"> ...
...group"> <div id="gradient" class="gradient"> <div id="gradient_picker"> </div> </div> <div id="hue" data-topic="hue" class="hue"> <div id="hue_selector"> </div> </div> <div class="info"> <div class="input" data-topic="hue" data-
title='H:' data-action="HSV"></div> <div class="input" data-topic="saturation" data-
title='S:' data-action="HSV"></div> <div class="input" data-topic="value" data-
title='V:' data-action="HSV"></div> </div> <div class="alpha"> <div id="alpha" data-topic="alpha"> <di...
...And 8 more matches
<metadata> - SVG: Scalable Vector Graphics
Used by hub symbol --> <symbol id="hubPlug"> ...
...Used by hub symbol --> <symbol id="hubPlug"> <desc>A 10BaseT...
... <desc>A typical 10BaseT/100BaseTX network hub</desc> <text x="0" y="15">Hub</text> <g transform="translate(0 20)"> <rect width="253" height="84"/> <rect width="229" height="44" x="12" y="10"/> <circle fill="red" cx="227" cy="71" r="7" /> <!-- five groups each using the defined socket --> <g id="sock1et" transform="translate(25 20)"> <
title>Socket 1</
title> <use xlink:href="#hubPlug"/> </g> <g id="socket2" transform="translate(70 20)"> <
title>Socket 2</
title> <use xlink:href="#hubPlug"/> </g> <g id="socket3" transform="translate(115 20)"> <
title>Socket 3</
title> <use xlink:href="#hubPlug"/> </g> <g id="socket4" transform="translate(160 ...
...And 8 more matches
Index - Archive of obsolete content
ing the size, except in the other direction. ...
... XUL Reference No summary! 100 disableglobalhistory No summary! 101 disablehistory No summary! 102 disablesecurity XUL Attributes, XUL Reference No summary! 103 dlgtype XUL Attributes, XUL Reference No summary! 104 dragging XUL Attributes, XUL Reference No summary! 105 drawin
titlebar No summary! 106 droppedLinkHandler XUL Attributes, XUL Reference No summary! 107 editable XUL Attributes, XUL Reference No summary! 108 editor.type XUL Attributes, XUL Reference No summary! 109 editortype XUL Attributes, XUL Reference No summary! 110 element XUL Attributes, XUL Referen...
...summary! 152 ignorecase XUL Attributes, XUL Reference No summary! 153 ignoreincolumnpicker XUL Attributes, XUL Reference No summary! 154 ignorekeys XUL Attributes, XUL Reference No summary! 155 image XUL Attributes, XUL Reference No summary! 156 image.onload No summary! 157 inactive
titlebarcolor XUL Attributes, XUL Reference No summary! 158 increment XUL Attributes, XUL Reference No summary! 159 index XUL Attributes, XUL Reference No summary! 160 inputtooltiptext XUL Attributes, XUL Reference No summary! 161 insertafter XUL Attributes, XUL Reference No summary! 162 insertbefor...
...And 7 more matches
Multiple Rule Example - Archive of obsolete content
ription. The next example shows how we can do this. ...
...how we can do this. ...
... <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/description" object="?description"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/date" object="?date"/> </conditions> <action> <hbox uri="?photo" class="box-padded"> <vbox> <label value="?
title"/> <image src="?photo"/> </vbox> <groupbox> <caption label="Photo Details"/> <label value="?description"/> <label value="Date: ?date"/> </groupbox> </hbox> </action> </rule> <rule> <conditions> <content uri="?start"/> <member container="?start" child="?photo"/> <triple...
...And 7 more matches
Implementation Status - Archive of obsolete content
ter Index Here we give an overview of XForms 1.1 specification chapters and the current status of the Mozilla support. The sections are marked with their current status: Supported, partial support, in progress, and not currently supported. We have listed the most relevant bugs here, but check out the Bugzilla XForms buglist for the complete list. 3. ...
...lex schema validation 278761; 278762; 3.3.4 bind partial Using the index() function in binds does not work. 292333; 3.4 Extension Module unsupported 300760; 3.5 MustUnderstand Module unsupported 300757; 4. Processing Model (Events) Section
Title Status Notes Bugs 4 Processing Model (Events) partial The xforms-recalculate, xforms-revalidate, and xforms-refresh events are not as separated as they should be. 278448; 338146; 4.2 Initialization Events supported 4.2.1 xforms-model-construct supported ...
... supported 4.8.3 recalculate() supported 4.8.4 revalidate() supported 4.8.5 refresh() supported 4.9 Feature string for the hasFeature method call supported 5. Datatypes Section
Title Status Notes Bugs 5.1 XML Schema Built-in Datatypes partial whitespace facet not supported. 5.2.1 Additional XForms Datatypes to Allow Empty Content unsupported 5.2.2 xforms:listItem supported 5.2.3 xforms:listItems support...
...And 7 more matches
Accessible multimedia - Learn web development
The main ones you'll come across are: Captions -- There for the benefit of deaf users who can't hear the audio track, including the words being spoken, and contextual information such as who spoke the words, if the...
...The main ones you'll come across are: Captions -- There for the benefit of deaf users who can't hear the audio track, including the words being spoken, and contextual information such as who spoke the words, if the people were angry or sad, and what mood the music is currently creating...
...often available on DVDs, for example There are different types of text track with different purposes. The main ones you'll come across are: Captions -- There for the benefit of deaf users who can't hear the audio track, including the words being spoken, and contextual information such as who spoke the words, if the people were angry or sad, and what mood the music is currently creating. ...
...And 7 more matches
Examples of web and XML development using the DOM - Web APIs
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. ...
...des 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. ...
...ityripple.com/samples/d2/8ba7141ed1.gif" height="50" width="500"> </p> <p>Image 3: no height, width, but style="height: 50px; width: 500px;" <img id="image3" src="https://udn.realityripple.com/samples/d2/8ba7141ed1.gif" style="height: 50px; width: 500px;"> </p> <div id="output"> </div> </body> </html> Example 2: Image Attributes <!DOCTYPE html> <html lang="en"> <head> <
title>Modifying an image border</
title> <script> function setBorderWidth(width) { document.getElementById("img1").style.borderWidth = width + "px"; } </script> </head> <body> <p> <img id="img1" src="image1.gif" style="border: 5px solid green;" width="100" height="100" alt="border test"> </p> <form name="FormName"> <input type="button" value="Make border 20px-wide" onclick=...
...And 7 more matches
IDBRequest.onerror - Web APIs
The onerror event handler of the IDBRequest interface handles the error event, fired when a request returns an error. The event handler takes one parameter, an error Event with type="error". Note: This feature is available in Web Workers. Syntax request.onerror = function(event) { ... ...
...rface handles the error event, fired when a request returns an error. The event handler takes one parameter, an error Event with type="error". Note: This feature is available in Web Workers. Syntax request.onerror = function(event) { ... }; Example The following example requests a given record
title, onsuccess gets the associated record from the IDBObjectStore (made available as objectStore
TitleRequest.result), updates one property of the record, and then puts the updated record back into the object store. Also included at the bottom is an onerror function that reports what the error was if the request fails. For a full working example, see our To-do Notifications app (view example live.) var
title = "Walk dog"; // Open up a transaction as usual var objectStore = db.transaction(['toDoL...
...k into the object store. Also included at the bottom is an onerror function that reports what the error was if the request fails. ...
...And 7 more matches
IDBRequest.transaction - Web APIs
ill be an IDBTransaction with mode equal to "versionchange", and can be used to access existing object stores and indexes, or abort the the upgrade. Following the upgrade, the transaction property will again be null. Note: This feature is available in Web Workers. Syntax var myTransaction = request.transaction; Value An IDBTransaction. Example The following example requests a given record
title, onsuccess gets the associated record from the IDBObjectStore (made available as objectStore
TitleRequest.result), updates one property of the record, and then puts the updated record back into the object store in another request. The source of the requests is logged to the developer console -- both originate from the same transaction. For a full working example, see our To-do Notifications app (v...
...ociated record from the IDBObjectStore (made available as objectStore
TitleRequest.result), updates one property of the record, and then puts the updated record back into the object store in another request. The source of the requests is logged to the developer console -- both originate from the same transaction. ...
...re in another request. The source of the requests is logged to the developer console -- both originate from the same transaction. ...
...And 7 more matches
Timing element visibility with the Intersection Observer API - Web APIs
appending ads to the existing content. Creating an article To create the <article> element for an article (as well as all of its contents), we use the createArticle() function, which takes as input a string which is the full text of the article to add to the page. function createArticle(contents) { let articleElem = document.createElement("article"); articleElem.id = nextArticleID; let
titleElem = document.createElement("h2");
titleElem.id = nextArticleID;
titleElem.innerText = "Article " + nextArticleID + "
title"; articleElem.appendChild(
titleElem); articleElem.innerHTML += contents; nextArticleID +=1 ; return articleElem; } First, the <article> element is created and its ID is set to the unique value nextArticleID (which starts at 1 and goes up for each article). Th...
...Finally, nextArticleID is incremented (so that the next element gets a new unique ID) and we return the new <article> element to the caller. Creating an ad The loadRandomAd() function simulates loading an ad and adding it to the page. ...
...is treated as an existing ad element; instead of creating a new one, the existing element is changed to contain the new ad's style, content, and other data. This avoids the risk of lengthy layout work being done when you update the ad, which could happen if you first delete the old element then insert a new one. ...
...And 7 more matches
Color picker tool - CSS: Cascading Style Sheets
ColorPicker tool HTML <div id="container"> <div id="palette" class="block"> <div id="color-palette"></div> <div id="color-info"> <div class="
title"> CSS Color </div> </div> </div> <div id="picker" class="block"> <div class="ui-color-picker" data-topic="picker" data-mode="HSL"></div> <div id="picker-samples" sample-id="master"></div> <div id="controls"> <div id="delete"> <div id="trash-can"></div> </div> <div id="void-sample" class="icon"></div> </div> </div> <div id="canvas" data-tutorial="drop"> <div id="zindex" class="ui-input-slider" data-topic="z-index" data...
...border-box; box-sizing: border-box; transition: all 0.2s; } #delete[drag-state='enter'] { background-color: #999; } /** * Color Theme */ #color-theme { margin: 0 8px 0 0; border: 1px solid #EEE; display: inline-block; float: right; } #color-theme .box { width: 80px; height: 92px; float: left; } /** * Color info box */ #color-info { width: 360px; float: left; } #color-info .
title { width: 100%; padding: 15px; font-size: 18px; text-align: center; background-image: url('https://mdn.mozillademos.org/files/6071/color-wheel.png'); background-repeat:no-repeat; background-position: center left 30%; } #color-info .copy-container { position: absolute; top: -100%; } #color-info .property { min-width: 280px; height: 30px; margin: 10px 0; text-align: center; line-heig...
... -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } #color-palette { width: 640px; font-family: Arial, Helvetica, sans-serif; color: #777; float: left; } #color-palette .container { width: 100%; height: 50px; line-height: 50px; overflow: hidden; float: left; transition: all 0.5s; } #color-palette .container > * { float: left; } #color-palette .
title { width: 100px; padding: 0 10px; text-align: right; line-height: inherit; } #color-palette .palette { width: 456px; height: 38px; margin: 3px; padding: 3px; display: table; background-color: #FFF; } #color-palette .palette .sample { width: 30px; height: 30px; margin: 3px; position: relative; border: 1px solid #DDD; float: left; transition: all 0.2s; } #color-palette .palette .
...And 7 more matches
ui/sidebar - Archive of obsolete content
t page: Specifying sidebar content The content of a sidebar is specified using HTML, which is loaded from the URL supplied in the url option to the sidebar's constructor. ...
...L constructed using self.data.url(): var sidebar = require("sdk/ui/sidebar").Sidebar({ id: 'my-sidebar',
title: 'My sidebar', url: require("sdk/self").data.url("sidebar.html") }); From Firefox 34, you can use "./sidebar.html" as an alias for self.data.url("sidebar.html"). So you can rewrite the above code like this: var sidebar = require("sdk/ui/sidebar").Sidebar({ id: 'my-sidebar',
title: 'My sidebar', url: "./sidebar.html" }); You can include JavaScript and CSS from the HTML as you would with any web page, for example using <script> and <link> tags containing a path relative to the HTML file itself. <!DOCTYPE HTML> <html> <head> <link href="stuff.css" type="text/css" rel="stylesheet"> </head> <body> <script type="text/javascript" src="stuff.js"></script> <...
..., and adds a listener to the pong message. addon.port.emit("ping"); addon.port.on("pong", function() { console.log("sidebar script got the reply"); }); The "main.js" file creates a sidebar object and adds a listener to its attach event. On attach, "main.js" starts listening to the ping message, and responds with a pong: var sidebar = require("sdk/ui/sidebar").Sidebar({ id: 'my-sidebar',
title: 'My sidebar', url: require("sdk/self").data.url("sidebar.html"), onAttach: function (worker) { worker.port.on("ping", function() { console.log("add-on script got the message"); worker.port.emit("pong"); }); } }); Try running the add-on, and showing the sidebar using the "View->Sidebar->My sidebar" menu item. You should see console output like: console.log: add-on: add...
...And 6 more matches
Inline options - Archive of obsolete content
s now available in Firefox on the desktop as well. Options file The XUL allowed for the inline options is limited to a few new tags. Here is an example of an options.xul file: <?xml version="1.0"?> <!DOCTYPE mydialog SYSTEM "chrome://myaddon/locale/mydialog.dtd"> <vbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <setting type="bool" pref="extensions.myaddon.bool"
title="Boolean" desc="Stored as a boolean preference" /> </vbox> Note that it's limited to <setting> tags. The root <vbox> just acts as a container, it isn't merged into the main window. If you need script support, see the display notifications section. Setting types There are several types of <setting>s, each with a different type attribute: type attribute displayed as preference s...
...ing (in the #123456 format) file browse button and label string directory browse button and label string menulist menulist dependent on the menu item values radio radio buttons dependent on the radio values control button no pref stored The pref attribute should have the full name of the preference to be stored. ...
...ull name of the preference to be stored. The
title attribute is used as a label for the controls. To set a description, either use the desc attribute, or a text node as a child of the <setting> tag. Settings are tied to actual preferences, except the button setting, which is designed more for actions. ...
...And 6 more matches
Defining Cross-Browser Tooltips - Archive of obsolete content
e browser that cannot display images). In a visual browser, the image should be displayed and the alt text should not. This assumes that the browser can find the image and that it supports the image format used; if either of these is not true, and the image cannot be displayed, then the alt text should be displayed in place of the missing image. ...
...ay images). In a visual browser, the image should be displayed and the alt text should not. This assumes that the browser can find the image and that it supports the image format used; if either of these is not true, and the image cannot be displayed, then the alt text should be displayed in place of the missing image. ...
...he browser can find the image and that it supports the image format used; if either of these is not true, and the image cannot be displayed, then the alt text should be displayed in place of the missing image. On the other hand, the HTML 4.01 definition of the
title attribute states:
title = text CS This attribute offers advisory information about the element for which it is set. Unlike the
TITLE element, which provides information about an entire document and may only appear once, the
title attribute may annotate any number of elements. Please consult an element's definition to verify that it supports this attribute... Values of the
title attribute may be rendered by user agents in a variety of ways. For instance, visual browsers frequently display the
title as a "tool tip" (a short mess...
...And 6 more matches
IDBObjectStore.put() - Web APIs
a being stored could not be cloned by the internal structured cloning algorithm. Parameters value The value to be stored. key The key to use to identify the record. If unspecified, it results to null. If the object store has a key generator (e.g. autoincrement) the key of the object must be passed in to update the object. ...
... The key to use to identify the record. If unspecified, it results to null. If the object store has a key generator (e.g. autoincrement) the key of the object must be passed in to update the object. Example The following example requests a given record
title; when that request is successful the onsuccess function gets the associated record from the IDBObjectStore (made available as objectStore
TitleRequest.result), updates one property of the record, and then puts the updated record back into the object store in another request with put(). For a full working example, see our To-do Notifications app (view example live.) const
title = "Walk dog"; // Open up a transaction as usual const objectStore = db.transaction(['toDoList'], "readwrite").objectStore('toDoList'); // Get the to-do list obj...
...pdates one property of the record, and then puts the updated record back into the object store in another request with put(). ...
...And 6 more matches
IDBRequest.error - Web APIs
e IDBRequest object, asynchronous operations can also raise exceptions. The list describes problems that could occur when the request is being executed, but you might also encounter other problems when the request is being made. For example, if the the request failed and the result is not available, the InvalidStateError exception is thrown. Example The following example requests a given record
title, onsuccess gets the associated record from the IDBObjectStore (made available as objectStore
TitleRequest.result), updates one property of the record, and then puts the updated record back into the object store. Also included at the bottom is an onerror function that reports what the error was if the request fails. For a full working example, see our To-do Notifications app (view example live.) v...
...nsuccess gets the associated record from the IDBObjectStore (made available as objectStore
TitleRequest.result), updates one property of the record, and then puts the updated record back into the object store. Also included at the bottom is an onerror function that reports what the error was if the request fails. ...
...ack into the object store. Also included at the bottom is an onerror function that reports what the error was if the request fails. ...
...And 6 more matches
IDBRequest.readyState - Web APIs
when an error occurs. Note: This feature is available in Web Workers. Syntax var currentReadyState = request.readyState; Value The IDBRequestReadyState of the request, which takes one of the following two values: Value Meaning pending The request is pending. done The request is done. ...
...tate = request.readyState; Value The IDBRequestReadyState of the request, which takes one of the following two values: Value Meaning pending The request is pending. done The request is done. Example The following example requests a given record
title, onsuccess gets the associated record from the IDBObjectStore (made available as objectStore
TitleRequest.result), updates one property of the record, and then puts the updated record back into the object store in another request. The readyState of the 2nd request is logged to the developer console. For a full working example, see our To-do Notifications app (view example live.) var
title = "Walk dog"; // Open up a transaction as usual var objectStore = db.transaction(['toDoList'], "readwrit...
...dated record back into the object store in another request. The readyState of the 2nd request is logged to the developer console. ...
...And 6 more matches
IDBRequest.source - Web APIs
If no source exists (such as when calling indexedDB.open), it returns null. Note: This feature is available in Web Workers. Syntax var IDBIndex = request.source; var IDBCursor = request.source; var IDBObjectStore = request.source; Value An object representing the source of the request, such as an IDBIndex, IDBObjectStore or IDBCursor. ...
... available in Web Workers. Syntax var IDBIndex = request.source; var IDBCursor = request.source; var IDBObjectStore = request.source; Value An object representing the source of the request, such as an IDBIndex, IDBObjectStore or IDBCursor. Example The following example requests a given record
title, onsuccess gets the associated record from the IDBObjectStore (made available as objectStore
TitleRequest.result), updates one property of the record, and then puts the updated record back into the object store in another request. The source of the 2nd request is logged to the developer console. For a full working example, see our To-do Notifications app (view example live.) var
title = "Walk dog"; // Open up a transaction as usual var objectStore = db.transaction(['toDoList'], "readwrite").
...e updated record back into the object store in another request. The source of the 2nd request is logged to the developer console. ...
...And 6 more matches
Window.open() - Web APIs
f the browsing context (window, <iframe> or tab) into which to load the specified resource; if the name doesn't indicate an existing context, a new window is created and is given the name specified by windowName. This name can be used as the target for the target attribute of <a> or <form> elements. The name should not contain whitespace. Keep in mind that this will NOT be used as the window's
title. windowFeatures Optional A DOMString containing a comma-separated list of window features given with their corresponding values in the form "name=value". These features include options such as the window's default size and position, whether or not to include toolbar, and so forth. There must be no whitespace in the string. See Window features below for documentation of each of the features that...
...the vertical scrollbar if present. The width value does not include the sidebar if it is expanded. The minimum required value is 100. height or innerHeight Specifies the height of the content area, viewing area of the new secondary window in pixels. The height value includes the height of the horizontal scrollbar if present. The height value does not include other UI parts such as location bar,
title bar, tab bar, etc. The minimum required value is 100. If the windowFeatures parameter is non-empty and no size features are defined, then the new window dimensions will be the same as the dimensions of the most recently rendered window. Browser-dependent size features Do not use them. outerWidth (only on Firefox, obsolete from Firefox 80) Specifies the width of the whole browser window ...
...w reference must exist and the window is not closed; therefore, we can bring it back on top of any other window with the focus() method. There would be no need to re-create the window or to reload the referenced resource. */ }; } </script> (...) <p><a href="http://www.spreadfirefox.com/" target="PromoteFirefoxWindowName" onclick="openFFPromotionPopup(); return false;"
title="This link will create a new window or will re-use an already opened one" >Promote Firefox adoption</a></p> The above code solves a few usability problems related to links opening secondary window. The purpose of the return false in the code is to cancel default action of the link: if the onclick event handler is executed, then there is no need to execute the default action of the link. But if ...
...And 6 more matches
Border-image generator - CSS: Cascading Style Sheets
"Y" data-topic="slice-bottom"></div> <div class="guideline" data-axis="X" data-topic="slice-left"></div> </div> <div id="preview"> </div> </div> <!-- controls --> <div id="controls" class="group section"> <!-- border-image-slice --> <div id="border-slice-control" class="category"> <div class="
title"> border-image-slice </div> <div class="property"> <div class="name">fill</div> <div class="ui-checkbox" data-topic='slice-fill'></div> </div> </div> <!-- border-image-width --> <div id="border-width-control" class="category"> <div class="
title"> border-image-width </div> ...
...i-checkbox" data-topic='slice-fill'></div> </div> </div> <!-- border-image-width --> <div id="border-width-control" class="category"> <div class="
title"> border-image-width </div> </div> <!-- border-image-outset --> <div id="border-outset-control" class="category"> <div class="
title"> border-image-outset </div> </div> <!-- other-settings --> <div id="aditional-properties" class="category"> <div class="
title"> aditional-properties </div> <div class="property"> <div class="name"> repeat-x </div> <div class="ui-dropdown border-repeat" data-topic="image-repeat-X" data-sel...
...div> </div> <div class="property"> <div class="ui-input-slider" data-topic="preview-height" data-info="height" data-unit=" px" data-min="10" data-max="10000" data-sensivity="3"> </div> </div> </div> <div id="output" class="category"> <div class="
title"> CSS Code </div> <div class="css-property"> <span class="name"> border-image-slice: </span> <span id="out-border-slice" class="value"> </span> </div> <div class="css-property"> <span class="name"> border-image-width: </span> <span id="out-border-width" class="value"> </...
...And 6 more matches
<abbr>: The Abbreviation element - HTML: Hypertext Markup Language
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, phrasing content, palpable content Permitted content Phrasing content Tag omission None, both the starting and ending tag are mandatory. ...
... Permitted content Phrasing content Tag omission None, both the starting and ending tag are mandatory. Permitted parents Any element that accepts phrasing content Implicit ARIA role No corresponding role Permitted ARIA roles Any DOM Interface HTMLElement Attributes This element only supports the global attributes. ...
... Usage notes Typical use cases It's certainly not required that all abbreviations be marked up using <abbr>. ...
...And 6 more matches
Multiple Rules - Archive of obsolete content
h earlier rules to match this last rule. ...
...last rule. A multiple rule template looks like the following: <hbox id="photosList" datasources="template-guide-photos3.rdf" ref="http://www.xulplanet.com/rdf/myphotos"> <template> <query> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/
title" object="?
title"/> </query> <rule> <where subject="?
title" rel="equals" value="Canal"/> <action> <button uri="?photo" image="?photo" label="View" orient="vertical"/> </action> </rule> <rule> <action> <image uri="?photo" src="?photo"/> </action> </rule> </template> </hbox> This template contains a query with two rules. The query generates a lis...
...Note that the full query syntax must be used to use conditions within rules. The first rule contains a new element, where which is used to define a condition. The second rule does not contain a where element, so it matches results unconditionally, or any result that wasn't matched by a previous rule. ...
...And 5 more matches
Simple Example - Archive of obsolete content
The resource uris correspond to their actual u...
...A template which displays this information is...
...images/t/obelisk.jpg"/> </rdf:Seq> <rdf:Description rdf:about="http://www.xulplanet.com/ndeakin/images/t/palace.jpg" dc:
title="Palace from Above"/> <rdf:Description rdf:about="http://www.xulplanet.com/ndeakin/images/t/canal.jpg" dc:
title="Canal"/> <rdf:Description rdf:about="http://www.xulplanet.com/ndeakin/images/t/obelisk.jpg" dc:
title="Obelisk"/> </rdf:RDF> In this example, we have three images, which can be identified by urls. The resource uris correspond to their actual urls although this isn't necessary. Each image also has one property, the image's
title. A template which displays this information is very simple to create. Unlike previous examples where we iterated over a property to navigate the graph, here we want to i...
...And 5 more matches
Using Multiple Queries to Generate More Results - Archive of obsolete content
The first query will match the streets as before, but the second query will generate a result for each person. A header class is used to distinguish the content, although you could use exactl...
...q> <rdf:li rdf:resource="http://www.xulplanet.com/rdf/person/1"/> <rdf:li rdf:resource="http://www.xulplanet.com/rdf/person/2"/> </rdf:Seq> </r:people> </rdf:Description> <rdf:Description rdf:about="http://www.xulplanet.com/rdf/person/1" dc:
title="Nathan"/> <rdf:Description rdf:about="http://www.xulplanet.com/rdf/person/2" dc:
title="Karen"/> We can then use two queries to generate results from different parts of the datasource. The first query will match the streets as before, but the second query will generate a result for each person. A header class is used to distinguish the content, although you could use exactly the same content if you wish. <template> <queryset> <query> <content uri="?start"/> <mem...
...s as before, but the second query will generate a result for each person. A header class is used to distinguish the content, although you could use exactly the same content if you wish. ...
...And 5 more matches
window - Archive of obsolete content
the window will not be stylized and will be invisible and glitchy when opened as a dialog. Note: Starting in Gecko 1.9.2, you can detect when a window is activated or deactivated by watching for the "activate" and "deactivate" events. See Window activation events. More information is available in the XUL tutorial. ...
...you can detect when a window is activated or deactivated by watching for the "activate" and "deactivate" events. See Window activation events. More information is available in the XUL tutorial. ...
...idechrome, id, lightweightthemes, lightweightthemesfooter, screenX, screenY, sizemode,
title, width, windowtype Examples <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <!-- run this example using copy & paste in this live XUL editor: https://github.com/KM-200/xul --> <!-- Extremely recommended to keep this css include!! ...
...And 5 more matches
Example - Learn web development
This the example for a basic payment form for the article How to structure an HTML form. ...
... This the example for a basic payment form for the article How to structure an HTML form. ...
... This the example for a basic payment form for the article How to structure an HTML form. ...
...And 5 more matches
Images in HTML - Learn web development
to embed simple images in HTML, annotate them with captions, and how HTML images relate to CSS background images. How do we put an image on a webpage? In order to put a simple image on a webpage, we use the <img> element. This is an empty element (meaning that it has no text content or closing tag) that requires a minimum of one attribute to be useful -- src (sometimes spoken as its full
title, source). The src attribute contains a path pointing to the image you want to embed in the page, which can be a relative or absolute URL, in the same way as href attribute values in <a> elements. Note: You should read A quick primer on URLs and paths to refresh your memory on relative and absolute URLs before continuing. So for example, if your image is called dinosaur.jpg, and it sits in the...
...at look grainy, fuzzy, or too small, and wasting bandwidth downloading an image that is not fitting the user's needs. The image may also end up looking distorted, if you don't maintain the correct aspect ratio. You should use an image editor to put your image at the correct size before putting it on your webpage. Note: If you do need to alter an image's size, you should use CSS instead. ...
... wasting bandwidth downloading an image that is not fitting the user's needs. The image may also end up looking distorted, if you don't maintain the correct aspect ratio. You should use an image editor to put your image at the correct size before putting it on your webpage. Note: If you do need to alter an image's size, you should use CSS instead. ...
...And 5 more matches
Video and audio content - Learn web development
Previous Overview: Multimedia and embedding Next Now that we are comfortable with adding simple images to a webpage, the next step is to start adding video and audio players to your HTML documents! In this article we'll look at doing just that with the <video> and <audio> elements; we'll then finish off by looking at how to add captions/sub
titles to your videos. Prerequisites: Basic computer literacy, basic software installed, basic knowledge of working with files, familiarity with HTML fundamentals (as covered in Getting started with HTML) and Images in HTML. Objective: To learn how to embed video and audio content into a webpage, and add captions/sub
titles to video. Video and audio on the web Web developers have wanted to use video and audio on the W...
... the media, what codecs are used to encode its channels, and so forth. A WebM file containing a movie which has a main video track and one alternate angle track, plus audio for both English and Spanish, in addition to audio for an English commentary track can be conceptualized as shown in the diagram below. Also included are text tracks containing closed captions for the feature film, Spanish sub
titles for the film, and English captions for the commentary. The audio and video tracks within the container hold data in the appropriate format for the codec used to encode that media. Different formats are used for audio tracks versus video tracks. Each audio track is encoded using an audio codec, while video tracks are encoded using (as you probably have guessed) a video codec. As we talked abou...
...lting text is a "transcript." WebVTT is a format for writing text files containing multiple strings of text along with metadata such as the time in the video at which each text string should be displayed, and even limited styling/positioning information. These text strings are called cues, and there are several kinds of cues which are used for different purposes. The most common cues are: sub
titles Translations of foreign material, for people who don't understand the words spoken in the audio. captions Synchronized transcriptions of dialog or descriptions of significant sounds, to let people who can't hear the audio understand what is going on. timed descriptions Text which should be spoken by the media player in order to describe important visuals to blind or otherwise visually impai...
...And 5 more matches
HTML table advanced features and accessibility - Learn web development
he same styling. Note: We don't expect you to fully understand the CSS right now. You'll learn more about this when you go through our CSS modules (Introduction to CSS is a good place to start; we also have an article specifically on styling tables). ...
...We don't expect you to fully understand the CSS right now. You'll learn more about this when you go through our CSS modules (Introduction to CSS is a good place to start; we also have an article specifically on styling tables). ...
...generally not really advised, as it makes the markup more confusing and less accessible to screenreader users, and in many cases you might as well just insert extra cells/rows/columns into the existing table. It is however sometimes necessary, for example if you want to import content easily from other sources. ...
...And 5 more matches
Gecko info for Windows accessibility vendors
t pane object. Once the new page is ready to be displayed and traversed via its IAccessible tree, the old content window is destroyed, and a new window is created. Next, another EVENT_STATE_CHANGE is fired for the new root ROLE_DOCUMENT object for the window, with its STATE_BUSY flag cleared. ...
...CKED for radio or checkbox menuitem types Accelerator key comes in accName after a \t (TAB) character. For example, "Open\tCtrl+O" ROLE_TOOLTIP XUL: <tooltip> or tooltiptext attribute ROLE_APPLICATION Default role of root object of application DHTML: role="wairole:application" accName() exposes the <
title> of the current pane. Role Supported? Unique features ROLE_DOCUMENT Default role for root object of document DHTML: role="wairole:document" Sets STATE_READONLY indicates it is a normal document, otherwise we're in an editor. Sets STATE_BUSY when a new document is loading in this space. Fires EVENT_STATE_CHANG...
... DHTML: role="wairole:document" Sets STATE_READONLY indicates it is a normal document, otherwise we're in an editor. Sets STATE_BUSY when a new document is loading in this space. Fires EVENT_STATE_CHANGE when busy flag is set or cleared due to document load starting or finishing. accValue() exposes the URL of the current pane. accName() exposes the <
title> of the current pane. ROLE_PANE The first child of a <frame> or <iframe> accValue() exposes the URL of the current document. accName() exposes the <
title> of the current pane. Sets STATE_READONLY unless it's an editable frame via designMode. ROLE_CHART Not supported. n/a ROLE_DIALOG ...
...And 5 more matches
Extras
echnology demonstration of some of the extras in Mozilla but not defined in the MathML spec, and not prevented by the spec either. They are not portable and are meant to showcase a few interesting upshots from building natively upon the browser environment. Other renderers are expected to ignore attributes that they don't understand while the behavior of undefined elements is well, undefined. ...
...the spec either. They are not portable and are meant to showcase a few interesting upshots from building natively upon the browser environment. Other renderers are expected to ignore attributes that they don't understand while the behavior of undefined elements is well, undefined. ...
...nt to showcase a few interesting upshots from building natively upon the browser environment. Other renderers are expected to ignore attributes that they don't understand while the behavior of undefined elements is well, undefined. The
title attribute as a tooltip (from XHTML) HTML Content <p>Mouse over either log to see a tooltip showing the
title <math display="block"> <mrow> <mrow> <msub
title="Base-a log"> <mi>log</mi> <mi>a</mi> </msub> <mo>⁡</mo> <mi>x</mi> </mrow> <mo>=</mo> <mfrac> <mrow> <mi
title="Natural log">ln</mi> <mo>⁡</mo> <mi>x</mi> </mrow> <mrow> <mi
title="Natural log">ln</mi> <mo>⁡</mo> <mi>a</mi> </mrow> </mfrac> </mrow> </math> Rather than repeating the instructions, some CSS might be used to provide a visual cue. For exampl...
...And 5 more matches
Places utilities for JavaScript
sultNode aNode, string aType, nsIURI aOverrideURI); array unwrapNodes(string blob, string aType); nsITransaction makeTransaction(string data, string type, nsINavHistoryResultNode container, int index, boolean copy); nsINavHistoryResult getFolderContents(int aFolderId, boolean aExcludeItems, boolean aExpandQueries); boolean showAddBookmarkUI(nsIURI aURI, string a
Title, string aDescription, int aDefaultInsertionPoint, boolean aShowPicker, boolean aLoadInSidebar, string aKeyword, string aPostData); boolean showMinimalAddBookmarkUI(nsIURI aURI, string a
Title, string aDescription, int aDefaultInsertionPoint, boolean aShowPicker, boolean aLoadInSidebar, string aKeyword, string aPostData); boolean showAddLivemarkUI(nsIURI aFeedURI, nsIURI aSiteURI,...
...aDescription, int aDefaultInsertionPoint, boolean aShowPicker, boolean aLoadInSidebar, string aKeyword, string aPostData); boolean showMinimalAddBookmarkUI(nsIURI aURI, string a
Title, string aDescription, int aDefaultInsertionPoint, boolean aShowPicker, boolean aLoadInSidebar, string aKeyword, string aPostData); boolean showAddLivemarkUI(nsIURI aFeedURI, nsIURI aSiteURI, string a
Title, string aDescription, int aDefaultInsertionPoint, boolean aShowPicker); boolean showMinimalAddLivemarkUI(nsIURI aFeedURI, nsIURI aSiteURI, string a
Title, string aDescription, int aDefaultInsertionPoint, boolean aShowPicker); boolean showMinimalAddMultiBookmarkUI(array nsIURI aURIList); boolean showBookmarkProperties(int aId); boolean showFolderProperties(int aI...
...oint, boolean aShowPicker); boolean showMinimalAddLivemarkUI(nsIURI aFeedURI, nsIURI aSiteURI, string a
Title, string aDescription, int aDefaultInsertionPoint, boolean aShowPicker); boolean showMinimalAddMultiBookmarkUI(array nsIURI aURIList); boolean showBookmarkProperties(int aId); boolean showFolderProperties(int aId); boolean showAddFolderUI(string a
Title, int aDefaultInsertionPoint, boolean aShowPicker); array object getAnnotationsForURI(nsIURI aURI); array object getAnnotationsForItem(int aItemId); void setAnnotationsForURI(nsIURI aURI, object aAnnos); void setAnnotationsForURI(int aItemId, object aAnnos); getViewForNode(nsIDOMNode aNode); void markPageAsTyped(string aURL); void mark...
...And 5 more matches
Querying Places
onIsNot attribute AUTF8String annotation readonly attribute boolean hasAnnotation readonly attribute unsigned long folderCount Basic Query Configuration Options const unsigned short GROUP_BY_DAY = 0 const unsigned short GROUP_BY_HOST = 1 const unsigned short GROUP_BY_DOMAIN = 2 const unsigned short GROUP_BY_FOLDER = 3 const unsigned short SORT_BY_NONE = 0 const unsigned short SORT_BY_
TITLE_ASCENDING = 1 const unsigned short SORT_BY_
TITLE_DESCENDING = 2 const unsigned short SORT_BY_DATE_ASCENDING = 3 const unsigned short SORT_BY_DATE_DESCENDING = 4 const unsigned short SORT_BY_URI_ASCENDING = 5 const unsigned short SORT_BY_URI_DESCENDING = 6 const unsigned short SORT_BY_VISITCOUNT_ASCENDING = 7 const unsigned short SORT_BY_VISITCOUNT_DESCENDING = 8 const unsigned short SORT_...
...re nsINavHistoryQuery objects to executeQueries(). Within one query object, all parameters are ANDed together. The conditions for different query objects are then ORed together. This allows for a simpler implementation and interface than a full logical operation with nested clauses while still being expressive. ...
...ether. The conditions for different query objects are then ORed together. This allows for a simpler implementation and interface than a full logical operation with nested clauses while still being expressive. Example of querying for any pages I've visited that contain the word "firefox" in the
title/URL or that I've visited today from mozilla.org. ...
...And 5 more matches
Checking when a deadline is due - Web APIs
mplex example involving checking the current time and date against a deadline stored via IndexedDB. The main complication here is checking the stored deadline info (month, hour, day, etc.) against the current time and date taken from a Date object. The main example application we will be referring to in this article is To-do list notifications, a simple to-do list application that stores task
titles and deadline times and dates via IndexedDB, and then provides users with notifications when deadline dates are reached, via the Notification, and Vibration APIs. You can download the To-do list notifications app from github and play around with the source code, or view the app running live. The basic problem In the to-do app, we wanted to first record time and date information in a format that...
...ate objects, but of course humans don't want to enter deadline information in the same format JavaScript understands. Human-readable dates are quite different, with a number of different representations. Recording the date information To provide a reasonable user experience on mobile devices, and to cut down on ambiguities, I decided to create an HTML form with: A text input for entering a
title for your to-do list. This is the least avoidable bit of user typing. Number inputs for the hour and minute parts of the deadline. On browsers that support type="number", you get a nice little up and down arrow number picker. On mobile platforms you tend to get a numeric keypad for entering data, which is helpful. On others you just get a standard text input, which is okay. <select> elements for...
... to give them a choice to pick from, which also saves on annoying typing for mobile users. The days are recorded as numerical days of the month, the months are recorded as full month names, and the years are recorded as full four digit year numbers. When the form's submit button is pressed, we run the addData() function, which starts like this: function addData(e) { e.preventDefault(); if(
title.value == '' || hours.value == null || minutes.value == null || day.value == '' || month.value == '' || year.value == null) { note.innerHTML += '<li>Data not submitted -- form incomplete.</li>'; return; } In this segment, we check to see if the form fields have all been filled in. If not, we drop a message into our developer notifications pane (see the bottom left of the app UI) to tel...
...And 5 more matches
HTML documentation index - HTML: Hypertext Markup Language
le or files. This attribute and the <style> element have mainly the purpose of allowing for quick styling, for example for testing purposes. 31 tabindex Global attributes, HTML, Reference The tabindex global attribute indicates that its element can be focused, and where it participates in sequential keyboard navigation (usually with the Tab key, hence the name). 32
title Global attributes, HTML, Reference,
Title The
title global attribute contains text representing advisory information related to the element it belongs to. 33 translate Experimental, Global attributes, HTML, Reference The translate global attribute is an enumerated attribute that is used to specify whether an element's translateable attribute values and its Text node...
...l addresses, locations in the same page, or anything else a URL can address. 56 <abbr>: The Abbreviation element Acronym, Definitions, Element, HTML, HTML text-level semantics, HTML:Flow content, HTML:Palpable Content, HTML:Phrasing content, Reference, Web, abbr, abbreviation, semantics The HTML Abbreviation element (<abbr>) represents an abbreviation or acronym; the optional
title attribute can provide an expansion or description for the abbreviation. 57 <acronym> Element, HTML, HTML:Flow content, Obsolete, Reference, Web The HTML Acronym Element (<acronym>) allows authors to clearly indicate a sequence of characters that compose an acronym or abbreviation for a word. 58 <address>: The Contact Address element Address, Author, Contact, Co...
...rd button functionality. 76 <canvas>: The Graphics Canvas element Canvas, Element, HTML, HTML scripting, HTML5, Reference, Web Use the HTML <canvas> element with either the canvas scripting API or the WebGL API to draw graphics and animations. 77 <caption>: The Table Caption element Element, HTML, HTML Tables, HTML tabular data, Reference, Table Captions, Table
Titles, Tables, Web, caption The HTML <caption> element specifies the caption (or
title) of a table. 78 <center>: The Centered Text element (obsolete) Element, HTML, Obsolete, Reference, Text, Text Alignment, Web, alignment, center The obsolete HTML Center Element (<center>) is a block-level element that displays its block-level or inline contents centered horizontally within...
...And 5 more matches
SVG animation with SMIL - SVG: Scalable Vector Graphics
the <circle> element. The important attributes for <animate> are: attributeName The name of the attribute to animate. from The initial value of the attribute. to The final value. dur The duration of the animation (for example, write '5s' for 5 seconds). If you want to animate more attributes inside the same element, just add more <animate> elements. ...
...attributes for <animate> are: attributeName The name of the attribute to animate. from The initial value of the attribute. to The final value. dur The duration of the animation (for example, write '5s' for 5 seconds). If you want to animate more attributes inside the same element, just add more <animate> elements. <svg width="300" height="100"> <
title>Attribute Animation with SMIL</
title> <rect x="0" y="0" width="300" height="100" stroke="black" stroke-width="1" /> <circle cx="0" cy="50" r="15" fill="blue" stroke="black" stroke-width="1"> <animate attributeName="cx" from="0" to="500" dur="5s" repeatCount="indefinite" /> </circle> </svg> Animating the transform attributes The <animateTransform> element let you animate transform attributes. This new elem...
...m> element let you animate transform attributes. This new element is necessary because we are not animating a simple attribute like x which is just a number. Rotation attributes look like this: rotation(theta, x, y), where theta is the angle in degrees, and x and y are absolute positions. In the example below, we animate the center of the rotation and the angle. ...
...And 5 more matches
tabs - Archive of obsolete content
ttp://www.example.com"); Track tabs You can register event listeners to be notified when tabs open, close, finish loading DOM content, or are made active or inactive: var tabs = require("sdk/tabs"); // Listen for tab openings. tabs.on('open', function onOpen(tab) { myOpenTabs.push(tab); }); // Listen for tab content loads. ...
...nings. tabs.on('open', function onOpen(tab) { myOpenTabs.push(tab); }); // Listen for tab content loads. tabs.on('ready', function(tab) { console.log('tab is loaded', tab.
title, tab.url); }); Access tabs The module itself can be used as a list of all opened tabs across all windows. ...
...('tab is loaded', tab.
title, tab.url); }); Access tabs The module itself can be used as a list of all opened tabs across all windows. ...
...And 4 more matches
package.json - Archive of obsolete content
thers, such as lib, permissions, and preferences, represent instructions to the jpm tool itself to generate and include particular code and data structures in your add-on. Creating a manifest The package.json file is initially generated in your add-on's root directory the first time you run jpm init. ...
...Defaults to an empty string. ...
...Defaults to an empty string. It may include a optional URL in parentheses and an email address in angle brackets. ...
...And 4 more matches
JavaScript Daemons Management - Archive of obsolete content
future date. The date argument can be a Date object, a string expressing the date in GMTString format, or a number expressing the number of milliseconds since January 1, 1970, 00:00:00 UTC. Only the length property will be modified. ...
...nt can be a Date object, a string expressing the date in GMTString format, or a number expressing the number of milliseconds since January 1, 1970, 00:00:00 UTC. Only the length property will be modified. ...
...The @context object must contain *at least* |*| a "perform" property poi...
...And 4 more matches
prefwindow - Archive of obsolete content
ys. Note for Mac OS X: a common way of opening modal windows on Mac OS X that are not attached as a sheet to the main window is to use nsIWindowWatcher.openWindow() with a null parentWindow. This does not work with prefwindows, breaking the general behavior of the window and in particular the list of prefpanes. ...
...eral behavior of the window and in particular the list of prefpanes. Prefer the classical window.openDialog() with the following window features: "chrome,
titlebar,toolbar,centerscreen,dialog=yes". ...
...This only affects Mac OS X. buttonalign Type: string The value of the align attribute for the box containing the buttons. buttondir Type: string The value of the dir attribute for the bo...
...And 4 more matches
Looping code - Learn web development
do, you want to do each different one, not the same one over and over again! Let's look at an example to perfectly illustrate why loops are such a good thing. ...
...erent one, not the same one over and over again! Let's look at an example to perfectly illustrate why loops are such a good thing. ...
...e so we can visualize what these do more clearly. ...
...And 4 more matches
nsINavHistoryObserver
Methods ...
... Methods onBeforeDeleteURI() Obsolete since...
...RTime aVisitTime, in boolean aWholeEntry ); Parameters aURI The URI of the page that expired. aVisitTime The visit time that expired; this may (or may not) be 0 if a bookmark with no visits is deleted. aWholeEntry true if this expiration will result in the entire history entry being deleted from the history store; if false, only the specified visit is being deleted. on
TitleChanged() Called whenever either the real
title or the custom
title of the page changes. Both
titles are always included in this notification, even though only one is changed each time it is called, since often consumers will want to display the user
title if available, falling back to the
title specified by the page's <
title> element if there is no user
title. It's important to note that there is...
...And 4 more matches
nsIPrompt
to nsIPromptService. If you are using this interface, you must remove the nsIDOMWindow arguments from those methods. Normally you would use the prompt service as it is more flexible, but sometimes a callback will request an nsIPrompt via nsIInterfaceRequestor.getInterface(). To get an instance, call the nsIWindowWatcher.getNewPrompter(). ...
... nsIDOMWindow arguments from those methods. Normally you would use the prompt service as it is more flexible, but sometimes a callback will request an nsIPrompt via nsIInterfaceRequestor.getInterface(). To get an instance, call the nsIWindowWatcher.getNewPrompter(). ...
...es a callback will request an nsIPrompt via nsIInterfaceRequestor.getInterface(). To get an instance, call the nsIWindowWatcher.getNewPrompter(). ...
...And 4 more matches
ContentIndex.add() - Web APIs
Used in user-visible lists of content. description: A String description of the item. ...
...Used in user-visible lists of content. description: A String description of the item. ...
...Used in user-visible lists of content. description: A String description of the item. ...
...And 4 more matches
ARIA live regions - Accessibility
It is nam...
...foButton">Go</button> </fieldset> <div role="region" id="planetInfo" aria-live="polite"> <h2 id="planet
Title">No planet selected</h2> <p id="planetDescription">Select a planet to view its description</p> </div> <p><small>Information courtesy <a href="https://en.wikipedia.org/wiki/Solar_System#Inner_Solar_System">Wikipedia</a></small></p> JavaScript const PLANETS_INFO = { mercury: {
title: 'Mercury', description: 'Mercury is the smallest and innermost planet in the Solar System. It is named after the Roman deity Mercury, the messenger to the gods.' }, venus: {
title: "Venus", description: 'Venus is the second planet from the Sun. It is named after the Roman goddess of love and beauty.' }, earth: {
title: "Earth", description: 'Earth is the third plane...
...m. It is named after the Roman deity Mercury, the messenger to the gods.' }, venus: {
title: "Venus", description: 'Venus is the second planet from the Sun. It is named after the Roman goddess of love and beauty.' }, earth: {
title: "Earth", description: 'Earth is the third planet from the Sun and the only object in the Universe known to harbor life.' }, mars: {
title: "Mars", description: 'Mars is the fourth planet from the Sun and the second-smallest planet in the Solar System after Mercury. In English, Mars carries a name of the Roman god of war, and is often referred to as the "Red Planet".' } }; function renderPlanetInfo(planet) { const planet
Title = document.querySelector('#planet
Title'); const planetDescription = document.querySelector('#plan...
...And 4 more matches
ARIA: dialog role - Accessibility
pplication dialog or window that separates content or UI from the rest of the web application or page. Dialogs are generally placed on top of the rest of the page content using an overlay. Dialogs can be either non-modal (it's still possible to interact with content outside of the dialog) or modal (only the content in the dialog can be interacted with). ...
... from the rest of the web application or page. Dialogs are generally placed on top of the rest of the page content using an overlay. Dialogs can be either non-modal (it's still possible to interact with content outside of the dialog) or modal (only the content in the dialog can be interacted with). <div role="dialog" aria-labelledby="dialog1
Title" aria-describedby="dialog1Desc"> <h2 id="dialog1
Title">Your personal details were successfully updated</h2> <p id="dialog1Desc">You can change your details at any time in the user account section.</p> <button>Close</button> </div> Description Marking up a dialog element with the dialog role helps assistive technology identify the dialog's content as being grouped and separated from the rest of the page content. However, adding role="dialog" al...
... able to receive focus, it still needs to be labeled. The label given to the dialog will provide contextual information for the interactive controls inside the dialog. In other words, the dialog's label acts like a grouping label for the controls inside it (similar to how a <legend> element provides a grouping label for the controls inside a <fieldset> element). If a dialog already has a visible
title bar, the text inside that bar can be used to label the dialog itself. The best way to achieve this is by using the aria-labelledby attribute to the role="dialog" element. Additionally, if the dialog contains additional descriptive text besides the dialog
title, this text can be associated with the dialog using the aria-describedby attribute. This approach is shown in the code snippet below: <div...
...And 4 more matches
HTML attribute: pattern - HTML: Hypertext Markup Language
mented in our guide on regular expressions; the 'u' flag is specified when compiling the regular expression, so that the pattern is treated as a sequence of Unicode code points, instead of as ASCII. No forward slashes should be specified around the pattern text. If the specified pattern is not specified or is invalid, no regular expression is applied and this attribute is ignored. Tip: Use the
title attribute to specify text that most browsers will display as a tooltip to explain what the requirements are to match the pattern. You should also include other explanatory text nearby. Some of the input types supporting the pattern attribute, notably the email and url input types, have expected value syntaxes that must be matched. If the pattern attribute isn't present, and the value doesn't m...
...y the email and url input types, have expected value syntaxes that must be matched. If the pattern attribute isn't present, and the value doesn't match the expected syntax for that value type, the ValidityState object's read-only typeMismatch property will be true. Usability When including a pattern, provide a description of the pattern in visible text near the control. ...
.... If the pattern attribute isn't present, and the value doesn't match the expected syntax for that value type, the ValidityState object's read-only typeMismatch property will be true. Usability When including a pattern, provide a description of the pattern in visible text near the control. Additionally, include a
title attribute which gives a description of the pattern. User agents may use the
title contents during constraint validation to tell the user that the pattern is not matched. Some browsers show a tooltip with
title contents, improving usability for sighted users. Additionally, assistive technology may read the
title aloud when the control gains focus, but this should not be relied upon for accessibility. Constraint validation If the input's value is not the empty string and the v...
...And 4 more matches
preserveAspectRatio - SVG: Scalable Vector Graphics
="60"><use href="#smiley" /></svg> </svg> topExample html,body,svg { height:100% } <svg viewBox="-1 -1 162 92" xmlns="http://www.w3.org/2000/svg"> <defs> <path id="smiley" d="M50,10 A40,40,1,1,1,50,90 A40,40,1,1,1,50,10 M30,40 Q36,35,42,40 M58,40 Q64,35,70,40 M30,60 Q50,75,70,60 Q50,75,30,60" /> </defs> <!-- (width>height) meet --> <rect x="0" y="0" width="20" height="10"> <
title>xMidYMid meet</
title> </rect> <svg viewBox="0 0 100 100" width="20" height="10" preserveAspectRatio="xMidYMid meet" x="0" y="0"> <use href="#smiley" /> </svg> <rect x="25" y="0" width="20" height="10"> <
title>xMinYMid meet</
title> </rect> <svg viewBox="0 0 100 100" width="20" height="10" preserveAspectRatio="xMinYMid meet" x="25" y="0"> <use href="#smiley" /...
...width="20" height="10" preserveAspectRatio="xMidYMid meet" x="0" y="0"> <use href="#smiley" /> </svg> <rect x="25" y="0" width="20" height="10"> <
title>xMinYMid meet</
title> </rect> <svg viewBox="0 0 100 100" width="20" height="10" preserveAspectRatio="xMinYMid meet" x="25" y="0"> <use href="#smiley" /> </svg> <rect x="50" y="0" width="20" height="10"> <
title>xMaxYMid meet</
title> </rect> <svg viewBox="0 0 100 100" width="20" height="10" preserveAspectRatio="xMaxYMid meet" x="50" y="0"> <use href="#smiley" /> </svg> <!-- (width>height) slice --> <rect x="0" y="15" width="20" height="10"> <
title>xMidYMin slice</
title> </rect> <svg viewBox="0 0 100 100" width="20" height="10" preserveAspectRatio="xMidYMin slice" x="0...
...veAspectRatio="xMaxYMid meet" x="50" y="0"> <use href="#smiley" /> </svg> <!-- (width>height) slice --> <rect x="0" y="15" width="20" height="10"> <
title>xMidYMin slice</
title> </rect> <svg viewBox="0 0 100 100" width="20" height="10" preserveAspectRatio="xMidYMin slice" x="0" y="15"> <use href="#smiley" /> </svg> <rect x="25" y="15" width="20" height="10"> <
title>xMidYMid slice</
title> </rect> <svg viewBox="0 0 100 100" width="20" height="10" preserveAspectRatio="xMidYMid slice" x="25" y="15"> <use href="#smiley" /> </svg> <rect x="50" y="15" width="20" height="10"> <
title>xMidYMax slice</
title> </rect> <svg viewBox="0 0 100 100" width="20" height="10" preserveAspectRatio="xMidYMax slice" x="50" y="15"> <use href="#s...
...And 4 more matches
ui/frame - Archive of obsolete content
It occupies the whole width of the browser window and is 18 pixels high on a normal-resolution display or 36 pixels high on a high-resolution (HiDPI) display. This toolbar might look something like: Scripting frames To add scripts to frames, include them directly from the frame's HTML...
...ssages in the main add-on code, you can assign a listener to the frame's message event. The data property of the event is the message payload. var { Frame } = require("sdk/ui/frame"); var { Toolbar } = require("sdk/ui/toolbar"); var frame = new Frame({ url: "./city-info.html", onMessage: (e) => { console.log("New city: " + e.data); } }); var toolbar = Toolbar({ name: "city-info",
title: "City info", items: [frame] }); From add-on to all frames To send a message from the add-on code to all frames, attached to all open browser windows, you can use Frame.postMessage(). You can specify the frame's url property as the targetOrigin: frame.postMessage(message, frame.url); This add-on listens for a frame script to send the "city changed" message above, and in response, updates a...
...a dictionary, where in a real case it might ask a web service): var { Frame } = require("sdk/ui/frame"); var { Toolbar } = require("sdk/ui/toolbar"); var weather = { "London" : "Rainy", "Toronto" : "Snowy", "San Francisco" : "Foggy" } var frame = new Frame({ url: "./city-info.html", onMessage: (e) => { updateWeather(e.data); } }); var toolbar = Toolbar({ name: "city-info",
title: "City info", items: [frame] }); function updateWeather(location) { frame.postMessage(weather[location], frame.url); } To listen to these messages in the frame script, add a listener to the window's message event: window.addEventListener("message", updateWeather, false); function updateWeather(message) { var label = window.document.getElementById("weather"); label.textContent = messag...
...And 3 more matches
Style System Overview - Archive of obsolete content
es inherit and some properties use initial value. inherited: 'font-size', 'color', etc. "reset": 'border', 'background', etc. ...
...properties use initial value. inherited: 'font-size', 'color', etc. "reset": 'border', 'background', etc. ...
...xample document source <doc> <
title>A few quotes</
title> <para class="emph"> Franklin said that <quote>"A penny saved is a penny earned."</quote> </para> <para> FDR said <quote>"We have nothing to fear but <span class="emph">fear itself.</span>"</quote> </para> </doc> Example document tree doc ? ? ?
title para class="emph" para ? ? quote quote ? ...
...And 3 more matches
Creating a Help Content Pack - Archive of obsolete content
.com/NC-rdf#"> </rdf:RDF> If you're familiar with HTML or XML, you might recognize this as the container element for the whole document. It serves as a wrapper around the entire contents of the file, marking it as RDF. Next, you'll need to insert a rdf:Description element into the file, inside the rdf:RDF element just created: <rdf:Description rdf:about="urn:root" nc:
title="" nc:defaulttopic="" nc:base=""> </rdf:Description> Fill in the attributes as follows: rdf:about must be urn:root or your pack won't work. This attribute marks the start point in the RDF graph described by the file, and the Help Viewer searches for this element in order to query for further information (stored in child elements) about the conten...
...nc:defaulttopic="" nc:base=""> </rdf:Description> Fill in the attributes as follows: rdf:about must be urn:root or your pack won't work. This attribute marks the start point in the RDF graph described by the file, and the Help Viewer searches for this element in order to query for further information (stored in child elements) about the content pack being parsed. nc:
title is where you specify the
title (e.g., "Mozilla Firefox Help") for the Help Window. This attribute is required. nc:defaulttopic will hold the rdf:ID of the topic you want displayed when the viewer first loads if none has been specified. This attribute also specifies what topic is loaded when the user hits the Home button in the viewer. We'll get to exactly how to fill in this attribute later. Thi...
...q above: <rdf:li> <rdf:Description nc:name="" nc:link=""/> </rdf:li> The rdf:li element serves purely to contain each separate entry. The rdf:Description element describes the glossary entry. It has two required attributes: nc:name and nc:link. nc:name is the name for the entry - it's what's currently displayed in the glossary as the entry's
title. nc:link contains a URI referencing what will be displayed in the viewer when the entry is accessed. The Index File One important note on the index file is that there is no automatically generated set of top-level letters (e.g., A for Accessibility and Automation or B for Book and Border). Help documentation may be written in any language, so such automatic splitting is not desirable. You must...
...And 3 more matches
Bindings - Archive of obsolete content
he previous example to show more information. For example, a description could be added to a photo. To do this all we need to do is add the necessary data to the RDF datasource and add another <triple> element to the template's statements. <query> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/
title" object="?
title"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/description" object="?description"/> </query> It works similarly to the previous triple. The ?photo variable is filled in with the known value and then the arc is looked up the datasource, filling in the value for the ?description variable. The ?description variable would then b...
...ription variable would then be used in the action body. Let assume though, that we are only going to add a description to one of the photos in the datasource; the other two photos will not have a description. This may mean the description is not known, or that it wasn't filled in by the user. <rdf:Description rdf:about="http://www.xulplanet.com/ndeakin/images/t/palace.jpg" dc:
title="Palace from Above"/> dc:description="View from the top of the tower looking east of the Doges Palace"/> If you try a full example based on this data, you will notice that only one result has been generated. This is because only one item has a description. Here is the data after the first <triple> has been evaluated. (?start = http://www.xulplanet.com/rdf/myphotos, ?photo = h...
...n="View from the top of the tower looking east of the Doges Palace"/> If you try a full example based on this data, you will notice that only one result has been generated. This is because only one item has a description. Here is the data after the first <triple> has been evaluated. ...
...And 3 more matches
Simple Query Syntax - Archive of obsolete content
used instead. In the simple syntax, the builder will use the default query shown above, although the variable names are randomly generated. Since the photos list iterates over the children of a container, we can use the simple syntax. Here is what it might look like: <template> <vbox class="box-padded" uri="rdf:*"> <image src="rdf:*"/> <label value="rdf:http://purl.org/dc/elements/1.1/
title"/> </vbox> </template> There is no <query> or <action> element used. Instead, the builder uses a default query, and the action is placed directly inside the <template> element. You can see that this code is much simpler than the full syntax. To understand how this works, let's examine how the builder processes a simple query. First, it evaluates the default query as above, except that no varia...
...e are several attributes in the example XUL content above that have values prefixed with 'rdf:'. Since you can't declare variables in the simple syntax, a different way is used to grab RDF data. The 'rdf:' prefix means look up a predicate pointing out of the node for that result (the child or member node). For example, the label's value attribute has a value of rdf:http://purl.org/dc/elements/1.1/
title'. This means look up the value of the predicate http://purl.org/dc/elements/1.1/
title' pointing out of the current result. Of course, it should be obvious that this causes the value attribute to be set to the photo's
title. You can get other predicates in the same way, just by using the predicate uri and prefixing it with 'rdf:'. You can also combine two in one attribute by separating them with a...
...Of course, it should be obvious that this causes the value attribute to be set to the photo's
title. You can get other predicates in the same way, just by using the predicate uri and prefixing it with 'rdf:'. You can also combine two in one attribute by separating them with a space or a caret (^) just as you can with the full syntax. For example: <label value="rdf:http://purl.org/dc/elements/1.1/
title http://www.xulplanet.com/rdf/country"/> The 'rdf:' form is really equivalent to the <binding> tag in the full syntax. The subject of the binding is the result member resource, the predicate is the string that comes after 'rdf:' and the object isn't necessary as the value is replaced directly in the attribute. As with bindings, the value is not required to match, so the data doesn't have to exist...
...And 3 more matches
Static Content - Archive of obsolete content
The content will be displayed just ...
...The content will be displayed just like it would be as if the template w...
...The content will be displayed just like it would be as if the template wasn't present. That is, before the template is examined, the menulist would have one item in it, with...
...And 3 more matches
XBL Attribute Inheritance - Archive of obsolete content
tbox (a textbox with a text description beside it) out of a label and a textbox element, the label will need to inherit its text from the value attribute and the textbox will also need to inherit its default value from the value attribute as well. To solve this, we will need to use a different attribute and map it to the same one. The following demonstrates this: XUL: <box class="labeledtextbox"
title="Enter some text:" value="OK"/> CSS: box.labeledtextbox { -moz-binding: url('chrome://example/skin/example.xml#labeledtextbox'); } XBL: <binding id="labeledtextbox"> <content> <xul:label xbl:inherits="value=
title"/> <xul:textbox xbl:inherits="value"/> </content> </binding> The textbox inherits the value attribute directly. To set the value attribute on the label, we need to u...
...skin/example.xml#labeledtextbox'); } XBL: <binding id="labeledtextbox"> <content> <xul:label xbl:inherits="value=
title"/> <xul:textbox xbl:inherits="value"/> </content> </binding> The textbox inherits the value attribute directly. To set the value attribute on the label, we need to use a different attribute name and map it to the value. The inherits attribute on the label grabs the
title attribute from the labeledtextbox and maps it to the value attribute of the label element. The syntax <inner attribute>=<outer attribute> is used to map one attribute to another. ...
...ctly. To set the value attribute on the label, we need to use a different attribute name and map it to the value. The inherits attribute on the label grabs the
title attribute from the labeledtextbox and maps it to the value attribute of the label element. The syntax <inner attribute>=<outer attribute> is used to map one attribute to another. ...
...And 3 more matches
dialog - Archive of obsolete content
ogs and prompts (code snippets). ...
...buttonlabeldisclosure, buttonlabelextra1, buttonlabelextra2, buttonlabelhelp, buttonorient, buttonpack, buttons, defaultButton,
title Properties buttons, defaultButton Methods acceptDialog, cancelDialog, centerWindowOnScreen, getButton, moveToAlertPosition Examples <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> <dialog id="donothing"
title="Dialog example" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" buttons="accept,cancel" buttonlabelcancel="Cancel" buttonlabelaccept="Save"> <dialogheader
title="Options" description="My preferences"/> <groupbox> <caption label="Colour"/> <radiogroup> <radio label="Red"/> <radio label="Green" selected="true"/> <radio label="Blue"/> ...
...This only affects Mac OS X. buttonaccesskeyaccept Type: string The access key to use for the "accept" button. ...
...And 3 more matches
wizard - Archive of obsolete content
unless you use the next and pageid attributes on the pages to change the sequence. The wizard will rendered in a manner suitable for the user's selected theme and platform. In newer versions of Mozilla, a statusbar may be placed directly inside the wizard element which will be shared among all pages. More information is available in the XUL tutorial. ...
...e for the user's selected theme and platform. In newer versions of Mozilla, a statusbar may be placed directly inside the wizard element which will be shared among all pages. More information is available in the XUL tutorial. ...
...l. ...
...And 3 more matches
Windows and menus in XULRunner - Archive of obsolete content
he things common to a desktop application user interface: Windows and dialogs Menus and toolbars OS Common dialogs Controls or widgets Windows Each window or dialog should be created in its own XUL file. The XUL file may also contain other top-level declarations for CSS and DTD, which I will discuss in a moment. <window> is the basic windowing element in XUL. ...
...as attributes to set the
title/caption as well as to control its width and height. Although I have not seen it mentioned yet, I am assuming that you can only have one <window> element per XUL file. Here is an example: <?xml version="1.0"?> <?xml-stylesheet href="chrome://basicapp/skin/main.css" type="text/css"?> <!DOCTYPE window SYSTEM "chrome://basicapp/locale/main.dtd"> <window id="main"
title="&
title;" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script src="main.js"/> ... </window> Notice the references to CSS and DTD files. The CSS is used to apply formatting to elements, just as it would in HTML. ...
...Also notice the <script> element which is used to include the window's JavaScript into the XUL file. ...
...And 3 more matches
2D maze game with device orientation - Game development
side. audio: The sound files used in the game. Setting up the Canvas We will be rendering our game on Canvas, but we won't do it manually -- this will be taken care of by the framework. Let's set it up: our starting point is the index.html file with the following content. ...
...d files used in the game. Setting up the Canvas We will be rendering our game on Canvas, but we won't do it manually -- this will be taken care of by the framework. Let's set it up: our starting point is the index.html file with the following content. ...
...The <body> contains initialization of the Phaser framework and the definitions of the game states. var game = new Phaser.Game(320, 480, Phaser.CANVAS, 'game'); The line above will initialize the Phaser instance -- the arguments are the width of the Canvas, height of the Canvas, rendering method (we're using CANVAS, but there are also WEBGL...
...And 3 more matches
MathML Demo: <mspace> - space
for easier viewing. You can set the width ? x y height ? x y and depth [ x y ] of mspace elements (click the math text to view the numeric values that are set). Interactive Sizing HTML Content <p> Use the control buttons below to adjust the parameters of the <code>mspace</code> element and see the effects. ...
...depth [ x y ] of mspace elements (click the math text to view the numeric values that are set). Interactive Sizing HTML Content <p> Use the control buttons below to adjust the parameters of the <code>mspace</code> element and see the effects. ...
...ues that are set). Interactive Sizing HTML Content <p> Use the control buttons below to adjust the parameters of the <code>mspace</code> element and see the effects. ...
...And 3 more matches
TPS Tests
TPS addon so that other tests can use it. Example Test Here's an example TPS test to tie it all together. ...
...Note that it's equivalent to what you get after applying the propertie...
...al list of bookmarks to be added to the browser var bookmarks_initial = { "menu": [ { uri: "http://www.google.com",
title "google.com", changes: { // These properties are ignored by calls other than Bookmarks.modify
title: "Google" } }, { folder: "foldera" }, { folder: "folderb" } ], "menu/foldera": [ { uri: "http://www.yahoo.com",
title: "testing Yahoo", changes: { location: "menu/folderb" } } ] }; // The state of bookmarks after the first 'modify' action has been performed // on them. ...
...And 3 more matches
nsAString_internal
erminated. This type is not instantiated directly. A sub-class is instantiated instead. For example, see nsTString. NAMES: nsAString for wide characters nsACString for narrow characters Many of the accessors on nsTSubstring are inlined as an optimization. ...
...sAString for wide characters nsACString for narrow characters Many of the accessors on nsTSubstring are inlined as an optimization. ...
...on. ...
...And 3 more matches
nsIAlertsService
. Note: Since Gecko 22, the notifications are provided by Firefox and have become platform-independent. ...
...olean inPrivateBrowsing); void closeAlert([optional] in AString name, [optional] in nsIPrincipal principal); Methods showAlertNotification() Displays a notification window. Note: If you are calling this function from JavaScript, you should wrap it in a try/catch because it can fail on Mac OS X prior to Firefox 22. ...
...text, in boolean textClickable, Optional in AString cookie, Optional in nsIObserver alertListener, Optional in AString name, Optional in AString dir, Optional in AString lang, Optional in AString data, Optional in nsIPrincipal principal, Optional in boolean inPrivateBrowsing, Optional ); Parameters imageUrl A URL identifying the image to display in the notification alert.
title The
title for the alert. text The text to display in the alert, explaining the alert condition. The text must not be too long, otherwise it might be truncated to a platform-specific length. If the text is too long, try to use line returns in the text to have it split and displayed over multiple lines. textClickable Optional If true, if the user clicks on it, the listener is notified; when ho...
...And 3 more matches
nsIAuthPrompt
d for authentication. Inherits from: nsISupports Last changed in Gecko 1.9 (Firefox 3) This interface is implemented by @mozilla.org/login-manager/prompter;1. ...
... S...
... SAVE_PASSWORD_FOR_SESSION 1 Saves the password for the session. ...
...And 3 more matches
nsIFilePicker
, and naming, new files. Inherits from: nsISupports Last changed in Gecko 17.0 (Firefox 17.0 / Thunderbird 17.0 / SeaMonkey 2.14) Implemented by: @mozilla.org/filepicker;1. ...
...4) Implemented by: @mozilla.org/filepicker;1. ...
... *.divx, *.flv, *.m4v, *.mkv, *.mov, *.mp4, *.mpeg, *.mpg, *.ogm, *.ogv, *.ogx, *.rm, *.rmvb, *.smil, *.webm, *.wmv and *.xvid filters for file extensions. Methods appendFilter() Appends a custom file extension filter to the dialog. The filter appended first will be used to display the nsIFilePicker dialog, the user may then select another from the list. void appendFilter( in AString
title, in AString filter ); Parameters
title The
title of the filter. filter The filter string. Multiple extensions may be included, separated by a semicolon and a space. Example Some example filter strings: "*.ics" "*.txt; *.doc; *.rtf" appendFilters() Appends a list of file extension filters, from the predefined list, to the dialog. void appendFilters( in long filterMask ); P...
...And 3 more matches
nsINavHistoryResultViewer
ount); void nodeIconChanged(in nsINavHistoryResultNode aNode); void nodeKeywordChanged(in nsINavHistoryResultNode aNode, in AUTF8String aNewKeyword); void nodeMoved(in nsINavHistoryResultNode aNode, in nsINavHistoryContainerResultNode aOldParent, in unsigned long aOldIndex, in nsINavHistoryContainerResultNode aNewParent, in unsigned long aNewIndex); void node
TitleChanged(in nsINavHistoryResultNode aNode, in AUTF8String aNew
Title); void nodeRemoved(in nsINavHistoryContainerResultNode aParent, in nsINavHistoryResultNode aNode, in unsigned long aOldIndex); void nodeTagsChanged(in nsINavHistoryResultNode aNode); void nodeURIChanged(in nsINavHistoryResultNode aNode, in AUTF8String aNewURI); void nodeReplaced(in nsINavHisto...
...nsINavHistoryContainerResultNode aContainerNode ); Parameters aContainerNode The container that should be rebuilt. nodeAnnotationChanged() Called right after the annotation on a node has changed. This is called when the annotation is changed, set, or unset. void nodeAnnotationChanged( in nsINavHistoryResultNode aNode, in AUTF8String aAnnoName ); Parameters aNode The node whose
title has changed. aAnnoName The name of the annotation that hanged. nodeDateAddedChanged() Called right after the date added property of a node has changed. void nodeKeywordChanged( in nsINavHistoryResultNode aNode, in PRTime aNewValue ); Parameters aNode The node whose
title has changed. aNewValue The new value for the node's date added property. nodeLastModifiedChanged() Called ...
... aNewValue The new value for the node's last modified property. nodeHistoryDetailsChanged() Called right after a node's last access time or access count has changed. ...
...And 3 more matches
nsISHEntry
1. ...
... contentType ACString Indicates the content-type of the document that this is a session history entry for. ...
... contentType ACString Indicates the content-type of the document that this is a session history entry for. contentViewer nsI...
...And 3 more matches
IDBRequest.onsuccess - Web APIs
The onsuccess event handler of the IDBRequest interface handles the success event, fired when the result of a request is successfully returned. The event handler takes one parameter, a success Event with type="success". Note: This feature is available in Web Workers. Syntax request.onsuccess = function(event) { ... ...
...nt, fired when the result of a request is successfully returned. The event handler takes one parameter, a success Event with type="success". Note: This feature is available in Web Workers. Syntax request.onsuccess = function(event) { ... }; Example The following example requests a given record
title, onsuccess gets the associated record from the IDBObjectStore (made available as objectStore
TitleRequest.result), updates one property of the record, and then puts the updated record back into the object store. For a full working example, see our To-do Notifications app (view example live.) var
title = "Walk dog"; // Open up a transaction as usual var objectStore = db.transaction(['toDoList'], "readwrite").objectStore('toDoList'); // Get the to-do list object that has this
title as it's ti...
...dates one property of the record, and then puts the updated record back into the object store. ...
...And 3 more matches
IDBRequest.result - Web APIs
The result read-only property of the IDBRequest interface returns the result of the request. If the request failed and the result is not available, an InvalidStateError exception is thrown. Note: This feature is available in Web Workers. ...
...t interface returns the result of the request. If the request failed and the result is not available, an InvalidStateError exception is thrown. Note: This feature is available in Web Workers. Syntax var myResult = request.result; Value any Example The following example requests a given record
title, onsuccess gets the associated record from the IDBObjectStore (made available as objectStore
TitleRequest.result), updates one property of the record, and then puts the updated record back into the object store. For a full working example, see our To-do Notifications app (view example live.) var
title = "Walk dog"; // Open up a transaction as usual var objectStore = db.transaction(['toDoList'], "readwrite").objectStore('toDoList'); // Get the to-do list object that has this
title as it's ti...
...dates one property of the record, and then puts the updated record back into the object store. ...
...And 3 more matches
Web Video Text Tracks Format (WebVTT) - Web APIs
The primary purpose of WebVTT files is to add text overlays to a <video>. WebVTT is a text based format, which must be encoded using UTF-8. Where you can use spaces you can also use tabs. There is also a small API available to represent and manage these tracks and the data needed to perform the playback of the text at the correct times. WebVTT files The MIME type of WebVTT is text/vtt. A WebVTT file (.vtt) contains cues, which can be either a single line or multiple lines, as shown below: WEBVTT 00:01.000 --> 00:04.000 - Never drink liquid nitrogen. ...
... in a cue, as seen below (see Cue settings for more information): WEBVTT 00:00:00.000 --> 00:00:04.000 position:10%,line-left align:left size:35% Where did he go? 00:00:03.000 --> 00:00:06.500 position:90% align:right size:35% I think he went down this lane. 00:00:04.000 --> 00:00:06.500 position:45%,line-right align:center size:35% What are you waiting for? WebVTT cues A cue is a single sub
title block that has a single start time, end time, and textual payload. Example 6 consists of the header, a blank line, and then five cues separated by blank lines. A cue consists of five components: An optional cue identifier followed by a newline. Cue timings. Optional cue settings with at least one space before the first and between each setting. One or more newlines. The cue payload text. ...
..., end time, and textual payload. Example 6 consists of the header, a blank line, and then five cues separated by blank lines. A cue consists of five components: An optional cue identifier followed by a newline. Cue timings. Optional cue settings with at least one space before the first and between each setting. One or more newlines. The cue payload text. Example 7 - Example of a cue 1 -
Title Crawl 00:00:05.000 --> 00:00:10.000 line:0 position:20% size:60% align:start Some time ago in a place rather distant.... Cue identifier The identifier is a name that identifies the cue. It can be used to reference the cue from a script. It must not contain a newline and cannot contain the string "-->". It must end with a single newline. They do not have to be unique, although it is common to nu...
...And 3 more matches
WindowOrWorkerGlobalScope.setInterval() - Web APIs
intervalID = window.setInterval(myCallback, 500, 'Parameter 1', 'Parameter 2'); function myCallback(a, b) { // Your code here // Parameters are purely optional. console.log(a); console.log(b); } Example 2: Alternating two colors The following example calls the flashtext() function once a second until the Stop button is pressed. ...
...ck, 500, 'Parameter 1', 'Parameter 2'); function myCallback(a, b) { // Your code here // Parameters are purely optional. console.log(a); console.log(b); } Example 2: Alternating two colors The following example calls the flashtext() function once a second until the Stop button is pressed. <!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <
title>setInterval/clearInterval example</
title> <script> var nIntervId; function changeColor() { nIntervId = setInterval(flashText, 1000); } function flashText() { var oElem = document.getElementById('my_box'); oElem.style.color = oElem.style.color == 'red' ? 'blue' : 'red'; // oElem.style.color == 'red' ? 'blue' : 'red' is a conditional or ternary operator. } function stopTextColor() { ...
... <body onload="changeColor();"> <div id="my_box"> <p>Hello World</p> </div> <button onclick="stopTextColor();">Stop</button> </body> </html> Example 3: Typewriter simulation The following example simulates typewriter by first clearing and then slowly typing content into the NodeList that matches a specified group of selectors. ...
...And 3 more matches
Generating HTML - Web APIs
ents, our own namespace is needed, http://devedge.netscape.com/2002/de, and it is given the prefix myNS (xmlns:myNS="http://devedge.netscape.com/2002/de"). Figure 2 XML file :(example2.xml)view example | view source XML Document (example2.xml): <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="example2.xsl"?> <myNS:Article xmlns:myNS="http://devedge.netscape.com/2002/de"> <myNS:
Title>My Article</myNS:
Title> <myNS:Authors> <myNS:Author company="Foopy Corp.">Mr. Foo</myNS:Author> <myNS:Author>Mr. Bar</myNS:Author> </myNS:Authors> <myNS:Body> The <b>rain</b> in <u>Spain</u> stays mainly in the plains. </myNS:Body> </myNS:Article> The XSL Stylesheet used will need to have two namespaces - one for the XSLT elements and one for our own XML elem...
... xmlns:myNS="http://devedge.netscape.com/2002/de"> <xsl:output method="html"/> ... </xsl:stylesheet version="1.0"> A template matching the root node of the XML document is created and used to create the basic structure of the HTML page. Figure 4 : Creating the basic HTML document XSL Stylesheet (example2.xsl): ... ...
.../de"> <xsl:output method="html"/> ... </xsl:stylesheet version="1.0"> A template matching the root node of the XML document is created and used to create the basic structure of the HTML page. Figure 4 : Creating the basic HTML document XSL Stylesheet (example2.xsl): ... ...
...And 3 more matches
Alternative style sheets - CSS: Cascading Style Sheets
lso supports this feature (beginning with IE 8), also accessed from View > Page Style. Chrome requires an extension to use the feature (as of version 48). The web page can also provide its own user interface to let the user switch styles. ...
... The web page can also provide its own user interface to let the user switch styles. An example: specifying the alternative stylesheets The alternate stylesheets are commonly specified using a <link> element with rel="alternate stylesheet" and
title="..." attributes. For example: <link href="reset.css" rel="stylesheet" type="text/css"> <link href="default.css" rel="stylesheet" type="text/css"
title="Default Style"> <link href="fancy.css" rel="alternate stylesheet" type="text/css"
title="Fancy"> <link href="basic.css" rel="alternate stylesheet" type="text/css"
title="Basic"> In this example, the styles "Default Style", "Fancy", and "Basic" will be listed in the Page Style submenu, with "Default Style" pre-selected. When the user selects a different style, the page will immediately be re-re...
...-selected. When the user selects a different style, the page will immediately be re-rendered using that style sheet. No matter what style is selected, the rules from the reset.css stylesheet will always be applied. Try it out Click here for a working example you can try out. Details Any stylesheet in a document falls into one of the following categories: Persistent (no rel="alternate", no
title=""): always applies to the document. Preferred (no rel="alternate", with
title="..." specified): applied by default, but disabled if an alternate stylesheet is selected. There can only be one preferred stylesheet, so providing stylesheets with different
title attributes will cause some of them to be ignored. See Correctly Using
Titles With External Stylesheets for a more detailed discussion. Al...
...And 3 more matches
Printing - Developer guides
preferred. Examples Here are some common examples. ...
...on examples. ...
...You can also try changi...
...And 3 more matches
<track>: The Embed Text Track element - HTML: Hypertext Markup Language
The tracks are formatted in WebVTT format (.vtt files) -- Web Video Text Tracks. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories None Permitted content None, it is an empty element. ...
... DOM interface HTMLTrackElement Attributes This element includes the global attributes. default This attribute indicates that the track should be enabled unless the user's preferences indicate that another track is more appropriate. This may only be used on one track element per media element. kind How the text track is meant to be used. ...
...ates that the track should be enabled unless the user's preferences indicate that another track is more appropriate. This may only be used on one track element per media element. kind How the text track is meant to be used. If omitted the default kind is sub
titles. If the attribute contains an invalid value, it will use metadata (Versions of Chrome earlier than 52 treated an invalid value as sub
titles). The following keywords are allowed: sub
titles Sub
titles provide translation of content that cannot be understood by the viewer. For example dialogue or text that is not English in an English language film. Sub
titles may contain additional content, usually extra background information. For example the text at the beginning of the Star Wars films, or the date, time, and location ...
...And 3 more matches
HTML elements reference - HTML: Hypertext Markup Language
render the page. Metadata for styles and scripts may be defined in the page or link to another file that has the information. Element Description <base> The HTML <base> element specifies the base URL to use for all relative URLs in a document. <head> The HTML <head> element contains machine-readable information (metadata) about the document, like its
title, scripts, and style sheets. <link> The HTML External Resource Link element (<link>) specifies relationships between the current document and an external resource. This element is most commonly used to link to stylesheets, but is also used to establish site icons (both "favicon" style icons and icons for the home screen and apps on mobile devices) among other things. <meta...
...an external resource. This element is most commonly used to link to stylesheets, but is also used to establish site icons (both "favicon" style icons and icons for the home screen and apps on mobile devices) among other things. <meta> The HTML <meta> element represents metadata that cannot be represented by other HTML meta-related elements, like <base>, <link>, <script>, <style> or <
title>. <style> The HTML <style> element contains style information for a document, or part of a document. <
title> The HTML
Title element (<
title>) defines the document's
title that is shown in a browser's
title bar or a page's tab. Sectioning root Element Description <body> The HTML <body> Element represents the content of an HTML doc...
...ord, line, or any arbitrary piece of text. Element Description <a> The HTML <a> element (or anchor element), with its href attribute, creates a hyperlink to web pages, files, email addresses, locations in the same page, or anything else a URL can address. <abbr> The HTML Abbreviation element (<abbr>) represents an abbreviation or acronym; the optional
title attribute can provide an expansion or description for the abbreviation. <b> The HTML Bring Attention To element (<b>) is used to draw the reader's attention to the element's contents, which are not otherwise granted special importance. <bdi> The HTML Bidirectional Isolate element (<bdi>) tells the browser's bidirectional algorithm to treat the text it contains in isol...
...And 3 more matches
Preloading content with rel="preload" - HTML: Hypertext Markup Language
ylesheet" href="styles/main.css"> Here however, we will use a rel value of preload, which turns <link> into a preloader for any resource we want. You will also need to specify: The path to the resource in the href attribute. The type of resource in the as attribute. ...
... Here however, we will use a rel value of preload, which turns <link> into a preloader for any resource we want. You will also need to specify: The path to the resource in the href attribute. The type of resource in the as attribute. A simple example might look like this (see our JS and CSS example source, and also live): <head> <meta charset="utf-8"> <
title>JS and CSS preload example</
title> <link rel="preload" href="style.css" as="style"> <link rel="preload" href="main.js" as="script"> <link rel="stylesheet" href="style.css"> </head> <body> <h1>bouncing balls</h1> <canvas></canvas> <script src="main.js" defer></script> </body> Here we preload our CSS and JavaScript files so they will be available as soon as they are required for the rendering of the page later on. ...
...ntains the MIME type of the resource the element points to. This is especially useful when preloading resources -- the browser will use the type attribute value to work out if it supports that resource, and will only download it if so, ignoring it if not. You can see an example of this in our video example (see the full source code, and also the live version): <head> <meta charset="utf-8"> <
title>Video preload example</
title> <link rel="preload" href="sintel-short.mp4" as="video" type="video/mp4"> <link rel="preload" href="sintel-short.webm" as="video" type="video/webm"> </head> <body> <video controls> <source src="sintel-short.mp4" type="video/mp4"> <source src="sintel-short.webm" type="video/webm"> <p>Your browser doesn't support HTML5 video. Here is a <a href="sintel...
...And 3 more matches
Destructuring assignment - JavaScript
at least one argument to be supplied when invoked, whereas in its current form, you can simply call drawChart() without supplying any parameters. The current design is useful if you want to be able to call the function without supplying any parameters, the other can be useful when you want to ensure an object is passed to the function. ...
...u want to be able to call the function without supplying any parameters, the other can be useful when you want to ensure an object is passed to the function. ...
...an be useful when you want to ensure an object is passed to the function. ...
...And 3 more matches
windows - Archive of obsolete content
In particular, depending on what you do with these objects, your code might not work with multiprocess Firefox. Globals Functions open(options) Open a new window. var window...
...nDeactivate function A callback function that is called when the window is made inactive. This is an optional property. Returns BrowserWindow : Properties browserWindows browserWindows provides access to all the currently open browser windows as BrowserWindow objects. ...
...dow objects. var windows = require("sdk/windows"); for (let window of windows.browserWindows) { console.log(window.
title); } console.log(windows.browserWindows.length); The currently active window is given by BrowserWindows.activeWindow: var windows = require("sdk/windows").browserWindows; windows.on('activate', function(window) { console.log("A window was activated."); var activeWindow
Title = windows.activeWindow.
title; console.log("Active window
title is: " + activeWindow
Title); }); Events The browserWindows property emits the following events which can be listened to using its on function. var windows = require("sdk/windows").browserWindows; // add a listener to the 'open' event windows.on('open', function(window) { myOpenWindows.push(window); }); // add a listener to the...
...And 2 more matches
Adding windows and dialogs - Archive of obsolete content
e window.alert function to open alert messages in our examples so far, but that's not the right way to do it. It's OK to use this function if you're just debugging some problem and want to see if the program reaches a specific line of code, or to inspect the value of a variable, but your final extension should not have alert calls anywhere. If you use window.alert, the alert window will have the
title [JavaScript Application], indicating that the source of the message is not well defined. The Prompt Service allows better alerts to be displayed. Here's an example of displaying an alert using the Prompt Service: let prompts = Cc["@mozilla.org/embedcomp/prompt-service;1"]. getService(Ci.nsIPromptService); prompts.alert(window, "Alert
Title", "Hello!"); You should of course use locali...
...efined. The Prompt Service allows better alerts to be displayed. Here's an example of displaying an alert using the Prompt Service: let prompts = Cc["@mozilla.org/embedcomp/prompt-service;1"]. getService(Ci.nsIPromptService); prompts.alert(window, "Alert
Title", "Hello!"); You should of course use localized strings instead of hard-coded ones. The Prompt Service allows you to set the
title of the dialog however you want it, and also lets you specify the window you want to use as a parent for the alert. This normally should be set to the current window. You can pass a null value and the service will pick the currently active window. Confirm Confirmation dialogs display a text with a Yes / No question, and prompts the user to choose an answer. In HTML you can use the window.confirm...
...urrently active window. Confirm Confirmation dialogs display a text with a Yes / No question, and prompts the user to choose an answer. In HTML you can use the window.confirm function for this. The Prompt Service has a confirm method with similar behavior: let prompts = Cc["@mozilla.org/embedcomp/prompt-service;1"]. getService(Ci.nsIPromptService); if (prompts.confirm(window, "Confirm
Title", "Would you like to continue?")) { // do something. } else { // do something else } The method returns a boolean value indicating the user's response. Others Unprivileged Javascript can also use the window.prompt function to receive text input from the user. The Prompt Service has a very rich set of functions that allow different kinds of inputs, such as text, passwords, usernames and p...
...And 2 more matches
Inner-browsing extending the browser navigation paradigm - Archive of obsolete content
provided in the DOM nodes. When the markup is ready, it copies the markup into the container element, which is a DIV element. The following code snippet shows a simplified version of the logic that happens in the actual sample: // doc is the DOM to the document returned articles=doc.getElementsByTagName("article"); for(i=0;i<articles.length;i++) { // acquiring the data from the DOM... ...
...of the logic that happens in the actual sample: // doc is the DOM to the document returned articles=doc.getElementsByTagName("article"); for(i=0;i<articles.length;i++) { // acquiring the data from the DOM... article
Title=article.getElementsByTagName("article").item(0).firstChild.nodeValue; // inserting the content into the container.. ...
... DOM to the document returned articles=doc.getElementsByTagName("article"); for(i=0;i<articles.length;i++) { // acquiring the data from the DOM... article
Title=article.getElementsByTagName("article").item(0).firstChild.nodeValue; // inserting the content into the container.. document.getElementById("container").innerHTML+=article
Title+"<br />"; } Source code for the sample <html> <head> <
title>Inner-browsing example, with XMLHTTPRequest and DOM</
title> <script type="text/javascript" language="javascript" src="xmlrequest.js"></script> <script> /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a ...
...And 2 more matches
Introducing the Audio API extension - Archive of obsolete content
s available, it triggers a loadedmetadata event. This event has the following attributes: mozChannels: Number of channels mozSampleRate: Sample rate per second mozFrameBufferLength: Number of samples collected in all channels This information is needed later to decode the audio data stream. ...
...tadata event. This event has the following attributes: mozChannels: Number of channels mozSampleRate: Sample rate per second mozFrameBufferLength: Number of samples collected in all channels This information is needed later to decode the audio data stream. ...
...ples. It's important to note that the samples are not separated by channels; they are all delivered together. For example, for a two-channel signal: Channel1-Sample1 Channel2-Sample1 Channel1-Sample2 Channel2-Sample2 Channel1-Sample3 Channel2-Sample3. ...
...And 2 more matches
Building Trees - Archive of obsolete content
This template uses the simple rule syntax. The extended syntax could also be used. When using the tree builder, t...
...the nsITreeView interface, so it becomes the tree's view--in other words, the tree's view and the tree's builder are the same object. When the tree is displayed, it asks the view for the contents of each cell. The builder looks at the label for the corresponding cell, translates any variables or predicates into values, and returns the value. In the example above, the first cell should display the
title. The builder doesn't compute any labels until the view asks for them. When the view requests a label for the first cell, the builder looks up the 'http://purl.org/dc/elements/1.1/
title' predicate for the row in question and returns it. The content builder generates content in the template body and substitutes data from the datasource right away. However, it will generate the same result on screen...
...oto as a property of a tree's rows. We can use that property to change the appearance of each row. ...
...And 2 more matches
Localization - Archive of obsolete content
by modifying the find files dialog so that it uses a DTD file for all of its text strings. The entire XUL file is shown below with the changes shown in red. ...
...nd files dialog so that it uses a DTD file for all of its text strings. The entire XUL file is shown below with the changes shown in red. ...
..." label="&openCmdToolbar.label;"/> <toolbarbutton id="savesearch" label="&saveCmdToolbar.label;"/> </toolbar> </toolbox> <tabbox> <tabs> <tab label="&searchTab;" selected="true"/> <tab label="&optionsTab;"/> </tabs> <tabpanels> <tabpanel id="searchpanel" orient="vertical" context="editpopup"> <description> &findDescription; </description> <spacer class="
titlespace"/> <groupbox orient="horizontal"> <caption label="&findCriteria;"/> <menulist id="searchtype"> <menupopup> <menuitem label="&type.name;"/> <menuitem label="&type.size;"/> <menuitem label="&type.date;"/> </menupopup> </menulist> <spacer class="springspace"/> <menulist id="searchmode"> <menupopup> <menuitem la...
...And 2 more matches
Simple Menu Bars - Archive of obsolete content
ed inside a toolbox and the menu would work just like any other toolbar. XUL does have some special elements which provide special functionality typical of menus. There are five elements associated with creating a menu bar and its menus, which are explained briefly here and in detail afterwards: menubar The container for the row of menus. menu Despite the name, this is actually only the
title of the menu on the menubar. This element can be placed on a menubar or can be placed separately. menupopup The popup box that appears when you click on the menu
title. This box contains the list of menu commands. menuitem An individual command on a menu. This would be placed in a menupopup. menuseparator A separator bar on a menu. This would be placed in a menupopup. You can cus...
...up> </menu> <menu id="edit-menu" label="Edit"> <menupopup id="edit-popup"> <menuitem label="Undo"/> <menuitem label="Redo"/> </menupopup> </menu> </menubar> </toolbox> Here, a simple menu bar is created using the menubar element. It will create a row for menus to be placed on. Two menus, File and Edit have been created here. The menu element creates the
title at the top of the menu, which appears on the menu bar. The popups are created using the menupopup element. It will pop up when the user clicks on the parent menu
title. The size of the popup will be large enough to fit the commands inside it. The commands themselves are created using the menuitem element. Each one represents a single command on the menu popup. You can also create separators on t...
...g menus. Note that it has been placed inside a flexible toolbox. The menubar has no special attributes but it is a type of box. This means that you could create a vertical menubar by setting the orient attribute to vertical. menu element The menu element works much like the button element. It accepts some of the same attributes plus some additional ones: id The unique identifier of the menu
title button. label The text to appear on the menu, such as File or Edit. disabled This boolean attribute determines whether the menu is disabled. Although you can, there's rarely a need to disable an entire menu. This attribute can be set to either true or false. Of course, the latter is the default. accesskey This is the key that the user can press to activate the menu item. This lette...
...And 2 more matches
dialogheader - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes | Properties | Methods | Related ] A heading row for a dialog box. This element should be placed inside a dialog element. The header may have a
title and a description. ...
... << XUL Reference home [ Examples | Attributes | Properties | Methods | Related ] A heading row for a dialog box. This element should be placed inside a dialog element. The header may have a
title and a description. ...
... << XUL Reference home [ Examples | Attributes | Properties | Methods | Related ] A heading row for a dialog box. This element should be placed inside a dialog element. The header may have a
title and a description. ...
...And 2 more matches
Why RSS Content Module is Popular - Including HTML Contents - Archive of obsolete content
oded HTML is allowed" and even provides examples showing exactly the syntax above (using CDATA and unencoded HTML). The wording of this note should be reconsidered. ...
...lowed" and even provides examples showing exactly the syntax above (using CDATA and unencoded HTML). The wording of this note should be reconsidered. ...
...n below: <?xml version="1.0"?> <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" > <channel> <
title>Example</
title> <description>An RSS Example with Slash</description> <lastBuildDate>Sun, 15 May 2005 13:02:08 -0500</lastBuildDate> <link>http://www.example.com</link> <item> <
title>A Link in Here</
title> <guid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:2005/05/15/114</guid> <pubDate>Sun, 15 May 2005 13:02:08 -0500</pubDate> <link>http://www.example.com/blog/2005/05/15/114</link> <content:encoded><![CDATA[This is a <a href="http://example.com/">link</a>.]]></content:encoded> </item> <item> ...
...And 2 more matches
Why Well-Formed Web RSS Module is Popular - Syndicating Your Comments - Archive of obsolete content
sn't machine readable. It is desirable to be able to deal with comments in the same way one deals with RSS feeds; through syndication. The RSS Well-Formed Web Module exists to fill this gap. ...
...adable. It is desirable to be able to deal with comments in the same way one deals with RSS feeds; through syndication. The RSS Well-Formed Web Module exists to fill this gap. ...
...An example using the most popular element of the Well-Formed Web RSS Module is shown below: <?xml version="1.0"> <rss version="2.0" xmlns:wfw="http://wellformedweb.org/CommentAPI/" > <channel> <
title>Example</
title> <description>An RSS Example with WFW</description> <lastBuildDate>Sun, 15 May 2005 13:02:08 -0500</lastBuildDate> <link>http://www.example.com</link> <item> <
title>I like Root Beer</
title> <guid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:article:54321</guid> <pubDate>Sun, 15 May 2005 13:02:08 -0500</pubDate> <link>http://www.example.com/article/54321</link> <wfw:commentRss>http://www.example.com/feed/rss/54321/comments</wfw:commentRss> </item> <item> <
title>Rain is Wet</
title> <guid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:article:54320</guid> ...
...And 2 more matches
How CSS is structured - Learn web development
on. This is the most common and useful method of bringing CSS to a document. You can link a single CSS file to multiple web pages, styling all of them with the same CSS stylesheet. In the Getting started with CSS, we linked an external stylesheet to our web page. ...
...on and useful method of bringing CSS to a document. You can link a single CSS file to multiple web pages, styling all of them with the same CSS stylesheet. In the Getting started with CSS, we linked an external stylesheet to our web page. You reference an external CSS stylesheet from an HTML <link> element: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <
title>My CSS experiment</
title> <link rel="stylesheet" href="styles.css"> </head> <body> <h1>Hello World!</h1> <p>This is my first CSS example</p> </body> </html> The CSS stylesheet file might look like this: h1 { color: blue; background-color: yellow; border: 1px solid black; } p { color: red; } The href attribute of the <link> element needs to reference a file on your file system. In the example...
...inside a subdirectory called styles --> <link rel="stylesheet" href="../styles/style.css"> Internal stylesheet An internal stylesheet resides within an HTML document. To create an internal stylesheet, you place CSS inside a <style> element contained inside the HTML <head>. The HTML for an internal stylesheet might look like this: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <
title>My CSS experiment</
title> <style> h1 { color: blue; background-color: yellow; border: 1px solid black; } p { color: red; } </style> </head> <body> <h1>Hello World!</h1> <p>This is my first CSS example</p> </body> </html> In some circumstances, internal stylesheets can be useful. For example, perhaps you're working wit...
...And 2 more matches
Creating hyperlinks - Learn web development
ng the text or other content, see Block level links, inside an <a> element and using the href attribute, also known as a Hypertext Reference, or target, that contains the web address. <p>I'm creating a link to <a href="https://www.mozilla.org/">the Mozilla homepage</a>. </p> This gives us the following result: I'm creating a link to the Mozilla homepage. ...
...nt and using the href attribute, also known as a Hypertext Reference, or target, that contains the web address. <p>I'm creating a link to <a href="https://www.mozilla.org/">the Mozilla homepage</a>. </p> This gives us the following result: I'm creating a link to the Mozilla homepage. Adding supporting information with the
title attribute Another attribute you may want to add to your links is
title. The
title contains additional information about the link, such as which kind of information the page contains, or things to be aware of on the web site. <p>I'm creating a link to <a href="https://www.mozilla.org/"
title="The best place to find more information about Mozilla's mission and how to contribute">the Mozilla homepage</a>. </p> This gives us the following result and hover...
... information about the link, such as which kind of information the page contains, or things to be aware of on the web site. <p>I'm creating a link to <a href="https://www.mozilla.org/"
title="The best place to find more information about Mozilla's mission and how to contribute">the Mozilla homepage</a>. </p> This gives us the following result and hovering over the link displays the
title as a tooltip. I'm creating a link to the Mozilla homepage. ...
...And 2 more matches
Accessibility API cross-reference
widget containing a collection of one or more rows with one or more cells where some or all cells in the grid are focusable by using methods of two-dimensional navigation, such as directional arrow keys, e.g. a spreadsheet. gridcell A type of mouse pointer used for resizing windows GRIP n/a n/a n/a Probably a group box (
titledbox in mozilla) GROUPING PANEL PANEL group <fieldset>, <div> A heading for a section of the page. In ARIA, the heading level is expressed with the aria-level attribute. heading <h1> ... <h6> <H1> ... <H6>. <H> is also available but its use is not recommended because of lack of suitable tools - and the heading level is undefined ...
...order and old information may disappear. log The main content of a document, distinct from complementary info, headers, footers, navigation, asides etc. main <main> A type of live region where non-essential information changes frequently. marquee The main menu bar below the app's
title bar MENUBAR MENU_BAR MENU_BAR menubar A menu item MENUITEM MENU_ITEM MENU_ITEM menuitem A menuitem with a checkable state whose possible values are true, false, or mixed. menuitemcheckbox A checkable menuitem in a set of elements with the same role, only one of which can be checked at...
... tabpanel A word or phrase with a corresponding definition. ...
...And 2 more matches
Feed content access API
ct. ...
...TestResultListener.prototype = { handleResult: function(result) { var feed = result.doc; feed.QueryInterface(Components.interfaces.nsIFeed); // Open a new window var win = window.open("", "FeedTest_Window"); var doc = win.document.wrappedJSObject; doc.open(); // Write the HTML header and page
title doc.write("<html><head><
title>Feed: " + feed.
title.text + "</
title></head><body>"); doc.write("<h1>" + feed.
title.text + "</h1><p>"); var itemArray = feed.items; var numItems = itemArray.length; // Write the article information if (!numItems) { doc.write("<i>No news is good news!</i>"); } else { var i; var theEntry; var theUrl; ...
... news is good news!</i>"); } else { var i; var theEntry; var theUrl; var info; for (i=0; i<numItems; i++) { theEntry = itemArray.queryElementAt(i, Components.interfaces.nsIFeedEntry); if (theEntry) { theUrl = doc.write('<b><a href="' + theEntry.link.resolve("") + '">' + theEntry.
title.text + '</a></b><br>'); if (theEntry.summary) { info = theEntry.summary.text + "<p><hr><p>"; } else { info = theEntry.content.text + "<p><hr><p>"; } doc.write("<blockquote>" + info); doc.write("</blockquote><p>"); } } } // Close the document; w...
...And 2 more matches
nsACString_internal
rminated. This type is not instantiated directly. A sub-class is instantiated instead. For example, see nsTString. NAMES: nsAString for wide characters nsACString for narrow characters Many of the accessors on nsTSubstring are inlined as an optimization. ...
...tring for wide characters nsACString for narrow characters Many of the accessors on nsTSubstring are inlined as an optimization. ...
...map id="classes" name="classes"> <area alt="" coords="456,5,605,53" href="http://developer.mozilla.org/en/nsACString_internal" shape="rect"
title="nsACString_internal"> <area alt="" coords="415,101,497,149" href="http://developer.mozilla.org/en/nsCString" shape="rect"
title="nsCString"> <area alt="" coords="521,101,689,149" href="http://developer.mozilla.org/en/nsDependentCSubstring" shape="rect"
title="nsDependentCSubstring"> <area alt="" coords="172,197,289,245" href="http://developer.mozilla.org/en/nsFixedCString" shape="rect"
title="nsFixedCString"> <area alt="" coords="315,197,437,245" href="http://developer.mozilla.org/en/nsXPIDLCString" shape="rect"
title="nsXPIDLCString"> <area alt="" coords="461,197,611,245" href="http://developer.mozilla.org/en/nsDependentCString" shape="rect"
title="...
...And 2 more matches
nsAString (External)
Class Declaration This header provides wrapper classes around the frozen string API which are roughly equivalent to the internal string classes. ...
... wrapper classes around the frozen string API which are roughly equivalent to the internal string classes. ...
... alt="" coords="963,6,1045,54" href="http://developer.mozilla.org/en/nsAString_(External)" shape="rect"
title="nsAString_(External)"> <area alt="" coords="939,102,1069,150" href="http://developer.mozilla.org/en/nsStringContainer_(External)" shape="rect"
title="nsStringContainer_(External)"> <area alt="" coords="548,198,676,246" href="http://developer.mozilla.org/en/nsString_external" shape="rect"
title="nsString_external"> <area alt="" coords="700,198,913,246" href="http://developer.mozilla.org/en/nsDependentSubstring_external" shape="rect"
title="nsDependentSubstring_external"> <area alt="" coords="937,198,1071,246" href="http://developer.mozilla.org/en/PromiseFlatString_(External)" shape="rect"
title="PromiseFlatString_(External)"> <area alt="" coords="1095,198,1196,246" href="http://develope...
...And 2 more matches
nsINavBookmarkObserver
erMoved(in PRInt64 folder, in PRInt64 oldParent, in PRInt32 oldIndex, in PRInt64 newParent, in PRInt32 newIndex); Obsolete since Gecko 1.9 void onFolderRemoved(in PRInt64 folder, in PRInt64 parent, in PRInt32 index); Obsolete since Gecko 1.9 void onItemAdded(in long long aItemId, in long long aParentId, in long aIndex, in unsigned short aItemType, in nsIURI aURI, in AUTF8String a
Title, in PRTime aDateAdded, in ACString aGUID, in ACString aParentGUID); void onItemChanged(in long long aItemId, in ACString aProperty, in boolean aIsAnnotationProperty, in AUTF8String aNewValue, in PRTime aLastModified, in unsigned short aItemType, in long long aParentId, in ACString aGUID, in ACString aParentGUID); void onItemMoved(in long long aItemId, in long long aOldParentId, ...
...t64 parent, in PRInt32 index ); Parameters folder The id of the folder that was added. parent The id of the folder's parent. index The folder's index inside its parent. onFolderChanged() Obsolete since Gecko 1.9 (Firefox 3) Notify this observer that a bookmark folder's information has changed. This will be called whenever any attributes like "
title" are changed. void onFolderChanged( in PRInt64 folder, in ACString property ); Parameters folder The id of the folder that was changed. property The property that was changed. onFolderMoved() Obsolete since Gecko 1.9 (Firefox 3) Notify this observer that a bookmark folder has been moved. void onFolderMoved( in PRInt64 folder, in PRInt64 oldPare...
...s this observer that an item was added. It is called after the actual addition took place. When a new item is created, all the items following it in the same folder will have their index shifted down, but no additional notifications will be sent. void onItemAdded( in long long aItemId, in long long aParentId, in long aIndex, in unsigned short aItemType, in nsIURI aURI, in AUTF8String a
Title, in PRTime aDateAdded, in ACString aGUID, in ACString aParentGUID ); Parameters aItemId The id of the item that was added. aParentId The id of the folder to which the item was added. aIndex The item's index in the folder. aItemType The type of the item that was added. This should be one of the nsINavBookmarksService.Type constants. aURI The URI of...
...And 2 more matches
nsIWebContentHandlerRegistrar
0 / Thunderbird 8.0 / SeaMonkey 2.5) Implemented by @mozilla.org/embeddor.implemented/web-content-handler-registrar;1 as a service: var nsiwchr = Cc["@mozilla.org/embeddor.implemented/web-content-handler-registrar;1"] .getService(Ci.nsIWebContentHandlerRegistrar); Method overview void registerContentHandler(in DOMString mimeType, in DOMString uri, in DOMString
title, in nsIDOMWindow contentWindow) void registerProtocolHandler(in DOMString protocol,in DOMString uri, in DOMString
title, in nsIDOMWindow contentWindow) Methods registerContentHandler Summary of registerContentHandler void registerContentHandler( in DOMString mimeType, in DOMString uri, in DOMString ti...
...dow contentWindow) Methods registerContentHandler Summary of registerContentHandler void registerContentHandler( in DOMString mimeType, in DOMString uri, in DOMString
title, in nsIDOMWindow contentWindow ); Parameters mimeType The desired MIME type as a string uri The URI to the handler as a string.
title The
title of the handler presented to the user as a string. contentWindow The DOM content window from which the method has been called. ...
... Parameters mimeType The desired MIME type as a string uri The URI to the handler as a string.
title The
title of the handler presented to the user as a string. contentWindow The DOM content window from which the method has been called. registerProtocolHandler Summary of registerProtocolHandler void registerProtocolHandler( in DOMString protocol, in DOMString uri, in DOMString
title, in nsIDOMWindow contentWindow ); Parameters protocol The protocol the site wishes to handle, specified as a string. uri The URI to the handler as a string. You must include "%s" to indicate where to insert the escaped URI of the document to be handled. ...
...And 2 more matches
nsIWindowMediator
zLevelBottom 2 Send window to bottom. zLevelBelow 3 Place window below some window. Methods addListener() Register a listener for window status changes. void addListener( in nsIWindowMe...
... zLevelBottom 2 Send window to bottom. zLevelBelow 3 Place window below some window. Methods addListener() Register a listener for window status changes. void addListener( in nsIWindowMediatorListener aListener ); Parameters ...
...Calculate whether and h...
...And 2 more matches
Using dynamic styling information - Web APIs
lectorText, and parentStyleSheet for accessing and manipulating the individual style rules that make up a CSS stylesheet. To get to the style objects from the document, you can use the document.styleSheets property and access the individual objects by index (e.g., document.styleSheets[0] is the first stylesheet defined for the document, etc.). Modify a stylesheet rule with CSSOM <html> <head> <
title>Modifying a stylesheet rule with CSSOM</
title> <style type="text/css"> body { background-color: red; } </style> <script type="text/javascript"> var stylesheet = document.styleSheets[0]; stylesheet.cssRules[0].style.backgroundColor="blue"; </script> </head> <body> The stylesheet declaration for the body's background color is modified via JavaScript. </body> </html> The list of properties avail...
...or example, will override settings made elsewhere for that element's border property in the head section, or external style sheets. However, this will not affect any other property declarations for that element's styles, such as padding or margin or font, for example. To change a particular element's style, you can adapt the following example for the element(s) you want to style. ...
...ttings made elsewhere for that element's border property in the head section, or external style sheets. However, this will not affect any other property declarations for that element's styles, such as padding or margin or font, for example. To change a particular element's style, you can adapt the following example for the element(s) you want to style. <html> <head> <
title>simple style example</
title> <script type="text/javascript"> function alterStyle(elem) { elem.style.background = 'green'; } function resetStyle(elemId) { elem = document.getElementById(elemId); elem.style.background = 'white'; } </script> <style type="text/css"> #p1 { border: solid blue 2px; } </style> </head> <body> <!-- passes a reference to the element's object as parameter 'this'. --> <p id="p1" onclick="a...
...And 2 more matches
DOMImplementation.createHTMLDocument() - Web APIs
Example This example creates a new HTML document and inserts it into an <iframe> in the current document. ...
... Example This example creates a new HTML document and inserts it into an <iframe> in the current document. ...
... Example This example creates a new HTML document and inserts it into an <iframe> in the current document. ...
...And 2 more matches
IDBDatabase: error event - Web APIs
base when a request returns an error and the event bubbles up to the connection object. ...
...error event for the add() operation (this will occur if, for example, a record with the given task
Title already exists): // Open the database const dBOpenRequest = window.indexedDB.open('toDoList', 4); dBOpenRequest.onupgradeneeded = (event) => { const db = event.target.result; // Create an objectStore for this database const objectStore = db.createObjectStore('toDoList', { keyPath: 'task
Title' }); // define what data items the objectStore will contain objectStore.createIndex('hours', 'hours', { unique: false }); objectStore.createIndex('minutes', 'minutes', { unique: false }); objectStore.createIndex('day', 'day', { unique: false }); objectStore.createIndex('month', 'month', { unique: false }); objectStore.createIndex('year', 'year', { unique: false }); }; dBOpenRequest.
...e will contain objectStore.createIndex('hours', 'hours', { unique: false }); objectStore.createIndex('minutes', 'minutes', { unique: false }); objectStore.createIndex('day', 'day', { unique: false }); objectStore.createIndex('month', 'month', { unique: false }); objectStore.createIndex('year', 'year', { unique: false }); }; dBOpenRequest.onsuccess = (event) => { const newItem = { task
Title: 'my task', hours: 10, minutes: 10, day: 10, month: 'January', year: 2020 }; const db = dBOpenRequest.result; db.addEventListener('error', () => { console.log(`Error adding new item: ${newItem.task
Title}`); }); // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['toDoList'], 'readwrite'); const objectStore = transaction.objectStore(...
...And 2 more matches
IDBRequest: error event - Web APIs
The error handler is executed when an error caused a request to fail. ...
...he given task
Title already exists): // Open the database const DBOpenRequest = window.indexedDB.open('toDoList', 4); DBOpenRequest.addEventListener('upgradeneeded', event => { const db = event.target.result; db.onerror = () => { console.log('Error creating database'); }; // Create an objectStore for this database var objectStore = db.createObjectStore('toDoList', { keyPath: 'task
Title' }); // define what data items the objectStore will contain objectStore.createIndex('hours', 'hours', { unique: false }); objectStore.createIndex('minutes', 'minutes', { unique: false }); objectStore.createIndex('day', 'day', { unique: false }); objectStore.createIndex('month', 'month', { unique: false }); objectStore.createIndex('year', 'year', { unique: false }); }); DBOpenRequest...
..., 'month', { unique: false }); objectStore.createIndex('year', 'year', { unique: false }); }); DBOpenRequest.addEventListener('success', event => { const db = DBOpenRequest.result; // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['toDoList'], 'readwrite'); const objectStore = transaction.objectStore('toDoList'); const newItem = { task
Title: 'my task', hours: 10, minutes: 10, day: 10, month: 'January', year: 2020 }; const objectStoreRequest = objectStore.add(newItem); objectStoreRequest.addEventListener('error', () => { console.log(`Error adding new item: ${newItem.task
Title}`); }); }); The same example, using the onerror property instead of addEventListener(): // Open the database const DBOpenRequest = window.indexedD...
...And 2 more matches
IDBTransaction: error event - Web APIs
ion when a request returns an error and the event bubbles up to the transaction object. ...
...error event for the add() operation (this will occur if, for example, a record with the given task
Title already exists): // Open the database const dBOpenRequest = window.indexedDB.open('toDoList', 4); dBOpenRequest.onupgradeneeded = (event) => { const db = event.target.result; // Create an objectStore for this database const objectStore = db.createObjectStore('toDoList', { keyPath: 'task
Title' }); // define what data items the objectStore will contain objectStore.createIndex('hours', 'hours', { unique: false }); objectStore.createIndex('minutes', 'minutes', { unique: false }); objectStore.createIndex('day', 'day', { unique: false }); objectStore.createIndex('month', 'month', { unique: false }); objectStore.createIndex('year', 'year', { unique: false }); }; dBOpenRequest.
...nth', { unique: false }); objectStore.createIndex('year', 'year', { unique: false }); }; dBOpenRequest.onsuccess = (event) => { const db = dBOpenRequest.result; // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['toDoList'], 'readwrite'); transaction.addEventListener('error', () => { console.log(`Error adding new item: ${newItem.task
Title}`); }); const objectStore = transaction.objectStore('toDoList'); const newItem = { task
Title: 'my task', hours: 10, minutes: 10, day: 10, month: 'January', year: 2020 }; const objectStoreRequest = objectStore.add(newItem); }; The same example, using the onerror property instead of addEventListener(): // Open the database const dBOpenRequest = window.indexedDB.open('toDoList', 4); dB...
...And 2 more matches
Notification.Notification() - Web APIs
options Optional An options object containing any custom settings that you want to apply to the notification. The possible options are: dir: The direction in which to display the notification. ...
... options Optional An options object containing any custom settings that you want to apply to the notification. The possible options are: dir: The direction in which to display the notification. ...
... options Optional An options object containing any custom settings that you want to apply to the notification. The possible options are: dir: The direction in which to display the notification. ...
...And 2 more matches
Using Web Workers - Web APIs
etc): calls a Worker's queryable function * postMessage(string or JSON Data): see Worker.prototype.postMessage() * terminate(): terminates the Worker * addListene...
...etc): calls a Worker's queryable function * postMessage(string or JSON Data): see Worker.prototype.postMessage() * terminate(): terminates the Worker * addListener(name, function): adds a listener ...
...rmal scripts. But a <script> element that does not have a src attribute and has a type attribute that does not identify an executable MIME type can be considered a data block element that JavaScript could use. "Data blocks" is a more general feature of HTML5 that can carry almost any textual data. So, a worker could be embedded in this way: <!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <
title>MDN Example - Embedded worker</
title> <script type="text/js-worker"> // This script WON'T be parsed by JS engines because its MIME type is text/js-worker. var myVar = 'Hello World!'; // Rest of your worker code goes here. </script> <script type="text/javascript"> // This script WILL be parsed by JS engines because its MIME type is text/javascript. function pageLog(sMsg) { // Use a f...
...And 2 more matches
Window: popstate event - Web APIs
. The current page's session history stack entry will be referred to as current-entry. If new-entry doesn't currently contain an existing Document, fetch the content and create its Document before continuing. This will eventually send events such as DOMContentLoaded and load to the Window containing the document, but the steps below will continue to execute in the meantime. If current-entry's
title wasn't set using one of the History API methods (pushState() or replaceState(), set the entry's
title to the string returned by its document.
title attribute. If the browser has state information it wishes to store with the current-entry before navigating away from it, it then does so. The entry is now said to have "persisted user state." This information the browser might add to the history sess...
...you can see, the popstate event is nearly the last thing done in the process of navigating pages in this way. ...
...hing done in the process of navigating pages in this way. ...
...And 2 more matches
<dfn>: The Definition element - HTML: Hypertext Markup Language
t, but no <dfn> element must be a descendant. Tag omission None, both the starting and ending tag are mandatory. Permitted parents Any element that accepts phrasing content. Implicit ARIA role term Permitted ARIA roles Any DOM interface HTMLElement Attributes This element's attributes include the global attributes. In HTML5, the
title attribute has special meaning, as noted below. Usage notes There are some not-entirely-obvious aspects to using the <dfn> element. We examine those here. Specifying the term being defined The term being defined is identified following these rules: If the <dfn> element has a
title attribute, the value of the
title attribute is considered to be the term being defined. The element must still ...
... If the <dfn> element has a
title attribute, the value of the
title attribute is considered to be the term being defined. The element must still have text within it, but that text may be an abbreviation (perhaps using <abbr>) or another form of the term. If the <dfn> contains a single child element and does not have any text content of its own, and the child element is an <abbr> element with a
title attribute itself, then the exact value of the <abbr> element's
title is the term being defined. Otherwise, the text content of the <dfn> element is the term being defined. This is shown in the first example below. If the <dfn> element has a
title attribute, it must contain the term being defined and no other text. Links to <dfn> elements If you include an id attribute on the <dfn> element,...
...es of various usage scenarios. Basic identification of a term This example simply uses a plain <dfn> element to identify the location of a term within the definition. HTML <p>The <strong>HTML Definition element</strong> (<strong><dfn><dfn></dfn></strong>) is used to indicate the term being defined within the context of a definition phrase or sentence.</p> Since the <dfn> element has no
title, the text contents of the <dfn> element itself are used as the term being defined. Result This looks like this rendered in your browser: Links to definitions To add links to the definitions, you create the link the same way you always do, with the <a> element. HTML <p>The <strong>HTML Definition element</strong> (<strong><dfn id="definition-dfn"><dfn></dfn></strong>) is used to indi...
...And 2 more matches
<img>: The Image Embed element - HTML: Hypertext Markup Language
instead. This can be a confusing experience if the file name isn't representative of the image's contents. ...
... a confusing experience if the file name isn't representative of the image's contents. ...
...ssibility Tutorials Alt-texts: The Ultimate Guide -- Axess Lab How to Design Great Alt Text: An Introduction | Deque MDN Understanding WCAG, Guideline 1.1 explanations Understanding Success Criterion 1.1.1 | W3C Understanding WCAG 2.0 The
title attribute The
title attribute is not an acceptable substitute for the alt attribute. Additionally, avoid duplicating the alt attribute's value in a
title attribute declared on the same image. Doing so may cause some screen readers to announce the description twice, creating a confusing experience. ...
...And 2 more matches
<input type="email"> - HTML: Hypertext Markup Language
ur guide on regular expressions; the 'u' flag is specified when compiling the regular expression, so that the pattern is treated as a sequence of Unicode code points, instead of as ASCII. No forward slashes should be specified around the pattern text. If the specified pattern is not specified or is invalid, no regular expression is applied and this attribute is ignored completely. Tip: Use the
title attribute to specify text that most browsers will display as a tooltip to explain what the requirements are to match the pattern. You should also include other explanatory text nearby. See the section Pattern validation for details and an example. placeholder The placeholder attribute is a string that provides a brief hint to the user as to what kind of information is expected in the field. I...
...{ padding-bottom: 20px; } .messageBox { padding-bottom: 20px; } label { line-height: 22px; } label::after { content: ":"; } <form> <div class="emailBox"> <label for="emailAddress">Your e-mail address</label><br> <input id="emailAddress" type="email" size="64" maxLength="64" required placeholder="username@beststartupever.com" pattern=".+@beststartupever.com"
title="Please provide only a Best Startup Ever corporate e-mail address"> </div> <div class="messageBox"> <label for="message">Request</label><br> <textarea id="message" cols="80" rows="8" required placeholder="My shoes are too tight, and I have forgotten how to dance."></textarea> </div> <input type="submit" value="Send Request"> </form> Our <form> contains one <input> of ...
...r.com" (note the leading space) or "@@beststartupever.com", neither of which is valid. However, the browser runs both the standard e-mail address filter and our custom pattern against the specified text. As a result, we wind up with a validation which says "make sure this resembles a valid e-mail address, and if it is, make sure it's also a beststartupever.com address." It's advisable to use the
title attribute along with pattern. If you do, the
title must describe the pattern. That is, it should explain what format the data should take on, rather than any other information. That's because the
title may be displayed or spoken as part of a validation error message. For example, the browser might present the message "The entered text doesn't match the required pattern." followed by your specifie...
...And 2 more matches
<video>: The Video Embed element - HTML: Hypertext Markup Language
t events. In addition to providing controllability, these events let you monitor the progress of both download and playback of the media, as well as the playback state and position. You can use the object-position property to adjust the positioning of the video within the element's frame, and the object-fit property to control how the video's size is adjusted to fit within the frame. To show sub
titles/captions along with your video, you can use some JavaScript along with the <track> element and the WebVTT format. See Adding captions and sub
titles to HTML5 video for more information. You can play audio files using a <video> element. This can be useful if, for example, you need to perform audio with a WebVTT transcript, since the <audio> element doesn't allow captions using WebVTT. To test th...
...with the browser's default video controls to control playback. <!-- Simple video example --> <!-- 'Big Buck Bunny' licensed under CC 3.0 by the Blender foundation. Hosted by archive.org --> <!-- Poster from peach.blender.org --> <video controls src="https://archive.org/download/BigBuckBunny_124/Content/big_buck_bunny_720p_surround.mp4" poster="https://peach.blender.org/wp-content/uploads/
title_anouncement.jpg?x11217" width="620"> Sorry, your browser doesn't support embedded videos, but don't worry, you can <a href="https://archive.org/details/BigBuckBunny_124">download it</a> and watch it with your favorite video player! </video> Until the video starts playing, the image provided in the poster attribute is displayed in its place. If the browser doesn't support video playback, ...
....types" file in "/etc/apache" or via the "AddType" configuration directive in httpd.conf. AddType video/webm .webm Your web host may provide an easy interface to MIME type configuration changes for new technologies until a global update naturally occurs. Accessibility concerns Videos should provide both captions and transcripts that accurately describe its content (see Adding captions and sub
titles to HTML5 video for more information on how to implement these). Captions allow people who are experiencing hearing loss to understand a video's audio content as the video is being played, while transcripts allow people who need additional time to be able to review audio content at a pace and format that is comfortable for them. It's worth noting that while you can caption audio-only media, you ...
...And 2 more matches
Progressive web app structure - Progressive web apps (PWAs)
f our example application The js13kPWA website structure is quite simple: it consists of a single HTML file (index.html) with basic CSS styling (style.css), and a few images, scripts, and fonts. ...
...3kPWA website structure is quite simple: it consists of a single HTML file (index.html) with basic CSS styling (style.css), and a few images, scripts, and fonts. ...
... The app's only job is to list all the A-Frame entries from the js13kGames 2017 competition. As you ca...
...And 2 more matches
panel - Archive of obsolete content
g panel without opening a new one, you can call the hide() or the destroy() method. Panel content The panel's content is specified as HTML, which is loaded from the URL supplied in the contentURL option to the panel's constructor. You can load remote HTML into the panel: var myPanel = require("sdk/panel").Panel({ width: 180, height: 180, contentURL: "https://en.wikipedia.org/w/index.php?
title=Jetpack&useformat=mobile" }); myPanel.show(); You can also load HTML that's been packaged with your add-on, and this is most probably how you will create dialogs. To do this, save the HTML in your add-on's data directory and load it using the data.url() method exported by the self module, like this: var myPanel = require("sdk/panel").Panel({ contentURL: require("sdk/self").data.url("myFile...
...nel-style.css" type="text/css" rel="stylesheet"> </head> <body> My panel content </body> </html> From Firefox 31 onwards, you can style panel content using the contentStyle or contentStyleFile options. ...
... Panel limitations Although panels can host HTML documents, they are not implemented as browser tabs, so many th...
...n normal web pages do not work inside panels: Prior to Firefox 33, you don't get a context menu. From Firefox 33 you can enable a context menu by passing contextMenu: true to the panel's constructor. The HTML <select> element doesn't work. The HTML <datalist> element doesn't give you autocomplete suggestions (bug 918600). You can't embed Flash (bug 952578). You can't provide tooltips using
title attributes (bug 918600). Security warning pages (the "This Connection is Untrusted" warning) does not work, so panels which trigger it will be broken (bug 1031554). Mouse button shortcuts, such as using the middle button to open a link in a new page, don't work. Scrolling using keyboard doesn't work properly (bug 1001914) Globals Constructors Panel(options) Creates a panel. Parameters o...
private-browsing - Archive of obsolete content
true only if the object is: a private window, or a tab belonging to a private window, or a worker that's associated with a document hosted in a private window any window, tab, or worker if the browser has been configured to never remember history (Options->Privacy->History) Add-ons can use this API to decide whether or not to store user data. ...
...ng to a private window, or a worker that's associated with a document hosted in a private window any window, tab, or worker if the browser has been configured to never remember history (Options->Privacy->History) Add-ons can use this API to decide whether or not to store user data. ...
...he browser has been configured to never remember history (Options->Privacy->History) Add-ons can use this API to decide whether or not to store user data. ...
...o never remember history (Options->Privacy->History) Add-ons can use this API to decide whether or not to store user data. For example, here's an add-on that stores the
titles of tabs the user loads, and uses isPrivate() to exclude the
titles of tabs that were loaded into private windows: var simpleStorage = require("simple-storage"); if (!simpleStorage.storage.
titles) simpleStorage.storage.
titles = []; require("tabs").on("ready", function(tab) { if (!require("sdk/private-browsing").isPrivate(tab)) { console.log("storing..."); simpleStorage.storage.
titles.push(tab.
title); } else { console.log("not storing, private data"); } }); Here's an add-on that uses a page-mod to log the content of pages loaded by the user, unless the page is private. In the handler for the page...
places/history - Archive of obsolete content
", function (results) { // results is an array of objects containing // data about visits to any site on developers.mozilla.org // ordered by visit count }); // Complex query // The query objects are OR'd together // Let's say we want to retrieve all visits from before a week ago // with the query of 'ruby', but from last week onwards, we want // all results with 'javascript' in the URL or
title. // We'd compose the query with the following options let lastWeek = Date.now - (1000*60*60*24*7); search( // First query looks for all entries before last week with 'ruby' [{ query: "ruby", to: lastWeek }, // Second query searches all entries after last week with 'javascript' { query: "javascript", from: lastWeek }], // We want to order chronologically by visit date { sort: "date" }...
...that bookmarks must match each property within a query object. Multiple query objects are then OR'd together. options : object Optional options: Name Type count number The number of bookmark items to return. If left undefined, no limit is set. sort string A string specifying how the results should be sorted. Possible options are '
title', 'date', 'url', 'visitCount', 'keyword', 'dateAdded' and 'lastModified'. descending boolean A boolean specifying whether the results should be in descending order. By default, results are in ascending order. PlacesEmitter The PlacesEmitter is not exposed in the module, but returned from the search functions. The PlacesEmitter inherits from event/target, and em...
...emits data, error, and end. data events are emitted for every individual search result found, whereas end events are emitted as an aggregate of an entire search, passing in an array of all results into the handler. Events data The data event is emitted for every item returned from a search. Arguments Object : This is an object representing a history entry. Contains url, time, accessCount and
title of the entry. error The error event is emitted whenever a search could not be completed. Arguments string : A string indicating the error that occurred. end The end event is called when all search results have returned. Arguments array : The value passed into the handler is an array of all entries found in the history search. Each entry is an object containing the properties url, time, ac...
... ...
Bookmarks - Archive of obsolete content
Firefox 2 and earlier Creating a new bookmark var win = myBrowser.contentWindow; // Get the bookmarks service const BMSVC = Components.classes["@mozilla.org/browser/bookmarks-service;1"] .getService(Components.interfaces.nsIBookmarksService); // Create the bookmark BMSVC.createBookmarkInContainer(win.document.
title, // bookmark name win.location.href.toString(), // URI of the bookmark null, // shortcut win.document.
title, // description win.document.characterSet, // charset null, // postData bookmarksService.getBookmarksToolbarFolder(), // bookmark folder ...
...r bookmarksArray = bmsvc.getBookmarkIdsForURI(uri, {}); After executing this code, the array bookmarksArray contains the IDs of all bookmarks that refer to the specified URI (in this case, "http://google.com"). Manipulating existing items There are a number of convenient methods you can use to make changes to existing bookmarks and bookmark folders. This section covers some of them. ...
...svc.getBookmarkIdsForURI(uri, {}); After executing this code, the array bookmarksArray contains the IDs of all bookmarks that refer to the specified URI (in this case, "http://google.com"). Manipulating existing items There are a number of convenient methods you can use to make changes to existing bookmarks and bookmark folders. This section covers some of them. ...
...sArray contains the IDs of all bookmarks that refer to the specified URI (in this case, "http://google.com"). Manipulating existing items There are a number of convenient methods you can use to make changes to existing bookmarks and bookmark folders. This section covers some of them. The item
title To change the
title of a bookmark or bookmark folder, you use the nsINavBookmarksService.setItem
Title() method. bmsvc.setItem
Title(newBkmkId, "New
title"); This sets the
title of the item referenced by the ID newBkmkId to "New
title". You can fetch the current
title of an item using the nsINavBookmarksService.getItem
Title() method: var this
Title = bmsvc.getItem
Title(newBkmkId); This code will display an alert containing the
title of the item referenced by the ID newBkmkId. The item URI S...
Using XML Data Islands in Mozilla - Archive of obsolete content
sed into a DOM tree using the DOMParser API: var parser = new DOMParser(); var doc = parser.parseFromString(orderSource, "application/xml"); The HTML5 data block-based way shown here works in Firefox, Opera, WebKit-based browsers such as Chrome and Safari, and IE9 while IE's XML data islands work only in IE. ...
...he DOMParser API: var parser = new DOMParser(); var doc = parser.parseFromString(orderSource, "application/xml"); The HTML5 data block-based way shown here works in Firefox, Opera, WebKit-based browsers such as Chrome and Safari, and IE9 while IE's XML data islands work only in IE. ...
... var doc = parser.parseFromString(orderSource, "application/xml"); The HTML5 data block-based way shown here works in Firefox, Opera, WebKit-based browsers such as Chrome and Safari, and IE9 while IE's XML data islands work only in IE. Here is another possible way, using the <object> tag. ...
...String(orderSource, "application/xml"); The HTML5 data block-based way shown here works in Firefox, Opera, WebKit-based browsers such as Chrome and Safari, and IE9 while IE's XML data islands work only in IE. Here is another possible way, using the <object> tag. ...
Floating Panels - Archive of obsolete content
Floating Panels A floating panel is used for secondary popups such as tool palettes and property inspector panels. It will have a
titlebar which the user may use to move the panel around on the screen. A floating panel can be created using the panel element with at least two additional attributes as in the following example: <panel id="tools-panel" noautohide="true"
titlebar="normal"> <label control="name" value="Name:"/> <textbox id="name"/> </panel> The noautohide attribute is used to indicate that the panel is not temporary. When set to true, the popup will not close when the user clicks outside of it, nor when the user presses the Escape key. The
titlebar attribute creates a panel with a
titlebar. Currently, only the value normal is supported, which creates a default
titlebar. In the ...
...nel> The noautohide attribute is used to indicate that the panel is not temporary. When set to true, the popup will not close when the user clicks outside of it, nor when the user presses the Escape key. The
titlebar attribute creates a panel with a
titlebar. Currently, only the value normal is supported, which creates a default
titlebar. In the future, a distinction will be available to support
titlebars of differing styles. The floating panel can be placed and moved independently of the main window, however it will always appear above the main window. ...
...ill be available to support
titlebars of differing styles. The floating panel can be placed and moved independently of the main window, however it will always appear above the main window. On Mac, floating panels are invisible when another application is made active, and become visible again when the XUL application is made active. A floating panel may contain any type of element. A label for the
titlebar may be set using the label attribute, as in the following example: <panel id="info-panel" noautohide="true"
titlebar="normal" label="Image Properties"> Closing a Floating Panel Unlike other panels, a floating panel does not close when clicking outside of it. You can use the close attribute to have a close button on the
titlebar. When the user presses it, the popup will be closed. <panel id="i...
...See Closing a Popup for more information about this. ...
Filtering - Archive of obsolete content
ttp://www.w3.org/1999/02/22-rdf-syntax-ns#type' set to a resource for that type. In RDF/XML, a syntax shortcut may be used which involves replacing the Description tag with the type. We need to add the type to the two countries in the datasource, as well as ensure that the namespace is declared on the root RDF tag: <nso:Country about="http://www.daml.org/2001/09/countries/iso#IT" dc:
title="Italy"/> <nso:Country about="http://www.daml.org/2001/09/countries/iso#NL" dc:
title="Netherlands"/> The type of these two resources, when expanded with the namespace (not shown here), will be 'http://www.daml.org/2001/09/countries/country-ont#Country'. The resulting RDF triples for the first country will be: http://www.daml.org/2001/09/countries/iso#IT -> http://www.w3.org/1999...
... namespace (not shown here), will be 'http://www.daml.org/2001/09/countries/country-ont#Country'. The resulting RDF triples for the first country will be: http://www.daml.org/2001/09/countries/iso#IT -> http://www.w3.org/1999/02/22-rdf-syntax-ns#type -> http://www.daml.org/2001/09/countries/country-ont#Country http://www.daml.org/2001/09/countries/iso#IT -> http://purl.org/dc/elements/1.1/
title -> Italy The type is just like any other triple in the datasource, so we don't need any special syntax to navigate over it. We just need to use the right predicate to look for all the countries. You might wonder what the ref attribute or starting point should be set to since there is no container for the countries. Actually, we can just use the type as the starting point. <menulist datasource...
...s pointing into the type resource. Since we want the arcs pointing into the type, we need to determine the source or subject of a triple. Look at the resulting RDF triples above again if this is unclear. The starting node is 'http://www.daml.org/2001/09/countries/country-ont#Country'. We need to iterate over the 'type' predicate to find the individual countries. A second triple is used to get the
title for the country. <query> <content uri="?start"/> <triple subject="?country" predicate="http://www.w3.org/1999/02/22-rdf-syntax-ns#type" object="?start"/> <triple subject="?country" predicate="http://purl.org/dc/elements/1.1/
title" object="?country
title"/> </query> The action body will need to generate a <menuitem> for each result. It will also need ...
... a <menuitem> for each result. It will also need to include a <menupopup> around all of the items. Since we only want to generate a single menupopup, it should go outside of the element with the uri attribute. Only the contents at the element with the uri attribute and below are copied for each result. The elements above are not. <action> <menupopup> <menuitem uri="?country" label="?country
title" value="?country"/> </menupopup> </action> The result will be two generated menuitems, one for each country, inside a menupopup. The value attribute is assigned the ?country variable so that the applyFilter function can use this value easily for filtering. The complete example shows this working. Note that due to a bug with template generation in menulists when the datasource hasn't loaded yet...
Multiple Queries - Archive of obsolete content
or all of the queries. ...
...The second query doesn't contain such a triple and will match all three of the photos. It the first query was used by itself, only one result would match. If the second query was used by itself, three results would match. When used together in this example, the results are combined and only three results are shown. However, you will probably notice that the one photo that matches the ...
...ail later. Multiple Queries Using the RDF Simple Syntax You can also use multiple queries with RDF datasources using the simple query syntax. Here is the previous example rewritten using the simple syntax: <hbox id="photosList" datasources="template-guide-photos3.rdf" ref="http://www.xulplanet.com/rdf/myphotos" xmlns:dc="http://purl.org/dc/elements/1.1/"> <template> <rule dc:
title="Canal"> <button uri="rdf:*" image="rdf:*" label="View" orient="vertical"/> </rule> <rule> <image uri="rdf:*" src="rdf:*"/> </rule> </template> </hbox> The result to the user in this example is the same as the previous example. You can also mix simple and extended queries in one template, although you may prefer to use the same style in all queries for consistency. Howe...
...ingle query, the simple query syntax allows a slight shorthand. You can remove the <rule> element and place the rule's conditions directly on the <template>. There's no performance benefit, but it does save some typing. <hbox id="photosList" datasources="template-guide-photos3.rdf" ref="http://www.xulplanet.com/rdf/myphotos" xmlns:dc="http://purl.org/dc/elements/1.1/"> <template dc:
title="Canal"> <button uri="rdf:*" image="rdf:*" label="View" orient="vertical"/> </template> </hbox> This example shows only a single photo since a condition is used to filter out the other two photos. Note that in this shorthand, the query conditions are placed directly on the <template> element. << PreviousNext >> ...
RDF Modifications - Archive of obsolete content
t, removing an old result, or by changing the value of some part of the result. The builder is smart enough to only change what needs to be changed and leave the remaining parts alone. Let's assume we have single query with as follows: <query> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/
title" object="?
title"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/description" object="?description"/> </query> These query statements will cause any photos with both a
title and a description to be displayed. Assuming that the 'obelisk' photo doesn't have a description already, adding the triple listed above should cause a new result...
...new RDF triple that isn't an addition or removal from a container, this statement can be skipped. Effectively, if the result generation process was to evaluate this member statement, the same output would be supplied for the ?photo variable whether the new data is there or not. Thus, the member statement can be skipped. The next statement is a triple involving the 'http://purl.org/dc/elements/1.1/
title' predicate. We aren't adding a arc involving this triple so we can ignore this statement as well. The second triple, however, could cause a change, since the predicate attribute matches the predicate being added. The subject and object are variables so the builder accepts this as a possible change, and moves on to the next step. If the predicate was different, the builder would come to the end of...
...ttp://www.xulplanet.com/ndeakin/images/t/obelisk.jpg, ?description = 'One of the thirty or so Egyptian obelisks') Next, the builder works its way backwards through the statements, in order to fill in the remaining variables. It does this in a similar manner as it does when it generates results, but traverses the statements in the opposite order. The previous triple will fill in a value for the ?
title variable, since we now have a value for the ?photo variable referred to by the triple's subject attribute. Next, the member statement is examined, and, in this situation, the builder fills in the known ?photo variable, and looks for a parent container containing this value. There is a container 'http://www.xulplanet.com/rdf/myphotos', so the ?start variable will be filled in with this value. Now,...
...ariable, and looks for a parent container containing this value. There is a container 'http://www.xulplanet.com/rdf/myphotos', so the ?start variable will be filled in with this value. Now, the potential result so far is: (?photo = http://www.xulplanet.com/ndeakin/images/t/obelisk.jpg, ?description = 'One of the thirty or so Egyptian obelisks', ?start = http://www.xulplanet.com/rdf/myphotos, ?
title = 'Obelisk') As you can see, the result looks to have all the information necessary to create a new item in the output. If a statement hadn't generated a result, for instance if the photo did not have a
title, or it wasn't contained in a parent container, there would be no match and the builder could stop processing the new triple. For instance, we might have added a description for a new photo,...
Sorting Results - Archive of obsolete content
er that the template builder generates the results. For ascending or descending sorts, this doesn't matter, since it will ignore whether results are containers and just sort by a value, alphabetically or numerically depending on the type of data. When using a tree, sorting may be performed on each column of the tree. For instance, if a list of photos was displayed in a two column tree showing the
title and description, you could sort by either
title or description. The user can change the sort column and direction by clicking the column headers, however, you can programmatically change the sort as well. Sorting Tree Results We'll examine sorting of trees first since trees are the most common element used with sorted items. Using a tree builder, you can sort the results in a tree by a column. To...
... numbers which will allow sorting numerically. By specifing different types for different values, you can sort alphabetically, numerically or by date. If you are using the simple RDF query syntax, there are no variables, so you need to specify the full predicate including the rdf: prefix in the sort attribute. For instance: <treecol id="name" label="Name" sort="rdf:http://purl.org/dc/elements/1.1/
title" flex="1"/> Note that all of this discussion about sorting only applies to tree builders. For other elements or content trees, sorting is done by placing the attributes on the root element. Content Sorting For content builders (templates that do not use flags="dont-build-content"), sorting is done by placing the sort and sortDirection attributes on the root node of the template. The sortActive a...
...rs when output is first generated as well as when a result is added as a result of a datasource change. When the RDF datasource changes, and a new result is available, the new content is inserted at the right location. For RDF datasources, you can also use an RDF predicate for sorting instead of a variable: <hbox datasources="template-guide-photos5.rdf" sort="http://purl.org/dc/elements/1.1/
title" sortDirection="ascending" ref="http://www.xulplanet.com/rdf/myphotos"> <template> <vbox class="box-padded" uri="rdf:*"> <image src="rdf:*"/> <label value="rdf:http://purl.org/dc/elements/1.1/
title"/> </vbox> </template> </hbox> In this example, the generated items will be sorted by
title. When sorting, the predicate specified in the sort attribute for the res...
...The arguments to the sort method specify the root node (the listbox), the sort key and the sort direction. << PreviousNext >> ...
Special Condition Tests - Archive of obsolete content
use the same technique. To do this kind of matching, you again place a parent attribute on the rule, set to the tag to match. For instance, we might use the following: <vbox datasources="template-guide-streets.rdf" ref="http://www.xulplanet.com/rdf/myneighbourhood"> <template> <rule parent="vbox"> <groupbox uri="rdf:*"> <caption label="rdf:http://purl.org/dc/elements/1.1/
title"/> </groupbox> </rule> <rule> <label uri="rdf:*" value="rdf:http://www.xulplanet.com/rdf/address"/> </rule> </template> </vbox> On the first pass, the container where generated content would be inserted is a <vbox>, so the first rule will match and a captioned <groupbox> will be created. On the next pass, the parent container will be the element with the uri attribute f...
...try the example. ...
... Here is the same example using the extended template syntax: <vbox datasources="template-guide-streets.rdf" ref="http://www.xulplanet.com/rdf/myneighbourhood"> <template> <query> <content uri="?start"/> <member container="?start" child="?item"/> </query> <rule parent="vbox"> <binding subject="?item" predicate="http://purl.org/dc/elements/1.1/
title" object="?
title"/> <action> <groupbox uri="?item"> <caption label="?
title"/> </groupbox> </action> </rule> <rule> <binding subject="?item" predicate="http://www.xulplanet.com/rdf/address" object="?address"/> <action> <label uri="?item" value="?address"/> </action> </rule> </template> </vbox> Containment Tests For RDF sources, the simp...
...ommonly used with menus, and we can rewrite the previous example using the iscontainer attribute instead. <button label="Houses in my Neighbourhood" type="menu" datasources="template-guide-streets.rdf" ref="http://www.xulplanet.com/rdf/myneighbourhood"> <template> <rule iscontainer="true"> <menupopup> <menu uri="rdf:*" label="rdf:http://purl.org/dc/elements/1.1/
title"/> </menupopup> </rule> <rule> <menupopup> <menuitem uri="rdf:*" label="rdf:http://www.xulplanet.com/rdf/address"/> </menupopup> </rule> </template> </button> The only difference in the code in this example is that the order of the rules has been switched around, the condition check for house has been removed and the iscontainer attribute has been added. S...
Creating a Wizard - Archive of obsolete content
using the wizardpage element. You can place whatever content you want inside each wizardpage. Note that wizards currently only work properly from chrome URLs. The wizard consists of several sections. The exact layout will vary according to the OS for the platform. Wizards will generally be displayed using customs that are familiar to the user of a particular OS. A typical layout will include a
title across the top, a set of navigation buttons across the bottom and the page contents in between. The
title across the top is created using the
title attribute, much like one would use for regular windows. The navigation buttons are created automatically. An example wizard Source <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <wizard id="example-window" ...
... across the top, a set of navigation buttons across the bottom and the page contents in between. The
title across the top is created using the
title attribute, much like one would use for regular windows. The navigation buttons are created automatically. ...
..."/> <radio value="large" label="Large"/> </radiogroup> <radiogroup> <caption label="Gender"/> <radio value="male" label="Male"/> <radio value="female" label="Female"/> </radiogroup> </wizardpage> </wizard> This wizard has two pages, one that has a drop-down menu and the other with a set of radio buttons. The wizard will be formatted automatically, with a
title across the top and a set of buttons along the bottom. The user can navigate between the pages of the wizard with the Back and Next buttons. These buttons will enable and disable themselves at the appropriate moments. In addition, on the last page, the Finish button will appear. All of this is automatic, so you don't have to do anything to manipulate the pages. The description attribute may optio...
...page. Handling Page Changes You will generally want to do something once the Finish button is pressed. You can set an attribute onwizardfinish on the wizard element to accomplish this. Set it to a script which performs whatever task you want and then returns true. This script might be used to save the information that the user entered during the wizard. For example: <wizard id="example-window"
title="Select a Dog Wizard" onwizardfinish="return saveDogInfo();" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> When the user clicks the Finish button, the function saveDogInfo() will be called, which would be defined in a script file to save the information that was entered. If the function returns true, the wizard closes. If it returns false, then the wizard does not c...
XUL accessibility guidelines - Archive of obsolete content
ended to use both a text label in the label attribute and image alt text in the tooltiptext attribute. View the code examples below. <image src="stop.png" tooltiptext="Stop" /> <html:img src="stop.jpg" alt="Stop" /> <html:img src="decorative_image.jpg" alt="" /> <!-- In HTML the alt attribute is required. ...
...xt label in the label attribute and image alt text in the tooltiptext attribute. View the code examples below. <image src="stop.png" tooltiptext="Stop" /> <html:img src="stop.jpg" alt="Stop" /> <html:img src="decorative_image.jpg" alt="" /> <!-- In HTML the alt attribute is required. --> <toolbarbutton label="Stop" image="stop.png" tooltiptext="Stop loading the page" />
Title Provide unique
titles to window container elements such as windows, wizards, and dialogs.
Titles provide users the most basic information about the application. The
title is often the first thing spoken by a screen reader when an application is opened or activated. Users can also refer back to the
title to get a sense of where they are located.
Titles are displayed in the top bar of an application. View code examples...
... as windows, wizards, and dialogs.
Titles provide users the most basic information about the application. The
title is often the first thing spoken by a screen reader when an application is opened or activated. Users can also refer back to the
title to get a sense of where they are located.
Titles are displayed in the top bar of an application. View code examples below. <dialog id="print_dialog"
title="Print" ...> <window id="mywindow"
title="My Application" ...> <wizard id="reg_window"
title="Register your software" ...> Form labels Labels are not automatically associated to form elements. Use the control attribute to bind a text label (from a label element) to a form element. Screen readers will then read aloud the label when entering a form field. For label...
...th a keyboard. Focus Keyboard focus is maintained and does not move unexpectedly. Focus moves or is disabled unexpectedly. Assistive information Checkpoint Pass Fail Alternative text Alternative text is provided for meaningful images. Alternative text is missing on meaningful images, or it is inappropriate for the function of an image.
Title All windows, including dialogs and wizards, have a descriptive
title. Windows lack a
title or have a incorrect
title. Form labels Every form element has an associated label and radiobuttons are encapsulated in a groupbox. Form elements are missing labels or the labels are not programmatically connected or radiobuttons are not contained in a groupbox. Display ...
panel - Archive of obsolete content
Some features may work, but only on some platforms. For those versions of Firefox, it is best to avoid child frames in a panel, if possible. This limitation was resolved as of Firefox 4.0. Attributes backdrag, close, consumeoutsideclicks, fade, flip, ignorekeys, label, left, level, noautofocus, noautohide, norestorefocus, onpopuphidden, onpopuphiding, onpopupshowing, onpopupshown, position,
titlebar, top, type Properties accessibleType, label, popupBoxObject, popup, state Methods hidePopup, moveTo, openPopup, openPopupAtScreen, sizeTo Examples The following example shows how a panel may be attached to a label. <panel id="thepanel"> <hbox align="start"> <image src="warning.png"/> <vbox> <description value="You have 6 new messages."/> <hbox> <butt...
... label="Read Mail"/> <button label="New Message"/> </hbox> </vbox> </hbox> </panel> <description value="6 New Messages" popup="thepanel"/> Attributes backdrag Type: boolean Setting the backdrag attribute on a XUL panel lets the user move the panel by clicking and dragging anywhere on its background area. close Type: boolean If the panel has a
titlebar, set the panel's close attribute to true to have a close button appear on the
titlebar. Pressing the close button will close the panel. consumeoutsideclicks Type: boolean Controls whether or not the event that caused the popup to be automatically dismissed (or "rolled up") should be consumed or be dispatched as a normal event. If it is not set, it defaults to the plat...
... the panel such that it is still aligned with the anchor. Without flip="slide", the panel would have had its width truncated and the panel would not extend to the left of the anchor. ignorekeys Type: boolean If false, the default value, the Escape key may be used to close the panel. If true, the Escape key cannot be used to close the panel. label Type: string For panels with
titlebars, the label on the
titlebar. left Type: integer Overrides the horizontal position of the popup specified by the showPopup method. level Type: one of the values below Specifies whether the panel appears on top of all windows, or just on top of the window the panel is in. If this attribute is not set, the popup window level depends on the platform. On Linux, the default value i...
... second word) can be one of topleft, topright, bottomleft or bottomright. Positions specified as a single word string are shortcuts for the values above. Valid single-word values are after_start, after_end, before_start, before_end, end_after, end_before, start_after, start_before, overlap, at_pointer or after_pointer. For more details, including examples, please see popup positioning
titlebar Type: string Set the panel's
titlebar attribute to the value normal to display a panel with a
titlebar. The noautohide attribute must be set to true. top Type: integer Overrides the vertical position of the popup specified by the showPopup method. type Type: string The panel type. Should be one of the following: autocomplete Specify this for a pane...
Why RSS Slash is Popular - Counting Your Comments - Archive of obsolete content
t parade, and a section with every blog post. RSS does not have any facilites for including this information in an <item>, so the RSS Slash Module exists to fill in this gap. ...
... section with every blog post. RSS does not have any facilites for including this information in an <item>, so the RSS Slash Module exists to fill in this gap. ...
...s shown below: <?xml version="1.0"> <rss version="2.0" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" > <channel> <
title>Example</
title> <description>An RSS Example with Slash</description> <lastBuildDate>Sun, 15 May 2005 13:02:08 -0500</lastBuildDate> <link>http://www.example.com</link> <item> <
title>Review of Sin City</
title> <guid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:2005/05/15/114</guid> <pubDate>Sun, 15 May 2005 13:02:08 -0500</lastBuildDate></pubDate> <link>http://www.example.com/blog/2005/05/15/114</link> <slash:comments>43</slash:comments> </item> <item> <
title>What is the 3571st Prime Num...
...ew of Sin City</
title> <guid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:2005/05/15/114</guid> <pubDate>Sun, 15 May 2005 13:02:08 -0500</lastBuildDate></pubDate> <link>http://www.example.com/blog/2005/05/15/114</link> <slash:comments>43</slash:comments> </item> <item> <
title>What is the 3571st Prime Number</
title> <guid>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:2005/05/15/113</guid> <pubDate>Sun, 15 May 2005 10:55:12 -0500</lastBuildDate></pubDate> <link>d77d2e80-0487-4e8c-a35d-a93f12a0ff7d:2005/05/15/113</link> <slash:comments>72</slash:comments> </item> <item> <
title>First Article!</
title> <guid>d...
0.90 - Archive of obsolete content
format. (See the RSS Versions List for a list of non-deprecated RSS formats.) Consumers of RSSSHOULD still be able to accept RSS 0.90 feeds though. ...
...ersions List for a list of non-deprecated RSS formats.) Consumers of RSSSHOULD still be able to accept RSS 0.90 feeds though. ...
... <?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://my.netscape.com/rdf/simple/0.9/" > <channel> <
title>Mozilla Dot Org</
title> <link>http://www.mozilla.org</link> <description>the Mozilla Organization web site</description> </channel> <image> <
title>Mozilla</
title> <url>http://www.mozilla.org/images/moz.gif</url> <link>http://www.mozilla.org</link> </image> <item> <
title>New Status Updates</
title> <link>http://www.mozilla.org/status/</link> </item> <item> <
title>Bugzilla Reorganized</
title> <link>http://www.mozilla.org/bugs/</link> ...
.../www.mozilla.org/images/moz.gif</url> <link>http://www.mozilla.org</link> </image> <item> <
title>New Status Updates</
title> <link>http://www.mozilla.org/status/</link> </item> <item> <
title>Bugzilla Reorganized</
title> <link>http://www.mozilla.org/bugs/</link> </item> <item> <
title>Mozilla Party, 2.0!</
title> <link>http://www.mozilla.org/party/1999/</link> </item> <item> <
title>Unix Platform Parity</
title> <link>http://www.mozilla.org/build/unix.html</link> </item> <item> <
title>NPL 1.0M published</
title> <link>http://www.mozilla.org/NPL/NPL-1.0M.html</link> </item> </...
Processing XML with E4X - Archive of obsolete content
n.(over40(parseInt(age))).name); // Alerts Joe Handling namespaces E4X is fully namespace aware. Any XML object that represents a node or attribute provides a name() method which returns a QName object, allowing easy inspection of namespaced elements. ...
...0(parseInt(age))).name); // Alerts Joe Handling namespaces E4X is fully namespace aware. Any XML object that represents a node or attribute provides a name() method which returns a QName object, allowing easy inspection of namespaced elements. ...
...on of namespaced elements. ...
.... ...
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
e appropriate database driver for mySQL is loaded and the connection string to a database named rhino on my local machine is configured using the user account uRhino with the password of pRhino. The SQL statement is prepared, executed, and printed with the help of the metadata obtained from the resultset. Sample output is shown in Listing 2. id: 1 first_name: Sammy last_name: Hamm department: IT
title: Network Administrator ---------- id: 2 first_name: Nigel last_name: Bitters department: Finance
title: Accounting Manager ... It's clear to see that with just a few lines of code, we can easily take advantage of SQL data stores in JavaScript. The sample script in Listing 1 could be factored out to it's own function to retrieve the set of employee information, or abstrac...
...After the asset is retrieved and stored in a string, the proper namespaces are defined for this particular resource. The default namespace is de...
...After the asset is retrieved and stored in a string, the proper namespaces are defined for this particular resource. The default namespace is defined along w...
... the message text field txt_message = new Ext.form.TextArea({ name: "message", fieldLabel: "Message", width: 200 }); // create a button used to send the form details. btn_comments = new Ext.Button({ text: "Submit", fieldLabel: "", handler: formHandler }); // create the form panel, attach the inputs form_comments = new Ext.form.FormPanel({ labelAlign: "right", width: 400,
title: "Comments", items: [ txt_name, txt_email, txt_message, btn_comments ], renderTo: "form-comments" }); }); </script> The code in Listing 6 starts by hooking in the Ext JS library which is used to produce the UI elements of the form. Next a script named validateComments.js is hooked in with the runat attribute set to both. The function defined within...
Styling Abbreviations and Acronyms - Archive of obsolete content
s, but their styling can come as a surprise to authors. See how you can take control of their presentation without sacrificing the benefits these elements provide. Many authors are beginning to use the HTML elements abbr (abbreviation) and acronym in their Web pages. ...
...) and acronym in their Web pages. ...
...ty Guidelines, both elements should be given a
title attribute to improve "readability of the Web for all people, including those with learning disabilities, cognitive disabilities, or people who are deaf." The Problem Authors have discovered that any abbr or acronym that has a
title attribute is rendered with a dotted underline, per the following rule in resource://gre-resources/html.css abbr[
title], acronym[
title] { text-decoration: dotted underline; } The Solution If authors wish to remove the underline from abbr and acronym elements, this can be done with the following rule: abbr[
title], acronym[
title] { text-decoration: none; } It may be better to lessen the visual weight of the border without actually removing it. The underline tells readers that the word in question has extra...
...Removing the underline from these elements will rob readers of an indication that there is extra information available. Related Links Web Content Accessibility Guidelines 1.0 Original Document Information Author(s): Eric A. ...
How can we design for all types of users? - Learn web development
e root element's font size and is expressed as portions of 1, like em. Suppose we wanted a base font size of 16px and an h1 (main heading) at the equivalent of 32px, yet if within the h1 we find a span with the subheading class, it too must be rendered at the default font size (usually 16px). ...
...nd is expressed as portions of 1, like em. Suppose we wanted a base font size of 16px and an h1 (main heading) at the equivalent of 32px, yet if within the h1 we find a span with the subheading class, it too must be rendered at the default font size (usually 16px). ...
...e solution? Columns. Of course the problem doesn't go away when we switch to the Web. The reader's eyes act like a shuttle going from line to line. To make it easier on people's eyes, limit line width to around 60 or 70 characters. To achieve this, you can specify a size for your text's container. Let's consider this HTML: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <
title>Font size experiment</
title> </head> <body> <div class="container"> <h1>This is our main heading <span class="subheading">This is our subheading</span> </h1> <p>[lengthly text that spans many lines]</p> </div> </body> </html> We have a div with class container. We can style the div either to set its width (using the width property) or its maximum width so that it never get...
...ption Extension (longdesc) for the full explanation and thorough examples. Audio/video You must also provide alternatives to multimedia content. Subtitling/close-captioning You should include captions in your video to cater to visitors who can't hear the audio. Some users have hearing challenges, lack functioning speakers, or work in a noisy environment (like on the train). Transcript Sub
titles only work if somebody watches the video. Many users don't have time, or lack the proper plugin or codec. Additionally, search engines rely mainly on text to index your contents. For all these reasons, please provide a text transcript of the video/audio file. Image compression Some users may choose to display images, but still have limited bandwidth available, especially in developing countrie...
HTML basics - Learn web development
Previous Overview: Getting started with the web Next HTML (Hypertext Markup Language) is the code that is used to structure a web page and its content. For example, content could be structured within a set of paragraphs, a list of bulleted points, or using images and data tables. As the
title suggests, this article will give you a basic understanding of HTML and its functions. So what is HTML? HTML is not a programming language; it is a markup language that defines the structure of your content. HTML consists of a series of elements, which you use to enclose, or wrap, different parts of the content to make it appear a certain way, or act a certain way. The enclosing tags can make a word or image hyperlink to somewhere else, can italicize words, can make the font bigger or smaller,...
...lace it appears. Anatomy of an HTML document That wraps up the basics of individual HTML elements, but they aren't handy on their own. Now we'll look at how individual elements are combined to form an entire HTML page. Let's revisit the code we put into our index.html example (which we first met in the Dealing with files article): <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <
title>My test page</
title> </head> <body> <img src="images/firefox-icon.png" alt="My test image"> </body> </html> Here, we have the following: <!DOCTYPE html> -- the doctype. It is required preamble. In the mists of time, when HTML was young (around 1991/92), doctypes were meant to act as links to a set of rules that the HTML page had to follow to be considered good HTML, which could mean...
...results, CSS to style our content, character set declarations and more. <meta charset="utf-8"> -- This element sets the character set your document should use to UTF-8 which includes most characters from the vast majority of written languages. Essentially, it can now handle any textual content you might put on it. There is no reason not to set this and it can help avoid some problems later on. <
title></
title> -- the <
title> element. This sets the
title of your page, which is the
title that appears in the browser tab the page is loaded in. It is also used to describe the page when you bookmark/favourite it. <body></body> -- the <body> element. This contains all the content that you want to show to web users when they visit your page, whether that's text, images, videos, games, playable audio ...
...ming up with some better alt text for your image now. Find out more about accessibility in our accessibility learning module. Marking up text This section will cover some of the essential HTML elements you'll use for marking up the text. Headings Heading elements allow you to specify that certain parts of your content are headings -- or subheadings. In the same way that a book has the main
title, chapter
titles and sub
titles, an HTML document can too. HTML contains 6 heading levels, <h1>-<h6>, although you'll commonly only use 3 to 4 at most: <h1>My main
title</h1> <h2>My top level heading</h2> <h3>My subheading</h3> <h4>My sub-subheading</h4> Now try adding a suitable
title to your HTML page just above your <img> element. Note: You'll see that your heading level 1 has an implicit st...
Advanced text formatting - Learn web development
owsers, screenreaders, etc. don't really do much with it. There is no way to get the browser to display the contents of cite, without writing your own solution using JavaScript or CSS. If you want to make the source of the quotation available on the page you need to make it available in the text via a link or some other appropriate way. There is a <cite> element, but this is meant to contain the
title of the resource being quoted, e.g. the name of the book. There is no reason however why you couldn't link the text inside <cite> to the quote source in some way: <p>According to the <a href="/docs/Web/HTML/Element/blockquote"> <cite>MDN blockquote page</cite></a>: </p> <blockquote cite="/docs/Web/HTML/Element/blockquote"> <p>The <strong>HTML <code><blockquote></code> Element</strong> (o...
... q page</cite></a>.</p> Citations are styled in italic font by default. Active learning: Who said that? Time for another active learning example! In this example we'd like you to: Turn the middle paragraph into a blockquote, which includes a cite attribute. Turn "The Need To Eliminate Negative Self Talk" in the third paragraph into an inline quote, and include a cite attribute. Wrap the
title of each source in <cite> tags and turn each one into a link to that source. The citation sources you need are: http://www.brainyquote.com/quotes/authors/c/confucius.html for the Confucius quote http://www.affirmationsforpositivethinking.com for "The Need To Eliminate Negative Self Talk". If you make a mistake, you can always reset it using the Reset button. If you get really stuck, press ...
...ion is not saved over the user code if(solution.value === 'Show solution') { userEntry = textarea.value; } else { solutionEntry = textarea.value; } updateCode(); }; Abbreviations Another fairly common element you'll meet when looking around the Web is <abbr> -- this is used to wrap around an abbreviation or acronym, and provide a full expansion of the term (included inside a
title attribute.) Let's look at a couple of examples: <p>We use <abbr
title="Hypertext Markup Language">HTML</abbr> to structure our web documents.</p> <p>I think <abbr
title="Reverend">Rev.</abbr> Green did it in the kitchen with the chainsaw.</p> These will come out looking something like this (the expansion will appear in a tooltip when the term is hovered over): Note: There is another elem...
...a.value; solutionEntry = htmlSolution; solution.value = 'Show solution'; updateCode(); }); solution.addEventListener('click', function() { if(solution.value === 'Show solution') { textarea.value = solutionEntry; solution.value = 'Hide solution'; } else { textarea.value = userEntry; solution.value = 'Show solution'; } updateCode(); }); const htmlSolution = '<p><abbr
title="National Aeronautics and Space Administration">NASA</abbr> sure does some exciting work.</p>'; const solutionEntry = htmlSolution; textarea.addEventListener('input', updateCode); window.addEventListener('load', updateCode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keyCode === 9) { e.preventDe...
Document and website structure - Learn web development
main>. footer: <footer>. Active learning: exploring the code for our example Our example seen above is represented by the following code (you can also find the example in our GitHub repository). We'd like you to look at the example above, and then look over the listing below to see what parts make up what section of the visual. ...
...: <footer>. Active learning: exploring the code for our example Our example seen above is represented by the following code (you can also find the example in our GitHub repository). We'd like you to look at the example above, and then look over the listing below to see what parts make up what section of the visual. ...
...er>. Active learning: exploring the code for our example Our example seen above is represented by the following code (you can also find the example in our GitHub repository). We'd like you to look at the example above, and then look over the listing below to see what parts make up what section of the visual. ...
...related to the main content but can provide additional information indirectly related to it (glossary entries, author biography, related links, etc.). <header> represents a group of introductory content. If it is a child of <body> it defines the global header of a webpage, but if it's a child of an <article> or <section> it defines a specific header for that section (try not to confuse this with
titles and headings). <nav> contains the main navigation functionality for the page. Secondary links, etc., would not go in the navigation. <footer> represents a group of end content for a page. Non-semantic wrappers Sometimes you'll come across a situation where you can't find an ideal semantic element to group some items together or wrap some content. Sometimes you might want to just group a set...
Debugging on Mac OS X
ime, official builds of Firefox 69 and later are Notarized. Uplifts to Firefox 68 and ESR 68 to enable Notarization are planned. As a result, it is not possible to attach a debugger to these official Firefox releases on macOS 10.14+ without disabling System Integrity Protection (SIP). This is due to Notarization requiring Hardened Runtime to be enabled with the com.apple.security.get-task-allow en
titlement disallowed. Rather than disabling SIP (which has security implications), it is recommended to debug with try builds or local builds. The differences are explained below. try Server Builds In most cases, developers needing to debug a build as close as possible to the production environment should use a try build. These builds enable Hardened Runtime and only differ from production builds in ...
...n environment should use a try build. These builds enable Hardened Runtime and only differ from production builds in that they are not Notarized which should not otherwise affect functionality, (other than the ability to easily launch the browser on macOS 10.15+ -- see quarantine note below). At this time, developers can obtain a Hardened Runtime build with the com.apple.security.get-task-allow en
titlement allowed by submitting a try build and downloading the dmg generated by the "Rpk" shippable build job. A debugger can be attached to Firefox processes of these builds. try builds use the developer.en
titlements.xml file from the source tree while production builds use production.en
titlements.xml. On macOS 10.15+, downloaded try builds will not launch by default because Notarization is required.
...ll be permitted on local builds, but blocked on production builds which have Hardened Runtime enabled. Bug 1522409 was filed to automate codesigning local builds to enable Hardened Runtime by default and eliminate this discrepancy. To obtain a Hardened Runtime build without using try infrastructure, a developer can manually codesign builds using the macOS codesign(1) command with the developer.en
titlements.xml file from the tree. This requires creating a codesigning identity. Disabling System Integrity Protection (SIP) If debugging a production build is required, follow Apple's documented steps for disabling System Integrity Protection (SIP). Note that disabling SIP bypasses Hardened Runtime restrictions which can mask some bugs that only occur with Hardened Runtime so it is recommended to t...
...oduct menu, select Scheme > New Scheme and name your scheme (for example, "Debug"). After you click OK, Xcode should open the settings window for the new scheme. (If not, then open its settings from the Product > Edit Scheme menu.) Select "Run" on the left-hand side of the settings window, then select the "Info" tab. Set the Executable by clicking on "None" and selecting "Other...". A new dialog
titled "Choose an executable to launch" will pop up. Browse to the .app file that you want to debug (Firefox.app, NightlyDebug.app etc). The .app file is typically found inside the dist folder in your build directory. If you are debugging Firefox, Thunderbird, or some other application that supports multiple profiles, using a separate profile for debugging purposes is recommended. See "Having a profil...
mozbrowseropensearch
type Read only DOMString The type of event. bubbles Read only Boolean Whether the event normally bubbles or not. cancelable Read only Boolean Whether the event is cancellable or not. details Read only Object A custom object. ...
...ng The type of event. bubbles Read only Boolean Whether the event normally bubbles or not. cancelable Read only Boolean Whether the event is cancellable or not. details Read only Object A custom object. details The details property returns an anonymous JavaScript object with the following properties:
title A DOMString representing the
title of the search engine. ...
...ls property returns an anonymous JavaScript object with the following properties:
title A DOMString representing the
title of the search engine. href A DOMString representing URL of the search engine. ...
...frame"); browser.addEventListener("mozbrowseropensearch", function( event ) { console.log("New search engine encountered: " + event.details.
title); }); Related Events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsersecuritychange mozbrowser
titlechange ...
Localization and Plurals
ting a table entry will populate the bottom box with sample uses of the word for some numbers. Install pluralForm Checker v0.3 extension Extension input It would be good to keep this list updated with all the words that need plural forms. People using the extension can then copy/paste this input. ...
...d will be placed in a separate file, such as yourextension.properties, instead of being hardcoded in the JavaScript code file. The following 3 file snippets show how to use PluralForm with your .xul, .properties, .js files. ...
...ul, .properties, .js files. downloads.xul: <stringbundleset> <stringbundle id="strings" src="chrome://downloads.properties"/> </stringbundleset> downloads.properties: # LOCALIZATION NOTE (downloads
TitleFiles): Semi-colon list of plural forms. ...
...#1 files - Downloads # LOCALIZATION NOTE (timePair): #1 time number; #2 time unit # example: 1 second; 11 seconds timePair=#1 #2 seconds=second;seconds minutes=minute;minutes hours=hour;hours downloads.js: Components.utils.import("resource://gre/modules/PluralForm.jsm"); let getStr = function(string) document.getElementById("strings").getString(string); // Get the correct plural form for the
title let numDownloads = 3; let
title = PluralForm.get(numDownloads, getStr("downloads
TitleFiles")); // Put in the correct number of downloads print(
title.replace("#1", numDownloads)); // Get the correct plural form of seconds let timeLeft = 55; let seconds = PluralForm.get(timeLeft, getStr("seconds")); // Print the localized string for "55 seconds" print(getStr("timePair").replace("#1", timeLeft).rep...
Gecko Roles
Used by MSAA only, this is supported automatically by Microsoft Windows. ...
... << AT APIs Support Page This page offers a list of accessible roles used in Gecko. Role constants are defined in the nsIAccessibleRole interface. ROLE_NOTHING Used when the accessible item doesn't have a strongly defined role. ROLE_
TITLEBAR Represents a
title or caption bar for a window. Used by MSAA only, this is supported automatically by Microsoft Windows. ROLE_MENUBAR Represents the menu bar (positioned beneath the
title bar of a window on most platforms or at the top of the screen on Mac OS X) from which menus are selected by the user. ROLE_SCROLLBAR Represents a vertical or horizontal scroll bar, which is part of the client area or used in a control. ROLE_GRIP Represents a special mouse pointer, which allows a user to manipulate user interf...
... ROLE_CARET Represents the system caret. ROLE_ALERT Represents an alert or a condition that a user should be notified about. Assistive Technologies typically respond to the role by reading the entire onscreen contents of containers advertising this role. Should be used for warning dialogs, etc. ROLE_WINDOW Represents the window frame, which contains child objects such as a
title bar, client, and other objects contained in a window. The role is supported automatically by Microsoft Windows. ROLE_INTERNAL_FRAME A sub-document. ROLE_MENUPOPUP Represents a menu, which presents a list of options from which the user can make a selection to perform an action. ROLE_MENUITEM Represents a menu item, which is an entry in a menu that a user can choose to carry...
...pecialized dialog that displays the files in the directory and lets the user select a file, browse a different directory, or specify a filename. May use the directory pane to show the contents of a directory. ROLE_FONT_CHOOSER A font chooser. A font chooser is a component that lets the user pick various attributes for fonts. ROLE_CHROME_WINDOW Frame role. A top level window with a
title bar, border, menu bar, etc. It is often used as the primary window for an application. ROLE_GLASS_PANE A glass pane. A pane that is guaranteed to be painted on top of all panes beneath it. ROLE_HTML_CONTAINER A document container for HTML, whose children represent the document content. ROLE_ICON A small fixed size picture, typically used to decorate components. ROLE_LA...
nsINavHistoryResultObserver
Although this attribute is read-write, you should not alter it directly; in...
...Although this attribute is read-write, you should not alter it directly; instead, call nsINavHistoryResult.addObserver() to add an observer t...
...iner( in nsINavHistoryContainerResultNode aContainerNode ); Parameters aContainerNode The container that should be rebuilt. nodeAnnotationChanged() Called right after the annotation on a node has changed. This is called when the annotation is changed, set, or unset. void nodeAnnotationChanged( in nsINavHistoryResultNode aNode, in AUTF8String aAnnoName ); Parameters aNode The node whose
title has changed. aAnnoName The name of the annotation that changed. nodeDateAddedChanged() Called right after the dateAdded property property of a node has changed. void nodeDateAddedChanged( in nsINavHistoryResultNode aNode, in PRTime aNewValue ); Parameters aNode The node whose dateAdded property has changed. aNewValue The new value of the dateAdded property. nodeHistoryDetailsChanged() Cal...
...e The container (parent node) in which the item is being replaced. aOldNode The node which is being replaced. aNewNode The node replacing the aOldNode. aIndex The index at which the node is located in the container. nodeTagsChanged() Called right after a node's tags have changed. void nodeTagsChanged( in nsINavHistoryResultNode aNode ); Parameters aNode The node whose tags have changed. node
TitleChanged() Called right after a node's
title has changed. void node
TitleChanged( in nsINavHistoryResultNode aNode, in AUTF8String aNew
Title ); Parameters aNode The node whose
title has changed. aNew
Title The new
title of the node. nodeURIChanged() Called right after the URI of a node has changed. void nodeURIChanged( in nsINavHistoryResultNode aNode, in AUTF8String aNewURI ); Parameters...
Address Book examples
ookURI); How do I search for a particular contact property (name, email)? Once you have an object that implements nsIAbCollection (see above), you can search for cards with particular properties within that collection using getCardFromProperty. This function will return the first match that it finds in the collection or null. let collection = ... let card = collection.getCardFromProperty("Job
Title", "software engineer", false); If you are searching for a card with a particular email address, you can use the cardForEmailAddress function that will match against multiple email addresses stored in one card. Again, this function returns the first match that it finds in the collection, or null. let collection = ... let card = collection.cardForEmailAddress("foo@bar.invalid.com"); Note: Both...
...owing examples: selectedAB is the URI of an address book to default the dialog to saving the card in. This may be blank if not required. abURI and card are the URI of the address book and the card contained within that address book. ...
...ntact Dialog window.openDialog("chrome://messenger/content/addressbook/abNewCardDialog.xul", "", "chrome,resizable=no,
titlebar,modal,centerscreen", {selectedAB:selectedAB}); Edit Contact Dialog window.openDialog("chrome://messenger/content/addressbook/abEditCardDialog.xul", "", "chrome,resizable=no,modal,
titlebar,centerscreen", {abURI:abURI, card:card}); New List Dialog window.openDialog("chrome://messenger/content/addressbook/abMailListDialog.xul", "", "chrome,resizable=no,
titlebar,modal,centerscreen", {selectedAB:selectedAB}); Edit List Dialog window.openDialog("chrome://messenger/content/addressbook/abEditListDialog.xul", ...
...The following options are available. For local (mork) address books: window.openDialog( "chrome://messenger/content/addressbook/abAdd...
Document.enableStyleSheetsForSet() - Web APIs
Notes
Title matches are case-sensitive. ...
... Notes
Title matches are case-sensitive. ...
... Notes
Title matches are case-sensitive. ...
...abled). Syntax document.enableStyleSheetsForSet(name); Parameters name The name of the style sheets to enable. All style sheets with a
title that match this name will be enabled, while all others that have a
title will be disabled. Specify an empty string for the name parameter to disable all alternate and preferred style sheets (but not the persistent style sheets; that is, those with no
title attribute). Notes
Title matches are case-sensitive. Calling this method with a null name has no effect; if you want to disable all alternate and preferred style sheets, you must pass "", the empty string. Stylesheets that don't have a
title are never affected by this method. This method never affects the values of document.lastStyleSheetSet or document.preferredStyleSheetSet. Example d...
Document.getElementById() - Web APIs
Syntax var element = document.getElementById(id); Parameters id The ID of the element to locate. The ID is case-sensitive string which is unique within the document; only one element may have any given ID. Return value An Element object describing the DOM element object matching the specified ID, or null if no matching element was found in the document. ...
...t.getElementById(id); Parameters id The ID of the element to locate. The ID is case-sensitive string which is unique within the document; only one element may have any given ID. Return value An Element object describing the DOM element object matching the specified ID, or null if no matching element was found in the document. ...
...uch as Document.querySelector() and Document.querySelectorAll(), getElementById() is only available as a method of the global document object, and not available as a method on all element objects in the DOM. Because ID values must be unique throughout the entire document, there is no need for "local" versions of the function. ...
...querySelector() and Document.querySelectorAll(), getElementById() is only available as a method of the global document object, and not available as a method on all element objects in the DOM. Because ID values must be unique throughout the entire document, there is no need for "local" versions of the function. ...
Using files from web applications - Web APIs
tring. This is just the file name, and does not include any path information. size The size of the file in bytes as a read-only 64-bit integer. type The MIME type of the file as a read-only string or "" if the type couldn't be determined. ...
...the file name, and does not include any path information. size The size of the file in bytes as a read-only 64-bit integer. type The MIME type of the file as a read-only string or "" if the type couldn't be determined. ...
...the file's content. Asynchronously handling the file upload process This example, which uses PHP on the server side and JavaScript on the client side, demonstrates asynchronous uploading of a file. <?php if (isset($_FILES['myFile'])) { // Example: move_uploaded_file($_FILES['myFile']['tmp_name'], "uploads/" . ...
...nchronously handling the file upload process This example, which uses PHP on the server side and JavaScript on the client side, demonstrates asynchronous uploading of a file. <?php if (isset($_FILES['myFile'])) { // Example: move_uploaded_file($_FILES['myFile']['tmp_name'], "uploads/" . ...
IDBTransaction: complete event - Web APIs
complete Examples Using addEventListener(): // Open the database const DBOpenRequest = window.indexedDB.open('toDoList', 4); DBOpenRequest.onupgradeneeded = event => { const db = event.target.result; db.onerror = () => { console.log('Error creating database'); }; // Create an objectStore for this database var objectStore = db.createObjectStore('toDoList', { keyPath: 'task
Title' }); // define what data items the objectStore will contain objectStore.createIndex('hours', 'hours', { unique: false }); objectStore.createIndex('minutes', 'minutes', { unique: false }); objectStore.createIndex('day', 'day', { unique: false }); objectStore.createIndex('month', 'month', { unique: false }); objectStore.createIndex('year', 'year', { unique: false }); }; DBOpenRequest.
...ent => { const db = DBOpenRequest.result; // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['toDoList'], 'readwrite'); // add a listener for `complete` transaction.addEventListener('complete', event => { console.log('Transaction was competed'); }); const objectStore = transaction.objectStore('toDoList'); const newItem = { task
Title: 'my task', hours: 10, minutes: 10, day: 10, month: 'January', year: 2019 }; const objectStoreRequest = objectStore.add(newItem); }; Using the oncomplete property: // Open the database const DBOpenRequest = window.indexedDB.open('toDoList', 4); DBOpenRequest.onupgradeneeded = event => { const db = event.target.result; db.onerror = () => { console.log('Error creating database'); ...
....add(newItem); }; Using the oncomplete property: // Open the database const DBOpenRequest = window.indexedDB.open('toDoList', 4); DBOpenRequest.onupgradeneeded = event => { const db = event.target.result; db.onerror = () => { console.log('Error creating database'); }; // Create an objectStore for this database var objectStore = db.createObjectStore('toDoList', { keyPath: 'task
Title' }); // define what data items the objectStore will contain objectStore.createIndex('hours', 'hours', { unique: false }); objectStore.createIndex('minutes', 'minutes', { unique: false }); objectStore.createIndex('day', 'day', { unique: false }); objectStore.createIndex('month', 'month', { unique: false }); objectStore.createIndex('year', 'year', { unique: false }); }; DBOpenRequest.
...st.onsuccess = event => { const db = DBOpenRequest.result; // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['toDoList'], 'readwrite'); // add a listener for `complete` transaction.oncomplete = event => { console.log('Transaction was competed'); }; const objectStore = transaction.objectStore('toDoList'); const newItem = { task
Title: 'my task', hours: 10, minutes: 10, day: 10, month: 'January', year: 2019 }; const objectStoreRequest = objectStore.add(newItem); }; ...
Web-based protocol handlers - Web APIs
Registering the same protocol handler more than once will pop up a different notification, indicating that the protocol handler is already registered. Therefore, it is a good idea to guard your call to register the protocol handler with a check to see if it is already registered, such as in the example below. ...
...an once will pop up a different notification, indicating that the protocol handler is already registered. Therefore, it is a good idea to guard your call to register the protocol handler with a check to see if it is already registered, such as in the example below. ...
... the <code>web+burger:</code> protocol.</p> </body> </html> Activating Now, anytime the user activates a link that uses the registered protocol, the browser will route the action to the URL supplied when the web application registered. Firefox will, by default, prompt the user before handing off the action. Example <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html lang="en"> <head> <
title>Web Protocol Handler Sample - Test</
title> </head> <body> <p>Hey have you seen <a href="web+burger:cheeseburger">this</a> before?</p> </body> </html> Handling The next phase is handling the action. The browser extracts the href from the activated link, combines it with the URL template supplied during handler registration and performs an HTTP GET on the URL. So, using the above examples, the...
...an extract the query string parameters and perform the desired action. Note:The server side code is passed the entire contents of the href. This means the server side code will have to parse out the protocol from the data. Example <?php $value = ""; if ( isset ( $_GET["value"] ) ) { $value = $_GET["value"]; } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html lang="en"> <head> <
title>Web Protocol Handler Sample</
title> </head> <body> <h1>Web Protocol Handler Sample - Handler</h1> <p>This web page is called when handling a <code>web+burger:</code> protocol action. The data sent:</p> <textarea> <?php echo(htmlspecialchars($value, ENT_QUOTES, 'UTF-8')); ?> </textarea> </body> </html> References http://www.w3.org/TR/2011/WD-html5-20110525/timers.html#custom-handlers ...
Navigator.registerProtocolHandler() - Web APIs
The Navigator method registerProtocolHandler() lets web sites register their ability to open or handle particular URL schemes (aka protocols). For example, this API lets webmail sites open mailto: URLs, or VoIP sites open tel: URLs. Syntax navigator.registerProtocolHandler(scheme, url,
title); Note: Recently updated to navigator.registerProtocolHandler(scheme, url), but no browsers currently support this version. Parameters scheme A string containing the protocol the site wishes to handle. For example, you can register to handle SMS text message links by passing the "sms" scheme. url A string containing the URL of the handler. This URL must include %s, as a placeholder that will be replaced with the escaped URL to be handled. Note: The handler URL must us the https schem...
... scheme A string containing the protocol the site wishes to handle. For example, you can register to handle SMS text message links by passing the "sms" scheme. url A string containing the URL of the handler. This URL must include %s, as a placeholder that will be replaced with the escaped URL to be handled. Note: The handler URL must us the https scheme. Older browsers also supported http. ...
...ng the protocol the site wishes to handle. For example, you can register to handle SMS text message links by passing the "sms" scheme. url A string containing the URL of the handler. This URL must include %s, as a placeholder that will be replaced with the escaped URL to be handled. Note: The handler URL must us the https scheme. Older browsers also supported http.
title A human-readable
title string for the handler. ...
...t include %s, as a placeholder that will be replaced with the escaped URL to be handled. Note: The handler URL must us the https scheme. Older browsers also supported http.
title A human-readable
title string for the handler. This will be displayed to the user, such as prompting "Allow this site to handle [scheme] links?" or listing registered handlers in the browser's settings. Note: The
title has been removed from the spec due to spoofing concerns, but all current browsers still require it. It is recommended to always set the
title, since browsers that support the updated spec most likely will be backwards-compatible and still accept the
title (but not use it). Exceptions SecurityError The user agent blocked the registration. This might happen if: The registered scheme (p...
Privileged features - Web APIs
n that requires chrome-privilege in Firefox. This is not for web content. The following features require the chrome-privilege. centerscreen Centers the window in relation to its parent's size and position. minimizable This setting can only apply to dialog windows; minimizable requires dialog=yes. If minimizable is on, the new dialog window will have a minimize system command icon in the
titlebar and it will be minimizable. Any non-dialog window is always minimizable and minimizable=no will be ignored. dependent If on, the new window is said to be dependent of its parent window. A dependent window closes when its parent window closes. A dependent window is minimized on the Windows task bar only when its parent window is minimized. On Windows platforms, a dependent window does not sho...
...interface elements. There will be no context menu defined by default and none of the standard keyboard shortcuts will work. The page is supposed to provide a user interface of its own, usually this feature is used to open XUL documents (standard dialogs like the JavaScript Console are opened this way). dialog The dialog feature removes all icons (restore, minimize, maximize) from the window's
titlebar, leaving only the close button. Mozilla 1.2+ and Netscape 7.1 will render the other menu system commands (in FF 1.0 and in NS 7.0x, the command system menu is not identified with the Firefox/NS 7.0x icon on the left end of the
titlebar: that's probably a bug. You can access the command system menu with a right-click on the
titlebar). Dialog windows are windows which have no minimize system com...
...They are said to be dialog because their normal, usual purpose is to only notify info and to be dismissed, closed. ...
...nction. The exact behavior of modal windows depends on the platform and on the Mozilla release version. Note: As of Gecko 1.9, the Internet Explorer equivalent to this feature is the window.showModalDialog() method. For compatibility reasons, it's now supported in Firefox. Note also that starting in Gecko 2.0, you can use window.showModalDialog() without UniversalBrowserWrite privileges.
titlebar By default, all new secondary windows have a
titlebar. If set to no or 0, this feature removes the
titlebar from the new secondary window. Mozilla and Firefox users can force new windows to always render the
titlebar by setting dom.disable_window_open_feature.
titlebar to true in about:config or in their user.js file. alwaysRaised If on, the new window will always be displayed on top of o...
HTML in XMLHttpRequest - Web APIs
equest works just like retrieving an XML resource as a DOM using XMLHttpRequest, except you can't use the synchronous mode and you have to explicitly request a document by assigning the string "document" to the responseType property of the XMLHttpRequest object after calling open() but before calling send(). var xhr = new XMLHttpRequest(); xhr.onload = function() { console.log(this.responseXML.
title); } xhr.open("GET", "file.html"); xhr.responseType = "document"; xhr.send(); Feature detection Method 1 This method relies on the "force async" nature of the feature. When you try to set responseType of an XMLHttpRequest object after it is opened as "sync". This throws an error in the browsers that implement the feature and works on others. function HTMLinXHR() { if (!window.XMLHttpReques...
...First, the detection result is obtained asynchronously, because HTML support is only available in the asynchronous mode. Second, you have to actually fetch a test document over HTTP, because testing with a data: URL would end up testing data: URL support at the same time. Thus, to detect HTML support, a test HTML file is needed on the server. ...
...ction result is obtained asynchronously, because HTML support is only available in the asynchronous mode. Second, you have to actually fetch a test document over HTTP, because testing with a data: URL would end up testing data: URL support at the same time. Thus, to detect HTML support, a test HTML file is needed on the server. ...
...ed for detecting HTML parsing support: function detectHtmlInXhr(callback) { if (!window.XMLHttpRequest) { window.setTimeout(function() { callback(false); }, 0); return; } var done = false; var xhr = new window.XMLHttpRequest(); xhr.onreadystatechange = function() { if (this.readyState == 4 && !done) { done = true; callback(!!(this.responseXML && this.responseXML.
title && this.responseXML.
title == "&&<")); } } xhr.onabort = xhr.onerror = function() { if (!done) { done = true; callback(false); } } try { xhr.open("GET", "detect.html"); xhr.responseType = "document"; xhr.send(); } catch (e) { window.setTimeout(function() { if (!done) { done = true; callback(false); } }, 0); } } T...
Using XMLHttpRequest - Web APIs
e effects using JavaScript you have to instruct the interpreter about everything. Therefore, how to send forms in pure AJAX is too complex to be explained here in detail. ...
...the interpreter about everything. Therefore, how to send forms in pure AJAX is too complex to be explained here in detail. ...
...an be utilized in a number of ways with an XMLHttpRequest. For examples, and explanations of how one can utilize FormData with XMLHttpRequests, see the Using FormData Objects page. For didactic purposes here is a translation of the previous example transformed to use the FormData API. ...
...ttpRequest. For examples, and explanations of how one can utilize FormData with XMLHttpRequests, see the Using FormData Objects page. For didactic purposes here is a translation of the previous example transformed to use the FormData API. ...
ARIA Test Cases - Accessibility
- - Orca - - - - FFD - An interesting thing to note is that, when focus moves to an alert, JAWS loses its place on the page, so that, when the alert disappears, JAWS Virtual Cursor is at the bottom of the page. Alertdialog Alert Dialog YUI alert dialog (3rd button in this page) Expected AT Behavior: AT should speak the fact that this is an alert, the
title and contents of the dialog, then place virtual focus or the real focus on the desired control (like a button). Screen magnifier should show the focused button or emulate any other standard behavior found in notification dialogs in Windows or respective operating systems. Markup used: role="alert" aria-labeledby Notes: In the UIUC test example, the 'close' button cannot recieve focus. R...
... Markup used: Notes: Results: AT Firefox IE Opera Safari JAWS 9 - - n/a n/a JAWS 10 pass fail - - VoiceOver (Leopard) n/a n/a - fail Window-Eyes - - - - NVDA - n/a - -...
...bel Expected AT Behavior: Screen reader should prefer aria-label information above anything else, including screen text or aria-labelledby. Markup used: aria-label="My something-or-other" Notes: If the screen reader simply uses the accessible name property it should get the correct text to speak, even if several methods (aria-label, aria-labelledby, alt, label for, descendant text,
title, etc.) are used. Results: AT Firefox IE Opera Safari JAWS 9 - - n/a n/a JAWS 10 - - - - VoiceOver (Leopard) n/a n/a - fail Window-Eyes - - - - NVDA Fail n/a - - Zoom (Leopard) pass n/a pass pass ZoomText - - - - Orca ...
... Expected AT Behavior: Screen reader should prefer this information over screen text or other attributes, excluding aria-label, which supercedes even this one. Markup used: aria-labelledby Notes: If the screen reader simply uses the accessible name property it should get the correct text to speak, even if several methods (aria-label, aria-labelledby, alt, label for, descendant text,
title, etc.) are used. Results: AT Firefox IE Opera Safari JAWS 9 - - n/a n/a JAWS 10 - - - - VoiceOver (Leopard) n/a n/a - fail Window-Eyes - - - - NVDA - n/a - - Zoom (Leopard) pass n/a pass pass ZoomText - - - - Orca - ...
Linear-gradient Generator - CSS: Cascading Style Sheets
linear-gradient generator HTML Content <div id="container"> <div id="gradient-container" data-alpha="true"> </div> <div id="controls"> <div class="section"> <div class="
title"> Active point </div> <div class="property"> <div class="ui-input-slider" data-topic="point-position" data-info="position" data-unit="px" data-min="-1000" data-value="0" data-max="1000" data-sensivity="5"></div> <div id="delete-point" class="button"> delete point </div> </div> <div class="ui-color-picker" data-topic="picker"></div> </div> <div class="section"> <div class="
title"> Active axis </div> ...
...elete-axis" class="button"> delete line </div> </div> <div class="property"> <div class="ui-slider" data-topic="axis-rotation" data-info="rotation" data-min="-180" data-value="0" data-max="180"></div> </div> </div> <div id="tool-section" class="section"> <div class="
title"> Tool settings </div> <div class="property"> <div class="name"> alpha background </div> <div id="canvas-bg"></div> <div id="add-axis" class="button"> add line </div> </div> <div id="order"> <div id="gradient-axes"></div> <div id="gradient-order"></di...
...5C9BDA; } .gradient-axis[axisID='3'] path { fill: #5C5CDA; } .gradient-axis .rotate-point:hover { cursor: pointer; } /** * Controls */ #controls { width: 100%; margin: 0 auto; display: table; } #controls .section { width: 50%; padding: 10px; display: table; float: left; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } #controls .section .
title { width: 90%; margin: 0 0 10px 0; padding: 5px; border-bottom: 1px solid #DDD; font-size: 18px; color: #777; } #controls .property { width: 100%; height: 24px; margin: 10px 0; padding: 3px 0; display: table; } #controls .property > * { float: left; } #controls .property .name { width: 90px; padding: 0px 10px 0px 0px; text-align: right; line-height: 150%; } /* Button */ #contr...
...tePreviewBox(e) { var preview_box = document.createElement('div'); var preview_color = document.createElement('div'); preview_box.className = 'preview'; preview_color.className = 'preview-color'; this.preview_color = preview_color; preview_box.appendChild(preview_color); this.node.appendChild(preview_box); }; ColorPicker.prototype.newInputComponent = function newInputComponent(
title, topic, onChangeFunc) { var wrapper = document.createElement('div'); var input = document.createElement('input'); var info = document.createElement('span'); wrapper.className = 'input'; wrapper.setAttribute('data-topic', topic); info.textContent =
title; info.className = 'name'; input.setAttribute('type', 'text'); wrapper.appendChild(info); wrapper.appendChild(input); this...
animation - CSS: Cascading Style Sheets
ion | delay */ animation: 3s linear 1s slidein; /* @keyframes name | duration */ animation: slidein 3s; <div class="grid"> <div class="col"> <div class="note"> Given the following animation: <pre>@keyframes slidein { from { transform: scaleX(0); } to { transform: scaleX(1); } }</pre> </div> <div class="row"> <div class="cell"> <button class="play"
title="PLAY"></button> </div> <div class="cell flx"> <div class="overlay">animation: 3s ease-in 1s 2 reverse both paused slidein;</div> <div class="animation a1"></div> </div> </div> <div class="row"> <div class="cell"> <button class="pause"
title="PAUSE"></button> </div> <div class="cell flx"> <div class="overlay">animation: 3...
...="animation a1"></div> </div> </div> <div class="row"> <div class="cell"> <button class="pause"
title="PAUSE"></button> </div> <div class="cell flx"> <div class="overlay">animation: 3s linear 1s slidein;</div> <div class="animation a2"></div> </div> </div> <div class="row"> <div class="cell"> <button class="pause"
title="PAUSE"></button> </div> <div class="cell flx"> <div class="overlay">animation: 3s slidein;</div> <div class="animation a3"></div> </div> </div> </div> </div> html,body { height: 100%; box-sizing: border-box; } pre { margin-bottom: 0; } svg { width: 1.5em; height: 1.5em; } button { width: 27px; height: 27px; background-size: 16px; background-...
...7A6; width: 100%; height: calc(100% - 1.5em); transform-origin: left center; } window.addEventListener('load', function () { var ANIMATION = Array.from(document.querySelectorAll('.animation')); var BUTTON = Array.from(document.querySelectorAll('button')); function toggleButton (btn, type) { btn.classList.remove('play', 'pause', 'restart'); btn.classList.add(type); btn.
title = type.toUpperCase(type); } function playPause (i) { var btn = BUTTON[i]; var anim = ANIMATION[i]; if (btn.classList.contains('play')) { anim.style.animationPlayState = 'running'; toggleButton(btn, 'pause'); } else if (btn.classList.contains('pause')) { anim.style.animationPlayState = 'paused'; toggleButton(btn, 'play'); } else { anim.class...
... <number><single-animation-direction> = normal | reverse | alternate | alternate-reverse<single-animation-fill-mode> = none | forwards | backwards | both<single-animation-play-state> = running | paused<keyframes-name> = <custom-ident> | <string>where <cubic-bezier-timing-function> = ease | ease-in | ease-out | ease-in-out | cubic-bezier(<number <a href="/docs/CSS/Value_definition_syntax#Brackets"
title="Brackets: enclose several entities, combinators, and multipliers to transform them as a single component">[0,1]>, <number>, <number <a href="/docs/CSS/Value_definition_syntax#Brackets"
title="Brackets: enclose several entities, combinators, and multipliers to transform them as a single component">[0,1]>, <number>)<step-timing-function> = step-start | step-end | steps(<integer>[, <step-position>]...
Audio and Video Delivery - Developer guides
ad attribute may be ignored by some mobile browsers. ...
...me mobile browsers. For further info see Cross Browser Audio Basics (HTML5 Audio In Detail) HTML Video <video controls width="640" height="480" poster="initialimage.png" autoplay muted> <source src="videofile.mp4" type="video/mp4"> <!-- fallback for browsers that don't support mp4 --> <source src="videofile.webm" type="video/webm"> <!-- specifying sub
title files --> <track src="sub
titles_en.vtt" kind="sub
titles" srclang="en" label="English"> <track src="sub
titles_no.vtt" kind="sub
titles" srclang="no" label="Norwegian"> <!-- fallback for browsers that don't support video tag --> <a href="videofile.mp4">download video</a> </video> The code above creates a video player of dimensions 640x480 pixels, displaying a poster image until the video is played. We instruct the video t...
..., v); }, false); Audio/Video JavaScript Libraries A number of audio and video JavaScript libaries exist. The most popular libraries allow you to choose a consistent player design over all browsers and provide a fallback for browsers that don't support audio and video natively. Fallbacks often use Adobe Flash or Microsoft Silverlight plugins. Other functionality such as the track element for sub
titles can also be provided through media libraries. Audio only SoundManager AmplitudeJS HowlerJS Video only flowplayer: Gratis with a flowplayer logo watermark. Open source (GPL licensed.) JWPlayer: Requires registration to download. Open Source Edition (Creative Commons License.) SublimeVideo: Requires registration. Form based set up with domain specific link to CDN hosted library. Vide...
... you want to set up an adaptive streaming media source on a server, to be consumed inside an HTML5 media element. How would you do that? This article explains how, looking at two of the most common formats: MPEG-DASH and HLS (HTTP Live Streaming.) DASH Adaptive Streaming for HTML 5 Video Details how to set up adaptive streaming using DASH and WebM. Advanced tutorials Adding captions and sub
titles to HTML5 video This article explains how to add captions and sub
titles to HTML5 <video>, using Web_Video_Text_Tracks_Format and the <track> element. Writing Web Audio API code that works in every browser A guide to writing cross browser Web Audio API code. H.264 support in Firefox This article explains the state of support for the H.264 video format in Firefox/Firefox OS, including code exa...
Using HTML sections and outlines - Developer guides
doesn't belong to the main flow, like an explanation box or an advertisement. The aside element has its own outline, but doesn't belong to the main one. Other Semantic HTML elements used in Sectioning HTML Body Element (<body>) defines all the content of a document. It contains all the content and HTML tags. HTML Header Element (<header>) defines a page area that typically contains a logo,
title, and navigation. The header can also be used inside other semantic elements such as <article> or <section>. A section header might contain the section's heading, author name, etc. <article>, <section>, <aside>, and <nav> can have their own <header>. Despite its name, the header is not necessarily positioned at the beginning of a page or section. HTML Footer Element (<footer>) defines a page foot...
...ction>, <aside>, and <nav> can have their own <footer>. Despite its name, the footer is not necessarily positioned at the end of a page or section. ...
...ctional Elements Work? ...
... <nav> <ul> <li><a href="#">link</a></li...
HTML attribute: rel - HTML: Hypertext Markup Language
ndicates an alternate representation of the current document. Valid for link, a, and area, the meaning depends on the values of the other attributes. With the stylesheet keyword on a <link>, it creates an alternate stylesheet. <!-- a persistent style sheet --> <link rel="stylesheet" href="default.css"> <!-- alternate style sheets --> <link rel="alternate stylesheet" href="highcontrast.css"
title="High contrast"> With an hreflang attribute that differs from the document language, it indicates a translation. With the type attribute, it indicates that the referenced document is the same content in a different format. For example, with type="application/rss+xml" it creates a hyperlink referencing a syndication feed. <link rel="alternate" type="application/atom+xml" href="posts.xml"...
..."High contrast"> With an hreflang attribute that differs from the document language, it indicates a translation. With the type attribute, it indicates that the referenced document is the same content in a different format. For example, with type="application/rss+xml" it creates a hyperlink referencing a syndication feed. ...
...type="application/rss+xml" it creates a hyperlink referencing a syndication feed. <link rel="alternate" type="application/atom+xml" href="posts.xml"
title="Blog"> Both the hreflang and type attributes specify links to versions of the document in an alternative format and language, intended for other media: <link rel=alternate href="/fr/html/print" hreflang=fr type=text/html media=print
title="French HTML (for printing)"> <link rel=alternate href="/fr/pdf" hreflang=fr type=application/pdf
title="French PDF"> author Indicates the author of the current document or article. Relevant for <link>, <a>, and <area> elements, the author keyword creates a hyperlink. With <a> and <area>, it indicates the linked document (or mailto:) provides information about the author of the nearest <...
...fault value. If it's not a stylesheet of type text/css it is best to declare the type. While this attribute defines the link as being a stylesheet, the interaction with other attributes and other keyterms within the rel value impact whether the stylesheet is downloaded and / or used. When used with the alternate keyword, it defines an alternative style sheet. In this case, include a non-empty
title. The external stylesheet will not be used or even downloaded if the media does not match the value of the media attribute. Requires the use of the CORS protocol for cross-origin fetching. tag Valid for the <a>, and <area> elements, it gives a tag (identified by the given address) that applies to the current document. The tag value denotes that the link refers to a document describing a ta...
<hgroup> - HTML: Hypertext Markup Language
so is unlikely to go away. However, given that a key purpose of the <hgroup> element is to affect how headings are displayed by the outline algorithm defined in the HTML specification--but the HTML outline algorithm is not implemented in any browsers--then the <hgroup> semantics are in practice only theoretical. So the HTML5 (W3C) specification provides advice on how to mark up Subheadings, sub
titles, alternative
titles and taglines without using <hgroup>. The <hgroup> element allows the primary heading for a document section to be grouped with any secondary headings--such as subheadings or alternative
titles--to form a multi-level heading. In other words, the <hgroup> element prevents any of its secondary <h1>-<h6> children from creating separate sections of their own in the outline--as ...
...ith a colon character and space (": ") or other such punctuation after the primary heading and before the first secondary heading (and with the same or similar punctuation before any other secondary headings an <hgroup> might be shown in a rendered outline in with the primary heading followed by parentheses around the secondary heading(s) Consider the following HTML document: <!DOCTYPE html> <
title>HTML Standard</
title> <body> <hgroup id="document-
title"> <h1>HTML</h1> <h2>Living Standard -- Last Updated 12 August 2016</h2> </hgroup> <p>Some intro to the document.</p> <h2>Table of contents</h2> <ol id=toc>...</ol> <h2>First section</h2> <p>Some intro to the first section.</p> </body> A rendered outline for that document might look like the following: That is, the r...
... id="document-
title"> <h1>HTML</h1> <h2>Living Standard -- Last Updated 12 August 2016</h2> </hgroup> <p>Some intro to the document.</p> <h2>Table of contents</h2> <ol id=toc>...</ol> <h2>First section</h2> <p>Some intro to the first section.</p> </body> A rendered outline for that document might look like the following: That is, the rendered outline might show the primary
title, HTML, followed by a colon and space, followed by the secondary
title, Living Standard -- Last Updated 12 August 2016. Or, the rendered outline for that document might instead look like the following: That is, the rendered outline might show the primary
title, HTML, followed by the secondary
title shown in parentheses: (Living Standard -- Last Updated 12 August 2016). Examples <hgroup id="d...
...followed by a colon and space, followed by the secondary
title, Living Standard -- Last Updated 12 August 2016. Or, the rendered outline for that document might instead look like the following: That is, the rendered outline might show the primary
title, HTML, followed by the secondary
title shown in parentheses: (Living Standard -- Last Updated 12 August 2016). Examples <hgroup id="document-
title"> <h1>HTML</h1> <h2>Living Standard -- Last Updated 12 August 2016</h2> </hgroup> Specifications Specification Status Comment HTML Living StandardThe definition of '<hgroup>' in that specification. Living Standard ...
<input type="url"> - HTML: Hypertext Markup Language
ur guide on regular expressions; the 'u' flag is specified when compiling the regular expression, so that the pattern is treated as a sequence of Unicode code points, instead of as ASCII. No forward slashes should be specified around the pattern text. If the specified pattern is not specified or is invalid, no regular expression is applied and this attribute is ignored completely. Tip: Use the
title attribute to specify text that most browsers will display as a tooltip to explain what the requirements are to match the pattern. You should also include other explanatory text nearby. See the section Pattern validation for details and an example. placeholder The placeholder attribute is a string that provides a brief hint to the user as to what kind of information is expected in the field. I...
...padding-right: 30px; } input:invalid+span:after { position: absolute; content: '?'; padding-left: 5px; } input:valid+span:after { position: absolute; content: '?'; padding-left: 5px; } <form> <div> <label for="myURL">Enter the problem website address:</label> <input id="myURL" name="myURL" type="url" required pattern=".*\.myco\..*"
title="The URL must be in a Myco domain"> <span class="validity"></span> </div> <div> <label for="myComment">What is the problem?</label> <input id="myComment" name="myComment" type="text" required> <span class="validity"></span> </div> <div> <button>Submit</button> </div> </form> First of all, the required attribute is specified, making it mandatory that a ...
...a dot, followed by "myco", followed by a dot, followed by any number of characters. And because the browser runs both the standard URL filter and our custom pattern against the specified text, we wind up with a validation which says "make sure this is a valid URL, and also in a Myco domain." This isn't perfect, but it is good enough for this simple demo's requirements. It's advisable to use the
title attribute along with pattern. If you do, the
title must describe the pattern; it should explain what format the data should take on, rather than any other information. That's because the
title may be displayed or spoken as part of a validation error message. For example, the browser might present the message "The entered text doesn't match the required pattern." followed by your specified
title. ...
...URL", which is not a good user experience. That's why, instead, we specify the string "The URL must be in a myco domain". By doing that, the resulting full error message might be something like "The entered text doesn't match the required pattern. ...
Global attributes - HTML: Hypertext Markup Language
eyboard navigation, but its relative order is defined by the platform convention; a positive value means that the element should be focusable and reachable via sequential keyboard navigation; the order in which the elements are focused is the increasing value of the tabindex. If several elements share the same tabindex, their relative order follows their relative positions in the document.
title Contains a text representing advisory information related to the element it belongs to. Such information can typically, but not necessarily, be presented to the user as a tooltip. translate An enumerated attribute that is used to specify whether an element's attribute values and the values of its Text node children are to be translated when the page is localized, or whether to leave them unc...
... Recommendation Snapshot of HTML Living Standard. From HTML5, contextmenu, draggable, dropzone, and spellcheck have been added. HTML5The definition of 'Global attributes' in that specification. Recommendation Snapshot of HTML Living Standard. From HTML 4.01 Specification, the concept of global attributes is introduced and the dir, lang, style, id, class, tabindex, accesskey, and
title are now true global attributes. xml:lang which was initially part of XHTML, is now also part of HTML. hidden, data-*, contenteditable, and translate have been added. HTML 4.01 Specification Recommendation There are no global attributes defined. Several attributes that will become global attributes in subsequent specifications are defined on a subset of elements. class a...
...ata-*, contenteditable, and translate have been added. HTML 4.01 Specification Recommendation There are no global attributes defined. Several attributes that will become global attributes in subsequent specifications are defined on a subset of elements. class and style are supported on all elements but <base>, <basefont>, <head>, <html>, <meta>, <param>, <script>, <style>, and <
title>. dir is supported on all elements but <applet>, <base>, <basefont>, <bdo>, <br>, <frame>, <frameset>, <iframe>, <param>, and <script>. id is supported on all elements but <base>, <head>, <html>, <meta>, <script>, <style>, and <
title>. lang is supported on all elements but <applet>, <base>, <basefont>, <br>, <frame>, <frameset>, <iframe>, <param>, and <script>. tabindex is only su...
...s but <base>, <head>, <html>, <meta>, <script>, <style>, and <
title>. lang is supported on all elements but <applet>, <base>, <basefont>, <br>, <frame>, <frameset>, <iframe>, <param>, and <script>. tabindex is only supported on <a>, <area>, <button>, <object>, <select>, and <textarea>. accesskey is only supported on <a>, <area>, <button>, <input>, <label>, <legend> and <textarea>.
title is supported on all elements but <base>, <basefont>, <head>, <html>, <meta>, <param>, <script>, and <
title>. ...
Structural overview of progressive web apps - Progressive web apps (PWAs)
favicon.ico fonts/ icons/ img/ bg.png js13kgames.png index.html js13kpwa.webmanifest style.css sw.js The HTML The HTML in the file index.html creates the structure of the app. The parts that are directly relevant to the app shell model are found outside the <section> with the ID content within this page. ...
... img/ bg.png js13kgames.png index.html js13kpwa.webmanifest style.css sw.js The HTML The HTML in the file index.html creates the structure of the app. The parts that are directly relevant to the app shell model are found outside the <section> with the ID content within this page. ...
...ions">Request dummy notifications</button> <section id="content"> // Content inserted in here </section> </main> <footer> <p>(C) js13kGames 2012-2018, created and maintained by <a href="http://end3r.com"> Andrzej Mazur</a> from <a href="http://enclavegames.com">Enclave Games</a>.</p> </footer> </body> </html> The <head> section contains basic information about the app, including its
title, description, and the needed references to its CSS file, web manifest, the main application JavaScript file (app.js, in which the app is initialized) as well as an additional JavaScript code file. The <body> is split into the <header> (which displays an image) and the body of the app, which is found inside a <main> element. The app displays its
title, a description, and then a place for the app c...
...ById("notifications"); button.addEventListener('click', function(e) { Notification.requestPermission().then(function(result) { if (result === 'granted') { randomNotification(); } }); }); The randomNotification() function follows, rounding out the last of the code in the file: function randomNotification() { var randomItem = Math.floor(Math.random()*games.length); var notif
Title = games[randomItem].name; var notifBody = 'Created by '+games[randomItem].author+'.'; var notifImg = 'data/img/'+games[randomItem].slug+'.jpg'; var options = { body: notifBody, icon: notifImg } var notif = new Notification(notif
Title, options); setTimeout(randomNotification, 30000); } The service worker The last file we'll briefly look at here is the service worker, which...
SVG and CSS - SVG: Scalable Vector Graphics
yles from that element. So to apply different styles to them you should use CSS custom properties. Example Make a new SVG document as a plain text file, doc8.svg. ...
...o to apply different styles to them you should use CSS custom properties. Example Make a new SVG document as a plain text file, doc8.svg. ...
...s standardized, though only a few browsers support the :hover pseudo-class and other more complex CSS selectors on elements referenced via <use> elements, at the moment. There is some discussion about what rules apply to such referenced elements. See below how the structure then looks like. ...
...ly a few browsers support the :hover pseudo-class and other more complex CSS selectors on elements referenced via <use> elements, at the moment. There is some discussion about what rules apply to such referenced elements. See below how the structure then looks like. ...
Storing annotations - Archive of obsolete content
in the panel, but we want to open them in the main browser window rather than the panel. So the content script binds a click handler to the links which will send the URL to the add-on. Save this file in data/list as annotation-list.js. ...
...t to open them in the main browser window rather than the panel. So the content script binds a click handler to the links which will send the URL to the add-on. Save this file in data/list as annotation-list.js. ...
...o OverQuota events Add-ons have a limited quota of storage space. If the add-on exits while it is over quota, any data stored since the last time it was in quota will not be persisted. So we want to listen to the OverQuota event emitted by simple-storage and respond to it. Add the following to your add-on's main function: simpleStorage.on("OverQuota", function () { notifications.notify({
title: 'Storage space exceeded', text: 'Removing recent annotations'}); while (simpleStorage.quotaUsage > 1) simpleStorage.storage.annotations.pop(); }); Because we use a notification to alert the user, we need to import the notifications module: var notifications = require("sdk/notifications"); (It should be obvious that this is an incredibly unhelpful way to deal with the problem. A real...
Alerts and Notifications - Archive of obsolete content
Basic modal alert alert('hello'); Pop-ups The following code presents a non-modal pop-up, which automatically disappears after an appropriate delay. It uses nsIAlertsService. ...
...following code presents a non-modal pop-up, which automatically disappears after an appropriate delay. It uses nsIAlertsService. ...
...illa.org/alerts-service;1'] .getService(Components.interfaces.nsIAlertsService) .showAlertNotification(null,
title, text, false, '', null); } catch(e) { // prevents runtime error on platforms that don't implement nsIAlertsService } } If you need to display a comparable alert on a platform that doesn't support nsIAlertsService, you can do this: function popup(
title, msg) { var image = null; var win = Components.classes['@mozilla.org/embedcomp/window-watcher;1'] .getService(Components.interfaces.nsIWindowWatcher) .openWindow(null, 'chrome://global/content/alerts/alert.xul', '_blank', 'chrome,
titlebar=no,popup=yes', null); win.arguments = [image,
title, msg, false, '']; } Usi...
Dialogs and Prompts - Archive of obsolete content
but the button set and layout is highly customizable, see below). Simple dialog code The following XUL code defines a simple dialog with two buttons, OK and Cancel (buttons="accept,cancel" attribute on dialog). <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> <dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="..."
title="..." buttons="accept,cancel" ondialogaccept="return onAccept();" ondialogcancel="return onCancel();"> <script src="chrome://..."/> <!-- Content --> </dialog> You need to implement onAccept and onCancel functions in your script. If they return anything but false, the dialog will be closed. Buttons in <dialog> Predefined There are six button types you can use in the buttons attribute of ...
...buttons listed above, and the default is "accept", for compatibility with previous versions. Using <dialogheader> You can use the dialogheader element to add "headers" to windows. To get an idea of what it looks like, open Options (or Preferences) dialog in Firefox or Thunderbird (v1.0 and earlier only). The header to the right of the sections buttons is made with <dialogheader>: <dialogheader
title="General" description="whatever"/> Note, that you should only use this element in a <dialog>, because otherwise it may be not styled properly. (Although it seems to work in <window> as well). Programmatic button access If you want to access the accept ("OK") and cancel buttons from script, use this: // Disable the OK and Cancel btns document.documentElement.getButton("accept").disabled = true...
...e://myext/content/mydialog.xul", "", "chrome, dialog, modal, resizable=yes", params).focus(); if (params.out) { // User clicked ok. Process changed arguments; e.g. write them to disk or whatever } else { // User clicked cancel. Typically, nothing is done here. ...
Appendix: What you should know about open-source software licenses - Archive of obsolete content
icenses vary from one license to the next. I'll look at three representative licenses here, and explain some of their features and relevant points. Most attempts at explaining open source start with the GPL. This is the longest, most complicated, and hardest to understand. So instead, I'm going to start with the simplest, the Modified BSD license. ...
...ative licenses here, and explain some of their features and relevant points. Most attempts at explaining open source start with the GPL. This is the longest, most complicated, and hardest to understand. So instead, I'm going to start with the simplest, the Modified BSD license. The table below shows a few well-known software
titles and their licenses License Representative software
titles Modified BSD FreeBSD, NetBSD, OpenBSD MPL Firefox, Thunderbird (also triple-licensed MPL/LGPL/GPL) GPL Linux kernel, GIMP LGPL GTK+, OpenOffice.org Modified BSD license This license permits free duplication, distribution, and modification provided that a copyright statement and liability disclaimer are included. Modifications to BSD-license...
...cense for your own use -> Support is a nightmare. Do you hate the idea of your software ever being embedded in a commercial package? -> Choose the GPL. Do you enthusiastically support the Free Software movement? -> Choose the GPL. Do you want your code to be embedded in a certain OSS project? -> Choose the same license as that project. None of the above: Choose the Modified BSD license. The
title hints at Matsumoto's diagnostic approach, since it mentions "free software." This is slightly different from open source. (Matsumoto updated his free software license diagnostic for a special open-source section in the January 2007 edition of Softbank's Open Source magazine.) If a company is considering releasing its own software as open source, it should consider dual-licensing or the CPL. Appl...
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
nt to display an OK button, so we set the buttons attribute to accept. Within the window are a label element and textbox element, wrapped in a hbox element so that they are arranged horizontally. ...
...isting 8. Add the DOCTYPE declaration that references the DTD file, and replace "clock" and "current time" with entity references. ...
...hat will be used to set your preferences. Add the contents of Listing 27 to your install manifest to make it so that the Add-on Manager can open your preference panel. ...
Bookmark Keywords - Archive of obsolete content
s been filed into a folder called "Widgets." You can create a folder with another name, or not put your keymarks into a folder at all. Changing the Properties To alter the properties of the bookmark, highlight the bookmark and select the "Properties..." button at the top of the Bookmark manager. This will open up a dialog box that will let you edit the properties of the bookmark. The original
title of the bookmark won't apply. You can name the bookmark whatever you want, but it's often handy to make the
title very similar to the keyword you plan to use. That way, if you ever forget the keyword you've assigned to a bookmark, you only have to glance at the bookmark's
title to remember the keyword. However, the two should not be a case-sensitive match-- that is, if your keyword is av, then you...
... Here's where the power starts to show up. ...
...rch Google directly form the address bar, go to Google and run a search for any word. Once you get a result page, bookmark that page. You'll need to replace the word for which you searched. One such example, with the relevant term highlighted, is shown in Figure 7. Once this result page has been bookmarked, we need only adjust the boookmark's properties. In this case, we'll give it a keyword and
title of google and replace the term "geitost" with the %s, as shown (with extra highlighting) in Figure 8. Now we can run Google searches straight from the address bar. These searches can be as complex as Google will tolerate, since the entered data will be converted to URL-encoded text before it's sent to the Google servers. Thus we could type any of the following into the address bar and get back u...
Creating a Firefox sidebar extension - Archive of obsolete content
xample 1. Package structure emptysidebar \- chrome |- content |- locale | \- en-US \- skin Create all folders, except for skin. It is not used for this tutorial. The locale holds the locale, only the en-US locale is created. It is listed in Example 2. The locale includes the name and shortcut keys for the sidebar. Example 2. chrome/locale/emptysidebar.dtd <!ENTITY emptysidebar.
title "EmptySidebar"> <!ENTITY openEmptySidebar.commandkey "E"> <!ENTITY openEmptySidebar.modifierskey "shift accel"> The content folder includes our sidebar, the emptysidebar.xul is shown in Example 3. It creates a page holding one label. Other elements can be included, please read the XUL tutorials for more information. Example 3. chrome/content/emptysidebar.xul <?xml version="1.0"?> <?xml-styl...
... label. Other elements can be included, please read the XUL tutorials for more information. Example 3. chrome/content/emptysidebar.xul <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css" ?> <?xml-stylesheet href="chrome://browser/skin/browser.css" type="text/css" ?> <!DOCTYPE page SYSTEM "chrome://emptysidebar/locale/emptysidebar.dtd"> <page id="sbEmptySidebar"
title="&emptysidebar.
title;" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" > <vbox flex="1"> <label id="atest" value="&emptysidebar.
title;" /> </vbox> </page> New extensions can be registered in the menus or popups, Firefox uses overlays for extending menus. This is an separate XUL file that specifies the location of menu items. The sidebar here is added to t...
...m key="key_openEmptySidebar" observes="viewEmptySidebar" /> </menupopup> <keyset id="mainKeyset"> <key id="key_openEmptySidebar" command="viewEmptySidebar" key="&openEmptySidebar.commandkey;" modifiers="&openEmptySidebar.modifierskey;" /> </keyset> <broadcasterset id="mainBroadcasterSet"> <broadcaster id="viewEmptySidebar" label="&emptysidebar.
title;" autoCheck="false" type="checkbox" group="sidebar" sidebarurl="chrome://emptysidebar/content/emptysidebar.xul" sidebar
title="&emptysidebar.
title;" oncommand="toggleSidebar('viewEmptySidebar');" /> </broadcasterset> </overlay> The overlay file consists of three entries, the menu definition, ...
Basics - Archive of obsolete content
to add to the consolestring console.log("hello world!"); arn()This method does stuff. error()This method does stuff. exception()This method does stuff. logFromCaller()This method does stuff. Class Notifications The Notification Box appears at the bottom right corner of the browser and displays important information to the user. The namespace for this class is jetpack.notificaitons. ...
...arn()This method does stuff. error()This method does stuff. exception()This method does stuff. logFromCaller()This method does stuff. Class Notifications The Notification Box appears at the bottom right corner of the browser and displays important information to the user. The namespace for this class is jetpack.notificaitons. Methods show(
titlestringbodystringiconstring)Draws a notification box. ...
...The namespace for this class is jetpack.tabs. ...
Notifications - Archive of obsolete content
uments the Jetpack Prototype, which is no longer under active development. Read the experiment report for what we learned from it and the blog post announcing the first SDK release for what we're up to next! The Notification Box appears at the bottom right corner of the browser and displays important information to the user. The namespace for this class is jetpack.notifications. ...
...ment. Read the experiment report for what we learned from it and the blog post announcing the first SDK release for what we're up to next! The Notification Box appears at the bottom right corner of the browser and displays important information to the user. The namespace for this class is jetpack.notifications. Methods show(
titlestring, [body as string] iconstring)Draws a notification box. ...
...ck.notifications. Methods show(
titlestring, [body as string] iconstring)Draws a notification box. ...
Elements - Archive of obsolete content
binding elements as children. Each binding child element defines a unique binding that can be attached to elements in other documents. An element can have only one binding attached (explicitly or inherited) at one moment. From several bindings only the last in the sequence will be used (like with any CSS rule). ...
... children. Each binding child element defines a unique binding that can be attached to elements in other documents. An element can have only one binding attached (explicitly or inherited) at one moment. From several bindings only the last in the sequence will be used (like with any CSS rule). ...
... an element that is displayed like a button. The part before the colon is a namespace prefix so you must declare the XUL namespace as well. Not all tags have a unique display type. The following XUL display types may be used: browser, button, checkbox, description, editor, grippy, iframe, image, label, menu, menuitem, menubar, progressmeter, radio, resizer, scrollbar, scrollbox, spacer, splitter,
titlebar, treechildren and treecol. You may also use a number of HTML, MathML and SVG tags. The 'display' attribute does not work unless the extends attribute is set, see bug bug 119389. In that case, put the value of the display attribute into the extends attribute. inheritstyle - The inheritstyle attribute indicates whether style rules from the document will affect anonymous content generated by the...
Attribute (XUL) - Archive of obsolete content
<< XUL Reference home acceltext accessible accesskey active
titlebarcolor afterselected align allowevents allownegativeassertions alternatingbackground alwaysopenpopup attribute autoCheck autocompleteenabled autocompletepopup autocompletesearch autocompletesearchparam autoFill autoFillAfterMatch autoscroll beforeselected buttonaccesskeyaccept buttonaccesskeycancel buttonaccesskeydisclosure buttonaccesskeyextra1 buttonaccesskeyextra2 buttonaccesskeyhelp buttonalign buttondir buttondisabledaccept buttonlabelaccept buttonlabelcancel buttonlabeldisclosure buttonlabelextra1 buttonlabelextra2 buttonlabelhelp buttonorient buttonpack buttons checked checkState clicktoscroll class closebutton closemenu coalesceduplicatearcs collapse collapsed col...
...size eventnode events expr firstdayofweek firstpage first-tab fixed flags flex focused forceComplete grippyhidden grippytooltiptext group handleCtrlTab height helpURI hidden hidechrome hidecolumnpicker hideheader hideseconds hidespinbuttons highlightnonmatches homepage href icon id ignoreBlurWhileSearching ignorecase ignoreincolumnpicker ignorekeys image inactive
titlebarcolor increment index inputtooltiptext insertafter insertbefore instantApply inverted iscontainer isempty key keycode keytext label lastpage lastSelected last-tab left linkedpanel max maxheight maxlength maxpos maxrows maxwidth member menu menuactive min minheight minResultsForPopup minwidth mode modifiers mousethrough movetoclick multiline multiple name ...
...reenY searchbutton searchSessions searchlabel selected selectedIndex seltype setfocus showcaret showCommentColumn showpopup size sizemode sizetopopup smoothscroll sort sortActive sortDirection sortResource sortResource2 spellcheck src state statedatasource statusbar statustext style subject substate suppressonselect tabindex tabScrolling targets template timeout
title toolbarname tooltip tooltiptext tooltiptextnew top type uri userAction validate value var visuallyselected wait-cursor width windowtype wrap wraparound ...
Adding Style Sheets - Archive of obsolete content
ble. For installed files, you'll have to create or modify a manifest file and install the skin. Our Find Files Dialog Example Let's modify the find files dialog so that its style comes from a separate style file. First, the modifed lines of findfile.xul: <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <?xml-stylesheet href="findfile.css" type="text/css"?> ... ...
..."/> <menulist id="searchmode"> <menupopup> <menuitem label="Is"/> <menuitem label="Is Not"/> </menupopup> </menulist> <spacer class="springspace"/> <menulist id="find-text" flex="1" editable="true" datasources="file:///mozilla/recents.rdf" ref="http://www.xulplanet.com/rdf/recent/all"/> ... <spacer class="
titlespace"/> <hbox> <progressmeter id="progmeter" value="50%" style="display:none;"/> The new xml-stylesheet line is used to import the style sheet. It will contain the styles instead of having them directly in the XUL file. You can include any number of style sheets in a similar way. Here the style sheet is placed in the same directory as findfile.xul. Some of the styles in the code above hav...
...wanted to. A class was added to the spacers so that they can be referred to. A style sheet also needs to be created. Create a file findfile.css in the same directory as the XUL file. (It would normally be put into a separate skin). In this file, we'll add the style declarations, as shown below: #find-text { min-width: 15em; } #progmeter { margin: 4px; } .springspace { width: 10px; } .
titlespace { height: 10px; } Notice how these styles are equivalent to the styles we had before. However, it is much easier for someone to change the look of the find files dialog now because they could add or modify the style declarations by either modifying the file or by changing the skin. If the user changes the interface skin, the files in a directory other than default will be applied. Impo...
Creating Dialogs - Archive of obsolete content
ed to include the XUL for each button; however, you do need to supply code to perform the appropriate tasks when the user presses each button. This mechanism is necessary because different platforms have a specific order in which the buttons appear. ...
...ccept - access key to use for the accept button egS defaultButton - button is activated when the Enter key is pressed Note: The label attributes are required by remote sites and are probably missing in the above examples due to bug 224996. ...
...ontent();" buttons="accept,cancel" buttonlabelaccept="Set Favourite" buttonaccesskeyaccept="S" ondialogaccept="return doSave();" buttonlabelcancel="Cancel" buttonaccesskeycancel="n" ondialogcancel="return doCancel();"> <script> function doSave(){ //doSomething() return true; } function doCancel(){ return true; } </script> <dialogheader
title="My dialog" description="Example dialog"/> <groupbox flex="1"> <caption label="Select favourite fruit"/> <radio id="orange" label="Oranges because they are fruity"/> <radio id="violet" selected="true" label="Strawberries because of their colour"/> <radio id="yellow" label="Bananas because they are pre-packaged"/> </groupbox> </dialog> The buttons elements can be accessed with the follo...
XUL Questions and Answers - Archive of obsolete content
t error is from a security check that has been put up to safeguard against cross-site-scripting attacks. A scheme is in development to allow servers to open up their site for cross-site access, but that's not yet done. hidechrome="true" doesn't work on a Mac? Unfortunately, no simple solution to this was posted. ...
...ndow.open" and send
titlebar="no" as one of the flags in the 3rd argument. Is it possible to have checkbox support for multi column lists? The current issue is a person exploring if it is possible to have checkbox support for multi column lists. The following is the code they wrote: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="test-window"
title="Check List Test" xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.mozilla.org/keymaster/gat...re.is.only.xul"> <listbox rows="4"> <listhead> <listheader label="multi-column"/> </listhead> <listcols> <listcol flex="1"/> </listcols> <listitem> <listcell type="checkbox" value="1" label="vghkvghk"/> </listitem> <listitem> <listcell type="checkbox" value="...
...What is an example of tab browser in XUL? An example of tab browswer in XUL How can i get URIs on open tabs? Using the following code sample, // Get browsers object var browsers=document.getElementById('content').browsers; var numBrowsers=browsers.length; for (var i=0; numBrowsers>i; i++) { var thisURI=browsers[i].currentURI.spec; // do something with it. } The person can get the
titles too using the .content
Title tag. How to add and remove values to/from, set up inside a <prefwindow> container to handle the preference? <prefwindow> can contain any control, just like a regular window. Some of them can be tied to a preference so that the preference is automatically updated as the control is manipulated. Others, like <listbox>, cannot be so tied, but one can always write a sc...
Theme changes in Firefox 2 - Archive of obsolete content
#application #feedBody #feedChangeSubscribeOptions #feedError #feedHeader #feedHeader[firstrun="true"] #feedHeader[firstrun="true"] #feedIntroText #feedHeader[firstrun="true"] #feedSubscribeLine #feedIntroText #feedSubscribeDoneChangingOptions #feedSubscribeHandleText #feedSubscribeHandler #feedSubscribeLine #feedSubscribeOptions #feedSubscribeOptionsGroup #feedSubscribeOptionsGroup
Title #feed
TitleContainer #feed
TitleImage #feed
TitleLink #readerContainer #readerGroup #readers #readers > listitem .feedEntryContent .feedSubscribeButton .feedSubscribeButton .button-icon .feedSubscribeLink .feedSubscribeLinkBox .field .link .link:hover:active .plain .plain > .button-box .plain:focus > .button-box .styleLessBorderLess The default theme also includes styles for a[h...
...r browses to a suspected phishing site: #safebrowsing-dim-area-canvas #safebrowsing-page-canvas #safebrowsing-palm-close #safebrowsing-palm-close-container #safebrowsing-palm-google-logo #safebrowsing-palm-message #safebrowsing-palm-message-actionbox #safebrowsing-palm-message-content #safebrowsing-palm-message-tail #safebrowsing-palm-message-tail-container #safebrowsing-palm-message-
titlebox .safebrowsing-palm-bigtext .safebrowsing-palm-fixed-width .safebrowsing-palm-paragraph .safebrowsing-palm-smalltext The following styles are used to display, in the URL bar, an indicator of whether or not the site is safe: #safebrowsing-urlbar-icon #safebrowsing-urlbar-icon[level="safe"] #safebrowsing-urlbar-icon[level="warn"] engineManager.css The following style needs to be imp...
...barbutton-text toolbar[mode="text"] .toolbarbutton-icon You may wish to change other styles as well. Changes in mozapps extensions/about.css The following styles from Firefox 1.5 are no longer used in Firefox 2 and should be removed: #contributorsBox #creatorBox #extensionContributors #extensionContributors #extensionCreatorLabel The following styles were added: .indent .section
Title You may wish to make changes to other styles as well. extensions/update.css The following styles are no longer used in Firefox 2 and should be removed from your theme: #foundList #statusbar-updates .updateCategoryBox .updateCategoryContent .updateCategoryIcon .updateCategoryLabel[selected="true"] .updateIcon .updateIcon[severity="0"] .updateIcon[severity="1"] .updateIcon[severity=...
Browser Detection and Cross Browser Support - Archive of obsolete content
these limitations in older browsers you can include modern content while at the same time supporting older browsers. HTML provides several methods of detecting support for various features such as support for scripting and FRAMES. Use these natural abilities of HTML to extend the range of browsers your content supports. Using NOFRAMES to support NON-FRAMES capable browsers <HTML> <HEAD> <
TITLE>FRAMES</
TITLE> </HEAD> <FRAMESET ROWS="30,*"> <FRAME SRC="foo.html"> <FRAME SRC="bar.html"> <NOFRAMES> <BODY> <P> This page requires frames. See <a href="noframes.html">sitemap</a>. </P> </BODY> </NOFRAMES> </FRAMESET> </HTML> Using NOSCRIPT to support non-scriptable browsers Some browsers may not support scripting while some users ma...
...se of advanced JavaScript features such as exception processing. One approach is to require that users of browsers which do not support the level of JavaScript used in your content to turn off JavaScript in order to be able to use your content. You can do this by providing an error message for users of older browsers as well as alternative content contained in NOSCRIPT tags. <HTML> <HEAD> <
TITLE>NOSCRIPT</
TITLE> </HEAD> <BODY> <SCRIPT LANGUAGE="JavaScript"> window.onerror = function () { // redirect user to a page describing the limitations // of their browser and requesting that they turn off // JavaScript in order to view your site. } // Netscape Navigator 4 will throw an error // on any JavaScript which attempts to use ...
...ag. Internet Explorer 4 and above can support a variety of script languages. The most common are VBSCRIPT and JavaScript. Internet Explorer also uses JSCRIPT as a synonym for JavaScript. Since other browsers do not support the language attribute VBSCRIPT or JSCRIPT you can use these languages when you wish certain scripts to only be executed by Internet Explorer 4 and above. <HTML> <HEAD> <
TITLE>SCRIPT Languages</
TITLE> </HEAD> <BODY> <SCRIPT LANGUAGE="JavaScript"> // JavaScript Code to implement fancy Menu // Visible to all JavaScript capable browsers </SCRIPT> <SCRIPT LANGUAGE="JScript"> // JavaScript Code that uses proprietary // Internet Explorer features not available in // other browsers. </SCRIPT> <SCRIPT LANGUAGE="VBScript"> ...
Reference - Archive of obsolete content
in_JavaScript_1.7#Using_JavaScript_1.7. This will impact the presentation of future examples if it hasn't already. --George3 11:47, 14 Sept 2006 (EDT) SGML comment hiding quirks SGML comment hiding needs to be mentioned here and its consequences. ...
...ure examples if it hasn't already. --George3 11:47, 14 Sept 2006 (EDT) SGML comment hiding quirks SGML comment hiding needs to be mentioned here and its consequences. Brendan just mentioned one obscure one here: https://bugzilla.mozilla.org/show_bu...?id=310993#c20 --Maian 22:46, 5 October 2005 (PDT) Section
title capitalization There's an inconsistency in the capitalization of section
titles. Some capitalize everything as if it's a book
title. Others just capitalize the first word. Which scheme should we take, or does it even matter? --Maian 07:11, 8 September 2005 (PDT) If you want to make them consistent, I think we should go with the "First word only" capitalization, rather than the book-
title style. Thanks :) -- dria deprecated pre box Is there any wiki markup available for...
...at will happen. In the meantime, newer features from JS 1.6 (and hopefully someone will add JS 1.7 features too) are being added to the reference with appropriate version information on the page itself. Yes, it can be slightly confusing, but it's better than no documentation for newer features at all. --Nickolay 01:53, 22 December 2006 (PST) Yes, seeing stuff that doesn't apply to 1.5 on a page
titled "... JavaScript 1.5" might be a little confusing. But there is no other place to put JavaScript 1.6 features at the moment. (There is no "Core JavaScript 1.6 Reference" yet.) What should we do, that will be the most useful to our readers? Copy all the "... JavaScript 1.5 ..." pages to "... JavaScript 1.6 ..." ? Then carefully update all links to the JavaScript 1.5 pages to link to the JavaScri...
Building up a basic demo with Babylon.js - Game development
browser with good WebGL support, such as the latest Firefox or Chrome. Creating a directory to store your experiments in. Saving a copy of the latest Babylon.js engine inside your directory. Opening the Babylon.js documentation in a separate tab -- it is useful to refer to. ...
...such as the latest Firefox or Chrome. Creating a directory to store your experiments in. Saving a copy of the latest Babylon.js engine inside your directory. Opening the Babylon.js documentation in a separate tab -- it is useful to refer to. ...
...The first <script> element includes the Babylon.js library in the page; we will write our example code in the second one. There is one helper variable already included, which will store a reference to the <canvas> element. Before rea...
Building up a basic demo with the PlayCanvas engine - Game development
n browser with good WebGL support, such as the latest Firefox or Chrome. Creating a directory to store your experiments in. Saving a copy of the latest PlayCanvas engine inside your directory. Opening the PlayCanvas documentation in a separate tab -- it is useful to refer to. HTML structure Here's the HTML structure we will use. ...
... such as the latest Firefox or Chrome. Creating a directory to store your experiments in. Saving a copy of the latest PlayCanvas engine inside your directory. Opening the PlayCanvas documentation in a separate tab -- it is useful to refer to. HTML structure Here's the HTML structure we will use. ...
...The first <script> element includes the PlayCanvas library in the page; we will write our example code in the second one. There is one helper variable already included, which will store a reference to the <canvas> element. Before reading on...
Building up a basic demo with Three.js - Game development
modern browser with good WebGL support, such as the latest Firefox or Chrome. Create a directory to store your experiments in. Save a copy of the latest minimized Three.js library inside your directory. Open the Three.js documentation in a separate tab -- it is useful to refer to. ...
...support, such as the latest Firefox or Chrome. Create a directory to store your experiments in. Save a copy of the latest minimized Three.js library inside your directory. Open the Three.js documentation in a separate tab -- it is useful to refer to. ...
...The first <script> element includes the Three.js library in the page, and we will write our example code inside the second. There are two helper variables already included, which store the window's width and height. ...
GLSL Shaders - Game development
the WebGL shaders you don't need much. You should: Make sure you are using a modern browser with good WebGL support, such as the latest Firefox or Chrome. Create a directory to store your experiments in. Save a copy of the latest minimized Three.js library inside your directory. HTML structure Here's the HTML structure we will use. ...
...ed much. You should: Make sure you are using a modern browser with good WebGL support, such as the latest Firefox or Chrome. Create a directory to store your experiments in. Save a copy of the latest minimized Three.js library inside your directory. HTML structure Here's the HTML structure we will use. ...
...The <script> element in the <head> includes the Three.js library in the page; we will write our code into three script tags in the <body> tag: The first one will contain the vertex shader. The second one will contain the fragment shader. The third one ...
Initialize the framework - Game development
enerate the required <canvas> element. The game's HTML The HTML document structure is quite simple, as the game will be rendered entirely on the <canvas> element generated by the framework. ...
...ument structure is quite simple, as the game will be rendered entirely on the <canvas> element generated by the framework. ...
...that suits you best -- I would recommend the min.js option as it keeps the source code smaller, and you are unlikely need to go through the source code anyway. Save the Phaser code inside a /js directory in the same location as your index.html file. Update the src value of the first <script> element as shown above. Walking through what we have so far At this point we have a charset defined, <
title> and some basic CSS in the header to reset the default margin and padding. We also have a <script> element to apply the Phaser source code to the page. The body contains a second <script> element, where we will write the JavaScript code to render the game and control it. The <canvas> element is generated automatically by the framework. We are initializing it by creating a new Phaser.Game object ...
Client-side form validation - Learn web development
whether it has a value or not. If the <input> has no value, the input will match the :invalid pseudoclass. Note: For good user experience, indicate to the user when form fields are required. It isn't only good user experience, it is required by WCAG accessibility guidelines. Also, only require users to input data you actually need: For example, why do you really need to know someone's gender or
title? Validating against a regular expression Another useful validation feature is the pattern attribute, which expects a Regular Expression as its value. A regular expression (regex) is a pattern that can be used to match character combinations in text strings, so regexs are ideal for form validation and serve a variety of other uses in JavaScript. Regexs are quite complex, and we don't intend to...
...t controls are used (such as the up and down number buttons). In the above example we've not included a step attribute, so the value defaults to 1. This means that floats, like 3.2, will also show as invalid. Full example Here is a full example to show usage of HTML's built-in validation features. ...
... input type but support the pattern attribute. Please note that browsers that support the pattern attribute will make it fail silently when used with a number field. ...
HTML text fundamentals - Learn web development
hs Most structured text consists of headings and paragraphs, whether you are reading a story, a newspaper, a college textbook, a magazine, etc. Structured content makes the reading experience easier and more enjoyable. ...
...Somewhere, an owl hooted. ...
...> There are six heading elements: <h1>, <h2>, <h3>, <h4>, <h5>, and <h6>. Each element represents a different level of content in the document; <h1> represents the main heading, <h2> represents subheadings, <h3> represents sub-subheadings, and so on. Implementing structural hierarchy For example, in this story, the <h1> element represents the
title of the story, the <h2> elements represent the
title of each chapter, and the <h3> elements represent sub-sections of each chapter: <h1>The Crushing Bore</h1> <p>By Chris Mills</p> <h2>Chapter 1: The dark night</h2> <p>It was a dark night. Somewhere, an owl hooted. The rain lashed down on the ...</p> <h2>Chapter 2: The eternal silence</h2> <p>Our protagonist could not so much as a whisper out of the shadowy figure ...</p> <h3>The specter spe...
Test your skills: Multimedia and embedding - Learn web development
lay some default controls. Add some appropriate fallback text for browsers that don't support <audio>. Try updating the live code below to recreate the finished example: Download the starting point for this task to work in your own editor or in an online editor. Multimedia and embedding 2 In this task we want you to mark up a slightly more complex video player, with multiple sources, sub
titles, and other features besides. You need to: Add an attribute to make browsers display some default controls. Add some appropriate fallback text for browsers that don't support <video>. Add multiple sources, containing the paths to the video files. The files are called video.mp4 and video.webm, and are in a folder inside the current folder called media. Let the browser know in advance what vi...
...are in a folder inside the current folder called media. Let the browser know in advance what video formats the sources point to, so it can make an informed choice of which one to download ahead of time. Give the <video> a width and height equal to its intrinsic size (320 by 240 pixels). Make the video muted by default. Display the text tracks contained in the media folder, in a file called sub
titles_en.vtt, when the video is playing. You must explicitly set the type as sub
titles, and the sub
title language to English. Try updating the live code below to recreate the finished example: Download the starting point for this task to work in your own editor or in an online editor. Multimedia and embedding 3 For this final task you have two tasks to do: Embed a PDF into the page. The PD...
... you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. You can write the code yourself, or use the starting point files linked to in the above sections. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for HTML image basics 1 skill test". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone with...
Index - Learn web development
dule will cover general best practices (which are demonstrated throughout the HTML, CSS, and JavaScript topics), cross browser testing, and some tips on enforcing accessibility from the start. We'll cover accessibility in special detail. 3 Accessible multimedia Accessibility, Article, Audio, Beginner, CodingScripting, HTML, Images, JavaScript, Learn, Multimedia, Video, captions, sub
titles, text tracks This chapter has provided a summary of accessibility concerns for multimedia content, along with some practical solutions. 4 Assessment: Accessibility troubleshooting Accessibility, Assessment, Beginner, CSS, CodingScripting, HTML, JavaScript, Learn, WAI-ARIA In the assessment for this module, we present to you a simple site with a number of accessibility ...
...t least might find interesting. To find way more HTML elements, you can take a look at our HTML element reference (the Inline text semantics section would be a great place to start.) In the next article we will look at the HTML elements you'd use to structure the different parts of an HTML document. 232 Creating hyperlinks Beginner, CodingScripting, Guide, HTML, HTTP, Learn, Links,
Title, absolute, href, hyperlinks, relative, urls That's it for links, for now anyway! You'll return to links later on in the course when you start to look at styling them. Next up for HTML, we'll return to text semantics and look at some more advanced/unusual features that you'll find useful -- Advanced text formatting is your next stop. 233 Debugging HTML Beginner, CodingScriptin...
...sign, Graphics, Guide, HTML, Image, Intermediate, JPEG, PNG, Pictures, captions, hyperlinks, img, picture, sizes, src, srcset That's a wrap for responsive images -- we hope you enjoyed playing with these new techniques. As a recap, there are two distinct problems we've been discussing here: 250 Video and audio content Article, Audio, Beginner, Guide, HTML, Video, captions, sub
titles, track And that's a wrap; we hope you had fun playing with video and audio in web pages! In the next article, we'll look at other ways of embedding content on the Web, using technologies like <iframe> and <object>. 251 Test your skills: Multimedia and embedding Beginner, Embedding, HTML, Learn, Multimedia, test your skills This aim of this skill test is to assess wheth...
Ember app structure and componentization - Learn web development
<label for="mark-all-complete">Mark all as complete</label> <ul class="todo-list"> <li> <div class="view"> <input aria-label="Toggle the completion of this todo" class="toggle" type="checkbox" > <label>Buy Movie Tickets</label> <button type="button" class="destroy"
title="Remove this todo" ></button> </div> <input autofocus class="edit" value="Todo Text"> </li> <li> <div class="view"> <input aria-label="Toggle the completion of this todo" class="toggle" type="checkbox" > <label>Go to Movie</label> <button type="button" ...
...></button> </div> <input autofocus class="edit" value="Todo Text"> </li> <li> <div class="view"> <input aria-label="Toggle the completion of this todo" class="toggle" type="checkbox" > <label>Go to Movie</label> <button type="button" class="destroy"
title="Remove this todo" ></button> </div> <input autofocus class="edit" value="Todo Text"> </li> </ul> </section> <footer class="footer"> <span class="todo-count"> <strong>0</strong> todos left </span> <ul class="filters"> <li> <a href="#">All</a> <a href="#">Active</a> <a href="#">Completed</a> </li> ...
...The contents of the todo.hbs file below will replace <Todo /> in the rendered page as our application loads. ...
Starting our Svelte Todo list app - Learn web development
t -- this will contain our list of todos. Create a new folder -- src/components. Note: you can put your components anywhere inside the src folder, but the components folder is a recognized convention to follow, allowing you to find your components easily. ...
...ponents. Note: you can put your components anywhere inside the src folder, but the components folder is a recognized convention to follow, allowing you to find your components easily. ...
...can put your components anywhere inside the src folder, but the components folder is a recognized convention to follow, allowing you to find your components easily. ...
Getting started with Svelte - Learn web development
d <script> section of every component and stores the result in public/build/bundle.js. It also adds the code in src/main.js to reference the features of each component. ...
... of every component and stores the result in public/build/bundle.js. It also adds the code in src/main.js to reference the features of each component. ...
... On the left side of the screen you'll see the code of your components, and on the right you'll see the running output of your app. The bar above the code lets you create .svelte and .js files and rearrange them. To create a file inside a folder just specify the complete pathname, like this -- components/MyComponent.svelte. The folder will be automatically created. Above that bar you have the
title of the REPL. Click on it to edit it. On the right side you have three tabs: The Result tab shows your app output, and provides a console at the bottom. The JS output tab lets you inspect the JavaScript code generated by Svelte, and set compiler options. The CSS output tab shows the CSS generated by Svelte. Above the tabs, you'll find a toolbar that lets you enter full-screen mo...
Localization content best practices
t have problems working with VCS systems. It's important to consider this when adding strings, and especially localization comments for strings that contain references, or obscure technical details. Localization files Choose good key IDs The IDs (names) chosen for your keys, regardless of the file format, should always be descriptive of the string, and its role in the interface (button label,
title, etc.). Think of them as long variable names. When you have to change a key ID, adding a progressive number to the existing key should always be used as a last resort. For example, suppose this string needs to be changed from "Event" to "Add New Event": new-event-header = Event add-new-event-header is definitely a better choice for the new string than new-event-header1. If a string is tied to ...
...his may lead to bad translations. Don't reuse strings in different contexts This is particularly important for mobile, where different context often means different font and available space for the string. For example, if you're adding a new menu item in Settings on Android, don't use the same string for the menu item and the following screen header. Another example, some locales use nouns for
titles, and verbs for actions (for example button labels). Sometimes they coincide with English, but they rarely do in other languages. Take Bookmark: it can be both a noun and a verb in English. A developer could be tempted to reuse the same string "Bookmark" in the button to add a bookmark, and in the header for the next dialog. This won't work in some languages. Avoid unnecessary complexity in stri...
...used strings in the .properties file. Tooltips If a string is used as a tooltip, it should not end in a period (in English). Tooltips are never written in imperative mood but infinitive mood instead. Hence the proper absence of periods to indicate this isn't just a matter of consistency for en-US, as it is also vital info for localizers. Menu and control labels The labels on controls and menu
titles, menu option strings, and so forth should not end in periods (in English). These are generally not complete sentences, but instead, phrases that convey the idea of a concept or action. Therefore, for both correctness and consistency within en-US, please leave out the trailing periods for these items. This also helps with localization. Developer tools key shortcuts When translating Firefox stri...
Creating localizable web applications
Snippet 8. Good: <p class="description"><strong><?= _("Description:");?></strong></p> Snippet 9. Good: <h1> <?printf("<a href=\"%s\"><img src=\"/static/img/logo.png\" alt=\"" . _("Mozilla Labs Personas") . "\" /></a>", $locale_conf->url('/'));?> </h1> Snippet 10. Better: <h1> <a href="<?= $locale_conf->url('/') ?>"> <img src="/static/img/logo.png" alt="<?= /* L10N: link
title attribute */ _("Mozilla Labs Personas"); ?> " /> </a> </h1> ...but don't sacrifice flexibility Don't sacrifice flexibility trying to satisfy the rule above. Make sure the content supports changing the order of the sentence, which may be required by some grammars. Snippet 1. Bad: <p class="added"><?= _("<strong>Added:</strong>") . $persona['date']; ?></p> Snippet 2. Bad: <p class="added"><...
...ments starting with this prefix using the --add-comments=PREFIX option, for example xgettext --add-comments=L10n. Snippet 1. Bad: <h1> <a href="<?= $locale_conf->url('/') ?>"> <img src="/static/img/logo.png" alt="<?= _("Mozilla Labs Personas"); ?>" /> </a> </h1> Snippet 2. Good: <h1> <a href="<?= $locale_conf->url('/') ?>"> <img src="/static/img/logo.png" alt="<?= /* L10n: link
title attribute */ _("Mozilla Labs Personas") ?> " /> </a> </h1> Snippet 3. Bad: <p class="added"><? printf(_("<strong>Added:</strong> %s"), $persona['date']);?></p> Snippet 4. Good: <p class="added"><? printf( /* L10N: %s is a date */ _("<strong>Added:</strong> %s"), $persona['date']);?></p> Snippet 5. Bad: printf(_("%1$s by %2$s"), $persona['name'], $persona['display_username']); Snipp...
...ust use string concatenation. See snippet 4 above for an example of how to do this. Use gettext contexts Depending on context in which it is used, one English string might require two or more different translations. This is particularly true for short strings, like "File" or "Log in". For instance, "Log in" as a button label might be translated by a localizer as the imperative, but for a dialog
title, the localizer may choose to use a different form, like gerund (much like "Logging in"). Gettext's context feature allows the developer to distinguish between two identical English strings and disambiguate the translation. Use gettext plurals Whenever you put numbers in your messages, make it possible to use different singular and plural forms. Snippet 1. Bad: print '<p class="numb-users">' .
gettext
so a msgstr[2] should be used. Read more about plurals in gettext at gnu.org. Using context with msgctxt Depending on context in which it is used, one English string might require two or more different translations. This is particularly true for short strings, like "File" or "Log in". ...
...In PHP, however, the default gettext functions don't support passing such additional argument. ...
...he plural string and the fourth argument as the context (the third argument is reserved for the number in this example). xgettext --language=PHP \ --add-comments=L10N \ --keyword=___:1 \ --keyword=___:1,2c \ --keyword=n___:1,2 \ --keyword=n___:1,2,4c \ file.php Running xgettext will result in the following messages.po file: # SOME DESCRIPTIVE
TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2009-09-28 16:18+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "...
Mozilla Web Developer FAQ
r the image. ('Bad' in the sense that the textual alternative is less useful for people who don't see the image.) When the alternative text is shown in a tooltip, other authors don't want to supply textual alternatives at all, because they don't want tooltips to appear. (Again, making things harder for people who don't see the image.) There is another attribute that Mozilla shows as a tooltip:
title. In fact, the HTML 4.01 specification suggests that the
title attribute may be displayed as a tooltip. However, this particular display method is not required and some other browsers show the
title attribute in the browser status bar, for example. At this point some people feel compelled to post a "But IE..." rant in the newsgroups or in Bugzilla. Please note that Mac IE 5 behaves in the same wa...
... Does Mozilla support downloadable fonts? Downloadable fonts in TrueType and OpenType formats (.ttf and .otf) are supported since Firefox 3.5. ...
... Does Mozilla support downloadable fonts? Downloadable fonts in TrueType and OpenType formats (.ttf and .otf) are supported since Firefox 3.5. ...
Preferences system
ow: Preferences System documentation: Introduction: Getting Started | Examples | Troubleshooting Reference: prefwindow | prefpane | preferences | preference | XUL attributes Use Code for a typical preferences window may look like this: <prefwindow id="appPreferences" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <prefpane id="pane1" label="&pane1.
title;"> <preferences> <preference id="pref1" name="pref.name" type="bool"/> </preferences> .. UI elements that refer to the preferences above, e.g.: <checkbox id="check1" preference="pref1" label="&check1.label;" accesskey="&check1.accesskey;"/> </prefpane> <prefpane id="pane2" label="&pane2.
title;" src="chrome://uri/to/pane.xul"/> </prefwindow> Pane content c...
...You should also be careful to specify the width of the window (in em) as appropriate using the preprocessor for each targeted platform, as well as the height (in em) for platforms where the window size does not change as the selected panel is changed (e.g. Windows). ...
...rm, as well as the height (in em) for platforms where the window size does not change as the selected panel is changed (e.g. Windows). Usage in XULRunner applications When calling openDialog() to open a preferences dialog, "toolbar" should be included in the features string. ...
L20n HTML Bindings
"/shared/{{locale}}/date.l20n"? ] } Make HTML Elements Localizable Use the data-l10n-id attribute on an HTML element to mark it as localizable. <p data-l10n-id="about"></p> Notice that you don't have to put the text content in the HTML anymore (you still can if you want to). All content lives in the localization resources. A safe subset of HTML elements (e.g. em, sup), attributes (e.g.
title) and entities can be used in translations. In addition to the pre-defined whitelists, any element found in the original source HTML is allowed in the translation as well. Consider the following source HTML: <p data-l10n-id="save"> <input type="submit"> <a href="/main" class="btn-cancel"></a> </p> Assume the following malicious translation: <save """ <input value="Save" type="text"> or ...
...ned whitelists, any element found in the original source HTML is allowed in the translation as well. Consider the following source HTML: <p data-l10n-id="save"> <input type="submit"> <a href="/main" class="btn-cancel"></a> </p> Assume the following malicious translation: <save """ <input value="Save" type="text"> or <a href="http://myevilwebsite.com" onclick="alert('pwnd!')"
title="Back to the homepage">cancel</a>. """> The result will be: <p data-l10n-id="back"> <input value="Save" type="submit"> or <a href="/main" class="btn-cancel"
title="Back to the homepage">cancel</a>. </p> The input element is not on the default whitelist but since it's present in the source HTML, it is also allowed in the translation. The value attribute is allowed on input elements, b...
... It is important to note that applying translations doesn't replace DOM elements, but only modifies their text nodes and their attributes. This makes it possible to use L20n in conjunction with MVC frameworks. ...
Manipulating bookmarks using Places
r bookmarksArray = bmsvc.getBookmarkIdsForURI(uri, {}); After executing this code, the array bookmarksArray contains the IDs of all bookmarks that refer to the specified URI (in this case, "http://google.com"). Manipulating existing items There are a number of convenient methods you can use to make changes to existing bookmarks and bookmark folders. This section covers some of them. ...
...svc.getBookmarkIdsForURI(uri, {}); After executing this code, the array bookmarksArray contains the IDs of all bookmarks that refer to the specified URI (in this case, "http://google.com"). Manipulating existing items There are a number of convenient methods you can use to make changes to existing bookmarks and bookmark folders. This section covers some of them. ...
...sArray contains the IDs of all bookmarks that refer to the specified URI (in this case, "http://google.com"). Manipulating existing items There are a number of convenient methods you can use to make changes to existing bookmarks and bookmark folders. This section covers some of them. The item
title To change the
title of a bookmark or bookmark folder, you use the nsINavBookmarksService.setItem
Title() method. bmsvc.setItem
Title(newBkmkId, "New
title"); This sets the
title of the item referenced by the ID newBkmkId to "New
title". You can fetch the current
title of an item using the nsINavBookmarksService.getItem
Title() method: var this
Title = bmsvc.getItem
Title(newBkmkId); This code will display an alert containing the
title of the item referenced by the ID newBkmkId. The item URI S...
Using the Places history service
.9.1 (Firefox3.1) on, don't use any Places service on (or after) quit-application has been notified, since the database connection will be closed to allow the last sync, and changes will most likely be lost. Use quit-application-granted instead. Differences from previous implementations The previous nsGlobalHistory service stored one entry for each page in history. This entry contained the URL,
title, visit count, last visit date, first visit date, host name, last referrer, flags for typed, hidden, and gecko flags (gecko flags is trunk only). The NavHistory service has broken this into two tables (see History Service Design). The main URL table stores the information about the page: URL, host name,
title, visit count, hidden, and typed. Stored separately is the information specific to each v...
...tails. nsINavHistoryService.addVisit: This is an advanced function that allows the caller to set the exact referring visit, the time, the session, etc. It is designed for people writing synchronizing or backup services that need access to all the flags. Under normal browsing, addURI and addDocumentRedirect will infer this information for you. Modifying pages in history nsIGlobalHistory2.setPage
Title: Called by Gecko when the <
title> element is encountered. nsIGlobalHistory3.setGeckoFlags: Called by Gecko to store rendering information about a page. Currently, this is used to store whether there was a scrollbar, which allows more efficient layout if the page is revisited. However, this is not yet supported by the NavHistory implementation. nsIBrowserHistory.removePage: Removes a given URI a...
...ffects the URL bar autocomplete. This will cause the transition type of the next visit of the URL to be marked as "typed." nsINavHistoryService.markPageAsFollowedBookmark: Called by the UI (implemented, but not yet called, see bug 409301) when the user selects a bookmark. This will cause the transition type of the next visit of the URL to be marked as "bookmark." nsINavHistoryService.setPageUser
Title: Sets the user-defined
title for the page, which will override the actual page
title when displayed in the UI. This is used for bookmark
titles.This function may be removed if the bookmark service is changed. nsINavHistoryService.setPageDetails: Used to set all of the global bits associated with a URL. It is designed for synchronizing or backup services. Basic querying of the history system ns...
nsACString (External)
Class Declaration <map id="classes" name="classes"><area alt="" coords="1005,6,1096,54" href="http://developer.mozilla.org/en/nsACString_(External)" shape="rect"
title="nsACString_(External)"> <area alt="" coords="980,102,1121,150" href="http://developer.mozilla.org/en/nsCStringContainer_(External)" shape="rect"
title="nsCStringContainer_(External)"> <area alt="" coords="571,198,707,246" href="http://developer.mozilla.org/en/nsCString_external" shape="rect"
title="nsCString_external"> <area alt="" coords="731,198,955,246" href="http://developer.mozilla.org/en/nsDependentCSubstring_external" shape="rect"
title="nsDependentCSubstring_external"> <area alt="" coords="979,198,1123,246" href="http://developer.mozilla.org/en/PromiseFlatCString_(External)" shape="rect"
title="PromiseFlatCString...
...href="http://developer.mozilla.org/en/nsDependentCSubstring_external" shape="rect"
title="nsDependentCSubstring_external"> <area alt="" coords="979,198,1123,246" href="http://developer.mozilla.org/en/PromiseFlatCString_(External)" shape="rect"
title="PromiseFlatCString_(External)"> <area alt="" coords="1147,198,1259,246" href="http://developer.mozilla.org/en/nsCAutoString_(External)" shape="rect"
title="nsCAutoString_(External)"> <area alt="" coords="5,294,208,342" href="http://developer.mozilla.org/en/nsDependentCString_external" shape="rect"
title="nsDependentCString_external"> <area alt="" coords="232,294,475,342" href="http://developer.mozilla.org/en/NS_ConvertUTF16toUTF8_external" shape="rect"
title="NS_ConvertUTF16toUTF8_external"> <area alt="" coords="499,294,779,342" href="http://develo...
..."http://developer.mozilla.org/en/nsDependentCString_external" shape="rect"
title="nsDependentCString_external"> <area alt="" coords="232,294,475,342" href="http://developer.mozilla.org/en/NS_ConvertUTF16toUTF8_external" shape="rect"
title="NS_ConvertUTF16toUTF8_external"> <area alt="" coords="499,294,779,342" href="http://developer.mozilla.org/en/NS_LossyConvertUTF16toASCII_external" shape="rect"
title="NS_LossyConvertUTF16toASCII_external"> <area alt="" coords="803,294,925,342" href="http://developer.mozilla.org/en/nsLiteralCString_(External)" shape="rect"
title="nsLiteralCString_(External)"></map> Method Overview BeginReading EndReading CharAt operator[] First BeginWriting EndWriting SetLength Length IsE...
nsIAccessibleRole
accessible/public/nsIAccessibleRole.idlScriptable This interface defines cross platform (Gecko) roles. 1.0 66 Introduced Gecko 1.9 Inherits from: nsISupports Last changed in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1) Constants Constant Value Description ROLE_NOTHING 0 Used when accessible has no strong defined role. ROLE_
TITLEBAR 1 Represents a
title or caption bar for a window. It is used by MSAA only, supported automatically by MS Windows. ROLE_MENUBAR 2 Represents the menu bar (positioned beneath the
title bar of a window) from which menus are selected by the user. The role is used by xul:menubar or role="menubar". ROLE_SCROLLBAR 3 Represents a vertical or horizontal scroll bar, which is part of the client area or used in a cont...
... Represents an alert or a condition that a user should be notified about. Assistive Technologies typically respond to the role by reading the entire on screen contents of containers advertising this role. Should be used for warning dialogs, etc. The role is used by xul:browsermessage, role="alert", xforms:message. ROLE_WINDOW 9 Represents the window frame, which contains child objects such as a
title bar, client, and other objects contained in a window. The role is supported automatically by MS Windows. ROLE_INTERNAL_FRAME 10 A sub-document or iframe. ROLE_MENUPOPUP 11 Represents a menu, which presents a list of options from which the user can make a selection to perform an action. It is used for role="menu". ROLE_MENUITEM 12 Represents a menu item, which is an entry in a menu that a us...
...ys the files in the directory and lets the user select a file, browse a different directory, or specify a filename. May use the directory pane to show the contents of a directory. Also refer to ROLE_DIRECTORY_PANE. ROLE_FONT_CHOOSER 74 A font chooser. A font chooser is a component that lets the user pick various attributes for fonts. ROLE_CHROME_WINDOW 75 Frame role. A top level window with a
title bar, border, menu bar, etc. It is often used as the primary window for an application. ROLE_GLASS_PANE 76 A glass pane. A pane that is guaranteed to be painted on top of all panes beneath it. Also refer to ROLE_ROOT_PANE. ROLE_HTML_CONTAINER 77 A document container for HTML, whose children represent the document content. ROLE_ICON 78 A small fixed size picture, typically used to decorate co...
nsIBrowserHistory
nged in Gecko 22.0 (Firefox 22.0 / Thunderbird 22.0 / SeaMonkey 2.19) Implemented by: @mozilla.org/browser/nav-history-service;1. ...
... since Gecko 15.0 (Firefox 15.0 / Thunderbird 15.0 / SeaMonkey 2.12) Note: This method was removed in Gecko 15.0. You should use mozIAsyncHistory.updatePlaces() instead. This method adds a page to the history with specific time stamp information. It is called by history importing code and is used in the History migration tool. void addPageWithDetails( in nsIURI aURI, in wstring a
Title, in long long aLastVisited ); Parameters aURI The page that will be added to the history. a
Title The
title of the page. aLastVisited When the page was last visited, in microseconds since the Unix epoch. markPageAsFollowedLink() Obsolete since Gecko 22.0 (Firefox 22.0 / Thunderbird 22.0 / SeaMonkey 2.19) Note: This method was moved to another interface in ...
...iven domain. If aEntireDomain is true, it will assume aHost is a domain, and remove all pages from the entire domain. void removePagesFromHost( in AUTF8String aHost, in boolean aEntireDomain ); Parameters aHost The name of the host to be removed. An empty value for this parameter means local files and anything else without a hostname. You can also pass in the localized "(local files)"
title given to you by a history query to remove all history information for local files. aEntireDomain If set to true, it will assume aHost is a domain, and remove all pages from the entire domain, including subdomains. Set to false otherwise. removeVisitsByTimeframe() Removes all visits within the given timeframe, using a batch. Any pages that become unvisited as a result are also deleted. void ...
nsINavHistoryQueryOptions
ou'll get all items, even hidden ones. Does nothing for bookmark queries. Defaults to false. maxResults long This is the maximum number of results that you want. The query is exeucted, the results are sorted, and then the top maxResults results are taken and returned. Set to "0" (the default) to get all results. This does not work in conjunction with sorting by
title. This is because sorting by
title requires us to sort after using locale-sensetive sorting (as opposed to letting the database do it for us). Instead, we get the result ordered by date, pick the maxResult most recent ones, and then sort by
title. queryType short The type of search to use when querying the DB; This attribute is only honored by query nodes. It is ...
...es. It is silently ignored for simple folder queries. See Query type constants for possible values. redirectsMode unsigned short Specifies how to handle redirects; see Redirects mode constants for details. The default value is REDIRECTS_MODE_ALL. Note: This option is only used on QUERY_TYPE_HISTORY. resolveNullBookmark
Titles boolean If a bookmark
title is NULL (note, not empty), attempt to use the history
title. It is set to false by default. resultType short Sets the result type. See Result type constants for possible values. showSessions boolean Separate/group history items based on session information. Only matters when sorting by date. ...
...g The annotation to use in SORT_BY_ANNOTATION_* sorting modes. sortingMode short The sorting annotation to use; see Sorting methods for possible values. Constants Sorting methods You can ask for the results to be pre-sorted. Since the DB has indices of many items, it can produce sorted results almost for free. Note: re-sorting is slower, as is sorting by
title or when you have a host name. Constant Value Description SORT_BY_NONE 0 For bookmark items, this constant means sort by the natural bookmark order. SORT_BY_
TITLE_ASCENDING 1 Sort by the ascending
title order. SORT_BY_
TITLE_DESCENDING 2 Sort by the descending
title order. ...
nsINavHistoryService
s from: nsISupports Last changed in Gecko 22 (Firefox 22 / Thunderbird 22 / SeaMonkey 2.19) Implemented by: "@mozilla.org/browser/nav-history-service;1". ...
...was a permanent redirect. TRANSITION_REDIRECT_TEMPORARY 6 This transition type is set when the transition was a temporary redirect. TRANSITION_DOWNLOAD 7 This transition type is set when the transition is a download. TRANSITION_FRAMED_LINK 8 This transition type is set when the user followed a link that loaded a page in a frame. Methods getPage
Title() This method retrieves the original
title of the page. AString getPage
Title( in nsIURI aURI ); Parameters aURI The page whose
title needs to be retrieved. Return value Returns the original
title of the page. markPageAsFollowedBookmark() This method is just like markPageAsTyped (in nsIBrowserHistory, also implemented by the history service), but for bookmarks. It declares that the ...
...the new async API mozIAsyncHistory.updatePlaces() instead. See this code for how a function to add visits and handle errors using the new API could look like. This method adds a visit for a specific page. This will probably not be commonly used other than for backup/restore type operations. If the URI does not have an entry in the history database already, one will be created with no visits, no
title, hidden, not typed. Adding a visit will automatically increment the visit count for the visited page and will unhide it and/or mark it typed according to the transition type. long long addVisit( in nsIURI aURI, in PRTime aTime, in nsIURI aReferringURI, in long aTransitionType, in boolean aIsRedirect, in long long aSessionID ); Parameters aURI The visited page. aTime The time ...
Preferences System
ow: Preferences System documentation: Introduction: Getting Started | Examples | Troubleshooting Reference: prefwindow | prefpane | preferences | preference | XUL attributes Use Code for a typical preferences window may look like this: <prefwindow id="appPreferences" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <prefpane id="pane1" label="&pane1.
title;"> <preferences> <preference id="pref1" name="pref.name" type="bool"/> </preferences> .. UI elements that refer to the preferences above, e.g.: <checkbox id="check1" preference="pref1" label="&check1.label;" accesskey="&check1.accesskey;"/> </prefpane> <prefpane id="pane2" label="&pane2.
title;" src="chrome://uri/to/pane.xul"/> </prefwindow> Pane content c...
...You should also be careful to specify the width of the window (in em) as appropriate using the preprocessor for each targeted platform, as well as the height (in em) for platforms where the window size does not change as the selected panel is changed (e.g. Windows). ...
...rm, as well as the height (in em) for platforms where the window size does not change as the selected panel is changed (e.g. Windows). Usage in XULRunner applications When calling openDialog() to open a preferences dialog, "toolbar" should be included in the features string. ...
Web Console remoting - Firefox Developer Tools
tance of the WebConsoleClient object. This object provides methods that abstract away protocol packets, things like startListeners(), stopListeners(), etc. Protocol packets look as follows: { "to": "root", "type": "listTabs" } { "from": "root", "consoleActor": "conn0.console9", "selected": 2, "tabs": [ { "actor": "conn0.tab2", "consoleActor": "conn0.console7", "
title": "", "url": "https://tbpl.mozilla.org/?tree=Fx-Team" }, // ... ] } Notice that the consoleActor is also available as a global actor. When you attach to the global consoleActor you receive all of the network requests, page errors, and the other events from all of the tabs and windows, including chrome errors and network events. This actor is used for the Browser Console implementati...
...abNavigated", "state": "start", "url": newURL, "nativeConsoleAPI": true } The nativeConsoleAPI property tells if the window.console object is native or not for the top level window object for the given tab - this is always true when navigation starts. ...
...", "state": "start", "url": newURL, "nativeConsoleAPI": true } The nativeConsoleAPI property tells if the window.console object is native or not for the top level window object for the given tab - this is always true when navigation starts. ...
Basic animations - Web APIs
t match the values of the CanvasXZSize and CanvasYSize variables in the JavaScript code. ...
...es of the CanvasXZSize and CanvasYSize variables in the JavaScript code. ...
... background-color: rgba(0,0,0,0.05); } </style> </head> <body> <canvas id="cw"></canvas> </body> </html> OutPut Snake Game <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width,initial-scale=1"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <
title>Nokia 1100:snake..Member berries</
title> </head> <body> <div class="keypress hide"> <div class="up" onclick="emit(38)">↑</div> <div class="right" onclick="emit(39)">→</div> <div class="left" onclick="emit(37)">←</div> <div class="down" onclick="emit(40)">↓</div> </div> <div class="banner" id="selector"> <div> ...
Document.anchors - Web APIs
rty of the Document interface returns a list of all of the anchors in the document. Syntax nodeList = document.anchors; Value An HTMLCollection. ...
...ocument interface returns a list of all of the anchors in the document. Syntax nodeList = document.anchors; Value An HTMLCollection. ...
...ument.getElementById("toc"); var i, li, newAnchor; for (i = 0; i < document.anchors.length; i++) { li = document.createElement("li"); newAnchor = document.createElement('a'); newAnchor.href = "#" + document.anchors[i].name; newAnchor.innerHTML = document.anchors[i].text; li.appendChild(newAnchor); toc.appendChild(li); } } </script> </head> <body onload="init()"> <h1>
Title</h1> <h2><a name="contents">Contents</a></h2> <ul id="toc"></ul> <h2><a name="plants">Plants</a></h2> <ol> <li>Apples</li> <li>Oranges</li> <li>Pears</li> </ol> <h2><a name="veggies">Veggies</a></h2> <ol> <li>Carrots</li> <li>Celery</li> <li>Beats</li> </ol> </body> </html> View on JSFiddle Notes For reasons of backwards compatibility, the returned set of anchors only contains ...
Document.forms - Web APIs
e HTMLFormElement.elements property. Syntax collection = document.forms; Value An HTMLCollection object listing all of the document's forms. Each item in the collection is a HTMLFormElement representing a single <form> element. If the document has no forms, the returned collection is empty, with a length of zero. ...
...perty. Syntax collection = document.forms; Value An HTMLCollection object listing all of the document's forms. Each item in the collection is a HTMLFormElement representing a single <form> element. If the document has no forms, the returned collection is empty, with a length of zero. ...
...k="alert(document.forms[1].id);" value="dave's form" /> </form> <form id="paul"> <input type="button" onclick="alert(document.forms[2].id);" value="paul's form" /> </form> </body> </html> Getting an element from within a form var selectForm = document.forms[index]; var selectFormElement = document.forms[index].elements[index]; Named form access <!DOCTYPE html> <html lang="en"> <head> <
title>document.forms example</
title> </head> <body> <form name="login"> <input name="email" type="email"> <input name="password" type="password"> <button type="submit">Log in</button> </form> <script> var loginForm = document.forms.login; // Or document.forms['login'] loginForm.elements.email.placeholder = 'test@example.com'; loginForm.elements.password.placeholder = 'password'; </script...
HTMLTrackElement - Web APIs
The HTMLTrackElement interface represents an HTML <track> element within the DOM. This element can be used as a child of either <audio> or <video> to specify a text track containing information such as closed captions or sub
titles. <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveAspectRatio="xMinYMin meet"><a xlink:href="/docs/Web/API/EventTarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignm...
... Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">HTMLTrackElement</text></a></svg></div> a:hover text { fill: #0095DD; pointer-events: all;} Properties Inherits properties from its parent, HTMLElement. HTMLTrackElement.kind Is a DOMString that reflects the kind HTML attribute, indicating how the text track is meant to be used. Possible values are: sub
titles, captions, descriptions, chapters, or metadata. HTMLTrackElement.src Is a DOMString that reflects the src HTML attribute, indicating the address of the text track data. HTMLTrackElement.srclang Is a DOMString that reflects the srclang HTML attribute, indicating the language of the text track data. HTMLTrackElement.label Is a DOMString that reflects the label HTML attribute, indicating a us...
... descriptions, chapters, or metadata. HTMLTrackElement.src Is a DOMString that reflects the src HTML attribute, indicating the address of the text track data. HTMLTrackElement.srclang Is a DOMString that reflects the srclang HTML attribute, indicating the language of the text track data. HTMLTrackElement.label Is a DOMString that reflects the label HTML attribute, indicating a user-readable
title for the track. HTMLTrackElement.default A Boolean reflecting the default attribute, indicating that the track is to be enabled if the user's preferences do not indicate that another track would be more appropriate. HTMLTrackElement.readyState Read only Returns an unsigned short that show the readiness state of the track: Constant Value Description NONE ...
History.pushState() - Web APIs
Whenever the user navigates to the new state, a popstate event is fired, and the state property of the event contains a copy of the history entry's state object. The state object can be anything that can be serialized. ...
...o the user's disk so they can be restored after the user restarts the browser, we impose a size limit of 640k characters on the serialized representation of a state object. If you pass a state object whose serialized representation is larger than this to pushState(), the method will throw an exception. If you need more space than this, you're encouraged to use sessionStorage and/or localStorage.
title Most browsers currently ignore this parameter, although they may use it in the future. Passing the empty string here should be safe against future changes to the method. Alternatively, you could pass a short
title for the state to which you're moving. url Optional The new history entry's URL is given by this parameter. Note that the browser won't attempt to load this URL after a call to pushSt...
... entry if the current hash isn't #foo. You can associate arbitrary data with your new history entry. With the hash-based approach, you need to encode all of the relevant data into a short string. Note that pushState() never causes a hashchange event to be fired, even if the new URL differs from the old URL only in its hash. Examples This creates a new browser history state setting the state,
title, and url. JavaScript const state = { 'page_id': 1, 'user_id': 5 } const
title = '' const url = 'hello-world.html' history.pushState(state,
title, url) Specifications Specification Status Comment HTML Living StandardThe definition of 'History.pushState()' in that specification. Living Standard No change from HTML5. HTML5The definition of 'History.pushSta...
Working with the History API - Web APIs
contents manually upon receiving the popstate event. Note: Calling history.back() normally behaves the same way as clicking the Back button. But there is one important exception: After using history.pushState(), calling history.back() does not raise a popstate event. Clicking the browser's Back button (still) does. The pushState() method pushState() takes three parameters: a state object; a
title (currently ignored); and (optionally), a URL. Let's examine each of these three parameters in more detail. state object The state object is a JavaScript object which is associated with the new history entry created by pushState(). Whenever the user navigates to the new state, a popstate event is fired, and the state property of the event contains a copy of the history entry's state object. ...
...he user's disk so they can be restored after the user restarts the browser, we impose a size limit of 640k characters on the serialized representation of a state object. If you pass a state object whose serialized representation is larger than this to pushState(), the method will throw an exception. If you need more space than this, you're encouraged to use sessionStorage and/or localStorage.
title All browsers but Safari currently ignore this parameter, although they may use it in the future. Passing the empty string here should be safe against future changes to the method. Alternatively, you could pass a short
title for the state to which you're moving. URL The new history entry's URL is given by this parameter. Note that the browser won't attempt to load this URL after a call to pu...
...tion keeps you at the same document only if you modify only the hash. You don't have to change the URL if you don't want to. In contrast, setting window.location = "#foo"; creates a new history entry only if the current hash isn't #foo. You can associate arbitrary data with your new history entry. With the hash-based approach, you need to encode all of the relevant data into a short string. If
title is subsequently used by browsers, this data can be utilized (independent of, say, the hash). Note that pushState() never causes a hashchange event to be fired, even if the new URL differs from the old URL only in its hash. In a XUL document, it creates the specified XUL element. In other documents, it creates an element with a null namespace URI. The replaceState() method history.replaceSta...
History API - Web APIs
current page is loaded in). Examples The following example assigns a listener to the onpopstate property. And then illustrates some of the methods of the history object to add, replace, and move within the browser history for the current tab. ...
...ing example assigns a listener to the onpopstate property. And then illustrates some of the methods of the history object to add, replace, and move within the browser history for the current tab. ...
...rty. And then illustrates some of the methods of the history object to add, replace, and move within the browser history for the current tab. ...
MediaMetadata.MediaMetadata() - Web APIs
The MediaMetadata() constructor creates a new MediaMetadata object. Syntax var mediaMetadata = new MediaMetadata([metadata]) Parameters metadata Optional The metadata parameters are as follows:
title: The
title of the media to be played. artist: The name of the artist, group, creator, etc. of the media to be played. album: The name of the album, or collection, containing the media to be played. artwork: An array of images associated with the playing media. ...
...e artist, group, creator, etc. of the media to be played. album: The name of the album, or collection, containing the media to be played. artwork: An array of images associated with the playing media. ...
..., etc. of the media to be played. album: The name of the album, or collection, containing the media to be played. artwork: An array of images associated with the playing media. ...
MediaMetadata - Web APIs
MediaMetadata.artist Returns or sets the name of the artist, group, creator, etc. of the media to be played. MediaMetadata.album Returns or sets the name of the album or collection containing the media to be played. ...
... MediaMetadata.artist Returns or sets the name of the artist, group, creator, etc. of the media to be played. MediaMetadata.album Returns or sets the name of the album or collection containing the media to be played. ...
... WebView Android No support NoChrome Android Full support 57Firefox Android ? Opera Android No support NoSafari iOS ? Samsung Internet Android Full support 7.0
title ExperimentalChrome Full support 57Edge No support NoFirefox Full support 71IE No support NoOpera Full support YesSafari ? WebView Android ...
Navigator.share() - Web APIs
The navigator.share() method of the Web Share API invokes the native sharing mechanism of the device. Syntax var sharePromise = navigator.share(data); Parameters data An object containing data to share. At least one of the following fields must be specified. Available options are: url: A USVString representing a URL to be shared. text: A USVString representing text to be shared.
title: A USVString representing the
title to be shared. files: A " FrozenArray" representing the array of file to be shared. Return value A Promise that will be fulfilled once a user has completed a share action (usually the user has chosen an application to share to). It will reject immediately if the data parameter is not correctly specified, and will also reject if the user cancels sharing. ...
...eted a share action (usually the user has chosen an application to share to). It will reject immediately if the data parameter is not correctly specified, and will also reject if the user cancels sharing. Examples In our Web share test (see the source code) there is a button which, when clicked, invokes the Web Share API to share MDN's URL. ...
... in the call to navigator.share(): Notice: That the sample handles feature detection by testing for navigator.canShare() rather than for navigator.share(). The data object passed to canShare() only supports the files property. Image, video, audio, and text files can be shared. if (navigator.canShare && navigator.canShare({ files: filesArray })) { navigator.share({ files: filesArray,
title: 'Pictures', text: 'Our Pictures.', }) .then(() => console.log('Share was successful.')) .catch((error) => console.log('Sharing failed', error)); } else { console.log(`Your system doesn't support sharing files.`); } Specifications Specification Status Comment Web Share APIThe definition of 'share()' in that specification. Draft ...
Page Visibility API - Web APIs
ventListener or the Page Visibility API if (typeof document.addEventListener === "undefined" || hidden === undefined) { console.log("This demo requires a browser, such as Google Chrome or Firefox, that supports the Page Visibility API."); } else { // Handle page visibility change document.addEventListener(visibilityChange, handleVisibilityChange, false); // When the video pauses, set the
title. ...
...en === undefined) { console.log("This demo requires a browser, such as Google Chrome or Firefox, that supports the Page Visibility API."); } else { // Handle page visibility change document.addEventListener(visibilityChange, handleVisibilityChange, false); // When the video pauses, set the
title. // This shows the paused videoElement.addEventListener("pause", function(){ document.
title = 'Paused'; }, false); // When the video plays, set the
title. ...
...; } else { // Handle page visibility change document.addEventListener(visibilityChange, handleVisibilityChange, false); // When the video pauses, set the
title. // This shows the paused videoElement.addEventListener("pause", function(){ document.
title = 'Paused'; }, false); // When the video plays, set the
title. videoElement.addEventListener("play", function(){ document.
title = 'Playing'; }, false); } Properties added to the Document interface The Page Visibility API adds the following properties to the Document interface: Document.hidden Read only Returns true if the page is in a state considered to be hidden to the user, and false otherwise. Document.visibilityState Read only A DOMString indicating the document's current visibility state. Possible valu...
PopStateEvent - Web APIs
did until version 10.0. Syntax window.onpopstate = funcRef; funcRef is a handler function. ...
... = funcRef; funcRef is a handler function. ...
...pstate event As an example, a page at http://example.com/example.html running the following code will generate alerts as indicated: window.onpopstate = function(event) { alert("location: " + document.location + ", state: " + JSON.stringify(event.state)); }; history.pushState({page: 1}, "
title 1", "?page=1"); history.pushState({page: 2}, "
title 2", "?page=2"); history.replaceState({page: 3}, "
title 3", "?page=3"); history.back(); // alerts "location: http://example.com/example.html?page=1, state: {"page":1}" history.back(); // alerts "location: http://example.com/example.html, state: null history.go(2); // alerts "location: http://example.com/example.html?page=3, state: {"page":3} Note that even though the original history entry (for http://example.com/example.html) has no state object a...
PushEvent.data - Web APIs
myPushData = PushEvent.data; Value A PushMessageData object. Examples The following example takes data from a PushEvent and displays it on all of the service workers' clients. ...
... PushEvent.data; Value A PushMessageData object. Examples The following example takes data from a PushEvent and displays it on all of the service workers' clients. ...
... ...
PushEvent - Web APIs
. Methods Inherits methods from its parent, ExtendableEvent. Examples The following example takes data from a PushEvent and displays it on all of the service worker's clients. ...
...Inherits methods from its parent, ExtendableEvent. Examples The following example takes data from a PushEvent and displays it on all of the service worker's clients. ...
...ion(event) { if (!(self.Notification && self.Notification.permission === 'granted')) { return; } var data = {}; if (event.data) { data = event.data.json(); } var
title = data.
title || "Something Has Happened"; var message = data.message || "Here's something you might want to check out."; var icon = "images/new-notification.png"; var notification = new self.Notification(
title, { body: message, tag: 'simple-push-demo-notification', icon: icon }); notification.addEventListener('click', function() { if (clients.openWindow) { clients.openWindow('https://example.blog.com/2015/03/04/something-new.html'); } }); }); Specifications Specification Status Comment Push APIThe definition of 'PushEvent' in that specificatio...
Window: unload event - Web APIs
ll the resources still exist (img, iframe etc.) Nothing is visible anymore to the end user UI interactions are ineffective (window.open, alert, confirm, etc.) An error won't stop the unloading workflow Please note that the unload event also follows the document tree: parent frame unload will happen before child frame unload (see example below). ...
...ll exist (img, iframe etc.) Nothing is visible anymore to the end user UI interactions are ineffective (window.open, alert, confirm, etc.) An error won't stop the unloading workflow Please note that the unload event also follows the document tree: parent frame unload will happen before child frame unload (see example below). ...
... window.addEventListener('beforeunload', function(event) { console.log('I am the 1st one.'); }); window.addEventListener('unload', function(event) { console.log('I am the 3rd one.'); }); </script> </head> <body> <iframe src="child-frame.html"></iframe> </body> </html> Below, the content of child-frame.html: <!DOCTYPE html> <html> <head> <
title>Child Frame</
title> <script> window.addEventListener('beforeunload', function(event) { console.log('I am the 2nd one.'); }); window.addEventListener('unload', function(event) { console.log('I am the 4th and last one...'); }); </script> </head> <body> :) </body> </html> When the parent frame is unloaded, events will be fired in the order...
WindowEventHandlers.onpopstate - Web APIs
story entries for the same document. Syntax window.onpopstate = funcRef; funcRef is a handler function. ...
...w.onpopstate = funcRef; funcRef is a handler function. ...
...on. ...
XSLT Basic Example - Web APIs
Figure 1 shows the source of the basic XSLT example. The XML document (example.xml) contains the information about the article. Using the ?xml-stylesheet? processing instruction, it links to the XSLT stylesheet (example.xsl) via its href attribute. ...
...lesheet? processing instruction, it links to the XSLT stylesheet (example.xsl) via its href attribute. An XSLT stylesheet starts with the xsl:stylesheet element, which contains all the templates used to create the final output. The example in Figure 1 has two templates - one that matches the root node and one that matches Author nodes. The template that matches the root node outputs the article's
title and then says to process all templates (via apply-templates) that match Author nodes which are children of the Authors node. Figure 1 : Simple XSLT Example XML Document (example.xml) : <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="example.xsl"?> <Article> <
Title>My Article</
Title> <Authors> <Author>Mr. Foo</Author> <Author>Mr. Bar</Author> </Authors> <Body>This is...
...Foo - Mr. ...
ARIA: feed role - Accessibility
ze="-1" to indicate that the size of the feed is not known. Another feature of the feed pattern is skim reading: Articles within a feed can contain both an accessible name with the aria-label and a description with an aria-describedby, suggesting to screen readers which elements to speak after the label when navigating by article. By identifying the elements inside of an article that provide the
title and the primary content, assistive technologies can provide functions that enable users to jump from article to article and efficiently discern which articles they want to read. The feed pattern enables reliable assistive technology reading mode interaction by establishing the following interoperability agreement between the web page and assistive technologies: In the context of a feed, the w...
... the nested feed with the Tab key and to provide another key, such as Alt + Page Down, to navigate from an 'outer' article to the first item in that article's nested feed. Navigate between the nested feed and main feed with Control + End , moving focus from the inner feed to the next article in the outer feed. WAI-ARIA roles, states, and properties aria-labelled If the feed has no visible
title, the feed element has a label specified with aria-label. If it does, see aria-labelledby. aria-labelledby If the feed has a visible
title, the feed element has aria-labelledby referring to the element containing the
title. If not, add an aria-label. aria-busy When busy, such as when articles are being added or removed from the feed, set aria-busy="true" during the update operation. Make sure ...
... busy, such as when articles are being added or removed from the feed, set aria-busy="true" during the update operation. Make sure it's reset to false when the operation is complete or the changes may not become visible. article Each section of content in a feed should be contained in an <article> or element with role article. Each article should have an aria-labelledby referring to the article
title or other child that can serve as a distinguishing label. Each article should preferably have aria-describedby referring to one or more elements inside the article that serve as the primary content of the article. Each article element has aria-posinset set to a value that represents its position in the feed and an aria-setsize set to a value that represents either the total number of articles that...
Event reference
icccardlockerror iccinfochange smartcard-insert smartcard-remove stkcommand stksessionend cardstatechange SMS and USSD events delivered received sent ussdreceived Frame events mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserlocationchange mozbrowserloadend mozbrowserloadstart mozbrowseropenwindow mozbrowsersecuritychange mozbrowsershowmodalprompt mozbrowser
titlechange DOM mutation events DOMAttributeNameChanged DOMAttrModified DOMCharacterDataModified DOMContentLoaded DOMElementNameChanged DOMNodeInserted DOMNodeInsertedIntoDocument DOMNodeRemoved DOMNodeRemovedFromDocument DOMSubtreeModified Touch events touchcancel touchend touchmove touchstart Pointer events pointerover pointerenter pointerdown pointermove pointerup pointercancel pointerout poin...
...tatechanged Firefox OS Browser API-specific Sent when the text selected inside the browser <iframe> content changes. Note that this is deprecated, and newer implementations use mozbrowsercaretstatechanged instead. mozbrowsershowmodalprompt Firefox OS Browser API-specific Sent when alert(), confirm() or prompt() are called within a browser <iframe> mozbrowser
titlechange Firefox OS Browser API-specific Sent when the document.
title changes within a browser iframe. mozbrowserusernameandpasswordrequired Firefox OS Browser API-specific Sent when an HTTP authentication is requested. mozbrowservisibilitychange Firefox OS Browser API-specific Sent when the visibility state of the current browser iframe <iframe> chang...
...nt is swiped across the touch surface to invoke the Edge UI (Win8 only). MozAfterPaint Addons specific Content has been repainted. DOMPopupBlocked Addons specific A popup has been blocked. DOMWindowCreated Addons specific A window has been created. DOMWindowClose Addons specific A window is about to be closed. DOM
TitleChanged Addons specific The
title of a window has changed. DOMLinkAdded Addons specific A link has been added a document. DOMLinkRemoved Addons specific A link has been removed inside from a document. DOMMetaAdded Addons specific A meta element has been added to a document. DOMMetaRemoved Addons specific A meta e...
XHTML - Developer guides
XHTML is a term that was historically used to describe HTML documents written to conform with XML syntax rules. The following example shows an HTML document and corresponding "XHTML" document, and the accompanying HTTP Content-Type headers they should be served with. ...
... XHTML is a term that was historically used to describe HTML documents written to conform with XML syntax rules. The following example shows an HTML document and corresponding "XHTML" document, and the accompanying HTTP Content-Type headers they should be served with. ...
...eaders they should be served with. HTML document Content-Type: text/html <!DOCTYPE html> <html lang=en> <head> <meta charset=utf-8> <
title>HTML</
title> </head> <body> <p>I am a HTML document</p> </body> </html> XHTML document Content-Type: application/xhtml+xml <?xml version="1.0" encoding="UTF-8"?> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <
title>XHTML</
title> </head> <body> <p>I am a XHTML document</p> </body> </html> In practice, very few "XHTML" documents are served over the web with a Content-Type: application/xhtml+xml header. Instead, even though the documents are written to conform to XML syntax rules, they are served with a Content-Type: text/html header -- so browsers parse those documents using HTML parsers rather th...
<audio>: The Embed Audio element - HTML: Hypertext Markup Language
nt, HTMLMediaElements fire many different events. This also provides a way to monitor the audio's fetching process so you can watch for errors or detect when enough is available to begin to play or manipulate it. You can also use the Web Audio API to directly generate and manipulate audio streams from JavaScript code rather than streaming pre-existing audio files. <audio> elements can't have sub
titles or captions associated with them in the same way that <video> elements can. See WebVTT and Audio by Ian Devlin for some useful information and workarounds. A good general source of information on using HTML <audio> is the Video and audio content beginner's tutorial. Styling with CSS The <audio> element has no intrinsic visual output of its own unless the controls attribute is specified, in w...
... important to review the generated content to ensure it accurately represents the source audio. The <audio> element doesn't directly support WebVTT. You will have to find a library or framework that provides the capability for you, or write the code to display captions yourself. One option is to play your audio using a <video> element, which does support WebVTT. In addition to spoken dialog, sub
titles and transcripts should also identify music and sound effects that communicate important information. This includes emotion and tone. For example, in the WebVTT below, note the use of square brackets to provide tone and emotional insight to the viewer; this can help establish the mood otherwise provided using music, nonverbal sounds and crucial sound effects, and so forth. 1 00:00:00 --> 00:00:4...
...direct download link) as a fallback for viewers who use a browser in which the <audio> element is not supported: <audio controls> <source src="myAudio.mp3" type="audio/mpeg"> <source src="myAudio.ogg" type="audio/ogg"> <p> Your browser doesn't support HTML5 audio. Here is a <a href="myAudio.mp4">link to download the audio</a> instead. ...
<iframe>: The Inline Frame element - HTML: Hypertext Markup Language
Cross-origin communication can be achieved using Window.postMessage(). Positioning and scaling As a replaced element, the position, alignment, and scaling of the embedded document within the <iframe> element's box, can be adjusted with the object-position and object-fit properties. Examples A simple <iframe> An <iframe> in action. ...
...ment, and scaling of the embedded document within the <iframe> element's box, can be adjusted with the object-position and object-fit properties. Examples A simple <iframe> An <iframe> in action. After creating the frame, when the user clicks a button, its
title is displayed in an alert. ...
...n <iframe> in action. After creating the frame, when the user clicks a button, its
title is displayed in an alert. HTML <iframe src="https://mdn-samples.mozilla.org/snippets/html/iframe-simple-contents.html"
title="iframe Example 1" width="400" height="300"> </iframe> Result Accessibility concerns People navigating with assistive technology such as a screen reader can use the
title attribute on an <iframe> to label its content. The
title's value should concisely describe the embedded content: <iframe
title="Wikipedia page for Avocados" src="https://en.wikipedia.org/wiki/Avocado"></iframe> Without this
title, they have to navigate into the <iframe> to determine what its embedded content is. This context shift can be confusing and time-consuming, especially for pages with...
<link>: The External Resource Link element - HTML: Hypertext Markup Language
els>X<height in pixels>. Each of these sizes must be contained in the resource. Note: Most icon formats are only able to store one single icon; therefore most of the time the sizes attribute contains only one entry. MS's ICO format does, as well as Apple's ICNS. ICO is more ubiquitous, so you should use this format if cross-browser support is a concern (especially for old IE versions).
title The
title attribute has special semantics on the <link> element. When used on a <link rel="stylesheet"> it defines a preferred or an alternate stylesheet. Incorrectly using it may cause the stylesheet to be ignored. type This attribute is used to define the type of the content linked to. The value of the attribute should be a MIME type such as text/html, text/css, and so on. The common use of ...
...ow recommended practice. It is also used on rel="preload" link types, to make sure the browser only downloads file types that it supports. Non-standard attributes methods The value of this attribute provides information about the functions that might be performed on an object. The values generally are given by the HTTP protocol when it is used, but it might (for similar reasons as for the
title attribute) be useful to include advisory information in advance in the link. For example, the browser might choose a different rendering of a link as a function of the methods specified; something that is searchable might get a different icon, or an outside link might render with an indication of leaving the current site. This attribute is not well understood nor supported, even by the defining b...
...ylesheet To include a stylesheet in a page, use the following syntax: <link href="style.css" rel="stylesheet"> Providing alternative stylesheets You can also specify alternative style sheets. The user can choose which style sheet to use by choosing it from the View > Page Style menu. This provides a way for users to see multiple versions of a page. <link href="default.css" rel="stylesheet"
title="Default Style"> <link href="fancy.css" rel="alternate stylesheet"
title="Fancy"> <link href="basic.css" rel="alternate stylesheet"
title="Basic"> Providing icons for different usage contexts You can include links to several different icons on the same page, and the browser will choose which one works best for its particular context using the rel and sizes values as hints. <!-- third-generati...
<u>: The Unarticulated Annotation (Underline) element - HTML: Hypertext Markup Language
ts default styling (of underlined text) in such a way as to be confused with a hyperlink, which is also underlined by default. Use cases Valid use cases for the <u> element include annotating spelling errors, applying a proper name mark to denote proper names in Chinese text, and other forms of annotation. ...
...s of annotation. You should not use <u> to simply underline text for presentation purposes, or to denote
titles of books. Other elements to consider using In most cases, you should use an element other than <u>, such as: <em> to denote stress emphasis <b> to draw attention to text <mark> to mark key words or phrases <strong> to indicate that text has strong importance <cite> to mark the
titles of books or other publications <i> to denote technical terms, transliterations, thoughts, or names of vessels in Western texts To provide textual annotations (as opposed to the non-textual annotations created with <u>), use the <ruby> element. To apply an underlined appearance without any semantic meaning, use the text-decoration property's value underline. Examples Indicating a spelling e...
...hat show what you should do instead in several cases. Non-semantic underlines To underline text without implying any semantic meaning, use a <span> element with the text-decoration property set to "underline", as shown below. HTML <span class="underline">Today's Special</span> <br> Chicken Noodle Soup With Carrots CSS .underline { text-decoration: underline; } Result Presenting a book
title Book
titles should be presented using the <cite> element instead of <u> or even <i>. HTML <p>The class read <cite>Moby Dick</cite> in the first term.</p> Result with default style Note that the default styling for the <cite> element renders the text in italics. You can, if you wish, override that using CSS: cite { font-style: normal; text-decoration: underline; } Result with custom...
Microformats - HTML: Hypertext Markup Language
organization h-entry describes episodic or date stamped online content like a blog post h-feed describes a stream or feed of posts You can find many more vocabularies on the microformats2 wiki. "p-*" for plain (text) properties, e.g. "p-name", "p-summary" Generic plain text parsing, element text in general. On certain HTML elements, use special attributes first, e.g. img/alt, abbr/
title. "u-*" for URL properties, e.g. "u-url", "u-photo", "u-logo" Special parsing: element attributes a/href, img/src, object/data etc. attributes over element contents. "dt-*" for datetime properties, e.g. "dt-start", "dt-end", "dt-bday" Special parsing: time element datetime attribute, value-class-pattern and separate date time value parsing for readability. "e-*" for element ...
... class="p-author h-card" href="http://example.com">W. ...
... <p>From <time class="dt-start" datetime="2013-06-30 12:00">30<sup>th</sup> June 2013, 12:00</time> to <time class="dt-end" datetime="2013-06-30 18:00">18:00</time> at <span class="p-location">Some bar in SF</span></p> <p class="p-summary">Get together and discuss all things microformats-related.</p> </div> Properties Property Description p-name event name (or
title) p-summary short summary of the event dt-start datetime the event starts dt-end datetime the event ends p-location where the event takes place, optionally embedded h-card Parsed h-event Example <div class="h-event"> <h2 class="p-name">IndieWeb Summit</h2> <time class="dt-start" datetime="2019-06-29T09:00:00-07:00">June 29, 2019 at 9:00a...
HTML: Hypertext Markup Language
ne another, either within a single website or between websites. Links are a fundamental aspect of the Web. By uploading content to the Internet and linking it to pages created by other people, you become an active participant in the World Wide Web. HTML uses "markup" to annotate text, images, and other content for display in a Web browser. HTML markup includes special "elements" such as <head>, <
title>, <body>, <header>, <footer>, <article>, <section>, <p>, <div>, <span>, <img>, <aside>, <audio>, <canvas>, <datalist>, <details>, <embed>, <nav>, <output>, <progress>, <video>, <ul>, <ol>, <li> and many others. An HTML element is set off from other text in a document by "tags", which consist of the element name surrounded by "<" and ">". The name of an element inside a tag is case insensitive. ...
...de>, <audio>, <canvas>, <datalist>, <details>, <embed>, <nav>, <output>, <progress>, <video>, <ul>, <ol>, <li> and many others. An HTML element is set off from other text in a document by "tags", which consist of the element name surrounded by "<" and ">". The name of an element inside a tag is case insensitive. That is, it can be written in uppercase, lowercase, or a mixture. For example, the <
title> tag can be written as <
Title>, <
TITLE>, or in any other way. The articles below can help you learn more about HTML. HTML Introduction If you're new to Web development, be sure to read our HTML Basics article to learn what HTML is and how to use it. HTML Tutorials For articles about how to use HTML, as well as tutorials and complete examples, check out our HTML Learning Area. HTML...
... much of the functionality you need for interacting with websites, e.g. registering and logging in, sending feedback, buying products, and more. This module gets you started with creating the client-side/front-end parts of forms. Use HTML to solve common problems Provides links to sections of content explaining how to use HTML to solve very common problems when creating a web page: dealing with
titles, adding images or videos, emphasizing content, creating a basic form, etc. Advanced topics CORS enabled image The crossorigin attribute, in combination with an appropriate CORS header, allows images defined by the <img> element to be loaded from foreign origins and used in a <canvas> element as if they were being loaded from the current origin. CORS settings attributes Some HTML elements...
451 Unavailable For Legal Reasons - HTTP
the entity ultimately responsible for the resource being unavailable belongs in the response body, not in the rel="blocked-by" link. This includes the name of the person or organization that made a legal demand resulting in the content's removal. ...
... the resource being unavailable belongs in the response body, not in the rel="blocked-by" link. This includes the name of the person or organization that made a legal demand resulting in the content's removal. ...
...tle></head> <body> <h1>Unavailable For Legal Reasons</h1> <p>This request may not be serviced in the Roman Province of Judea due to the Lex Julia Majestatis, which disallows access to resources hosted on servers deemed to be operated by the People's Front of Judea.</p> </body> </html> Specifications Specification
Title RFC 7725: 451 Unavailable For Legal Reasons An HTTP Status Code to Report Legal Obstacles ...
Authoring MathML - MathML
ar you can use usual Web features like CSS, DOM, Javascript or SVG. This is out of the scope of this document but anyone with basic knowledge of Web languages will easily be able to mix these features with MathML. Check out our demos and MathML references for more details. Using MathML MathML in HTML pages You can use Presentation MathML inside HTML5 documents: <!DOCTYPE html> <html> <head> <
title>MathML in HTML5</
title> </head> <body> <h1>MathML in HTML5</h1> <p> Square root of two: <math> <msqrt> <mn>2</mn> </msqrt> </math> </p> </body> </html> Content MathML is not supported by browsers. It's recommended to convert your Content MathML markup into Presentation MathML before publishing it, for example with the help of the ctop.xsl stylesheet. To...
...document, use of correct MIME type, MathML namespace "http://www.w3.org/1998/Math/MathML" on <math> roots. For example, the XHTML version of the previous example looks like this: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <
title>XHTML+MathML Example</
title> </head> <body> <h1>XHTML+MathML Example</h1> <p> Square root of two: <math xmlns="http://www.w3.org/1998/Math/MathML"> <msqrt> <mn>2</mn> </msqrt> </math> </p> </body> </html> MathML in email and instant messaging clients Modern mail clients may send and receive emails in the HTML5 format and thus can use MathML expressions. B...
...header of your document and the LaTeX content of your Web page marked by the "LaTeX" class will be automatically parsed and converted to HTML+MathML: <head> ... <script type="text/javascript" src="LaTeXMathML.js"></script> <link rel="stylesheet" type="text/css" href="LaTeXMathML.standardarticle.css" /> ... </head> <body> ... <div class="LaTeX"> \documentclass[12pt]{article} \begin{document} \
title{LaTeXML Example} \make
title \begin{abstract} This is a sample LaTeXML document. \end{abstract} \section{First Section} $$ \sum_{n=1}^{+\infty} \frac{1}{n^2} = \frac{\pi^2}{6} $$ \end{document} </div> ... jqMath is another script to parse a simple LaTeX-like syntax but which also accepts non-ASCII characters like ?{??{n=1}?{+?} 6/n^2} = ? to write ? n = 1 + ? 6 n 2 = ? . ...
<math> - MathML
value is inline. mode Deprecated in favor of the display attribute. Possible values are: display (which has the same effect as display="block") and inline. overflow Specifies how an expression behaves if it is too long to fit in the allowed width. Possible values are: linebreak (default), scroll, elide, truncate, scale. ...
...de Deprecated in favor of the display attribute. Possible values are: display (which has the same effect as display="block") and inline. overflow Specifies how an expression behaves if it is too long to fit in the allowed width. Possible values are: linebreak (default), scroll, elide, truncate, scale. ...
... <mn>2</mn> </msup> </mrow> <mo>=</mo> <msup> <mi>c</mi> <mn>2</mn> </msup> </mrow> </math> </body> </html> XHTML notation <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <
title>MathML in XHTML</
title> </head> <body> <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> <mrow> <msup> <mi>a</mi> <mn>2</mn> </msup> <mo>+</mo> <msup> <mi>b</mi> <mn>2</mn> </msup> </mrow> <mo>=</mo> <msup> <mi>c</mi> <mn>2</mn> </msup> </mrow> </math> ...
How to make PWAs re-engageable using Notifications and Push - Progressive web apps (PWAs)
on is chosen when the user won't make a choice, and the other two are set when the user clicks yes or no respectively. When accepted, the permission works for both notifications and push. ...
...push. ...
... the image as an icon: function randomNotification() { var randomItem = Math.floor(Math.random()*games.length); var notif
Title = games[randomItem].name; var notifBody = 'Created by '+games[randomItem].author+'.'; var notifImg = 'data/img/'+games[randomItem].slug+'.jpg'; var options = { body: notifBody, icon: notifImg } var notif = new Notification(notif
Title, options); setTimeout(randomNotification, 30000); } A new random notification is created every 30 seconds until it becomes too annoying and is disabled by the user. (For a real app, the notifications should be much less frequent, and more useful.) The advantage of the Notifications API is that it uses the operating system's notification functionality. This means that notifications can be dis...
SVG element reference - SVG: Scalable Vector Graphics
nce> <filter> <foreignObject> G <g> H <hatch> <hatchpath> I <image> L <line> <linearGradient> M <marker> <mask> <mesh> <meshgradient> <meshpatch> <meshrow> <metadata> <mpath> P <path> <pattern> <polygon> <polyline> R <radialGradient> <rect> S <script> <set> <solidcolor> <stop> <style> <svg> <switch> <symbol> T <text> <textPath> <
title> <tspan> U <unknown> <use> V <view> SVG elements by category Animation elements <animate>, <animateColor>, <animateMotion>, <animateTransform>, <discard>, <mpath>, <set> Basic shapes <circle>, <ellipse>, <line>, <polygon>, <polyline>, <rect> Container elements <a>, <defs>, <g>, <marker>, <mask>, <missing-glyph>, <pattern>, <svg>, <switch>, <symbol>, <unknown> Descriptive ele...
... <use> V <view> SVG elements by category Animation elements <animate>, <animateColor>, <animateMotion>, <animateTransform>, <discard>, <mpath>, <set> Basic shapes <circle>, <ellipse>, <line>, <polygon>, <polyline>, <rect> Container elements <a>, <defs>, <g>, <marker>, <mask>, <missing-glyph>, <pattern>, <svg>, <switch>, <symbol>, <unknown> Descriptive elements <desc>, <metadata>, <
title> Filter primitive elements <feBlend>, <feColorMatrix>, <feComponentTransfer>, <feComposite>, <feConvolveMatrix>, <feDiffuseLighting>, <feDisplacementMap>, <feDropShadow>, <feFlood>,<feFuncA>, <feFuncB>, <feFuncG>, <feFuncR>,<feGaussianBlur>, <feImage>, <feMerge>, <feMergeNode>, <feMorphology>, <feOffset>, <feSpecularLighting>, <feTile>, <feTurbulence> Font elements <font>, <font-face>, <font-...
...nts <circle>, <ellipse>, <image>, <line>, <mesh>, <path>, <polygon>, <polyline>, <rect>, <text>, <use> Graphics referencing elements <mesh>, <use> Light source elements <feDistantLight>, <fePointLight>, <feSpotLight> Never-rendered elements <clipPath>, <defs>, <hatch>, <linearGradient>, <marker>, <mask>, <meshgradient>, <metadata>, <pattern>, <radialGradient>, <script>, <style>, <symbol>, <
title> Paint server elements <hatch>, <linearGradient>, <meshgradient>, <pattern>, <radialGradient>, <solidcolor> Renderable elements <a>, <circle>, <ellipse>, <foreignObject>, <g>, <image>, <line>, <mesh>, <path>, <polygon>, <polyline>, <rect>, <svg>, <switch>, <symbol>, <text>, <textPath>, <tspan>, <unknown>, <use> Shape elements <circle>, <ellipse>, <line>, <mesh>, <path>, <polygon>, <polyline...
Basic Example - XSLT: Extensible Stylesheet Language Transformations
Basic Example The basic example will load an XML file and apply a XSL transformation on it. These are the same files used in the Generating HTML example in the XSLT in Netscape Gecko article. The XML file describes an article and the XSL file formats the information for display. Figure 4 : XML file <?xml version="1.0"?> <myNS:Article xmlns:myNS="http://devedge.netscape.com/2002/de"> <myNS:
Title>My Article</myNS:
Title> <myNS:Authors> <myNS:Author company="Foopy Corp.">Mr. Foo</myNS:Author> <myNS:Author>Mr. Bar</myNS:Author> </myNS:Authors> <myNS:Body> The <b>rain</b> in <u>Spain</u> stays mainly in the plains. </myNS:Body> </myNS:Article> Figure 5 : XSLT Stylesheet <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1...
...b>rain</b> in <u>Spain</u> stays mainly in the plains. ...
.../myNS:Body> </myNS:Article> Figure 5 : XSLT Stylesheet <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:myNS="http://devedge.netscape.com/2002/de"> <xsl:output method="html" /> <xsl:template match="/"> <html> <head> <
title> <xsl:value-of select="/myNS:Article/myNS:
Title"/> </
title> <style type="text/css"> .myBox {margin:10px 155px 0 50px; border: 1px dotted #639ACE; padding:0 5px 0 5px;} </style> </head> <body> <p class="myBox"> <span class="
title"> <xsl:value-of select="/myNS:Article/myNS:
Title"/> </span> <br /> Authors: <br /> <xsl:apply-templates ...
Navigator.mozNotification - Archive of obsolete content
es support for creating notification objects, which are used to display desktop notification alerts to the user. Currently, these are only supported on Firefox Mobile and Firefox OS. See Displaying notifications for an example. The support for this property as been dropped in favor of the standard Notification constructor. Method overview notification createNotification(in DOMString
title, in DOMString description, in DOMString iconURL Optional); Methods createNotification() Creates and returns a notification object that can be used to display the specified message with an optional URL. notification createNotification( in DOMString
title, in DOMString description, in DOMString iconURLOptional ); Parameters
title The notification
title. description The text ...
...display in the notification. Return value A new notification object. Permissions When using notifications in an open web app, be sure to add the desktop-notification permission in your manifest file: "permissions": { "desktop-notification": {} } Usage notes In Firefox 22+, the instantiation of a new notification should be done with the Notification object by calling new Notification(
title, options). Nick Desaulniers has written a Notification shim to cover both newer and older implementations. ...
XUL Migration Guide - Archive of obsolete content
t(null, "My Add-on", "Hello from XPCOM"); } }); It's good practice to encapsulate code which uses XPCOM by packaging it in its own module. For example, we could package the alert feature implemented above using a script like: var {Cc, Ci} = require("chrome"); var promptSvc = Cc["@mozilla.org/embedcomp/prompt-service;1"]. ...
... } }); It's good practice to encapsulate code which uses XPCOM by packaging it in its own module. For example, we could package the alert feature implemented above using a script like: var {Cc, Ci} = require("chrome"); var promptSvc = Cc["@mozilla.org/embedcomp/prompt-service;1"]. ...
indexed-db - Archive of obsolete content
database created will be unique and private per add-on, and is not linked to any website database. The module cannot be used to interact with a given website database. See bug 778197 and bug 786688. Example This example uses the action button API, which is only available from Firefox 29 onwards. Here's a complete add-on that adds two buttons to the browser: the button labeled "Add" adds the
title of the current tab to a database, while the button labeled "List" lists all the
titles in the database. The add-on implements helper functions open(), addItem() and getItems() to open the database, add a new item to the database, and get all items in the database. var { indexedDB, IDBKeyRange } = require('sdk/indexed-db'); var database = {}; database.onerror = function(e) { console.error(e.
... Globals Properties indexedDB Enables you to create, open, and delete databases. See the IDB...
notifications - Archive of obsolete content
Display transient, toaster-style desktop messages to the user. Usage This API supports desktop notifications on Windows, OS X using Growl (and Notification Center as of OS X 10.9 Mavericks), and Linux using libnotify. Here's a typical example. When the message is clicked, a string is logged to the console. var notifications = require("sdk/notifications"); notifications.notify({
title: "Jabberwocky", text: "'Twas brillig, and the slithy toves", data: "did gyre and gimble in the wabe", onClick: function (data) { console.log(data); // console.log(this.data) would produce the same result. } }); This one displays an icon that's stored in the add-on's data directory. See the self module documentation for more information. var notifications = require("sdk/notifications"); va...
...ts notifications service is not running: if Firefox was started normally, notifications are logged to Firefox's error console if the user launched Firefox from the command line, notifications are logged to the terminal. Globals Functions notify(options) Displays a transient notification to the user. Parameters options : object Optional options: Name Type
title string A string to display as the message's
title. text string A string to display as the body of the message. iconURL string The URL of an icon to display inside the message. It may be a remote URL, a data URI, or a URL returned by the self module. onClick function A function to be called when the user clicks the ...
ui - Archive of obsolete content
You initialize a sidebar with a URL pointing to an HTML document supplied under your add-on's "data" directory. This document can refer to bundled CSS and JavaScript files, and your main add-on ...
...u a vertical strip of space for presenting complex user interfaces. ...
frame/hidden-frame - Archive of obsolete content
ttent display, such as panel. Usage The module exports a constructor function, HiddenFrame, and two other functions, add and remove. HiddenFrame constructs a new hidden frame. add registers a hidden frame, preparing it to load content. remove unregisters a frame, unloading any content that was loaded in it. ...
... Globals Constructors HiddenFrame(options) Creates a hidden frame. ...
Creating annotations - Archive of obsolete content
tent script to execute in the panel's context. So create a subdirectory under data called editor. This will contain two files: the HTML content, and the content script. ...
...cute in the panel's context. So create a subdirectory under data called editor. This will contain two files: the HTML content, and the content script. Annotation editor HTML The HTML is very simple: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <
title>Annotation</
title> <style type="text/css" media="all"> body { font: 100% arial, helvetica, sans-serif; background-color: #F5F5F5; } textarea { width: 180px; height: 180px; margin: 10px; padding: 0px; } </style> </head> <body> <textarea rows='10' cols='20' id='annotation-box'> </textarea> </body> </html> Save this inside data/editor as annotation-editor.html. Annotation ed...
Downloading Files - Archive of obsolete content
nloading comes from. If, and only if, the URL is not // related to a window, null should be used instead. ...
...mWindow(urlSourceWindow); var hardCodedUserName = "ericjung"; var hardCodedPassword = "foobar"; persist.progressListener = { QueryInterface: XPCOMUtils.generateQI(["nsIAuthPrompt"]), // implements nsIAuthPrompt prompt: function(dialog
Title, text, passwordRealm, savePassword, defaultText, result) { result.value = hardCodedPassword; return true; }, promptPassword: function(dialog
Title, text, passwordRealm, savePassword, pwd) { pwd.value = hardCodedPassword; return true; }, promptUsernameAndPassword: function(dialog
Title, text, passwordRealm, savePassword, user, pwd) { user.value = hardCodedUserName; pwd.value = hardCodedPassword; return true; } }; persist.saveURI(urlToSave, null, null, null, "", nsFileInstance, privacy); The above is going to give ...
Windows - Archive of obsolete content
Re-using and focusing named windows While specifying the name parameter to window.open or window.openDialog will prevent multiple windows of that name from opening, each call will actually re-initialize the window and thus lose whatever state the user has put it in.
... Re-using and focusing named windows While specifying the name parameter to window.open or window.openDialog will prevent multiple windows of that name from opening, each call will actually re-initialize the window and thus lose whatever state the user has put it in. Additionally, if the window is in the background, it may not...
Displaying web content in an extension without security issues - Archive of obsolete content
code, and there are many more possibilities. So properly sanitizing input is still required when using innerHTML and it is far from trivial. It is much easier to use DOM manipulation methods that won't have unexpected side-effects. ...
...have this code: <style type="text/css"> #entryTemplate { display: none; } </style> <div id="entryTemplate"> <div class="
title"></div> <div class="description"></div> </div> Now to insert a new entry in the document you would do the following: var template = doc.getElementById("entryTemplate"); var entry = template.cloneNode(true); entry.removeAttribute("id"); entry.getElementsByClassName("
title")[0].textContent =
title; entry.getElementsByClassName("description")[0].textContent = description; template.parentNode.appendChild(entry); The important difference here is that the result will always have the same structure as the template tag. cloneNode() always creates a copy and textContent only manipulates text. So there is no chance of accidentally adding new elements or attributes. But wh...
How to convert an overlay extension to restartless - Archive of obsolete content
Also make sure to only unload your own JSM files to avoid accidentally breaking things horribly. For tearing down and cleaning up on a per-window basis, there is another route you can take. Instead of directly calling your tear down funct...
...Also make sure to only unload your own JSM files to avoid accidentally breaking things horribly. For tearing down and cleaning up on a per-window basis, there is another route you can take. Instead of directly calling your tear down function, make your unloadFromWindow() so...
User Notifications and Alerts - Archive of obsolete content
he user clicking on the alert. Another advantage is that you use an XPCOM service to do this (nsIAlertsService), so you can easily trigger alerts from chrome and non-chrome code. On the other hand, alerts are displayed only temporarily Using the Alerts Service is similar to using notification boxes: let alertsService = Cc["@mozilla.org/alerts-service;1"].getService(Ci.nsIAlertsService); let
title = this._bundle.getString("xulschoolhello.greeting.
title"); let message = this._bundle.getString("xulschoolhello.greeting.label"); alertsService.showAlertNotification( "chrome://xulschoolhello/skin/hello-notification.png",
title, message, true, "", this, "XULSchool Hello Message"); We pass this as an argument, assuming that this is an object that implements nsIObserver. We do this when we ...
...doesn't work. You'll end up with a box with a white background you can't get rid of . On Firefox 3 and above, this seems to have been corrected, using the panel element. The bottom right corner of the browser is the recommended location for an alert, because it normally doesn't block the part of the content where the user is reading, or the most important parts of page content, such as menus and
titles. Remember this is not a recommended practice. Imagine having multiple extensions notifying you in their own custom way, probably even at the same time! This is not good from a UI perspective, so you consider custom alerts the very last resort. << PreviousNext >> This tutorial was kindly donated to Mozilla by Appcoast. ...
Adding preferences to an extension - Archive of obsolete content
tener("load", function(e) { StockWatcher.startup(); }, false); window.addEventListener("unload", function(e) { StockWatcher.shutdown(); }, false); Design the preference dialog Now that we've written all the code, we need to build the XUL file for the options dialog. ...
...hod: Inline Options Requires Gecko 7(Firefox 7 / Thunderbird 7 / SeaMonkey 2.4) You could use Inline Options for this preference. You must set em:optionsType to 2 in your install.rdf. Your options.xul file would look like this: <?xml version="1.0" ?> <vbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <setting pref="extensions.stockwatcher2.symbol" type="string"
title="Stock to watch" /> </vbox> Adding the context menu Adding the contextual menu is easy; all the work that needs doing is done in the stockwatcher2.xul file. The first step is to add the context attribute to the status bar panel: <statusbar id="status-bar"> <statusbarpanel id="stockwatcher2" label="Loading..." context="stockmenu" onclick="StockWatcher.refreshInformation()" ...
DOMSubtreeModified - Archive of obsolete content
Example The following code will display the time of last DOM Change on the
title bar of the page. This event has been deprecated in favor of the Mutation Observer API This event can cause infinite loops if you decide to change the DOM inside the event handler, hence it has been disabled in a number of browsers (see DOMAttrModified and DOMSubtreeModified events are no longer fired when style attribute is changed via CSSOM for example). ...
...ation Observer API This event can cause infinite loops if you decide to change the DOM inside the event handler, hence it has been disabled in a number of browsers (see DOMAttrModified and DOMSubtreeModified events are no longer fired when style attribute is changed via CSSOM for example). document.body.addEventListener('DOMSubtreeModified', function () { document.
title = 'DOM Changed at ' + new Date(); }, false); ...
Index of archived content - Archive of obsolete content
Beginner tutorials Creating reusable content with CSS and XBL Underscores in class and ID Names XML data XUL user interfaces Case Sensitivity in class and id Names Creating a dynamic status bar extension Creating a status bar extension Element
title Gecko Compatibility Handbook Getting the page URL in NPAPI plugin Index Index of archived content Inner-browsing extending the browser navigation paradigm Install.js JXON List of Former Mozilla-Based Applications List of Mozilla-Based Applications Localizing an extension MMgc Makefil...
... Using Web Standards in your Web Pages Developing cross-browser and cross-platform pages References Summary of Changes Using the W3C DOM Using workers in extensions Web Standards Choosing Standards Compliance Over Proprietary Practices Community Correctly Using
Titles With External Stylesheets Describing microformats in JavaScript Displaying a graphic with audio samples Fixing Incorrectly Sized List Item Markers Fixing Table Inheritance in Quirks Mode Issues Arising From Arbitrary-Element hover Mozilla's DOCTYPE sniffing Parsing microformats in JavaScript Popup Window Controls ...
JXON - Archive of obsolete content
r> </table> <p> <input type="submit" value="Purchase!" /> </p> </form> </div> Other examples Example #1: How to use JXON to create an HTML document instead of an XML document: /* The structure of my document */ var oMyHTMLStruct = { "html": { "head": { "meta": { "@http-equiv": "Content-Type", "@content": "text/html; charset=UTF-8" }, "
title": "My HTML Document", "script": { "@type": "text/javascript", "keyValue": "alert(\"Welcome!\");" }, "style": "p:first-letter {\n font: italic bold 30px Georgia, serif;\n}" }, "body": { "h1": "My HTML Document", "p": "Hello world!!" } } }; /* Create the document */ var oMyHTMLDoc = JXON.unbuild(oMyHTMLStruct, "http://www.w3.org/1999/xht...
... Georgia, serif;\n}" }, "body": { "h1": "My HTML Document", "p": "Hello world!!" } } }; /* Create the document */ var oMyHTMLDoc = JXON.unbuild(oMyHTMLStruct, "http://www.w3.org/1999/xhtml"); ...And here is the output of alert((new XMLSerializer()).serializeToString(oMyHTMLDoc)): <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <
title>My HTML Document</
title> <script type="text/javascript"> alert("Welcome!"); </script> <style> p:first-letter { font: italic bold 30px Georgia, serif; } </style> </head> <body> <h1>My HTML Document</h1> <p>Hello world!!</p> </body> </html> Note: As we already said in the note within Code considerations, despite the bidirectional conversion between XML and JSON is l...
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
ref("MCD.logging.console", "All"); pref("MCD.logging.dump", "All"); Components.utils.import("resource:///modules/gloda/log4moz.js"); var log = Log4Moz.getConfiguredLogger("MCD"); // Enable alerts. var alerts = Components.classes["@mozilla.org/alerts-service;1"] .getService(Components.interfaces.nsIAlertsService); // displayError() is broken. Let's override it. function displayError(
title, msg) { log.debug(
title + ": " + msg); alerts.showAlertNotification("chrome://branding/content/icon48.png",
title, msg); } Firefox It's the same principles as for firefox as it was described above for thunderbir. Binary distributions should now include support for AutoConfig (pref extension!) but unfortunately not for LDAP calls :-( (cf. MOZ_LDAP_XPCOM=1). It is not vital in Firefox as...
...ues, "2)" just above. getLDAPAttributes("ldap2.int-evry.fr","ou=people,dc=int-evry,dc=fr","uid=" + env_user,"uid,cn,mail,labeledURI"); // Close the try, and call the catch() } catch(e) {displayError("lockedPref", e);} Debug If you set a username and the MOZILLA_DEBUG variable ($export MOZILLA_DEBUG=1; export USER=procacci), then the displayError() will show you this popup: That's a popup
titled as "error", but it's just a debug tool for me as I didn't find any other way to popup information. cf. bug 206294: ------- Comment #14 From Daniel Wang 2003-11-06 09:06 PDT [reply] ------- Jehan Procaccia, you need to change 5.8 to reflect what I said in comment 21. Preference files and config files are special JavaScript files with limited scopes. They can only call the get/set pref/env met...
Monitoring WiFi access points - Archive of obsolete content
Code with UniversalXPConnect privileges can monitor the list of available WiFi access points to obtain information about them including their SSID, MAC address, and signal strength. This capability was introduced primarily to allow WiFi-based location services to be used by geolocation services. Example This example simply displays a list of the available access points. ...
...salXPConnect privileges can monitor the list of available WiFi access points to obtain information about them including their SSID, MAC address, and signal strength. This capability was introduced primarily to allow WiFi-based location services to be used by geolocation services. Example This example simply displays a list of the available access points. ...
Visualizing an audio spectrum - Archive of obsolete content
udio. The function handling the loadedMetaData event stores the metadata of the audio element in global variables; the function for the MozAudioAvailable event does an FFT of the samples and displays them in a canvas. NOTE: You can use the AudioNode called AnalyserNode to perform real-time FFT analysis on an audio stream, rather than the code shown below. ...
...dedMetaData event stores the metadata of the audio element in global variables; the function for the MozAudioAvailable event does an FFT of the samples and displays them in a canvas. NOTE: You can use the AudioNode called AnalyserNode to perform real-time FFT analysis on an audio stream, rather than the code shown below. ...
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
: document.all[aID]); } Differences between Mozilla and Internet Explorer First, I'll discuss the differences in the way HTML behaves between Mozilla and Internet Explorer. Tooltips Legacy browsers introduced tooltips into HTML by showing them on links and using the value of the alt attribute as a tooltip's content. The latest W3C HTML specification created the
title attribute, which is meant to contain a detailed description of the link. Modern browsers will use the
title attribute to display tooltips, and Mozilla only supports showing tooltips for that attribute and not the alt attribute. Entities HTML markup can contain several entities, which the W3C web standards body has defined. You can reference entities through their numerical or character referenc...
...d in strict mode. Since Internet Explorer does not support true XHTML, it does not care if no units are specified. If the page is in strict standards mode, and no units are used, then Mozilla ignores the style: <DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <
title>CSS and units example</
title> </head> <body> // works in strict mode <div style="width: 40px; border: 1px solid black;"> Text </div> // will fail in strict mode <div style="width: 40; border: 1px solid black;"> Text </div> </body> </html> Since the above example has a strict doctype, the page is rendered in strict standards mode. The first div will hav...
allowevents - Archive of obsolete content
This means that elements placed inside a listitem do not respond to events, and instead clicking the mouse simply selects that item within the list. ...
...This means that elements placed inside a listitem do not respond to events, and instead clicking the mouse simply selects that item within the list. ...
Building accessible custom components in XUL - Archive of obsolete content
hey each get the appropriate role, "wairole:rowheader" or "wairole:columnheader". Each label element is an individual cell and needs a role of "wairole:gridcell". This means we actually need to declare two namespaces, the XHTML 2 namespace and the wairole namespace. We can declare both of them at the top of our .xul file and then reuse them as often as we need. <code> <window id="accjax"
title="AccJax Spreadsheet" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:x2="http://www.w3.org/TR/xhtml2" xmlns:wairole="http://www.w3.org/2005/01/wai-rdf/GUIRoleTaxonomy#" > </code> Once the namespaces are in place, we define the roles for each component of our spreadsheet. <code> <grid x2:role="wairole:spreadsheet" class="spreadsheet" id="accjaxspreadshee...
...Cell = e.target.getElementsByTagName('label')[0]; } gFocusCell.focus(); } else { gFocusCell = e.target; } } function spreadsheet_click(e) { e.target.focus(); } </code> Finally, we'll add two lines to our .xul file to link in the JavaScript file (accjax.js) and call the install_handlers function when the spreadsheet is loaded. ...
Popup Guide - Archive of obsolete content
Popup Types XUL provides a number of different types of elements which may be used to create popup menus or other types of popup widgets, which vary based on the manner in which they are attached to an element and the manner in which they are opened. A brief overview of each type is listed here; more details for each type can be found by following the corresponding links. ...
...if not applicable to that element. Panels A panel can contain any type of content. It is useful when you wish to display some controls temporarily over the existing UI. For example, a popup search field could be used to allow searching and will disappear when a search term has been entered. A panel is created using the panel element. Floating Panels A floating popup is a type of panel with a
titlebar and acts like an auxiliary window. Usually it would contain tools related to the main window, or an inspector which displays properties of a selected element. Tooltips When the mouse is positioned over a UI control, a tooltip provides a small box with descriptive help about that control. When the mouse is moved away from the control, the tooltip automatically disappears. A tooltip can be cr...
Property - Archive of obsolete content
ocale autoCheck autoFill autoFillAfterMatch boxObject browsers builder builderView buttons canAdvance canGoBack canGoForward canRewind checked checkState child children className clickSelectsAll clientHeight clientWidth collapsed color columns command commandManager completeDefaultIndex container contentDocument contentPrincipal content
Title contentView contentViewerEdit contentViewerFile contentWindow contextMenu control controller controllers crop current currentIndex currentItem currentNotification currentPage currentPane currentSet currentURI customToolbarCount database datasources date dateLeadingZero dateValue decimalPlaces decimalSymbol defaultButton defaultValue descript...
...electedItems selectedPanel selectedTab selectionEnd selectionStart selstyle selType sessionCount sessionHistory showCommentColumn showPopup size smoothScroll spinButtons src state statusbar statusText stringBundle strings style subject suppressOnSelect tabContainer tabIndex tabs tabScrolling tabpanels tag textLength textValue timeout
title toolbarName toolbarset tooltip tooltipText top treeBoxObject type uri userAction value valueNumber view webBrowsereFind webNavigation webProgress width wizardPages wrapAround year yearLeadingZero Related DOM element properties DOM:element.attributes DOM:element.baseURI DOM:element.childElementCount DOM:element.childNodes DOM:element.children D...
Building Hierarchical Trees - Archive of obsolete content
As shown in the snippet of the data below, the street is a Seq, so it will become a container. The houses are not containers, so they will not have children in the tree. <rdf:Bag rdf:abou...
...dicated by the rule's condition and the second rule is for the streets. As shown in the snippet of the data below, the street is a Seq, so it will become a container. The houses are not containers, so they will not have children in the tree. <rdf:Bag rdf:about="http://www.xulplanet.com/rdf/myneighbourhood"> <rdf:li> <rdf:Seq rdf:about="http://www.xulplanet.com/rdf/marion" dc:
title="Marion Street"> The result is a two level tree with two columns. For an XML source, a container is a node in the XML document that has children. In this example, the two group elements are displayed at the first level. The individual people are displayed at the next level of the tree as the builder recurses. In this example, we only need to use one rule. <tree datasources="people2.xml" ref="*"...
textbox (Toolkit autocomplete) - Archive of obsolete content
When the selected item is changed What is accessible The script context at this point can only access the following things: Global Values/Functions i.e. ...
...n attribute is not present if the menu is closed. readonly Type: boolean If set to true, then the user cannot change the value of the element. However, the value may still be modified by a script. showcommentcolumn New in Thunderbird 3Requires SeaMonkey 2.0 Type: boolean If true, a comment column appears in the popup. For the URL history, the comment column will contain the page
titles associated with each URL. If this attribute is not specified, the comment column doesn't appear. showimagecolumn Type: boolean If true, an image column appears in the popup. There is no default styling of this image, but the class name returned by the results appears in the property list for the column. If this attribute is not specified, the image column doesn't appear. size Type: ...
Textbox (XPFE autocomplete) - Archive of obsolete content
When the selected item is changed What is accessible The script context at this point can only access the following things: Global Values/Functions i.e. ...
...: The user's URL history is searched. Obsolete since Gecko 3 addrbook: The user's address book is searched. Obsolete since Gecko 3 ldap: The user's LDAP directories are searched. Obsolete since Gecko 25 showCommentColumn Obsolete since Gecko 1.9.1 Type: boolean If true, a comment column appears in the popup. For the URL history, the comment column will contain the page
titles associated with each URL. If this attribute is not specified, the comment column doesn't appear. As of Gecko 1.9.1, this attribute is now always specified in lower case. showcommentcolumn New in Thunderbird 3Requires SeaMonkey 2.0 Type: boolean If true, a comment column appears in the popup. For the URL history, the comment column will contain the page
titles associated with each URL. I...
SeaMonkey - making custom toolbar (SM ver. 1.x) - Archive of obsolete content
button.js button.xul contents.rdf In contents.rdf, also change the displayName, description and author attributes. 2. Create a working directory somewhere on your computer. Use any name that you like for this directory. 3. ...
...scription and author attributes. 2. Create a working directory somewhere on your computer. Use any name that you like for this directory. 3. In your working directory, create a plain text file named: install.js Copy the following content, and paste it into the new file: const
title = "Custom Toolbar Button" const name = "custombutton" const version = "1.0" r = initInstall(
title, name, version) || addDirectory(null, "content", getFolder("Chrome"), name) || registerChrome(CONTENT + DELAYED_CHROME, getFolder("Chrome", name), "") if (r) cancelInstall(r) else performInstall(), alert("Now restart SeaMonkey") Customize the
title, name and (optionally) version definitions, changing the text between double-quote characters on those three lines. The name must match the ch...
Creating a Window - Archive of obsolete content
ng a simple find files utility throughout this tutorial. First, however, we should look at the basic syntax of a XUL file. Creating a XUL File An XUL file can be given any name but it really should have a .xul extension. The simplest XUL file has the following structure: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="findfile-window"
title="Find Files" orient="horizontal" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <!-- Other elements go here --> </window> This window will not do anything since it doesn't contain any UI elements. Those will be added in the next section. In fact, there will not be shown any window at all. If you want to force the window to become visible you can add the width and...
... can be placed in the window tag -- in this case there are four. In the example, each attribute is placed on a separate line but they do not have to be. id="findfile-window" The id attribute is used as an identifier so that the window can be referred to by scripts. You will usually put an id attribute on all elements. The name can be anything you want although it should be something relevant.
title="Find Files" The
title attribute describes the text that would appear on the
title bar of the window when it is displayed. In this case the text 'Find Files' will appear. orient="horizontal" The orient attribute specifies the arrangement of the items in the window. The value horizontal indicates that items should be placed horizontally across the window. You may also use the value vertical, ...
Manifest Files - Archive of obsolete content
dopted the "Manifest" format. <?xml version="1.0"?> <RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:chrome="http://www.mozilla.org/rdf/chrome#"> <RDF:Seq about="urn:mozilla:package:root"> <RDF:li resource="urn:mozilla:package:myapplication"/> </RDF:Seq> <RDF:Description about="urn:mozilla:package:myapplication" chrome:displayName="Application
Title" chrome:author="Author Name" chrome:name="myapplication" chrome:extension="true"/> </RDF:RDF> content,install,url,file:///main/app/ Create a directory somewhere on your disk. Many people put this as a subdirectory inside Mozilla's chrome directory, but this isn't necessary. The directory could be anywhere and on any disk. Put your XUL files in this directory. C...
...to the new contents.rdf file. This file is used to identify the application id, its name, author, version and so on. Change the highlighted parts of the file above to your own information. The red text 'myapplication' should be the ID of your application. You make this up, but typically, the ID is similar to your application's name. Replace the blue highlighted text above with your application's
title and author. If the 'chrome:extension' field is true, the application is a Mozilla Firefox Extension and it will show up in the Extensions window of the browser. If false, it will not appear. Save the contents.rdf and make sure it is in the directory you created in step 1. Open the file <mozilla-directory>/chrome/installed-chrome.txt, where <mozilla-directory> is the directory where Mozilla is ...
Open and Save Dialogs - Archive of obsolete content
Components.interfaces.nsIFilePicker; var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker); fp.init(window, "Select a File", nsIFilePicker.modeOpen); First, a new file picker object is created and stored in the variable 'fp'. The 'init' function is used to initialize the file picker. This function takes three arguments, the window that is opening the dialog, the
title of the dialog and the mode. The mode here is modeOpen which is used for an Open dialog. You can also use modeGetFolder and modeSave for the other two modes. These modes are constants of the nsIFilePicker interface. Default directory and filters There are two features you can set of the dialog before it is displayed. The first is the default directory that is displayed when the dialog is open...
...t files only or all files. You can also use filterXML and filterXUL to filter for XML and XUL files respectively. If you would like to filter for custom files, you can use the appendFilter() function to do this: fp.appendFilter("All Files" ,"*.*"); fp.appendFilter("Audio Files (*.wav, *.mp3)","*.wav; *.mp3"); This line will add a filter for Wave and MP3 audio files. The first argument is the
title of the file type and the second is a semicolon-seperated list of file masks. You can add more masks or fewer masks as needed. You can call appendFilter as many times as necessary to add additional filters. The order you add them determines their priority. Typically, the first one added is selected by default. Getting the selected file Finally, you can show the dialog by calling the show() funct...
RDF Datasources - Archive of obsolete content
resource can be referred to using rdf:history as the datasource. The table below shows the resources (or fields) that you can retrieve from the history datasource. Put the URL values below where you want the value of the resource to be used. ...
...f attribute to any of the other about attribute values to limit the set of data that is returned. For example, to display only the reptiles, use a value of http://www.some-fictitious-zoo.com/reptiles. Setting the ref Attribute Example The example below shows how to display a particular piece of an RDF datasource by setting the ref attribute. ...
XUL Reference - Archive of obsolete content
box richlistitem row rows rule scale script scrollbar scrollbox scrollcorner separator spacer spinbuttons splitter stack statusbar statusbarpanel stringbundle stringbundleset tab tabbrowser (Firefox-only starting with Firefox 3/Gecko 1.9) tabbox tabpanel tabpanels tabs template textnode textbox textbox (Firefox autocomplete) textbox (Mozilla autocomplete) timepicker
titlebar toolbar toolbarbutton toolbargrippy toolbaritem toolbarpalette toolbarseparator toolbarset toolbarspacer toolbarspring toolbox tooltip tree treecell treechildren treecol treecols treeitem treerow treeseparator triple vbox where window wizard wizardpage Categorical list of all XUL elements << XUL Reference << Windows window wizard wizardpage
titlebar Wind...
... Tabs and grouping tab tabbox tabpanel tabpanels tabs Controls --- Text and images label caption image Lists --- Trees --- Layout --- Templates --- Scripting --- Helper elements Other XUL lists dialog overlay page window wizard wizardpage preference preferences prefpane prefwindow browser tabbrowser editor iframe
titlebar resizer statusbar statusbarpanel dialogheader notification notificationbox menubar menu menuitem menuseparator menupopup panel tooltip popupset toolbar toolbarbutton toolbargrippy toolbaritem toolbarpalette toolbarseparator toolbarset toolbarspacer toolbarspring toolbox tabbox tabs tab tabpanels tabpanel groupbox caption separator spacer button checkbox colo...
browser - Archive of obsolete content
only be called from chrome URLs. Other URLs will need to use the document and history objects to change the displayed document. ...
...ge to go forward to in the session history and the Forward button should be enabled. contentDocument Type: document This read-only property contains the document object in the element. contentPrincipal Type: nsIPrincipal This read-only property contains the principal for the content loaded in the browser, which provides security context information. content
Title Type: string This read-only property contains the
title of the document object in the browser. contentViewerEdit Type: nsIContentViewerEdit This read-only property contains the nsIContentViewerEdit which handles clipboard operations on the document. contentViewerFile Type: nsIContentViewerFile Reference to the nsIContentViewerFile inte...
tabbrowser - Archive of obsolete content
3 (XULRunner/Gecko 1.9), this is only used in the main Firefox window and cannot be used in other XUL windows by third-party applications or extensions. ...
...if there is a page to go back to in the session history and the Back button should be enabled. canGoForward Type: boolean This read-only property is true if there is a page to go forward to in the session history and the Forward button should be enabled. contentDocument Type: document This read-only property contains the document object in the element. content
Title Type: string This read-only property contains the
title of the document object in the browser. contentViewerEdit Type: nsIContentViewerEdit This read-only property contains the nsIContentViewerEdit which handles clipboard operations on the document. contentViewerFile Type: nsIContentViewerFile Reference to the nsIContentViewerFile interf...
toolbarbutton - Archive of obsolete content
here possible, provide keyboard alternatives. Where possible, duplicate functionality in a menu item or context menu. Where not possible, make all toolbarbuttons focusable by -moz-user-focus: normal. ...
...order that they appear in the XUL source. vertical Child elements of the element are placed under each other in a column in the order that they appear in the XUL source. tabindex Type: integer The tab order of the element. The tab order is the order in which the focus is moved when the user presses the "tab" key. Elements with a higher tabindex are later in the tab sequence.
title Type: string This functionality only applies when toolbarbutton is used in the Customize Toolbar dialog. The text that is displayed as a button's label when it's in the Customize Toolbar palette. It overrides the value of label, which is used if
title is not set. This does not affect the button's label when it is in a toolbar, which remains determined by the label attribute. type Type...
CommandLine - Archive of obsolete content
</window> Original Document Information Author: Georges-Etienne Legendre Last Updated Date: August 21st, 2007 ...
...</window> Original Document Information Author: Georges-Etienne Legendre Last Updated Date: August 21st, 2007 ...
Dialogs in XULRunner - Archive of obsolete content
m dialogs Building dialogs in XUL is very similar to creating windows. Each dialog is described in its own XUL file. XUL provides a dialog element to act as the container for the dialog. Dialog XUL files can have DTD, CSS, and JavaScript, just like windows. ...
...,cancel" buttonlabelaccept="Set Favorite" buttonaccesskeyaccept="S" ondialogaccept="return doSave();" buttonlabelcancel="Cancel" buttonaccesskeycancel="n" ondialogcancel="return doCancel();"> <script> function doSave(){ //doSomething() return true; } function doCancel(){ return true; } </script> <dialogheader
title="My dialog" description="Example dialog"/> <groupbox flex="1"> <caption label="Select favorite fruit"/> <radiogroup> <radio id="1" label="Oranges because they are fruity"/> <radio id="2" selected="true" label="Strawberries because of color"/> <radio id="3" label="Bananna because it pre packaged"/> </radiogroup> </groupbox> </dialog> XUL window elements have a ...
Getting started with XULRunner - Archive of obsolete content
w. The debugging preferences are discussed in Debugging a XULRunner Application Step 7: Create some XUL Finally, we need to create a simple XUL window, which is described in the file main.xul. Nothing fancy here, just the minimum we need to make a window. No menus or anything. main.xul: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="main"
title="My App" width="300" height="300" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="application/javascript" src="chrome://myapp/content/main.js"/> <caption label="Hello World"/> <separator/> <button label="More >>" oncommand="showMore();"/> <separator/> <description id="more-text" hidden="true">This is a simple XULRunner application. XUL is simple ...
... can do with XULRunner (who would have thought that? Typical Mozilla writing style at play here). Before you get too far into things you might want to read the XULRunner tips article. Also, throughout this tutorial you've been introduced to various bits of the Toolkit API and it may help you to get familiar with it. Once you've got an application that's ready for the world you'll love our article
titled Deploying XULRunner. For now, click the "next" link to learn about windows and menus in XULRunner! Next >> Original Document Information Author: Mark Finkle, October 2, 2006 ...
XULRunner tips - Archive of obsolete content
utton to save space. This button is usually called "xulrunner.exe" and has XULRunner's icon. There are two approaches to display the branding of your application instead: When compiling XULRunner yourself: create a file module.ver in the directory mozilla/xulrunner/app with the contents: WIN32_MODULE_DESCRIPTION=MyApplication MyApplication should be replaced by whatever you want to see as
title of the button. You can also replace xulrunner.ico in the same directory to change XULRunner's icon to the icon of your application. With a precompiled XULRunner: use xulrunner-stub.exe to start your application but rename it into MyApplication.exe. With XULRunner 1.9 this will make the desired name appear in the task bar (not with XULRunner 1.8 however). Your application's icon can also be add...
...ch to run a specified XUL application instead of starting the browser. On Windows: firefox.exe -app path\to\application.ini On Linux: firefox -app path/to/application.ini On the Mac: /Applications/Firefox.app/Contents/MacOS/firefox-bin -app /path/to/application.ini Note that at least on the Mac, you need to use a full path. Partial paths don't seem to work. Troubleshooting Window
title missing If the
title of your XUL <window> is blank, even though you specified a
title attribute, make sure the extension on your XUL file is .xul rather than .xml Default Theme To create a default theme you need to create a folder in the extensions folder with an install.rdf in it. As of Oct. 2008, the folder needs to have the same name as the one in Firefox 3.0. \MyApp\Extensions{972ce4c6-...
calICalendarViewController - Archive of obsolete content
optional, but aEndTime cannot be included without aStartTime. If aStartTime is specified, then the calIEvent is meant to be created 'silently', that is, without a more detailed dialog appearing. The calIEvent should have its endDate set to aEndTime, if this parameter is specified. Otherwise, it should be set to a default value, as determined by the application. The other values of the calIEvent (
title, summary, alarm, etc) should likewise be set to defaults. If no aStartTime is specified, then an event-creation dialog should be displayed. modifyOccurrence void modifyOccurrence (in calIItemOccurrence aOccurrence, in calIDateTime aNewStartTime, in calIDateTime aNewEndTime); The modifyOccurrence method is used to change the attributes of an already existing calIItem. The calID...
...s.NS_ERROR_NO_INTERFACE; } return this; }, createNewEvent: function (aCalendar, aStartTime, aEndTime) { // if we're given both times, skip the dialog if (aStartTime && aEndTime && !aStartTime.isDate && !aEndTime.isDate) { var event = createEvent(); event.startDate = aStartTime; event.endDate = aEndTime; event.
title = "New Event"; aCalendar.addItem(event, null); } else if (aStartTime && aStartTime.isDate) { var event = createEvent(); event.startDate = aStartTime; aCalendar.addItem(event, null); } else { createEventWithDialog(aCalendar, aStartTime, aEndTime); } }, modifyOccurrence: function (aOccurrence, aNewStartTime...
Proposal - Archive of obsolete content
r process them. ...
...raft Exists Source GUID When an RSS item is posted in response to a previous item (called the source item) RSS 2.0 offers the source element which allows the item to refer to the RSS feed which contains the source item. The SGUID specification provides a more granular approach by offering an sourceRef element which can reference the GUID permalink of the source. Draft Exists <
title>Proposals</
title> ...
Security Controls - Archive of obsolete content
tching. The motivation for having multiple layers is that if one layer fails or otherwise cannot counteract a certain threat, other layers might prevent the threat from successfully breaching the system. A combination of network-based and host-based controls is generally most effective at providing consistent protection. Original Document Information Author(s): U.S. ...
... Document Information Author(s): U.S. Department of Commerce
Title: Federal Information Processing Standard Publication 200, Minimum Security Requirements for Federal Information and Information Systems Last Updated Date: March 2006 Copyright Information: This document is not subject to copyright. Original Document Information Author(s): Karen Scarfone, Wayne Jansen, and Miles Tracy
Title: NIST Special Publication 800-123, Guide to General Server Security Last Updated Date: July 2008 Copyright Information: This document is not subject to copyright. ...
Threats - Archive of obsolete content
r data by flooding websites and networks with spurious traffic. Original Document Information Author(s): Ella Deon Lackey Last Updated Date: 2012 Copyright Information: (C) 2012 Red Hat, Inc. ...
...mation Author(s): Joint Task Force Transformation Initiative
Title: National Institute of Standards and Technology (NIST) Special Publication 800-30 Revision 1, Guide for Conducting Risk Assessments Last Updated Date: September 2012 Copyright Information: This document is not subject to copyright. Original Document Information Author(s): Karen Scarfone, Wayne Jansen, and Miles Tracy
Title: National Institute of Standards and Technology (NIST) Special Publication 800-123, Guide to General Server Security Last Updated Date: July 2008 Copyright Information: This document is not subject to copyright. ...
Browser Feature Detection - Archive of obsolete content
true true Document.createElement() true true true Document.createDocumentFragment() true true true Document.createTextNode() true true true Document.createComment() true true true Document.createAttribute() true true true Document.getElementsByTagName() true true true Document.
title true true true Document.referrer true true true Document.domain true true true Document.URL true true true Document.body true true true Document.images true true true Document.applets true true true Document.links true true true Document.forms true ...
...supported': false} ], 'DOMHTML': [ {name: 'documentElement', 'supported': false}, {name: 'createElement', 'supported': false}, {name: 'createDocumentFragment', 'supported': false}, {name: 'createTextNode', 'supported': false}, {name: 'createComment', 'supported': false}, {name: 'createAttribute', 'supported': false}, {name: 'getElementsByTagName', 'supported': false}, {name: '
title', 'supported': false}, {name: 'referrer', 'supported': false}, {name: 'domain', 'supported': false}, {name: 'URL', 'supported': false}, {name: 'body', 'supported': false}, {name: 'images', 'supported': false}, {name: 'applets', 'supported': false}, {name: 'links', 'supported': false}, {name: 'forms', 'supported': false}, {name: 'anchors', 'supported': false}, {name: 'cookie', ...
Displaying a graphic with audio samples - Archive of obsolete content
The following example shows how to take samples from an audio stream and display them behind an image (in this case, the Mozilla logo), giving the impression that the image is built from the samples. ...
... The following example shows how to take samples from an audio stream and display them behind an image (in this case, the Mozilla logo), giving the impression that the image is built from the samples. ...
Popup Window Controls - Archive of obsolete content
icking on a hyperlink, should succeed in opening popup windows even if the user has popup controls enabled on your site. Detecting Suppressed Popups Windows If a user has popup controls enabled for your site, any attempt to call window.open in global script, in an onload handler or in setTimeout() or setInterval() will return null rather than a reference to the opened window. ...
...cceed in opening popup windows even if the user has popup controls enabled on your site. Detecting Suppressed Popups Windows If a user has popup controls enabled for your site, any attempt to call window.open in global script, in an onload handler or in setTimeout() or setInterval() will return null rather than a reference to the opened window. ...
The Business Benefits of Web Standards - Archive of obsolete content
laced in search engines is one of the hardest challenges faced by webmasters. In this case, every bit helps. By using semantic markup we greatly assist the Search Engines in their indexing process. These things come naturally to Standards developers without additional effort, time or thought. All their documents are properly marked up at the outset. The number of sites which do not include proper
titles and descriptions in the meta is surprising. A lot of other sites would greatly increase their SEO by simply using proper tags for the content. Adding h1, h2, and h3, tags and so on gives proper structure to hypertext documents. Search engine agents crawl the web to index it, but for ranking and indexing purposes they can only process text. Dynamic effects such as those created by JavaScript are...
...poses they can only process text. Dynamic effects such as those created by JavaScript are not taken into account, and text rendered with graphics cannot be read and parsed either. Separating presentation from content increases the information/markup ratio, making CSS-based documents more pertinent with regard to the search terms, which makes them rank higher in search results. Using CSS to render
titles instead of graphics also helps in this regard. There are very significant differences in how search engines operate. Instead of worrying about each engine and attempting to artificially manipulate the results, Web Standards pages index and rank properly (where they deserve to) across all search engines. In the same way that Standards hugely reduce the concern we need to have for browser differe...
Game monetization - Game development
nsider earning some money out of it. If your work is a serious endeavour on the path to becoming an independent game developer able to make a living, read on and see what your options are. The technology is mature enough; now it's just about chosing the right approach. Paid games The first, most obvious choice that may come to your mind might be selling the games the way it is done for huge AAA
titles -- with a fixed, up front price. Even though the digital market is key and you don't need to print covers and put your game in a physical store in boxes, to earn decent money on selling your games for a fixed price you have to invest your time and money in marketing. Only the best games will break even or earn more than they cost to make, and you still need a lot of luck for that. How much you ...
...ut your game in a physical store in boxes, to earn decent money on selling your games for a fixed price you have to invest your time and money in marketing. Only the best games will break even or earn more than they cost to make, and you still need a lot of luck for that. How much you charge for your game depends on the market, quality of your game and a lot of other small factors. An arcade iOS
title can be sold for 0.99 USD, but a longer RPG-style desktop game on Steam can cost 20 USD; both prices are ok. You have to follow the market and do your own research -- learning from your mistakes quickly is important. In-app purchases Instead of having people pay for your game up front, you can offer a free game with in-app purchases (IAPs.) In this case the game can be acquired without spending ...
HTML: A good basis for accessibility - Learn web development
of the same image: <img src="dinosaur.png"> <img src="dinosaur.png" alt="A red Tyrannosaurus Rex: A two legged dinosaur standing upright like a human, with small arms, and a large head with lots of sharp teeth."> <img src="dinosaur.png" alt="A red Tyrannosaurus Rex: A two legged dinosaur standing upright like a human, with small arms, and a large head with lots of sharp teeth."
title="The Mozilla red dinosaur"> <img src="dinosaur.png" aria-labelledby="dino-label"> <p id="dino-label">The Mozilla red Tyrannosaurus Rex: A two legged dinosaur standing upright like a human, with small arms, and a large head with lots of sharp teeth.</p> The first image, when viewed by a screen reader, doesn't really offer the user much help -- VoiceOver for example reads out "/dinosaur.png, i...
...t is better to write an empty text as a value for alt attribute (see Empty alt attributes) or to just include them in the page as CSS background images. Note: Read Images in HTML and Responsive images for a lot more information about image implementation and best practices. If you do want to provide extra contextual information, you should put it in the text surrounding the image, or inside a
title attribute, as shown above. In this case, most screen readers will read out the alt text, the
title attribute, and the filename. In addition, browsers display
title text as tooltips when moused over. Let's have another quick look at the fourth method: <img src="dinosaur.png" aria-labelledby="dino-label"> <p id="dino-label">The Mozilla red Tyrannosaurus ... </p> In this case, we are not using...
HTML: A good basis for accessibility - Learn web development
of the same image: <img src="dinosaur.png"> <img src="dinosaur.png" alt="A red Tyrannosaurus Rex: A two legged dinosaur standing upright like a human, with small arms, and a large head with lots of sharp teeth."> <img src="dinosaur.png" alt="A red Tyrannosaurus Rex: A two legged dinosaur standing upright like a human, with small arms, and a large head with lots of sharp teeth."
title="The Mozilla red dinosaur"> <img src="dinosaur.png" aria-labelledby="dino-label"> <p id="dino-label">The Mozilla red Tyrannosaurus Rex: A two legged dinosaur standing upright like a human, with small arms, and a large head with lots of sharp teeth.</p> The first image, when viewed by a screen reader, doesn't really offer the user much help -- VoiceOver for example reads out "/dinosaur.png, i...
...t is better to write an empty text as a value for alt attribute (see Empty alt attributes) or to just include them in the page as CSS background images. Note: Read Images in HTML and Responsive images for a lot more information about image implementation and best practices. If you do want to provide extra contextual information, you should put it in the text surrounding the image, or inside a
title attribute, as shown above. In this case, most screen readers will read out the alt text, the
title attribute, and the filename. In addition, browsers display
title text as tooltips when moused over. Let's have another quick look at the fourth method: <img src="dinosaur.png" aria-labelledby="dino-label"> <p id="dino-label">The Mozilla red Tyrannosaurus ... </p> In this case, we are not using...
Test your skills: HTML accessibility - Learn web development
for this task to work in your own editor or in an online editor. HTML accessibility 2 In the second task, you have a form containing three input fields. You need to: Semantically associate the input with their labels. Assume that these inputs will be part of a larger form, and wrap them in an element that associates them all together as a single related group. Give the group a description/
title that summarises all of the information as personal data. Try updating the live code below to recreate the finished example: Download the starting point for this task to work in your own editor or in an online editor. HTML accessibility 3 In this task you are required to turn all the information links in the paragraph into good, accessible links. The first two links just go to regular ...
... you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. You can write the code yourself, or use the starting point files linked to in the above sections. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for HTML accessibility 1 skill test". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone wit...
Test your skills: Selectors - Learn web development
ist items that are a direct child of the ul with a class of list. Try updating the live code below to recreate the finished example: For assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor. Selectors Five In this final task add CSS using attribute selectors to do the following: Target the <a> element with a
title attribute and make the border pink (border-color: pink). Target the <a> element with an href attribute that contains the word contact somewhere in its value and make the border orange (border-color: orange). Target the <a> element with an href value starting with https and give it a green border (border-color: green). Try updating the live code below to recreate the finished example: Fo...
... you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. You can write the code yourself, or use the starting point files linked to in the above sections. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for Selectors skill test 1". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want to be assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone with a...
CSS selectors - Learn web development
different groups of selectors in more detail. Type, class, and ID selectors This group includes selectors that target an HTML element such as an <h1>. h1 { } It also includes selectors which target a class: .box { } or, an ID: #unique { } Attribute selectors This group of selectors gives you different ways to select elements based on the presence of a certain attribute on an element: a[
title] { } Or even make a selection based on the presence of an attribute with a particular value: a[href="https://example.com"] { } Pseudo-classes and pseudo-elements This group of selectors includes pseudo-classes, which style certain states of an element. The :hover pseudo-class for example selects an element only when it is being hovered over by the mouse pointer: a:hover { } It also includes...
...d to look up selectors later in the material, or as you experiment with CSS generally. ...
Using your new knowledge - Learn web development
live example shows a biography, which has been styled using CSS. The CSS properties that I have used are as follows -- each one links to its property page on MDN, which will give you more examples of its use. font-family color border-bottom font-weight font-size text-decoration I have used a mixture of selectors, styling elements such as h1 and h2, but also creating a class for the job
title and styling that. Use CSS to change how this biography looks by changing the values of the properties I have used. Make the level one heading pink, using the CSS color keyword hotpink. Give the heading a 10px dotted border-bottom which uses the CSS color keyword purple. Make the level 2 heading italic. Give the ul used for the contact details a background-color of #eeeeee, and a 5px solid ...
...his stage in your learning you can afford to have a bit of fun. Assessment or further help If you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for CSS First Steps". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone with a coding probl...
What is accessibility? - Learn web development
f all our target customers, and adapt accordingly. Hence accessibility. Web accessibility In the specific context of the web, accessibility means that anyone can benefit from your content, regardless of disability, location, technical limitations, or other circumstances. Let's consider video: Hearing impairment How does a hearing-impaired person benefit from a video? You have to provide sub
titles --or even better, a full text transcript. Also, make sure people can adjust the volume to accommodate their unique needs. Visual impairment Again, provide a text transcript that a user can consult without needing to play the video, and an audio-description (an off-screen voice that describes what is happening in the video). Pausing capacity Users may have trouble understanding someone in a ...
...so, make sure people can adjust the volume to accommodate their unique needs. Visual impairment Again, provide a text transcript that a user can consult without needing to play the video, and an audio-description (an off-screen voice that describes what is happening in the video). Pausing capacity Users may have trouble understanding someone in a video. Let them pause the video to read the sub
titles or process the information. Keyboard capacity Let the user tab into/out of a video, play it, and pause it without being trapped in it. The basics of Web accessibility A few necessities for basic Web accessibility include: Whenever your site needs an image to convey meaning, include text as an alternative for visually-challenged users or those with slow connections. Make sure all users c...
JavaScript basics - Learn web development
c value is equal to the path of the original image: If it is, the code changes the src value to the path of the second image, forcing the other image to be loaded inside the <img> element. If it isn't (meaning it must already have changed), the src value swaps back to the original image path, to the original state. Adding a personalized welcome message Next, let's change the page
title to a personalized welcome message when the user first visits the site. This welcome message will persist. Should the user leave the site and return later, we will save the message using the Web Storage API. We will also include an option to change the user, and therefore, the welcome message. In index.html, add the following line just before the <script> element: <button>Change user</button...
...tUserName(). Put this onclick event handler (below) on the button. When clicked, setUserName() runs. This allows the user to enter a different name by pressing the button. myButton.onclick = function() { setUserName(); } A user name of null? When you run the example and get the dialog box that prompts you to enter your user name, try pressing the Cancel button. You should end up with a
title that reads Mozilla is cool, null. This happens because--when you cancel the prompt--the value is set as null. Null is a special value in JavaScript that refers to the absence of a value. Also, try clicking OK without entering a name. You should end up with a
title that reads Mozilla is cool, for fairly obvious reasons. To avoid these problems, you could check that the user hasn't entered a blan...
What will your website look like? - Learn web development
at should your website actually do? A website can do basically anything, but, for your first try, you should keep things simple. We'll start by creating a simple webpage with a heading, an image, and a few paragraphs. To begin, you'll need to answer these questions: What is your website about? Do you like dogs, New York, or Pac-Man? What information are you presenting on the subject? Write a
title and a few paragraphs and think of an image you'd like to show on your page. What does your website look like, in simple high-level terms? What's the background color? What kind of font is appropriate: formal, cartoony, bold and loud, subtle? Note: Complex projects need detailed guidelines that go into all the details of colors, fonts, spacing between items on a page, appropriate writing style...
...ner and a user experience (UX) designer. Graphic designers put together the visuals of the website. UX designers have a somewhat more abstract role in addressing how users will experience and interact with the website. Choosing your assets At this point, it's good to start putting together the content that will eventually appear on your webpage. Text You should still have your paragraphs and
title from earlier. Keep these close by. Theme color To choose a color, go to the Color Picker and find a color you like. When you click on a color, you'll see a strange six-character code like #660066. That's called a hex code (short for hexadecimal), and represents your color. Copy the code down somewhere safe for now. Images To choose an image, go to Google Images and search for something suit...
Marking up a letter - Learn web development
xpansions of each acronym/abbreviation. The six sub/superscripts should be marked up appropriately -- in the chemical formulae, and the numbers 103 and 104 (they should be 10 to the power of 3 and 4, respectively). Try to mark up at least two appropriate words in the text with strong importance/emphasis. There are two places where the letter should have a hyperlink. Add appropriate links with
titles. For the location that the links point to, you may use http://example.com as the URL. Mark up the university motto quote and citation with appropriate elements. The head of the document The character set of the document should be set as utf-8 using the appropriate meta tag. The author of the letter should be specified in an appropriate meta tag. The provided CSS should be included inside...
...e of what the letter might look like after being marked up. Assessment or further help If you would like your work assessed, or if you get stuck and want to ask for help: Put your work in an online shareable editor such as CodePen, jsFiddle, or Glitch. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for Marking up a letter". Details of what you have already tried, and what you would like us to do (if you are stuck and need help, or if you want an assessment). A link to the example you want evaluated or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good habit to develop. It's very hard to help someone with a coding pro...
Structuring a page of content - Learn web development
s. Note: If you get stuck, then ask us for help -- see the Assessment or further help section at the bottom of this page. Project brief For this project, your task is to take the content for the homepage of a bird watching website and add structural elements to it so it can have a page layout applied to it. It needs to have: A header spanning the full width of the site containing the main
title for the page, the site logo, and the navigation menu. The
title and logo appear side by side once styling is applied, and the navigation appears below those two items. A main content area containing two columns -- a main block to contain the welcome text, and a sidebar to contain image thumbnails. A footer containing copyright information and credits. You need to add a suitable wrapper for: ...
...mple of what the homepage might look like after being marked up. Assessment or further help If you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for Structuring a page of content". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone with ...
Manipulating documents - Learn web development
with JavaScript after the page has been rendered. We have created a simple example page at dom-example.html (see it live also). Try opening this up in your browser -- it is a very simple page containing a <section> element inside which you can find an image, and a paragraph with a link inside. ...
... page has been rendered. We have created a simple example page at dom-example.html (see it live also). Try opening this up in your browser -- it is a very simple page containing a <section> element inside which you can find an image, and a paragraph with a link inside. ...
A first splash into JavaScript - Learn web development
inking like a programmer throughout the course. With that in mind, let's look at the example we'll be building up in this article, and review the general process of dissecting it into tangible tasks. ...
...oughout the course. With that in mind, let's look at the example we'll be building up in this article, and review the general process of dissecting it into tangible tasks. ...
Test your skills: Object basics - Learn web development
aining the following members: name: A string representing the name of the album. released: A number representing the year the album was released. Include at least two albums in the albums array. Once you've done this, you should then write a string to the variable bandInfo, which will contain a small biography detailing their name, nationality, years active, and style, and the
title and release date of their first album. Try updating the live code below to recreate the finished example: Download the starting point for this task to work in your own editor or in an online editor. Object basics 3 Finally for our object basics assessment, we want you to return to the cat object literal from Task #1. We want you to rewrite the greeting() method so that it logs "Hello, sai...
... you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. You can write the code yourself, or use the starting point files linked to in the above sections. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for Object basics 1 skill test". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone with a c...
Beginning our React todo list - Learn web development
First, consider the JSX we have, and how it corresponds to our user stories: We have a <form> element, with an <input type="text"> ...
...ly-hidden">Repeat</span> </button> <button type="button" className="btn btn__danger"> Delete <span className="visually-hidden">Repeat</span> </button> </div> </li> </ul> </div> ); } Now open public/index.html and change the <
title> element's text to TodoMatic. This way, it will match the <h1> at the top of our app. <
title>TodoMatic</
title> When your browser refreshes, you should see something like this: It's ugly, and doesn't function yet, but that's okay -- we'll style it in a moment. First, consider the JSX we have, and how it corresponds to our user stories: We have a <form> element, with an <input type="text"> for writing out a new task, and a button to submit the form. We have an array of buttons that...
Handling common accessibility problems - Learn web development
xt of web technology, most people immediately think of making sure websites/apps are usable by people with disabilities, for example: Visually impaired people using screen readers or magnification/zoom to access text People with motor function impairments using the keyboard (or other non-mouse features) to activate website functionality. People with hearing impairments relying on captions/sub
titles or other text alternatives for audio/video content. However, it is wrong to say that accessibility is just about disabilities. Really, the aim of accessibility is to make your websites/apps usable by as many people in as many contexts as possible, not just those users using high-powered desktop computers. Some examples might include: Users on mobile devices. Users on alternative browsing d...
... image that successfully conveys its meaning and content on the page, to be picked up by a screenreader and read out to the user. Note: For more information, read Text alternatives. Missing alt text can be tested for in a number of ways, for example using accessibility Auditing tools. Alt text is slightly more complex for video and audio content. There is a way to define text tracks (e.g. sub
titles) and display them when video is being played, in the form of the <track> element, and the WebVTT format (see Adding captions and sub
titles to HTML5 video for a detailed tutorial). Browser compatibility for these features is fairly good, but if you want to provide text alternatives for audio or support older browsers, a simple text transcript presented somewhere on the page or on a separate page ...
Implementing feature detection - Learn web development
s files. Save them in a new directory. We will add the HTML5 Shiv to our example too so that the HTML5 semantic elements will style properly in older versions of IE. Download the latest version (see Manual installation), unzip the ZIP file, copy the html5shiv-printshiv.min.js and html5shiv.min.js files into your example directory, and link to one of the files by putting the following under your <
title> element: <script src="html5shiv.min.js"></script> Have a look at your example CSS files -- you'll see that basic-styling.css handles all the styling that we want to give to every browser, whereas the other two CSS files contain the CSS we want to selectively apply to browser depending on their support levels. You can look at the different effects these two files have by manually changing th...
...aining only those feature detects, making for a much smaller file size. CSS Let's have a look at how Modernizr works in terms of selectively applying CSS. First, make a copy of supports-feature-detect.html and supports-styling.css. Save them as modernizr-css.html and modernizr-css.css. Update your <link> element in your HTML so it points to the correct CSS file (you should also update your <
title> element to something more suitable!): <link href="modernizr-css.css" rel="stylesheet"> Above this <link> element, add a <script> element to apply the Modernizr library to the page, as shown below. This needs to be applied to the page before any CSS (or JavaScript) that might make use of it. <script src="modernizr-custom.js"></script> Now edit your opening <html> tag, so that it looks l...
SVG Guidelines
an mean many things, including: The typical "Created with editor" comments Non-standard editor specific tags and attributes (sketch:foo, illustrator:foo, sopodi:foo, ...) The XML namespace definition that comes with the latter (xmlns:sketch, xmlns:sopodi, ...) Other metadata In addition to non-standard editor metadata, standard compliant metadata also exists. Typical examples of this are <
title> and <desc> tags. Although this kind of data is supported by the browser, it can only be displayed when the SVG is opened in a new tab. Plus, in most of the cases, the filename is quite descriptive So it's recommended to remove that kind of metadata since it doesn't bring much value. You shouldn't include DOCTYPEs in your SVGs either; they are a source of many issues, and the SVG WG recommends n...
...ss. To this date, there doesn't seem to be a tool that handles all of the above. ...
mozbrowsershowmodalprompt
Boolean Whether the event normally bubbles or not. cancelable Read only Boolean Whether the event is cancellable or not. details Read only Object A custom object. details The details property is an anonymous JavaScript object with the following properties: promptType A DOMString defining the type of the prompt. It can be alert, confirm, or prompt.
title A DOMString representing the
title of the prompt. message A DOMString representing the value passed to the window.alert(), window.confirm(), or window.prompt() methods within the browser <iframe>'s content. returnValue A DOMString representing the return value for the window.prompt() methods. This should be set by the embedder. unblock() A function to be called when the iframe is unblocked...
...rame"); browser.addEventListener("mozbrowsershowmodalprompt", function( event ) { console.log("Asking for prompt:" + JSON.stringify(event.detail)); }); Related Events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsersecuritychange mozbrowser
titlechange mozbrowserusernameandpasswordrequired ...
Mozilla Content Localized in Your Language
ne/Register What is the appropriate tone for your translations? Does it vary by product and target audience? If so, how? What are formality to avoid? List products and their tones if different. Capitalization What is the appropriate form of expressing capitalization in your language? Note: if this doens't apply, how is expressed in your language to indicate importance or name of a movie, book
title, product UIs (Save, File...). Hyphens and compounds What is the appropriate form of expressing hyphens and compounds in your language? Note: if this doens't apply, indicate so with N/A. Prepositions and articles What is the appropriate form of expressing prepositions and articles in your language? Note: if this doens't apply, indicate so with N/A. Punctuation What is the appropriate form ...
... What are the order of family name and given name in your language. Here is the guideline on the naming convention from w3c.org: New Terminology What is your localization team's process for identifying and creating new terminology? Currency Currency and symbol. What are other widely used currency and symbols used in your country/language for paid apps. User Interface Elements
Titles Should be brief and precise. Localizers can assume that source content reaches 2/3 of the total available line space. This allows localization text to expand and not be truncated or resolved through ellipsis.
Title on the final page (meaning no more click through) should allow enough room to display full text. Buttons Capitalize the first letter of each w...
Mozilla Style System Documentation
Mozilla stores the output of the selector matching process in a lexicographic tree, the rule tree. This double tree (style context tree and rule tree) allows for sharing of style data, which allows the data to take up less memory and allows the data computation to take less time. For example, suppose we had the CSS stylesheet: /* rule 1 */ doc { display: block; text-indent: 1em; } /* rule 2 */
title { display: block; font-size: 3em; } /* rule 3 */ para { display: block; } /* rule 4 */ [class="emph"] { font-style: italic; } and the following document: <doc> <
title>A few quotes</
title> <para class="emph">Benjamin Franklin said that <quote>"A penny saved is a penny earned."</quote></para> <para>Franklin D. Roosevelt said that <quote>"We have nothing to fear but <span cla...
... | [F: 4] Note that two rule nodes point to rule 4. The style context tree will look like this, ignoring all the style contexts for the text nodes (all of which have style contexts pointing to rule node A), with each style context in the format [element type: rule node]: [doc: B] ,------------' | `-----------. [
title: C] [para: F] [para: D] | | [quote: A] [quote: A] | [span: E] The reason the rule tree shares style data naturally is that most style rules specify properties in very few structs. As stated above, each style struct contains only features that are inherited by default...
Preference reference
m a web page, and it lets them know which part of the page had been selected. The emitting of the oncopy, oncut and onpaste events are controlled by this preference. ...
...een selected. The emitting of the oncopy, oncut and onpaste events are controlled by this preference. javascript.options.showInConsoleThe preference javascript.options.showInConsole controls whether errors or warnings in chrome code are shown in the Error Console.javascript.options.strictTechnical review completed.mail.tabs.drawIn
TitlebarStarting in Thunderbird 17.0, the tabs are drawn in the
title bar. The old behavior can be restored by setting the preference mail.tabs.drawIn
Titlebar to false.nglayout.debug.disable xul fastloadThe preference nglayout.debug.disable_xul_fastload controls whether or not XUL fastload is used.nglayout.debug.disable_xul_cacheTo improve performance, Mozilla caches chrome XUL documents the first time they load for faster loading later. The effect is that the sour...
TPS History Lists
There are two types of history asset lists, one used for adding/modiyfing/verifying history, and the other for deleting history. The history list used for operations other than delete has the following properties: uri: required.
title: optional. The page
title for this uri. visits: required. An array of objects representing visits to the page, each object has the following properties: type: required. An integer value from one of the transition types listed at https://developer.mozilla.org/en/nsINavHistoryService#Constants. date: required. ...
... following properties: type: required. An integer value from one of the transition types listed at https://developer.mozilla.org/en/nsINavHistoryService#Constants. date: required. An integer representing when the visit took place, expressed in hours from the present. For example, 0 is now, -24 is 24 hours in the past. For example: var history_initial = [ { uri: "http://www.google.com/",
title: "Google", visits: [ { type: 1, date: 0 }, { type: 2, date: -1 } ] }, { uri: "http://www.cnn.com/",
title: "CNN", visits: [ { type: 1, date: -1 }, { type: 2, date: -36 } ] }, ]; The history list used for deletions looks different. It's an array of objects, each of which represents a type of history to delete. There are three different types: to ...
Retrieving part of the bookmarks tree
to close the container to free up the resources. Otherwise, it will continue to get observer notifications and update itself, slowing down the whole browser. var rootNode = result.root; rootNode.containerOpen = true; // iterate over the immediate children of this folder and dump to console for (var i = 0; i < rootNode.childCount; i ++) { var node = rootNode.getChild(i); dump("Child: " + node.
title + "\n"); } // close a container after using it! rootNode.containerOpen = false; If you encounter a node with a type of RESULT_TYPE_FOLDER or another type of container, you can open these folders and descend into the hierarchy. You will want to read the section "Using the results" in Places:Query System to understand the different result types. Complete code listing var historyService = Componen...
...rootNode.containerOpen = false; ...
Building the WebLock UI
XML declaration is followed by the root element for the document, which is usually <window/> but for dialog boxes can also be the element <dialog/>. The "shell" for the XUL file, then, looks like this: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <dialog id="weblock_ui" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="Web Lock Manager" persist="screenX screenY" screenX="24" screenY="24"> </dialog> Note that this part of the XUL file also contains a stylesheet declaration, which imports CSS rules and applies them to particular parts of the interface. In Gecko, CSS is used to do virtually all of the presentation of the XUL interface - its color, position, style, and to some extent its behavio...
...ertically). Notice also that when it's clicked, the button executes a JavaScript function called addThisSite(), which we've already defined in the weblock.js file in Client Code Overview above. ...
Packaging WebLock
The WebLock Trigger Script The trigger script is the script placed on a web page that actually initiates an XPInstall installation and calls the installation script that appears in the XPI. The following HTML specifies a complete webpage in which the trigger script is defined as a JavaScript function, installWebLock, that gets called when the user clicks the hyperlink. ...
... The trigger script is the script placed on a web page that actually initiates an XPInstall installation and calls the installation script that appears in the XPI. The following HTML specifies a complete webpage in which the trigger script is defined as a JavaScript function, installWebLock, that gets called when the user clicks the hyperlink. ...
Mozilla internal string guide
n the inline buffer. ... nsAutoString value; GetValue(value); // if the result is less than 64 code units, // then this just saved us an allocation ... Member variables In general, you should use the concrete classes nsString and nsCString for member variables. class Foo { ... ...
...general, you should use the concrete classes nsString and nsCString for member variables. class Foo { ... // these store UTF-8 and UTF-16 values respectively nsCString mLocalName; nsString m
Title; }; Note that the strings are declared directly in the class, not as pointers to strings. Don't do this: class Foo { public: Foo() { mLocalName = new nsCString(); m
Title = new nsString(); } ~Foo() { delete mLocalName; delete m
Title; } private: // these store UTF-8 and UTF-16 values respectively nsCString* mLocalName; nsString* m
Title; }; The above code may appear to save the cost of the string objects, but nsString/nsCString are small objects - the overhead of the allocation outweighs the few bytes you'd save by keeping a pointer. Another...
mozIAsyncHistory
h to retrieve information, identified by either a single place GUID, a single URI, or a JS array of URIs and/or GUIDs. aCallback An object implementing the mozIVisitedStatusCallback.isVisited() method; this method will be called with the results once the request has been completed. updatePlaces() Adds a set of visits for one or more mozIPlaceInfo objects, and updates each mozIPlaceInfo's
title or GUID. Note that this lets you add to history even in Private Browsing mode; if that's not desired you can first check whether the window is in Private Browsing mode. void updatePlaces( in mozIPlaceInfo aPlaceInfo, in mozIVisitInfoCallback aCallback Optional ); Parameters aPlaceInfo The mozIPlaceInfo object[s] containing the information to store or update. This can be a single ob...
...er the window is in Private Browsing mode. void updatePlaces( in mozIPlaceInfo aPlaceInfo, in mozIVisitInfoCallback aCallback Optional ); Parameters aPlaceInfo The mozIPlaceInfo object[s] containing the information to store or update. This can be a single object, or an array of objects. aCallback Optional A mozIVisitInfoCallback object to be notified for each visit addition,
title change, GUID change, or error. If more than one operation is performed for a given visit, only one callback will be given (i.e.
title change and add visit). Exceptions thrown NS_ERROR_INVALID_ARG Passing in NULL for aPlaceInfo. Not providing at least one valid GUID or URI for all mozIPlaceInfo object[s]. Not providing an array or nothing for the visits property of mozIPlaceInf...
mozIRegistry
It's not really about any "registry interface" so much as it's about how Mozilla supports a more dynamic binding between interface clients and the code that actually provides the implementation of those interfaces. It happens that this objective requires storing information about which implementation to use in a place distinct from your source code. ...
... of those interfaces. It happens that this objective requires storing information about which implementation to use in a place distinct from your source code. And it happens that we've chosen, up till now, to store that information in the "Netscape registry" file. Which explains how this information came to be associated with the notion of a "registry." Someday (I hope) this page will be properly
titled so that everybody knows it is the place to come to in order to find out how they are supposed to link together the various XPCOM components that together form the Mozilla browser. The information below is intended to tell you everything you need to know about how to do that. Summary Clients will rely on nsRepository to create instances of a given class. Clients requiring dynamic "binding" of ...
mozIVisitInfoCallback
eInfo aPlaceInfo);Obsolete since Gecko 8.0 Methods handleError() Called when a mozIPlaceInfo couldn't be processed. void handleError( in nsresult aResultCode, in mozIPlaceInfo aPlaceInfo ); Parameters aResultCode nsresult indicating the reason why the change failed. aPlaceInfo The information that was unable to be processed. handleResult() Called for each visit added,
title change, or GUID change when passed to mozIAsyncHistory.updatePlaces(). If more than one operation is done for a given visit, this method is only called once (for all changes at once). void handleResult( in mozIPlaceInfo aPlaceInfo ); Parameters aPlaceInfo The information that was entered into the database. onComplete() Obsolete since Gecko 8.0 (Firefox 8.0 / Thunder...
...aces(). If more than one operation is done for a given visit, this method is only called once (for all changes at once). void handleResult( in mozIPlaceInfo aPlaceInfo ); Parameters aPlaceInfo The information that was entered into the database. onComplete() Obsolete since Gecko 8.0 (Firefox 8.0 / Thunderbird 8.0 / SeaMonkey 2.5) Called for each visit added,
title change, or GUID change when passed to mozIAsyncHistory.updatePlaces(). void onComplete( in nsresult aResultCode, in mozIPlaceInfo aPlaceInfo ); Parameters aResultCode nsresult of the change indicating success or failure reason. aPlaceInfo The information that was being entered into the database. Notes This method was replaced by the separate handleResult() and handleError()...
nsIDocShell
te an instance directly. Instead, retrieve an nsIDocShell from a browser or other document container element. Note that out-of-process browsers do not have an nsIDocShell; instead you can access the nsIDocShell object from a frame script. ...
...bject to the docshell. void addSessionStorage( in nsIPrincipal principal, in nsIDOMStorage storage ); Parameters principal The principal to use for the new storage object. storage The storage object to add. addState() Do either a history.pushState() or history.replaceState() operation, depending on the value of aReplace. void addState( in nsIVariant aData, in DOMString a
Title, in DOMString aURL, in boolean aReplace ); Parameters aData The state object to pass to the popstate event. It must be possible to serialise this in less than 640k characters. a
Title Gecko currently ignores this parameter. aURL The URL associated with the new history entry. For instance, if the user tries to reload the page, then this is the URL that will be reloaded...
nsIGlobalHistory2
was split off from nsIGlobalHistory during the transition to toolkit interfaces. Inherits from: nsISupports Last changed in Gecko 1.7 This interface replaces and deprecates nsIGlobalHistory Method overview void addURI(in nsIURI aURI, in boolean aRedirect, in boolean aToplevel, in nsIURI aReferrer); boolean isVisited(in nsIURI aURI); void setPage
Title(in nsIURI aURI, in AString a
Title); Methods addURI() Add a URI to global history. Note: Docshell will not filter out URI schemes like chrome:, data:, about: and view-source:. Embedders should consider filtering out these schemes and others, for example mailbox:, for the main nsIURI and the referrer. void addURI( in nsIURI aURI, in boolean aRedirect, in boolean aToplevel, in nsIU...
...on; this is true for the original URI which is redirected. aToplevel Whether the URI is loaded in a top-level window. aReferrer The URI of the referring page. isVisited() Checks to see whether the given URI is in history. boolean isVisited( in nsIURI aURI ); Parameters aURI The nsIURI of the page. Return value true if a URI has been visited. setPage
Title() Set the page
title for the given uri. URIs that are not already in global history will not be added. void setPage
Title( in nsIURI aURI, in AString a
Title ); Parameters aURI The nsIURI for which to set to the
title. a
Title The page
title. See also nsIGlobalHistory3 ...
nsIHTMLEditor
HTML(in AString aSourceToInsert); void selectElement(in nsIDOMElement aElement); void setBackgroundColor(in AString aColor); void setBodyAttribute(in AString aAttr, in AString aValue); void setCaretAfterElement(in nsIDOMElement aElement); void setCSSInlineProperty(in nsIAtom aProperty, in AString aAttribute, in AString aValue); void setDocument
Title(in AString a
Title); void setInlineProperty(in nsIAtom aProperty, in AString aAttribute, in AString aValue); void setParagraphFormat(in AString aParagraphFormat); void updateBaseURL(); Attributes Attribute Type Description isCSSEnabled boolean A boolean which is true is the HTMLEditor has been instantiated with CSS knowledge and if t...
...om aProperty, in AString aAttribute, in AString aValue ); Parameters aProperty The property to set on the selection. aAttribute The attribute of the property, if applicable. May be null. Example: aProperty="font", aAttribute="color" aValue If aAttribute is not null, the value of the attribute. May be null. Example: aProperty="font", aAttribute="color", aValue="0x00FFFF" setDocument
Title() Set the documents
title. void setDocument
Title( in AString a
Title ); Parameters a
Title setInlineProperty() void setInlineProperty( in nsIAtom aProperty, in AString aAttribute, in AString aValue ); Parameters aProperty aAttribute aValue setParagraphFormat() Insert a block paragraph tag around selection. void setParagraphFormat( in AString aParagraphForm...
nsIJumpListBuilder
dToRecentDocs shell api. JUMPLIST_CATEGORY_FREQUENT 2 Frequent lists are based on Window's recent document lists. The lists are generated automatically by Windows. Applications that use recent or frequent lists should keep document use tracking up to date by calling the SHAddToRecentDocs shell api. JUMPLIST_CATEGORY_CUSTOMLIST 3 Custom lists can be made up of tasks, links, and separators. The
title of of the list is passed through the optional string parameter of addBuildList. Methods abortListBuild() Aborts and clears the current jump list build. void abortListBuild(); Parameters None. addListToBuild() Adds a list and if required, a set of items for the list. boolean addListToBuild( in short aCatType, in nsIArray items, Optional in AString catName Optional ); Parameters aCatTyp...
...ent jump list build. void abortListBuild(); Parameters None. addListToBuild() Adds a list and if required, a set of items for the list. boolean addListToBuild( in short aCatType, in nsIArray items, Optional in AString catName Optional ); Parameters aCatType The type of list to add. items Optional An array of nsIJumpListItem items to add to the list. catName Optional For custom lists, the
title of the list. Return value true if the operation completed successfully. Exceptions thrown NS_ERROR_UNEXPECTED On internal errors. NS_ERROR_ILLEGAL_VALUE If an item is added that was removed since the last commit. NS_ERROR_INVALID_ARG If incorrect parameters are passed for a particular category or item type. commitListBuild() Commits the current jump list build to the Taskbar. boolean commitLis...
nsIMsgIncomingServer
gFilterList getFilterList(in nsIMsgWindow aMsgWindow); long getIntAttribute(in string name); long getIntValue(in string attr); nsIMsgFolder getMsgFolderFromURI(in nsIMsgFolder aFolderResource, in ACString aURI); void getNewMessages(in nsIMsgFolder aFolder, in nsIMsgWindow aMsgWindow, in nsIUrlListener aUrlListener); ACString getPasswordWithUI(in AString aPromptString, in AString aPrompt
Title, in nsIMsgWindow aMsgWindow, out boolean okayValue); AString getUnicharAttribute(in string name); AString getUnicharValue(in string attr); boolean isNewHdrDuplicate(in nsIMsgDBHdr aNewHdr); void onUserOrHostNameChanged(in ACString oldName, in ACString newName); void performBiff(in nsIMsgWindow aMsgWindow); void performExpand(in nsIMsgWindow aMsgWindow); void removeFiles(); void s...
...ription getNewMessages() void getNewMessages( in nsIMsgFolder aFolder, in nsIMsgWindow aMsgWindow, in nsIUrlListener aUrlListener ); Parameters aFolder Missing Description aMsgWindow Missing Description aUrlListener Missing Description Exceptions thrown Missing Exception Missing Description getPasswordWithUI() ACString getPasswordWithUI( in AString aPromptString, in AString aPrompt
Title, in nsIMsgWindow aMsgWindow, out boolean okayValue ); Parameters aPromptString Missing Description aPrompt
Title Missing Description aMsgWindow Missing Description okayValue Missing Description Return value Missing Description Exceptions thrown Missing Exception Missing Description getUnicharAttribute() these generic getter / setters, useful for extending mailnews note, these attributes p...
nsIMsgWindow
eaMonkey 2.5) Implemented by: @mozilla.org/messenger/msgwindow;1. To create an instance, use: msgWindow = Components.classes["@mozilla.org/messenger/msgwindow;1"] .createInstance(Components.interfaces.nsIMsgWindow); In Thunderbird the default message window is stored in the global variable msgWindow. Method overview void displayHTMLInMessagePane(in AString
title, in AString body, in boolean clearMsgHdr); void StopUrls(); void closeWindow(); Attributes Attribute Type Description windowCommands nsIMsgWindowCommands This allows the backend code to send commands to the UI, such as clearMsgPane. statusFeedback nsIMsgStatusFeedback This a...
... place to clear it. domWindow nsIDOMWindow The message window's global chrome window object. Set this to initialize the rootDocShell. Methods displayHTMLInMessagePane() Loads the specified HTML in the message pane. This is equivalent to calling LoadURI on the nsIWebNavigation object with a data: URL specifying the HTML. void displayHTMLInMessagePane(in AString
title, in AString body, in boolean clearMsgHdr); Parameters
title Not used. body The HTML to display in the message pane. Note that the HTML is wrapped in <html> and <body> tags for you. clearMsgHdr Whether or not the existing message pane and header should be cleared before the HTML is displayed. S...
nsINavHistoryResultNode
1.0 66 Introduced Gecko 1.9 Inherits from: nsISupports Last changed in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1) Attributes Attribute Type Description accessCount unsigned long Total number of times the URI has been accessed. ...
...he page visit occurred. For URIs, this is the most recent time at which the URI was visited. Even if you ask for all URIs for a given date range long ago, this might contain today's date if the URI was visited today. For hosts, or other node types with children, this is the most recent access time for any of the children. For days, this is midnight on the morning of the day in question in UTC.
title AUTF8String
Title of the web page or of the node's grouping (day, host, folder, and so on.). Read only. type unsigned long Identifies the type of node. You can use QueryInterface to access the corresponding specialized result node interface. Read only. uri AUTF8String The URI of the resource represented by the node. For visits and URLs, this is the URL of the page. For folders and queries, th...
nsITXTToHTMLConv
e allows you to modify the conversion from plain text to HTML. Inherits from: nsIStreamConverter Last changed in Gecko 1.8 (Firefox 1.5 / Thunderbird 1.5 / SeaMonkey 1.0) Implemented by "@mozilla.org/streamconv;1?from=text/plain&to=text/html". You should normally obtain an instance via the nsIStreamConverterService interface. ...
... void preFormatHTML(in boolean value); void set
Title(in wstring text); Prior versions of the interface named the methods using the InitialCaps style instead of the interCaps style. Methods preFormatHTML() Specifies whether or not to wrap the resulting HTML in an <pre> block. void preFormatHTML( in boolean value ); Parameters value true to wrap the resulting HTML in a <pre> block. set
Title() Sets the
title to use on the resulting HTML document. void set
Title( in wstring text ); Parameters text
Title to set for the HTML document. ...
nsITransferable
flect the status of the context in which the transferable was created. Native code only! requestingNode nsIDOMNode The source DOM Node this transferable was created from. Native code only! Note: Currently, this can only be used on Windows (in order to support network principal information in drag operations). Constants kFlavorHasDataProvider (that
title needs to be better) Constant Value Description kFlavorHasDataProvider 0 A description is needed here. Common MIME types Some of these need better descriptions, especially the Mozilla-specific ones. Constant Value Description kTextMime text/plain Plain text. kUnicodeMime text/unicode Unicode text. kMo...
...me image/png PNG image. kJPEGImageMime image/jpeg JPEG image. kJPGImageMime image/jpg JPEG image. kGIFImageMime image/gif GIF image. kFileMime application/x-moz-file An arbitrary file (is this an nsIFile?) kURLMime text/x-moz-url A Mozilla URL object; this is a text string containing the URL, a newline (\n), then the
title of the page. kURLDataMime text/x-moz-url-data A string containing only a URL. kURLDescriptionMime text/x-moz-url-desc A string containing only a description. kURLPrivateMime text/x-moz-url-priv The same as kURLDataMIme, except intended for private use only. kNativeImageMime application/x-moz-nativeimage An image in Gecko's native interna...
nsPIPromptService
dexes of GetInt(), SetInt(), GetString() and SetString() of the nsIDialogParamBlock interface but they are defined on in C++. The indexes for GetString() and SetString() are: eMsg The value is 0. This is the message text of the dialog. eCheckboxMsg The value is 1. This is the label text of a checkbox on the dialog. eIconClass The value is 2. This is the class attribute value of the icon image. e
TitleMessage The value is 3. This is the heading of the message. eEditfield1Msg The value is 4. This is the label text of the first text field on the dialog. eEditfield2Msg The value is 5. This is the label text of the second text field on the dialog. eEditfield1Value The value is 6. This is the default value of the first text field. This is also used for the result of the dialog. eEditfield2Value The ...
...d text field. This is also used for the result of the dialog. eButton0Text The value is 8. This is the label of the first button on the dialog. eButton1Text The value is 9. This is the label of the second button on the dialog. eButton2Text The value is 10. This is the label of the third button on the dialog. eButton3Text The value is 11. This is the label of the forth button on the dialog. eDialog
Title The value is 12. This is the
title of the dialog. eOpeningSound Obsolete since Gecko 1.9.2 The value is 13. This is the system sound name which should be played when the dialog is shown. See also nsISound.playSystemSound(). This is obsolete on Gecko 1.9.2 and later. You should use eSoundEventId instead. The indexes for GetInt() and SetInt() are: eButtonPressed The value is 0. This is used for ...
Working with windows in chrome code
is: var win = window.open("chrome://myextension/content/about.xul", "aboutMyExtension", "chrome,centerscreen"); The first parameter to window.open is the URI of the XUL file that describes the window and its contents. The second parameter is the window's name; the name can be used in links or forms as the target attribute. This is different from the user-visible window
title, which is specified using XUL. The third, and optional, parameter is a list of special window features the window should have. The window.openDialog function works similarly, but lets you specify optional arguments that can be referenced from the JavaScript code. It also handles window features a little differently, including always assuming the dialog feature is specified. From XPCOM componen...
...ypassing XPCNativeWrapper to work with content JavaScript directly can lead to security problems. See Interaction between privileged and non-privileged pages if you need to interact with the content page. The content shortcut In case of <browser type="content-primary" />, you can use the content shortcut property to accesss the Window object of the content document. For example: // alerts the
title of the document displayed in the content-primary widget alert(content.document.
title); For example, you can use content.document in a browser.xul overlay to access the web page in the selected tab in a Firefox window. Some examples use _content instead of content. The former has been deprecated for a while, and you should use content in the new code. Accessing a document in the sidebar Firef...
Using js-ctypes
Line 6 declares msgBox() to be a method that calls the Windows function MessageBoxW. Line 15 calls the msgBox() routine, which displays the alert. The last thing we do is call lib.close() to close the library when we're done using it. Instead of defining the whole path, you may also just give the file name. ABOUT DECL...
...rary/mac/documentation/CoreFoundation/Reference/CFUserNotificationRef/index.html#//apple_ref/c/func/CFUserNotificationDisplayNotice * SInt32 CFUserNotificationDisplayNotice ( * CFTimeInterval timeout, * CFOptionFlags flags, * CFURLRef iconURL, * CFURLRef soundURL, * CFURLRef localizationURL, * CFStringRef alertHeader, * CFStringRef alertMessage, * CFStringRef defaultButton
Title * ); */ var CFUserNotificationDisplayNotice = libcf.declare("CFUserNotificationDisplayNotice", ctypes.default_abi, SInt32, // return CFTimeInterval, // timeout CFOptionFlags, // flags CFURLRef, // iconURL CFURLRef, // soundURL CFURLRef, // localizationURL CFStringRef, // alertHeader CFStringRef, // alertMessage CFStringRef // defaultButton
Title ); /* https://developer.a...
Plug-in Basics - Plugins
See the Mozilla ActiveX project page in the Plug-in References section below for more information about embedding ActiveX controls in plug-ins or embedding plug-ins in ActiveX applications. The following examples demonstrate this use of nested object elements with markup more congenial to Gecko included as children of the parent object element. ...
...e Plug-in References section below for more information about embedding ActiveX controls in plug-ins or embedding plug-ins in ActiveX applications. The following examples demonstrate this use of nested object elements with markup more congenial to Gecko included as children of the parent object element. ...
Web Console Helpers - Firefox Developer Tools
a list of the values on that object; serves as a companion to keys(). Please refer to the Console API for more information about logging from content. Variables tempN The "Use in Console" option in the Inspector generates a variable for a node named temp0, temp1, temp2, etc. referencing the node. ...
...erates a variable for a node named temp0, temp1, temp2, etc. referencing the node. Examples Looking at the contents of a DOM node Let's say you have a DOM node with the ID "
title". In fact, this page you're reading right now has one, so you can open up the Web Console and try this right now. Let's take a look at the contents of that node by using the $() and inspect() functions: inspect($("#
title")) This automatically generates rich output for the object, showing you the contents of the DOM node that matches the CSS selector "#
title", which is of course the element with ID "
title". You can use the up- and down-arrow keys to navigate through the output, the right-arrow key to expand an item, and the left-arrow key to collapse it. ...
AudioContext.createMediaStreamDestination() - Web APIs
opping the MediaRecorder causes the dataavailable event to fire, and the event data is pushed into the chunks array. After that, the stop event fires, a new blob is made of type opus -- which contains the data in the chunks array, and a new window (tab) is then opened that points to a URL created from the blob. From here, you can play and save the opus file. ...
...ilable event to fire, and the event data is pushed into the chunks array. After that, the stop event fires, a new blob is made of type opus -- which contains the data in the chunks array, and a new window (tab) is then opened that points to a URL created from the blob. From here, you can play and save the opus file. ...
Basic usage of canvas - Web APIs
{ var ctx = canvas.getContext('2d'); // drawing code here } else { // canvas-unsupported code here } A skeleton template Here is a minimalistic template, which we'll be using as a starting point for later examples. Note: it is not good practice to embed a script inside HTML. We do it here to keep the example concise. ...
...etContext('2d'); // drawing code here } else { // canvas-unsupported code here } A skeleton template Here is a minimalistic template, which we'll be using as a starting point for later examples. Note: it is not good practice to embed a script inside HTML. We do it here to keep the example concise. ...
ContentIndex.getAll() - Web APIs
ace returns a Promise that resolves with an iterable list of content index entries. Syntax var indexedContent = ContentIndex.getAll(); Parameters This method receives no parameters. Return value Returns a Promise that resolves with an Array of ContentDescription items. ContentDescription Each item returned is an Object containing the following data: id: A unique String identifier.
title: A String
title for the item. Used in user-visible lists of content.
title: A String
title of the item. Used in user-visible lists of content. description: A String description of the item. Used in user-visible lists of content. url: A String containing the url of the corresponding HTML document. Needs to be under the scope of the current service worker. category: Optional A String defini...
... Unknown Initial definition. ...
ContentIndex - Web APIs
// feature detection if ('index' in registration) { // Content Index API functionality const contentIndex = registration.index; } Adding to the Content Index Here we're declaring an item in the correct format and creating an asynchronous function which uses the add() method to register it with the content index. ...
... async function unregisterContent(article) { // reference registration const registration = await navigator.serviceWorker.ready; // feature ...
Content Index API - Web APIs
// feature detection if ('index' in registration) { // Content Index API functionality const contentIndex = registration.index; } Adding to the Content Index Here we're declaring an item in the correct format and creating an asynchronous function which uses the add() method to register it with the content index. ...
... async function unregisterContent(article) { // reference registration const registration = await navigator.serviceWorker.ready; // feature ...
DataTransfer.effectAllowed - Web APIs
ninitialized The default value when the effect has not been set, equivalent to all. Assigning any other value to effectAllowed has no effect and the old value is retained. Internet Explorer will change the value to be lowercased; thus, linkMove will become linkmove, and so on. Example This example shows the use of the effectAllowed and dropEffect properties. ...
...valent to all. Assigning any other value to effectAllowed has no effect and the old value is retained. Internet Explorer will change the value to be lowercased; thus, linkMove will become linkmove, and so on. Example This example shows the use of the effectAllowed and dropEffect properties. ...
DataTransfer.items - Web APIs
list is empty. Syntax itemList = dataTransfer.items; Return value A DataTransferItemList object containing DataTransferItem objects representing the items being dragged in a drag operation, one list item for each object being dragged. If the drag operation had no data, the list is empty. Example This example shows the use of the items and types properties. ...
... Return value A DataTransferItemList object containing DataTransferItem objects representing the items being dragged in a drag operation, one list item for each object being dragged. If the drag operation had no data, the list is empty. Example This example shows the use of the items and types properties. ...
DataTransfer.setData() - Web APIs
t/uri-list. Syntax void dataTransfer.setData(format, data); Arguments format A DOMString representing the type of the drag data to add to the drag object. data A DOMString representing the data to add to the drag object. Return value void Example This example shows the use of the DataTransfer object's getData(), setData() and clearData() methods. ...
...ts format A DOMString representing the type of the drag data to add to the drag object. data A DOMString representing the data to add to the drag object. Return value void Example This example shows the use of the DataTransfer object's getData(), setData() and clearData() methods. ...
DataTransfer.types - Web APIs
xt"). Syntax dataTransfer.types; Return value An array of the data formats used in the drag operation. Each format is string. If the drag operation included no data, this list will be empty. If any files are included in the drag operation, then one of the types will be the string Files. Example This example shows the use of the types and items properties. ...
...ray of the data formats used in the drag operation. Each format is string. If the drag operation included no data, this list will be empty. If any files are included in the drag operation, then one of the types will be the string Files. Example This example shows the use of the types and items properties. ...
DataTransferItem.webkitGetAsEntry() - Web APIs
one is created, which responds to the drop event by scanning through the dropped files and directories, outputting a hierarchical directory listing. HTML content The HTML establishes the drop zone itself, which is a <div> element with the ID "dropzone", and an unordered list element with the ID "listing". ...
...Drag files and/or directories to the box below!</p> <div id="dropzone"> <div id="box
title"> Drop Files Here </div> </div> <h2>Directory tree:</h2> <ul id="listing"> </ul> CSS content The styles used by the example are shown here. #dropzone { text-align: center; width: 300px; height: 100px; margin: 10px; padding: 10px; border: 4px dashed red; border-radius: 10px; } #box
title { display: table-cell; vertical-align: middle; text-align: center; color: black; font: bold 2em "Arial", sans-serif; width: 300px; height: 100px; } body { font: 14px "Arial", sans-serif; } JavaScript content First, let's look at the recursive scanFiles() function. This function takes as input a FileSystemEntry representing an entry in the file system to be scanned and processed...
Document.createElement() - Web APIs
An optional ElementCreationOptions object, containing a single property named is, whose value is the tag name of a custom element previously defined via customElements.define(). See Web component example for more details. Return value The new Element. Examples Basic example This creates a new <div> and inserts it before the element with the ID "div1". ...
...s object, containing a single property named is, whose value is the tag name of a custom element previously defined via customElements.define(). See Web component example for more details. Return value The new Element. Examples Basic example This creates a new <div> and inserts it before the element with the ID "div1". ...
Document.createTextNode() - Web APIs
Creates a new Text node. This method can be used to escape HTML characters. Syntax var text = document.createTextNode(data); text is a Text node. data is a string containing the data to be put in the text node. ...
... Creates a new Text node. This method can be used to escape HTML characters. Syntax var text = document.createTextNode(data); text is a Text node. data is a string containing the data to be put in the text node. ...
Document.getElementsByTagName() - Web APIs
mentsByTagName() and the functionally identical Element.getElementsByTagName(), which starts the search at a specific element within the DOM tree. Clicking the buttons uses getElementsByTagName() to count the descendant paragraph elements of a particular parent (either the document itself or one of two nested <div> elements). ...
...y identical Element.getElementsByTagName(), which starts the search at a specific element within the DOM tree. Clicking the buttons uses getElementsByTagName() to count the descendant paragraph elements of a particular parent (either the document itself or one of two nested <div> elements). ...
Document.getElementsByTagNameNS() - Web APIs
h the DOM from that parent element, looking for child elements matching the tag name parameter. Note that when the node on which getElementsByTagName is invoked is not the document node, in fact the element.getElementsByTagNameNS method is used. To use the following example, just copy/paste it into a new file saved with the .xhtml extension. ...
...oking for child elements matching the tag name parameter. Note that when the node on which getElementsByTagName is invoked is not the document node, in fact the element.getElementsByTagNameNS method is used. To use the following example, just copy/paste it into a new file saved with the .xhtml extension. ...
Document.styleSheetSets - Web APIs
Duplicates are dropped from the list (using a case-sensitive comparison). ...
...Duplicates are dropped from the list (using a case-sensitive comparison). ...
Document.write() - Web APIs
es a string of text to a document stream opened by document.open(). Note: Because document.write() writes to the document stream, calling document.write() on a closed (loaded) document automatically calls document.open(), which will clear the document. Syntax document.write(markup); Parameters markup A string containing the text to be written to the document. Example <html> <head> <
title>Write example</
title> <script> function newContent() { document.open(); document.write("<h1>Out with the old, in with the new!</h1>"); document.close(); } </script> </head> <body onload="newContent();"> <p>Some original document content.</p> </body> </html> Notes The text you write is parsed into the document's structure model. In the example above, the h1 ...
...mes a node in the document. Writing to a document that has already loaded without calling document.open() will automatically call document.open(). After writing, call document.close() to tell the browser to finish loading the page. If the document.write() call is embedded within an inline HTML <script> tag, then it will not call document.open(). For example: <script> document.write("<h1>Main
title</h1>") </script> Note: document.write() and document.writeln do not work in XHTML documents (you'll get an "Operation is not supported" [NS_ERROR_DOM_NOT_SUPPORTED_ERR] error in the error console). This happens when opening a local file with the .xhtml file extension or for any document served with an application/xhtml+xml MIME type. More information is available in the W3C XHTML FAQ. Note: Us...
Introduction to the DOM - Web APIs
n retrieve, set, or otherwise manipulate, and the web user interface necessary to call those functions from the browser. You can use this test page or create a similar one to test the DOM interfaces you are interested in and see how they work on the browser platform. You can update the contents of the test() function as needed, create more buttons, or add elements as necessary. ...
...or otherwise manipulate, and the web user interface necessary to call those functions from the browser. You can use this test page or create a similar one to test the DOM interfaces you are interested in and see how they work on the browser platform. You can update the contents of the test() function as needed, create more buttons, or add elements as necessary. ...
Traversing an HTML table with JavaScript and DOM Interfaces - Web APIs
as in the above figure). The following source code is a commented version for the sample1.html. At the end of the start function, there is a new line of code. The table's border property was set using another DOM method, setAttribute(). setAttribute() has two arguments: the attribute name and the attribute value. You can set any attribute of any element using the setAttribute method. ...
... sample1.html. At the end of the start function, there is a new line of code. The table's border property was set using another DOM method, setAttribute(). setAttribute() has two arguments: the attribute name and the attribute value. You can set any attribute of any element using the setAttribute method. ...
Element.attributes - Web APIs
<p> element in the document var para = document.getElementsByTagName("p")[0]; var atts = para.attributes; Enumerating elements attributes Numerical indexing is useful for going through all of an element's attributes. The following example runs through the attribute nodes for the element in the document with id "paragraph", and prints each attribute's value. ...
...t var para = document.getElementsByTagName("p")[0]; var atts = para.attributes; Enumerating elements attributes Numerical indexing is useful for going through all of an element's attributes. The following example runs through the attribute nodes for the element in the document with id "paragraph", and prints each attribute's value. ...
Element.scrollWidth - Web APIs
fter. If the element's content can fit without a need for horizontal scrollbar, its scrollWidth is equal to clientWidth This property will round the value to an integer. If you need a fractional value, use element.getBoundingClientRect(). Syntax var xScrollWidth = element.scrollWidth; xScrollWidth is the width of the content of element in pixels. ...
...ement's content can fit without a need for horizontal scrollbar, its scrollWidth is equal to clientWidth This property will round the value to an integer. If you need a fractional value, use element.getBoundingClientRect(). Syntax var xScrollWidth = element.scrollWidth; xScrollWidth is the width of the content of element in pixels. ...
Element.setCapture() - Web APIs
interCapture instead, from the Pointer Events API. Syntax element.setCapture(retargetToElement); retargetToElement If true, all events are targeted directly to this element; if false, events can also fire at descendants of this element. Example In this example, the current mouse coordinates are drawn while you mouse around after clicking and holding down on an element. ...
...e Pointer Events API. Syntax element.setCapture(retargetToElement); retargetToElement If true, all events are targeted directly to this element; if false, events can also fire at descendants of this element. Example In this example, the current mouse coordinates are drawn while you mouse around after clicking and holding down on an element. ...
Comparison of Event Targets - Web APIs
osedTarget Event.webidl The original non-native target of the event before composition from Shadow DOM. ...
... original non-native target of the event before composition from Shadow DOM. ...
FileSystemDirectoryReader.readEntries() - Web APIs
one is created, which responds to the drop event by scanning through the dropped files and directories, outputting a hierarchical directory listing. HTML content The HTML establishes the drop zone itself, which is a <div> element with the ID "dropzone", and an unordered list element with the ID "listing". ...
...Drag files and/or directories to the box below!</p> <div id="dropzone"> <div id="box
title"> Drop Files Here </div> </div> <h2>Directory tree:</h2> <ul id="listing"> </ul> CSS content The styles used by the example are shown here. #dropzone { text-align: center; width: 300px; height: 100px; margin: 10px; padding: 10px; border: 4px dashed red; border-radius: 10px; } #box
title { display: table-cell; vertical-align: middle; text-align: center; color: black; font: bold 2em "Arial", sans-serif; width: 300px; height: 100px; } body { font: 14px "Arial", sans-serif; } JavaScript content First, let's look at the recursive scanFiles() function. This function takes as input a FileSystemEntry representing an entry in the file system to be scanned and processed...
GlobalEventHandlers.ondrag - Web APIs
A global event handler for the drag event. Syntax var dragHandler = targetElement.ondrag; Return value dragHandler The drag event handler for element targetElement. Example This example includes the use of the ondrag attribute handler to set an element's drag event handler. ...
... A global event handler for the drag event. Syntax var dragHandler = targetElement.ondrag; Return value dragHandler The drag event handler for element targetElement. Example This example includes the use of the ondrag attribute handler to set an element's drag event handler. ...
GlobalEventHandlers.ondragend - Web APIs
A global event handler for the dragend event. Syntax var dragendHandler = targetElement.ondragend; Return value dragendHandler The dragend event handler for element targetElement. Example This example shows two ways to use the ondragend attribute handler to set an element's dragend event handler. ...
... event handler for the dragend event. Syntax var dragendHandler = targetElement.ondragend; Return value dragendHandler The dragend event handler for element targetElement. Example This example shows two ways to use the ondragend attribute handler to set an element's dragend event handler. ...
GlobalEventHandlers.ondragenter - Web APIs
A global event handler for the dragenter event. Syntax var dragenterHandler = targetElement.ondragenter; Return value dragenterHandler The dragenter event handler for element targetElement. Example This example demonstrates using the ondragenter attribute handler to set an element's dragenter event handler. ...
...ler for the dragenter event. Syntax var dragenterHandler = targetElement.ondragenter; Return value dragenterHandler The dragenter event handler for element targetElement. Example This example demonstrates using the ondragenter attribute handler to set an element's dragenter event handler. ...
GlobalEventHandlers.ondragexit - Web APIs
re building a drag-and-drop feature for a website please see the ondragleave event listener instead. Syntax var dragexitHandler = targetElement.ondragexit; Return value dragexitHandler The dragexit event handler for element targetElement. Example This example demonstrates using the ondragexit attribute handler to set an element's dragexit event handler. ...
...ndragleave event listener instead. Syntax var dragexitHandler = targetElement.ondragexit; Return value dragexitHandler The dragexit event handler for element targetElement. Example This example demonstrates using the ondragexit attribute handler to set an element's dragexit event handler. ...
GlobalEventHandlers.ondragleave - Web APIs
A global event handler for the dragleave event. Syntax var dragleaveHandler = targetElement.ondragleave; Return value dragleaveHandler The dragleave event handler for element targetElement. Example This example demonstrates using the ondragleave attribute handler to set an element's dragleave event handler. ...
...ler for the dragleave event. Syntax var dragleaveHandler = targetElement.ondragleave; Return value dragleaveHandler The dragleave event handler for element targetElement. Example This example demonstrates using the ondragleave attribute handler to set an element's dragleave event handler. ...
GlobalEventHandlers.ondragover - Web APIs
A global event handler for the dragover event. Syntax var dragoverHandler = targetElement.ondragover; Return value dragoverHandler The dragover event handler for element targetElement. Example This example demonstrates using the ondragover attribute handler to set an element's dragover event handler. ...
...bal event handler for the dragover event. Syntax var dragoverHandler = targetElement.ondragover; Return value dragoverHandler The dragover event handler for element targetElement. Example This example demonstrates using the ondragover attribute handler to set an element's dragover event handler. ...
GlobalEventHandlers.ondragstart - Web APIs
A global event handler for the dragstart event. Syntax var dragstartHandler = targetElement.ondragstart; Return value dragstartHandler The dragstart event handler for element targetElement. Example This example demonstrates using the ondragstart attribute handler to set an element's dragstart event handler. ...
...nt handler for the dragstart event. Syntax var dragstartHandler = targetElement.ondragstart; Return value dragstartHandler The dragstart event handler for element targetElement. Example This example demonstrates using the ondragstart attribute handler to set an element's dragstart event handler. ...
GlobalEventHandlers.ondrop - Web APIs
A global event handler for the drop event. Syntax var dropHandler = targetElement.ondrop; Return value dropHandler The drop event handler for element targetElement. Example This example demonstrates the use of the ondrop attribute to define an element's drop event handler. ...
... A global event handler for the drop event. Syntax var dropHandler = targetElement.ondrop; Return value dropHandler The drop event handler for element targetElement. Example This example demonstrates the use of the ondrop attribute to define an element's drop event handler. ...
GlobalEventHandlers.onload - Web APIs
xin is an EventHandler that processes load events on a Window, XMLHttpRequest, <img> element, etc. The load event fires when a given resource has loaded. Syntax target.onload = functionRef; Value functionRef is the handler function to be called when the window's load event fires. ...
...ler that processes load events on a Window, XMLHttpRequest, <img> element, etc. The load event fires when a given resource has loaded. Syntax target.onload = functionRef; Value functionRef is the handler function to be called when the window's load event fires. ...
HTMLFormElement - Web APIs
m's properties document.forms["formA"].elements['form-info'].value = info; // document.forms["formA"]['form-info'].value would also work } function setFormInfo(f){ // Argument should be a form element reference. ...
....elements['form-info'].value = info; // document.forms["formA"]['form-info'].value would also work } function setFormInfo(f){ // Argument should be a form element reference. ...
Recommended Drag Types - Web APIs
ww.mozilla.org"); As usual, set the text/plain type last, as a fallback for the text/uri-list type. Note: the URL type is uri-list with an I, not an L. To drag multiple links, separate each link inside the text/uri-list data with a CRLF linebreak. Lines that begin with a number sign (#) are comments, and should not be considered URLs. You can use comments to indicate the purpose of a URL, the
title associated with a URL, or other data. The text/plain fallback for multiple links should include all URLs, but no comments. For example, this sample text/uri-list data contains two links and a comment: http://www.mozilla.org #A second link http://www.example.com When retrieving a dropped link, ensure you handle when multiple links are dragged, including any comments. For convenience, the sp...
...the first valid link within data for the text/uri-list type. Do not add data with the URL type -- attempting to do so will set the value of the text/uri-list type instead. var url = event.dataTransfer.getData("URL"); You may also see data with the Mozilla-specific type text/x-moz-url. If it appears, it should appear before the text/uri-list type. It holds the URLs of links followed by their
titles, separated by a linebreak. For example: http://www.mozilla.org Mozilla http://www.example.com Example Dragging HTML and XML HTML content may use the text/html type. The data for this type should be serialized HTML source code. For example, it would be suitable to set its data to the value of the innerHTML property of an element. XML content may use the text/xml type, but ensure that the dat...
History - Web APIs
nstance, specifying -1 when there are no previously-visited pages in the session history), this method silently has no effect. Calling go() without parameters or a value of 0 reloads the current page. Internet Explorer lets you specify a string, instead of an integer, to go to a specific URL in the history list. pushState() Pushes the given data onto the session history stack with the specified
title (and, if provided, URL). The data is treated as opaque by the DOM; you may specify any JavaScript object that can be serialized. Note that all browsers but Safari currently ignore the
title parameter. For more information, see Working with the History API. replaceState() Updates the most recent entry on the history stack to have the specified data,
title, and, if provided, URL. The data is tre...
...For more information, see Working with the History API. Specifications Specification Status Comment HTML Living StandardThe definition of 'History' in that specification. Living Standard Adds the scrollRestoration attribute. HTML5The definition of 'History' in that specification. ...
IDBCursor.delete() - Web APIs
action is inactive. ReadOnlyError The transaction mode is read-only. InvalidStateError The cursor was created using IDBIndex.openKeyCursor, is currently being iterated, or has iterated past its end. Example In this simple fragment we create a transaction, retrieve an object store, then use a cursor to iterate through all the records in the object store. If the album
Title of the current cursor is "Grace under pressure", we delete that entire record using var request = cursor.delete();. The cursor does not require us to select the data based on a key; we can just grab all of it. Also note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo. For a complete working example, see our IDBCursor ex...
... For a complete working example, see our IDBCursor example (view example live.) function deleteResult() { list.innerHTML = ''; var transaction = db.transaction(['rushAlbumList'], 'readwrite'); var objectStore = transaction.objectStore('rushAlbumList'); objectStore.openCursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { if(cursor.value.album
Title === 'Grace under pressure') { var request = cursor.delete(); request.onsuccess = function() { console.log('Deleted that mediocre album from 1984. Even Power windows is better.'); }; } else { var listItem = document.createElement('li'); listItem.innerHTML = '<strong>' + cursor.value.album
Title + '</strong>, ' + cursor.value.year; list...
IDBCursor.key - Web APIs
's key can be any data type. Note: This feature is available in Web Workers. Syntax var key = cursor.key; Value A value of any type. Example In this simple fragment we create a transaction, retrieve an object store, then use a cursor to iterate through all the records in the object store. Within each iteration we log the key of the cursor to the console, something like this (its the album
title in each case, which is our key). The cursor does not require us to select the data based on a key; we can just grab all of it. Also note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo. For a complete working example, see our IDBCursor example (view example live.) function displayData() { var transaction = db.transac...
... Recommendation Indexed Database API DraftThe defin...
IDBCursor.primaryKey - Web APIs
type. Note: This feature is available in Web Workers. Syntax var value = cursor.primaryKey; Value A value of any data type. Example In this simple fragment we create a transaction, retrieve an object store, then use a cursor to iterate through all the records in the object store. Within each iteration we log the primary key of the cursor to the console, something like this (its the album
title in each case, which is our primarykey): Hemispheres The cursor does not require us to select the data based on a key; we can just grab all of it. Also note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo. For a complete working example, see our IDBCursor example (view example live.) function displayData() { var tra...
... Recommendation Indexed Database API ...
IDBCursor.source - Web APIs
xample In this simple fragment we create a transaction, retrieve an object store, then use a cursor to iterate through all the records in the object store. Within each iteration we log the source of the cursor, which will log our IDBobjectStore object to the console, something like this: IDBObjectStore {autoIncrement: false, transaction: IDBTransaction, indexNames: DOMStringList, keyPath: "album
Title", name: "rushAlbumList"...} The cursor does not require us to select the data based on a key; we can just grab all of it. Also note that in each iteration of the loop, you can grab data from the current record under the cursor object using cursor.value.foo. For a complete working example, see our IDBCursor example (view example live.) function displayData() { var transaction = db.transaction(...
... Recommendation Indexed Database API DraftThe...
IDBCursor.update() - Web APIs
property in the value at the object store's key path does not match the key in this cursor's position. DataCloneError The data being stored could not be cloned by the internal structured cloning algorithm. Example In this simple fragment we create a transaction, retrieve an object store, then use a cursor to iterate through all the records in the object store. If the album
Title of the current cursor is "A farewell to kings", we update year the album was released using var request = cursor.update();. Note that you cannot change primary keys using cursor.update(), hence us not changing the album
title; this would ruin the integrity of the data. In such a situation, you would have to delete the record altogether and then add a new one using IDBObjectStore.add. Note also t...
...omplete working example, see our IDBCursor example (view example live.) function updateResult() { list.innerHTML = ''; const transaction = db.transaction(['rushAlbumList'], 'readwrite'); const objectStore = transaction.objectStore('rushAlbumList'); objectStore.openCursor().onsuccess = function(event) { const cursor = event.target.result; if (cursor) { if (cursor.value.album
Title === 'A farewell to kings') { const updateData = cursor.value; updateData.year = 2050; const request = cursor.update(updateData); request.onsuccess = function() { console.log('A better album year?'); }; }; const listItem = document.createElement('li'); listItem.innerHTML = '<strong>' + cursor.value.album
Title + '</strong>, ' + c...
IDBDatabase: abort event - Web APIs
exist), then opens a transaction, adds a listener to the abort event, then aborts the transaction to trigger the event. ...
...t the transaction transaction.abort(); }; The same example, but assigning the event handler to the onabort property: // Open the database const dBOpenRequest = window.indexedDB.open('toDoList', 4); dBOpenRequest.onupgradeneeded = (event) => { const db = event.target.result; // Create an objectStore for this database const objectStore = db.createObjectStore('toDoList', { keyPath: 'task
Title' }); // define what data items the objectStore will contain objectStore.createIndex('hours', 'hours', { unique: false }); objectStore.createIndex('minutes', 'minutes', { unique: false }); objectStore.createIndex('day', 'day', { unique: false }); objectStore.createIndex('month', 'month', { unique: false }); objectStore.createIndex('year', 'year', { unique: false }); }; dBOpenRequest.
IDBDatabase: close event - Web APIs
Event handler property onerror Examples This example opens a database and listens for the close event: // Open the database const dBOpenRequest = window.indexedDB.open('toDoList', 4); dBOpenRequest.onupgradeneeded = (event) => { const db = event.target.result; // Create an objectStore for this database const objectStore = db.createObjectStore('toDoList', { keyPath: 'task
Title' }); // define what data items the objectStore will contain objectStore.createIndex('hours', 'hours', { unique: false }); objectStore.createIndex('minutes', 'minutes', { unique: false }); objectStore.createIndex('day', 'day', { unique: false }); objectStore.createIndex('month', 'month', { unique: false }); objectStore.createIndex('year', 'year', { unique: false }); }; dBOpenRequest.
...g('Database connection closed'); }); }; The same example, using the onclose property instead of addEventListener(): // Open the database const dBOpenRequest = window.indexedDB.open('toDoList', 4); dBOpenRequest.onupgradeneeded = (event) => { const db = event.target.result; // Create an objectStore for this database const objectStore = db.createObjectStore('toDoList', { keyPath: 'task
Title' }); // define what data items the objectStore will contain objectStore.createIndex('hours', 'hours', { unique: false }); objectStore.createIndex('minutes', 'minutes', { unique: false }); objectStore.createIndex('day', 'day', { unique: false }); objectStore.createIndex('month', 'month', { unique: false }); objectStore.createIndex('year', 'year', { unique: false }); }; dBOpenRequest.
IDBDatabase: versionchange event - Web APIs
rty onversionchange Examples This example opens a database and, on success, adds a listener to versionchange: // Open the database const dBOpenRequest = window.indexedDB.open('Nonexistent', 4); dBOpenRequest.onupgradeneeded = event => { const db = event.target.result; // Create an objectStore for this database const objectStore = db.createObjectStore('toDoList', { keyPath: 'task
Title' }); // define what data items the objectStore will contain objectStore.createIndex('hours', 'hours', { unique: false }); objectStore.createIndex('minutes', 'minutes', { unique: false }); objectStore.createIndex('day', 'day', { unique: false }); objectStore.createIndex('month', 'month', { unique: false }); objectStore.createIndex('year', 'year', { unique: false }); }; dBOpenRequest.
... version of this database has changed'); }); }); The same example, using the onversionchange event handler property: // Open the database const dBOpenRequest = window.indexedDB.open('Nonexistent', 4); dBOpenRequest.onupgradeneeded = event => { const db = event.target.result; // Create an objectStore for this database const objectStore = db.createObjectStore('toDoList', { keyPath: 'task
Title' }); // define what data items the objectStore will contain objectStore.createIndex('hours', 'hours', { unique: false }); objectStore.createIndex('minutes', 'minutes', { unique: false }); objectStore.createIndex('day', 'day', { unique: false }); objectStore.createIndex('month', 'month', { unique: false }); objectStore.createIndex('year', 'year', { unique: false }); }; dBOpenRequest.
IDBObjectStore - Web APIs
n created before, or a new version number has been // submitted via the window.indexedDB.open line above DBOpenRequest.onupgradeneeded = function(event) { var db = event.target.result; db.onerror = function(event) { note.innerHTML += '<li>Error loading database.</li>'; }; // Create an objectStore for this database var objectStore = db.createObjectStore("toDoList", { keyPath: "task
Title" }); // define what data items the objectStore will contain objectStore.createIndex("hours", "hours", { unique: false }); objectStore.createIndex("minutes", "minutes", { unique: false }); objectStore.createIndex("day", "day", { unique: false }); objectStore.createIndex("month", "month", { unique: false }); objectStore.createIndex("year", "year", { unique: false }); objectStore.cr...
...alse }); objectStore.createIndex("day", "day", { unique: false }); objectStore.createIndex("month", "month", { unique: false }); objectStore.createIndex("year", "year", { unique: false }); objectStore.createIndex("notified", "notified", { unique: false }); note.innerHTML += '<li>Object store created.</li>'; }; // Create a new item to add in to the object store var newItem = [ { task
Title: "Walk dog", hours: 19, minutes: 30, day: 24, month: 'December', year: 2013, notified: "no" } ]; // open a read/write db transaction, ready for adding the data var transaction = db.transaction(["toDoList"], "readwrite"); // report on the success of the transaction completing, when everything is done transaction.oncomplete = function(event) { note.innerHTML += '<li>Transaction completed.</li>'...
IDBOpenDBRequest: blocked event - Web APIs
locked Examples Using addEventListener(): // Open the database const DBOpenRequest = window.indexedDB.open('toDoList', 4); DBOpenRequest.onupgradeneeded = (event) => { const db = event.target.result; db.onerror = () => { console.log('Error creating database'); }; // Create an objectStore for this database var objectStore = db.createObjectStore('toDoList', { keyPath: 'task
Title' }); // define what data items the objectStore will contain objectStore.createIndex('hours', 'hours', { unique: false }); objectStore.createIndex('minutes', 'minutes', { unique: false }); objectStore.createIndex('day', 'day', { unique: false }); objectStore.createIndex('month', 'month', { unique: false }); objectStore.createIndex('year', 'year', { unique: false }); }; DBOpenRequest.
...ocked'); }); }; Using the onblocked property: // Open the database const DBOpenRequest = window.indexedDB.open('toDoList', 4); DBOpenRequest.onupgradeneeded = (event) => { const db = event.target.result; db.onerror = () => { console.log('Error creating database'); }; // Create an objectStore for this database var objectStore = db.createObjectStore('toDoList', { keyPath: 'task
Title' }); // define what data items the objectStore will contain objectStore.createIndex('hours', 'hours', { unique: false }); objectStore.createIndex('minutes', 'minutes', { unique: false }); objectStore.createIndex('day', 'day', { unique: false }); objectStore.createIndex('month', 'month', { unique: false }); objectStore.createIndex('year', 'year', { unique: false }); }; DBOpenRequest.
IDBRequest: success event - Web APIs
stens for the success event using addEventListener(): // Open the database const openRequest = window.indexedDB.open('toDoList', 4); openRequest.onupgradeneeded = (event) => { const db = event.target.result; db.onerror = () => { console.log('Error creating database'); }; // Create an objectStore for this database var objectStore = db.createObjectStore('toDoList', { keyPath: 'task
Title' }); // define what data items the objectStore will contain objectStore.createIndex('hours', 'hours', { unique: false }); objectStore.createIndex('minutes', 'minutes', { unique: false }); objectStore.createIndex('day', 'day', { unique: false }); objectStore.createIndex('month', 'month', { unique: false }); objectStore.createIndex('year', 'year', { unique: false }); }; openRequest.ad...
...mple, but using the onsuccess event handler property: // Open the database const openRequest = window.indexedDB.open('toDoList', 4); openRequest.onupgradeneeded = (event) => { const db = event.target.result; db.onerror = () => { console.log('Error creating database'); }; // Create an objectStore for this database var objectStore = db.createObjectStore('toDoList', { keyPath: 'task
Title' }); // define what data items the objectStore will contain objectStore.createIndex('hours', 'hours', { unique: false }); objectStore.createIndex('minutes', 'minutes', { unique: false }); objectStore.createIndex('day', 'day', { unique: false }); objectStore.createIndex('month', 'month', { unique: false }); objectStore.createIndex('year', 'year', { unique: false }); }; openRequest.on...
IDBTransaction: abort event - Web APIs
, then aborts the transaction to trigger the event. ...
...ssigning the event handler to the onabort property: // Open the database const DBOpenRequest = window.indexedDB.open('toDoList', 4); DBOpenRequest.onupgradeneeded = event => { const db = event.target.result; db.onerror = () => { console.log('Error creating database'); }; // Create an objectStore for this database var objectStore = db.createObjectStore('toDoList', { keyPath: 'task
Title' }); // define what data items the objectStore will contain objectStore.createIndex('hours', 'hours', { unique: false }); objectStore.createIndex('minutes', 'minutes', { unique: false }); objectStore.createIndex('day', 'day', { unique: false }); objectStore.createIndex('month', 'month', { unique: false }); objectStore.createIndex('year', 'year', { unique: false }); }; DBOpenRequest.
KeyboardEvent.ctrlKey - Web APIs
The KeyboardEvent.ctrlKey read-only property returns a Boolean that indicates if the control key was pressed (true) or not (false) when the event occured. ...
... The KeyboardEvent.ctrlKey read-only property returns a Boolean that indicates if the control key was pressed (true) or not (false) when the event occured. ...
KeyboardEvent.shiftKey - Web APIs
The KeyboardEvent.shiftKey read-only property is a Boolean that indicates if the shift key was pressed (true) or not (false) when the event occurred. ...
... The KeyboardEvent.shiftKey read-only property is a Boolean that indicates if the shift key was pressed (true) or not (false) when the event occurred. ...
KeyboardEvent.which - Web APIs
meric keyCode of the key pressed, or the character code (charCode) for an alphanumeric key pressed. Syntax var keyResult = event.which; Return value keyResult contains the numeric code for a particular key pressed, depending on whether an alphanumeric or non-alphanumeric key was pressed. Please see KeyboardEvent.charCode and KeyboardEvent.keyCode for more details. ...
...he character code (charCode) for an alphanumeric key pressed. Syntax var keyResult = event.which; Return value keyResult contains the numeric code for a particular key pressed, depending on whether an alphanumeric or non-alphanumeric key was pressed. Please see KeyboardEvent.charCode and KeyboardEvent.keyCode for more details. ...
MediaSession.metadata - Web APIs
Syntax var mediaMetadata = navigator.mediaSession.metadata; navigator.mediaSession.metadata = mediaMetadata; Value An instance of MediaMetadata containing information about the media currently being played. ...
...a = navigator.mediaSession.metadata; navigator.mediaSession.metadata = mediaMetadata; Value An instance of MediaMetadata containing information about the media currently being played. ...
MediaSession - Web APIs
event handler for a media session action, such as play or pause. See the method page for a full list. setPositionState() Sets the current playback position and speed of the media currently being presented. ...
...a session action, such as play or pause. See the method page for a full list. setPositionState() Sets the current playback position and speed of the media currently being presented. ...
Media Session API - Web APIs
s you to create event handlers, to define your own behaviors for a user-agent playback controls. The aim of this is allowing users to know what's playing, and to control it, without opening the specific page that launched it. Media Session concepts and usage The MediaMetadata interface lets a web site provide rich metadata to the platform UI for media that is playing. This metadata includes the
title, artist (creator) name, album (collection), and artwork. The platform can show this metadata in media centers, notifications, device lockscreens, etc. The MediaSession interface lets users control playback of media through user-agent defined interface elements. Interaction with these elements even trigger handlers in the web page, playing the media. Since multiple pages may be simultaneously usi...
..., including the type of action to perform and any other information needed, such as seek distances or times. Examples The following example shows feature detection for the Media Session API. ...
Navigator.mediaSession - Web APIs
mple, can use setActionHandler() to let fhe media controls on a keyboard or elsehwere on the user's device be used to control the app's media playback. Syntax let mediaSession = navigator.mediaSession; Value A MediaSession object the current document can use to share information about media it's playing and its current playback status. This information can include typical metadata such as the
title, artist, and album name of the song being played as well as potentially one or more images containing things like album art, artist photos, and so forth. Example In this example, metadata is submitted to the mediaSession object. Note that the code begins by ensuring that the navigator.mediaSession property is available before attempting to use it. if ("mediaSession" in navigator){ navigator.
...d as well as potentially one or more images containing things like album art, artist photos, and so forth. Example In this example, metadata is submitted to the mediaSession object. Note that the code begins by ensuring that the navigator.mediaSession property is available before attempting to use it. if ("mediaSession" in navigator){ navigator.mediaSession.metadata = new MediaMetadata({
title: "Podcast Episode
Title", artist: "Podcast Host", album: "Podcast Name", artwork: [{src: "podcast.jpg"}] }); } Specifications Specification Status Comment Media Session StandardThe definition of 'navigator.mediaSession' in that specification. Draft Initial definition. ...
NotificationAction - Web APIs
functionality vary across platforms but generally they provide a way to asynchronously show actions to the user in a notification. Properties Instance properties These properties are available only on instances of the Notification object. NotificationAction.action Read only The name of the action, which can be used to identify the clicked action similar to input names. NotificationAction.
title Read only The string describing the action that is displayed to the user. NotificationAction.icon Read only The URL of the image used to represent the notification when there is not enough space to display the notification itself. Example Notifications can fire notificationclick events on the ServiceWorkerGlobalScope. Here a service worker shows a notification with a single "Archive" act...
...erviceWorkerGlobalScope. Here a service worker shows a notification with a single "Archive" action, allowing users to perform this common task from the notification without having to open the website. The user can also click the main body of the notification to open their inbox instead. ...
Using the Notifications API - Web APIs
fication.requestPermission().then(); } catch(e) { return false; } return true; } We basically try to see if the .then() method is available on requestPermission(). If so, we move on and return true. If it fails, we return false in the catch() {} block. Creating a notification Creating a notification is easy; just use the Notification constructor. ...
...constructor. This constructor expects a
title to display within the notification and some options to enhance the notification such as an icon or a text body. For example, in the to-do-list example we use the following snippet to create a notification when required (found inside the createNotification() function): var img = '/to-do-notifications/img/icon-128.png'; var text = 'HEY! Your task "' +
title + '" is now overdue.'; var notification = new Notification('To do list', { body: text, icon: img }); Closing notifications Used close() to remove a notification that is no longer relevant to the user (e.g. the user already read the notification on the webpage, in the case of a messaging app, or the following song is already playing in a music app to notifies upon song changes). Most modern brow...
Using the Payment Request API - Web APIs
ts Checking whether users can make payments is always useful. Here's a couple of related techniques. Customizing the payment button One useful technique to employ is customizing the payment request button depending on whether users can make payments. In the following snippet we do just this -- depending on whether the user can make a fast payment or needs to add payment credentials first, the
title of the checkout button changes between "Fast Checkout with W3C" and "Setup W3C Checkout". In both cases, the checkout button calls PaymentRequest.show(). const checkoutButton = document.getElementById('checkout-button'); checkoutButton.innerText = "Loading..."; if (window.PaymentRequest) { let request = new PaymentRequest(buildSupportedPaymentMethodNames(), buildShoppingCartDetails()); ...
...nMakeAFastPayment) { if (canMakeAFastPayment) { checkoutButton.innerText = "Fast Checkout with W3C"; } else { checkoutButton.innerText = "Setup W3C Checkout"; } }).catch(function(error) { // The user may have turned off the querying functionality in their // privacy settings. The website does not know whether they can make // a fast payment, so pick a generic
title. checkoutButton.innerText = "Checkout with W3C"; }); } Note: See our Customizing the payment button demo for the full code. Checking before all prices are known If the checkout flow needs to know whether PaymentRequest.canMakePayment() will return true even before all line items and their prices are known, you can instantiate PaymentRequest with dummy data and pre-query .canMakePaymen...
SVGAnimationElement: beginEvent event - Web APIs
ts). It may be raised both in the course of normal (i.e. scheduled or interactive) timeline play, as well as in the case that the element was begun with a DOM method. ...
... course of normal (i.e. scheduled or interactive) timeline play, as well as in the case that the element was begun with a DOM method. ...
SVGAnimationElement: endEvent event - Web APIs
his event may be raised both in the course of normal (i.e. scheduled or interactive) timeline play, as well as in the case that the element was ended with a DOM method. ...
...e course of normal (i.e. scheduled or interactive) timeline play, as well as in the case that the element was ended with a DOM method. ...
SVGAnimationElement: repeatEvent event - Web APIs
0-based integer, but the repeat event is not raised for the first iteration and so the observed values will be >= 1. This is supported in Firefox, but not in Chrome. ...
...ent is not raised for the first iteration and so the observed values will be >= 1. This is supported in Firefox, but not in Chrome. ...
SVGDocument - Web APIs
ocument object of a different type, such as an HTMLDocument object. ...
... referrer DOMString Returns the URI of the page that linked to this page. The value is an empty string if the user navigated to the page directly (not through a link, but, for example, via a bookmark). rootElement SVGSVGElement The root "svg" in the document hierarchy.
title DOMString The
title of a document as specified by the "
title" sub-element of the "svg" root element (i.e., <svg><
title>Here is the
title</
title>...</svg>) URL DOMString The complete URI of the document. Methods The SVGDocument interface does not provide any specific methods. Br...
TextTrack.mode - Web APIs
The TextTrack interface's mode property is a string specifying and controlling the text track's mode: disabled, hidden, or showing. You can read this value to determine the current mode, and you can change this value to switch modes. Safari additionally requires the default boolean attribute to be set to true when implementing your own video player controls in order for the sub
titles cues to be shown. Syntax var mode = textTrack.mode; textTrack.mode = "disabled" | "hidden" | "showing"; Value A DOMString which indicates the track's current mode. The text track mode is one of the values listed below, under Text track mode constants. Text track mode constants The text track mode--sometimes identified using the IDL enum TextTrackMode--must be one of the following values: disabled The t...
...event--in order to process some aspect of the cues upon page load--and the track mode was initially disabled, you'll have to change the mode to either hidden or showing in order to trigger loading of the cues. When the mode is showing, text tracks are performed. The exact appearance and manner of that performance varies depending on each text track's kind. In general: Tracks whose kind is "sub
titles" or "captions" are rendered with the cues overlaid over the top of the video. Tracks whose kind is "descriptions" are presented in a non-visual form (for example, the text might be spoken to describe the action in the video). Tracks whose kind is "chapters" are used by the user agent or the Web site or Web app to construct and present an interface for navigating the named chapters, where each ...
UIEvent.layerX - Web APIs
akes scrolling of the page into account and returns a value relative to the whole of the document unless the event occurs inside a positioned element, where the returned value is relative to the top left of the positioned element. Syntax var xpos = event.layerX xpos is an integer value in pixels for the x-coordinate of the mouse pointer, when the mouse event fired. ...
... returns a value relative to the whole of the document unless the event occurs inside a positioned element, where the returned value is relative to the top left of the positioned element. Syntax var xpos = event.layerX xpos is an integer value in pixels for the x-coordinate of the mouse pointer, when the mouse event fired. ...
UIEvent.layerY - Web APIs
s scrolling of the page into account, and returns a value relative to the whole of the document, unless the event occurs inside a positioned element, where the returned value is relative to the top left of the positioned element. Syntax var ypos = event.layerY; ypos is an integer value in pixels for the y-coordinate of the mouse pointer, when the mouse event fired. ...
...eturns a value relative to the whole of the document, unless the event occurs inside a positioned element, where the returned value is relative to the top left of the positioned element. Syntax var ypos = event.layerY; ypos is an integer value in pixels for the y-coordinate of the mouse pointer, when the mouse event fired. ...
UIEvent.pageY - Web APIs
The UIEvent.pageY read-only property returns the vertical coordinate of the event relative to the whole document. Syntax var pageY = event.pageY; pageY is an integer value in pixels for the y-coordinate of the mouse pointer, relative to the whole document, when the mouse event fired. This property takes into account any vertical scrolling of the page. ...
...y property returns the vertical coordinate of the event relative to the whole document. Syntax var pageY = event.pageY; pageY is an integer value in pixels for the y-coordinate of the mouse pointer, relative to the whole document, when the mouse event fired. This property takes into account any vertical scrolling of the page. ...
Using the Web Speech API - Web APIs
a supporting mobile browser like Chrome. Browser support Support for Web Speech API speech recognition is curently limited to Chrome for Desktop and Android -- Chrome has supported it since around version 33 but with prefixed interfaces, so you need to include prefixed versions of them, e.g. webkitSpeechRecognition. HTML and CSS The HTML and CSS for the app is really trivial. We simply have a
title, instructions paragraph, and a div into which we output diagnostic messages. <h1>Speech color changer</h1> <p>Tap/click then say a color to change the background color of the app.</p> <div> <p class="output"><em>...diagnostic messages</em></p> </div> The CSS provides a very simple responsive styling so that it looks ok across devices. JavaScript Let's look at the JavaScript in a bit more de...
...Windows)/44+, without prefixes, and it can be turned on by flipping the media.webspeech.synth.enabled flag to true in about:config. Firefox OS 2.5+ supports it, by default, and without the need for any permissions. Chrome for Desktop and Android have supported it since around version 33, without prefixes. HTML and CSS The HTML and CSS are again pretty trivial, simply containing a
title, some instructions for use, and a form with some simple controls. The <select> element is initially empty, but is populated with <option>s via JavaScript (see later on.) <h1>Speech synthesiser</h1> <p>Enter some text in the input below and press return to hear it. change voices using the dropdown menu.</p> <form> <input type="text" class="txt"> <div> <label for="rate">Rate</label><inpu...
window.location - Web APIs
{ location.search = sData; } // in html: <button onclick="sendData('Some data');">Send data</button> The current URL with "?Some%20data" appended is sent to the server (if no action is taken by the server, the current document is reloaded with the modified search string). ...
...h = sData; } // in html: <button onclick="sendData('Some data');">Send data</button> The current URL with "?Some%20data" appended is sent to the server (if no action is taken by the server, the current document is reloaded with the modified search string). ...
Window.personalbar - Web APIs
le shows the way that the visible property of the various "bar" objects is used, and also the change to the privileges necessary to write to the visible property of any of the bars on an existing window. Due to deprecation of enablePrivilege this functionality can not be used in web pages. EnablePrivilege is disabled in Firefox 15 and will be removed in Firefox 17. ...
... visible property of the various "bar" objects is used, and also the change to the privileges necessary to write to the visible property of any of the bars on an existing window. Due to deprecation of enablePrivilege this functionality can not be used in web pages. EnablePrivilege is disabled in Firefox 15 and will be removed in Firefox 17. ...
Window.resizeTo() - Web APIs
Example This function resizes the window so that it takes up one quarter of the available screen. See the Screen.availWidth and Screen.availHeight properties. ...
... Example This function resizes the window so that it takes up one quarter of the available screen. See the Screen.availWidth and Screen.availHeight properties. ...
Window.statusbar - Web APIs
ect, whose visibility can be toggled in the window. Syntax objRef = window.statusbar Example The following complete HTML example shows a way that the visible property of the various "bar" objects is used, and also the change to the privileges necessary to write to the visible property of any of the bars on an existing window. ...
... be toggled in the window. Syntax objRef = window.statusbar Example The following complete HTML example shows a way that the visible property of the various "bar" objects is used, and also the change to the privileges necessary to write to the visible property of any of the bars on an existing window. ...
Window.toolbar - Web APIs
xample shows way that the visible property of the various "bar" objects is used, and also the change to the privileges necessary to write to the visible property of any of the bars on an existing window. Due to deprecation of enablePrivilege this functionality can not be used in web pages. EnablePrivilege is disabled in Firefox 15 and will be removed in Firefox 17. ...
... visible property of the various "bar" objects is used, and also the change to the privileges necessary to write to the visible property of any of the bars on an existing window. Due to deprecation of enablePrivilege this functionality can not be used in web pages. EnablePrivilege is disabled in Firefox 15 and will be removed in Firefox 17. ...
Synchronous and asynchronous requests - Web APIs
is 200 -- HTTP's "OK" result -- the document's text content is output to the console. Example: Synchronous HTTP request from a Worker One of the few cases in which a synchronous request does not usually block execution is the use of XMLHttpRequest within a Worker. ...
...K" result -- the document's text content is output to the console. Example: Synchronous HTTP request from a Worker One of the few cases in which a synchronous request does not usually block execution is the use of XMLHttpRequest within a Worker. ...
msCapsLockWarningOff - Web APIs
assword fields will automatically display a warning if the caps lock is on. This property enables this warning to be disabled. Syntax document.msCapsLockWarningOff = true; Value Type: boolean False: Default. Automatic caps lock warning is turned on. True: Automatic caps lock warning is turned off. ...
...splay a warning if the caps lock is on. This property enables this warning to be disabled. Syntax document.msCapsLockWarningOff = true; Value Type: boolean False: Default. Automatic caps lock warning is turned on. True: Automatic caps lock warning is turned off. ...
Web APIs
HTMLParamElement HTMLPictureElement HTMLPreElement HTMLProgressElement HTMLQuoteElement HTMLScriptElement HTMLSelectElement HTMLShadowElement HTMLSlotElement HTMLSourceElement HTMLSpanElement HTMLStyleElement HTMLTableCaptionElement HTMLTableCellElement HTMLTableColElement HTMLTableElement HTMLTableRowElement HTMLTableSectionElement HTMLTemplateElement HTMLTextAreaElement HTMLTimeElement HTML
TitleElement HTMLTrackElement HTMLUListElement HTMLUnknownElement HTMLVideoElement HashChangeEvent Headers History HkdfParams HmacImportParams HmacKeyGenParams I IDBCursor IDBCursorSync IDBCursorWithValue IDBDatabase IDBDatabaseException IDBDatabaseSync IDBEnvironment IDBEnvironmentSync IDBFactory IDBFactorySync IDBIndex IDBIndexSync IDBKeyRange IDBLocaleAwareKeyRange IDBMu...
...nt SVGPolylineElement SVGPreserveAspectRatio SVGRadialGradientElement SVGRect SVGRectElement SVGRenderingIntent SVGSVGElement SVGScriptElement SVGSetElement SVGSolidcolorElement SVGStopElement SVGStringList SVGStylable SVGStyleElement SVGSwitchElement SVGSymbolElement SVGTRefElement SVGTSpanElement SVGTests SVGTextContentElement SVGTextElement SVGTextPathElement SVGTextPositioningElement SVG
TitleElement SVGTransform SVGTransformList SVGTransformable SVGURIReference SVGUnitTypes SVGUseElement SVGVKernElement SVGViewElement SVGZoomAndPan Screen ScreenOrientation ScriptProcessorNode ScrollToOptions SecurityPolicyViolationEvent Selection Sensor SensorErrorEvent ServiceWorker ServiceWorkerContainer ServiceWorkerGlobalScope ServiceWorkerMessageEvent ServiceWorkerRegistration Service...
Using the alertdialog role - Accessibility
ouncing the focused element. Note: Opinions may differ on how assistive technology should handle this technique. The information provided above is one of those opinions and therefore not normative. Examples Example 1: A basic alert dialog The code snippet below shows how to mark up an alert dialog that only provides a message and an OK button. ...
...dle this technique. The information provided above is one of those opinions and therefore not normative. Examples Example 1: A basic alert dialog The code snippet below shows how to mark up an alert dialog that only provides a message and an OK button. ...
ARIA: banner role - Accessibility
A banner role represents general and informative content frequently placed at the beginning of the page. This usually includes a logo, company name, search icon, photo related to the page, or slogan. <div role="banner"> <img src="companylogo.svg" alt="my company name" /> <h1>
Title</h1> <h2>Sub
title</h2> </div> By default, the HTML5 <header> element has an identical meaning to the banner landmark, unless it is a descendant of <aside>, <article>, <main>, <nav>, or <section>. Description A banner landmark role converts the container element upon which it is applied into a header. It should be reserved for the site header content that is common across the site generally at the top of every page. The banner is typically includes things a logo or corporate identity, possibly a site-spe...
...nested document and/or application roles, each nested document or application role may also have one banner landmark. If a page includes more than one banner landmark, each should have a unique label. Associated ARIA roles, states, and properties None Keyboard interactions None Required JavaScript features None Examples Here's a fake simple banner with a skip to navigation link, a logo, a
title and a sub
title. As this is the main header for the site, we've added the banner landmark role to the container element. <div role="banner"> <a href="#nav" id="skipToMenu" class="skiptocontent">Skip To Keyboard Navigation</a> <img src="images/w3c.png" alt="W3C Logo"> <h1>ARIA Landmarks</h1> <p>Identifying page subsections for easy navigation</p> </div> We could also have written the abov...
ARIA: form role - Accessibility
r search). Using the <form> element will automatically communicate a section of content as a form landmark, if it is provided an accessible name. Developers should always prefer using the correct semantic HTML element over using ARIA. Use the HTML <form> element if possible. The <form> element defines a form landmark when it has an accessible name (e.g. aria-labelledby, aria-label or
title). Make sure to have a unique label on each form in a document to help users understand the purpose of the form. This label should be visible to all users, not just assistive technology users. Use the search landmark instead of the form landmark when the form is used for search functionality. Use the role="form" to identify a region of the page; do not use it to identify every form field. Even if...
... declare role="form". Search If a form is used to search, you should use the more specialized role="search" value. Labeling landmarks Each <form> element and form role that needs to be exposed as a landmark must be given an accessible name. This name will allow an assitive technology user to be able to quickly understand the purpose of the form landmark. Use an aria-labelledby, aria-label or
title on the same element that was given the role="form" to provide it an accessible name. Using role="form" <div role="form" id="gift-cards" aria-label="Purchase a gift card"> <!-- form content --> </div> Redundant descriptions Screen readers will announce the type of role the landmark is. Because of this, you do not need to describe what the landmark is in its label. For example, a declaration...
ARIA: gridcell role - Accessibility
e position of an element in relation to the rest of the table-style grouping of information's columns. rowheader Specifies which element is the associated row header. aria-rowindex Identifies the position of an element in relation to the rest of the table-style grouping of information's rows. ...
...f information's columns. rowheader Specifies which element is the associated row header. aria-rowindex Identifies the position of an element in relation to the rest of the table-style grouping of information's rows. ...
Cognitive accessibility - Accessibility
l people exactly how much time will cause the session to time out and result in lost data. The exception to this is preserving data for more than 20 hours when no actions are taken. Navigation Guideline 2.4 states "provide ways to help users navigate, find content, and determine where they are," and provides 10 guidelines to ensure the site is navigable and content is findable: Include a <
title> Make sure to include a <
title> for the document, as
titles provide a quick and easy to reference description of the screen's main point. People with cognitive disabilities, limited short-term memory, and reading disabilities all benefit from being able to identify the purpose of content this way. Heading and labels Include clear and descriptive headings so users can easily find info...
...efit from being able to identify the purpose of content this way. Heading and labels Include clear and descriptive headings so users can easily find information and understand relationships between different content sections. Descriptive labels help users identify specific components within the content. People who read slowly and people with limited short-term memory benefit when section
titles make it possible to predict what each section contains. Section headings Headings help define overall organization of page content. They help facilitate navigation through page content sections, and provide a mechanism to aid comprehension. Examples of headings include chapters, sections and subsections of content, and so on. Headings are more obvious navigational aids compared to othe...
Implementing a Microsoft Active Accessibility (MSAA) Server - Accessibility
eet For information on what each role does, see the MSDN Role Constants page. Check with your assistive technology partners to find out what roles you need to support. There's a very good chance they won't ask for more than the roles marked [important]: There is no need to support the objects marked [inserted by system]. Windows will add those objects to your hierarchy for you. ...
... identifiers you need to support. There's a very good chance they won't ask for more than the object itentifiers marked [important]: OBJID_ALERT OBJID_CARET OBJID_CLIENT [important] OBJID_CURSOR OBJID_HSCROLL OBJID_NATIVEOM [important? might be useful for supporting custom interfaces, need to research] OBJID_MENU OBJID_QUERYCLASSNAMEIDX OBJID_SIZEGRIP OBJID_SOUND OBJID_SYSMENU OBJID_
TITLEBAR OBJID_VSCROLL OBJID_WINDOW [important, but implemented automatically by Microsoft Windows. Will return object of type ROLE_WINDOW. See WindowFromAccessibleObject quirk explanation below.] Dealing with the Quirks of MSAA MSAA has a well deseved reputation for quirkiness. It is not "plug and play", and will take a lot of testing/refinement before your solution works with any product. Here a...
Keyboard-navigable JavaScript widgets - Accessibility
l. Once keyboard focus lands on the containing <ul> element, the JavaScript developer must programmatically manage focus and respond to arrow keys. For techniques for managing focus within widgets, see "Managing focus inside groups" below. ...
..."mb1" tabindex="0"> <li id="mb1_menu1" tabindex="-1"> Font <ul id="fontMenu"
title="Font" tabindex="-1"> <li id="sans-serif" tabindex="-1">Sans-serif</li> <li id="serif" tabindex="-1">Serif</li> <li id="monospace" tabindex="-1">Monospace</li> <li id="fantasy" tabindex="-1">Fantasy</li> </ul> </li> <li id="mb1_menu2" tabindex="-1"> Style <ul id="styleMenu"
title="Style" tabindex="-1"> <li id="italic" tabindex="-1">Italics</li> <li id="bold" tabindex="-1">Bold</li> <li id="underline" tabindex="-1">Underlined</li> </ul> </li> <li id="mb1_menu3" tabindex="-1"> Justification <ul id="justificationMenu"
title="Justication" tabindex="-1"> <li id="left" tabindex="-1">Left</li> <li id="center" tabindex="-1">Centered</li> ...
Mobile accessibility checklist - Accessibility
ols such as links, buttons, and form fields are focusable by default. Non-standard controls MUST have an appropriate ARIA Role assigned to them, such as button, link, or checkbox. Focus should be handled in a logical order and consistent manner. Text Equivalents Text equivalent MUST be provided for every non-strictly presentational non-text element within the app. Use alt and
title where appropriate (see Steve Faulkner's post about Using the HTML
title attribute for a good guide.) If the above attributes are not applicable, use appropriate ARIA States and Properties such as aria-label, aria-labelledby, or aria-describedby. Images of text MUST be avoided. All user interface components with visible text (or image of text) as labels must have the same text available ...
...anges must be provided via ARIA States such as aria-checked, aria-disabled, aria-selected, aria-expanded, and aria-pressed. Orientation Content should not be restricted to a single orientation, such as portrait or landscape, unless essential. WCAG 2.1: Orientation Examples of when an orientation is esssential is a piano application or a bank cheque. General Guidelines An app
title MUST be provided. Headings MUST not break hierarchical structure <h1>Top level heading</h1> <h2>Secondary heading</h2> <h2>Another secondary heading</h2> <h3>Low level heading</h3> ARIA Landmark Roles SHOULD be used to describe an app or document structure, such as banner, complementary, contentinfo, main, navigation, search. For touch events, at least one of the following must be ...
Operable - Accessibility
r navigation). This is often achieved using "skip links" -- links put at the top of the page source that link to the main content and are hidden by CSS. If a proper structure of headings and semantic containers is provided to navigate with (for example <section>, <aside>, etc.), then an added "skip link" is not needed. Need to add a section on "skip links". 2.4.2 Include page
title (A) Each web page should include an informative <
title>, the content of which describes the page's content/purpose. See Adding a
title. 2.4.3 Logical focus order (A) The "tabbing order" of focusable page features (e.g. links, buttons, form inputs) makes logical sense, meaning that the page is still usable by non-sighted/keyboard users. See UI controls for general advice on ta...
...er users, who will often bring up a list of the links out of context -- several links all labelled "click here", "click here", "click here" would be confusing. 2.4.10 Section headings (AAA) As well as creating a useful document structure, headings should also accurately describe and break up content areas into logical sections. Note that this criterion refers to headings and
titles in general web content (e.g. headings within text content). Headings and
titles for user interfaces are a special case covered in criterion 4.1.2. See The basics of headings and paragraphs. Note: Also see the WCAG description for Guideline 2.4 Navigable: Provide ways to help users navigate, find content, and determine where they are. Guideline 2.5 Input Modalities: Make...
Mozilla CSS extensions - CSS: Cascading Style Sheets
t menulist-textfield menupopup menuradio menuseparator -moz-mac-unified-toolbar -moz-win-borderless-glass -moz-win-browsertabbar-toolbox -moz-win-communications-toolbox -moz-win-glass -moz-win-media-toolbox -moz-window-button-box -moz-window-button-box-maximized -moz-window-button-close -moz-window-button-maximize -moz-window-button-minimize -moz-window-button-restore -moz-window-
titlebar -moz-window-
titlebar-maximized progressbar progresschunk radio radio-container radio-label radiomenuitem resizer resizerpanel scale-horizontal scalethumb-horizontal scalethumb-vertical scale-vertical scrollbarbutton-down scrollbarbutton-left scrollbarbutton-right scrollbarbutton-up scrollbar-small scrollbarthumb-horizontal scrollbarthumb-vertical scrollbartrack-horizontal ...
...scroll :-moz-window-inactive ::-moz-xul-anonymous-block At-rules @-moz-document Media features -moz-mac-graphite-theme -moz-maemo-classic -moz-device-pixel-ratio -moz-os-version -moz-scrollbar-end-backward -moz-scrollbar-end-forward -moz-scrollbar-start-backward -moz-scrollbar-start-forward -moz-scrollbar-thumb-proportional -moz-touch-enabled -moz-windows-accent-color-in-
titlebar -moz-windows-classic -moz-windows-compositor -moz-windows-default-theme -moz-windows-glass -moz-windows-theme Other -moz-alt-content (see bug 11011) ...
Specificity - CSS: Cascading Style Sheets
This is because it matches the same element but the ID selector has a higher specificity. Tree proximity ignorance The proximity of an element to other elements that are referenced in a given selector has no impact on specificity. The following style declaration ... body h1 { color: green; } html h1 { color: purple; } ... with the following HTML ... <html> <body> <h1>Here is a
title!</h1> </body> </html> ... will render as: This is because the two declarations have equal selector type counts, but the html h1 selector is declared last. Directly targeted elements vs. inherited styles Styles for a directly targeted element will always take precedence over inherited styles, regardless of the specificity of the inherited rule. This CSS ... #parent { color: green; } h...
...tor type counts, but the html h1 selector is declared last. Directly targeted elements vs. inherited styles Styles for a directly targeted element will always take precedence over inherited styles, regardless of the specificity of the inherited rule. This CSS ... #parent { color: green; } h1 { color: purple; } ... with the following HTML ... <html> <body id="parent"> <h1>Here is a
title!</h1> </body> </html> ... will also render as: This is because the h1 selector targets the element specifically, but the green selector is only inherited from its parent. Specifications Specification Status Comment Selectors Level 4The definition of 'Calculating a selector's specificity' in that specification. Working Draft Add the specificity adjustment...
box-align - CSS: Cascading Style Sheets
is designated the end. If the alignment is set using the element's align attribute, then the style is ignored. ...
...he alignment is set using the element's align attribute, then the style is ignored. ...
offset-path - CSS: Cascading Style Sheets
The path, as can be seen in the rendering of the SVG code, is a line drawing of a house with a chimney. SVG The top and bottom halves of the scissors would appear in the top left of the canvas were they not positioned along the starting point of the motion path defined by offset-path. ...
...in the rendering of the SVG code, is a line drawing of a house with a chimney. SVG The top and bottom halves of the scissors would appear in the top left of the canvas were they not positioned along the starting point of the motion path defined by offset-path. ...
Getting Started - Developer guides
the complete list of timestamps, and the last timestamp, onto the page. This is repeated every 5 seconds, using a setInterval() call. The idea would be that a server-side script of some kind would continually update the text file with new timestamps, and our XHR code would be used to report the latest timestamp on the client-side. ...
...f timestamps, and the last timestamp, onto the page. This is repeated every 5 seconds, using a setInterval() call. The idea would be that a server-side script of some kind would continually update the text file with new timestamps, and our XHR code would be used to report the latest timestamp on the client-side. ...
Content categories - Developer guides
relevant portions of the HTML specification. Main content categories Metadata content Elements belonging to the metadata content category modify the presentation or the behavior of the rest of the document, set up links to other documents, or convey other out of band information. Elements belonging to this category are <base>, <command>, <link>, <meta>, <noscript>, <script>, <style> and <
title>. Flow content Elements belonging to the flow content category typically contain text or embedded content. They are: <a>, <abbr>, <address>, <article>, <aside>, <audio>, <b>,<bdo>, <bdi>, <blockquote>, <br>, <button>, <canvas>, <cite>, <code>, <command>, <data>, <datalist>, <del>, <details>, <dfn>, <div>, <dl>, <em>, <embed>, <fieldset>, <figure>, <footer>, <form>, <h1>, <h2>, <h3>, <h4>, <h5>...
...tioning content model create a section in the current outline that defines the scope of <header> elements, <footer> elements, and heading content. Elements belonging to this category are <article>, <aside>, <nav> and <section>. Do not confuse this content model with the sectioning root category, which isolates its content from the regular outline. Heading content Heading content defines the
title of a section, whether marked by an explicit sectioning content element, or implicitly defined by the heading content itself. Elements belonging to this category are <h1>, <h2>, <h3>, <h4>, <h5>, <h6> and <hgroup>. Though likely to contain heading content, the <header> is not heading content itself. Note: The <hgroup> element was removed from the W3C HTML specification prior to HTML 5 being ...
HTML5 Parser - Developer guides
Scripts that serve racy code to Firefox, perhaps while serving safe code to IE, will see a difference due to this change. Firefox writes a warning to the JavaScript console when it ignores a call to document.write(). Lack of Reparsing Prior to HTML5, parsers reparsed the document if they hit the end of the file within certain elements or within comments. For example, if the document lacked a </
title> closing tag, the parser would reparse to look for the first '<' in the document, or if a comment was not closed, it would look for the first '>'. This behavior created a security vulnerability. If an attacker could force a premature end-of-file, the parser might change which parts of the document it considered to be executable scripts. In addition, supporting reparsing led to unnecessarily compl...
...ted a security vulnerability. If an attacker could force a premature end-of-file, the parser might change which parts of the document it considered to be executable scripts. In addition, supporting reparsing led to unnecessarily complex parsing code. With HTML5, parsers no longer reparse documents. This change has the following consequences for web developers: If you omit the closing tag for <
title>, <style>, <textarea>, or <xmp>, the page will fail to be parsed. IE already fails to parse documents with a missing </
title> tag, so if you test with IE, you probably don't have that problem. If you forget to close a comment, the page will most likely fail to be parsed. However, unclosed comments often already break in existing browsers for one reason or another, so it's unlikely that you have ...
The HTML autocomplete attribute - HTML: Hypertext Markup Language
ame" The field expects the value to be a person's full name. Using "name" rather than breaking the name down into its components is generally preferred because it avoids dealing with the wide diversity of human names and how they are structured; however, you can use the following autocomplete values if you do need to break the name down into its components: "honorific-prefix" The prefix or
title, such as "Mrs.", "Mr.", "Miss", "Ms.", "Dr.", or "Mlle.". "given-name" The given (or "first") name. "additional-name" The middle name. "family-name" The family (or "last") name. "honorific-suffix" The suffix, such as "Jr.", "B.Sc.", "PhD.", "MBASW", or "IV". "nickname" A nickname or handle. "email" An email address. "username" A username or account name. "new-password...
...r your current password" field that might be present. This may be used by the browser both to avoid accidentally filling in an existing password and to offer assistance in creating a secure password (see also Preventing autofilling with autocomplete="new-password"). "current-password" The user's current password. "one-time-code" A one-time code used for verifying user identity. "organization-
title" A job
title, or the
title a person has within an organization, such as "Senior Technical Writer", "President", or "Assistant Troop Leader". "organization" A company or organization name, such as "Acme Widget Company" or "Girl Scouts of America". "street-address" A street address. This can be multiple lines of text, and should fully identify the location of the address within its second admi...
HTML attribute reference - HTML: Hypertext Markup Language
s in an editing host (e.g., using contenteditable attribute). ismap <img> Indicates that the image is part of a server-side image map. itemprop Global attribute keytype <keygen> Specifies the type of key generated. kind <track> Specifies the kind of text track. label <optgroup>, <option>, <track> Specifies a user-readable
title of the element. lang Global attribute Defines the language used in the element. language <script> Defines the script language used in the element. loading <img>, <iframe> Indicates if the element should be loaded lazily (loading="lazy") or loaded immediately (loading="eager"). WIP: WHATWG PR #3752 list <input> Identifies a list...
...ll override styles previously set. summary <table> tabindex Global attribute Overrides the browser's default tab order and follows the one specified instead. target <a>, <area>, <base>, <form> Specifies where to open the linked document (in the case of an <a> element) or where to display the response recieved (in the case of a <form> element)
title Global attribute Text to be displayed in a tooltip when hovering over the element. translate Global attribute Specify whether an element's attribute values and the values of its Text node children are to be translated when the page is localized, or whether to leave them unchanged. type <button>, <input>, <command>, <embed>, <object>, <script>, <source>, <style>, <...
<em>: The Emphasis element - HTML: Hypertext Markup Language
tes The <em> element is for words that have a stressed emphasis compared to surrounding text, which is often limited to a word or words of a sentence and affects the meaning of the sentence itself. Typically this element is displayed in italic type. However, it should not be used simply to apply italic styling; use the CSS font-style property for that purpose. Use the <cite> element to mark the
title of a work (book, play, song, etc.). Use the <i> element to mark text that is in an alternate tone or mood, which covers many common situations for italics such as scientific names or words in other languages. Use the <strong> element to mark text that has greater importance than surrounding text. <i> vs. <em> New developers are often confused at seeing multiple elements that produce similar res...
...ich should you use? By default, the visual result is the same. However, the semantic meaning is different. The <em> element represents stress emphasis of its contents, while the <i> element represents text that is set off from the normal prose, such a foreign word, fictional character thoughts, or when the text refers to the definition of a word instead of representing its semantic meaning. (The
title of a work, such as the name of a book or movie, should use <cite>.) This means the right one to use depends on the situation. Neither is for purely decorational purposes, that's what CSS styling is for. An example for <em> could be: "Just do it already!", or: "We had to do something about it". A person or software reading the text would pronounce the words in italics with an emphasis, using ver...
<head>: The Document Metadata (Header) element - HTML: Hypertext Markup Language
The HTML <head> element contains machine-readable information (metadata) about the document, like its
title, scripts, and style sheets. Note: <head> primarily holds information for machine processing, not human-readability. For human-visible information, like top-level headings and listed authors, see the <header> element. Content categories None. Permitted content If the document is an <iframe> srcdoc document, or if
title information is available from a higher level protocol (like the subject line in HTML email), zero or more elements of metadata content. Otherwise, one or more elements of metadata content where exactly one is a <
title> element. Tag omission The start tag may be omitted if the first thing inside the <head> element is an e...
...ermitted parents An <html> element, as its first child. Implicit ARIA role No corresponding role Permitted ARIA roles No role permitted DOM interface HTMLHeadElement Attributes This element includes the global attributes. profile The URIs of one or more metadata profiles, separated by white space. Example <!doctype html> <html> <head> <
title>Document
title</
title> </head> </html> Notes HTML5-compliant browsers automatically create a <head> element if its tags are omitted in the markup. This auto-creation is not guaranteed in ancient browsers. Specifications Specification Status Comment HTML Living StandardThe definition of '<head>' in that specification. Living Standard No change from latest s...
<input type="hidden"> - HTML: Hypertext Markup Language
dation Hidden inputs don't participate in constraint validation; they have no real value to be constrained. Examples Let's look at how we might implement a simple version of the edit form we described earlier (see Tracking edited content), using a hidden input to remember the ID of the record being edited. The edit form's HTML might look a little bit like this: <form> <div> <label for="
title">Post
title:</label> <input type="text" id="
title" name="
title" value="My excellent blog post"> </div> <div> <label for="content">Post content:</label> <textarea id="content" name="content" cols="60" rows="5"> This is the content of my excellent blog post. I hope you enjoy it! </textarea> </div> <div> <button type="submit">Update post</button> </div> <input type="h...
...rowser and would use that information when the form is returned to know which database record to update with modified information. No scripting is needed in the content to handle this. The output looks like this: Note: You can also find the example on GitHub (see the source code, and also see it running live). When submitted, the form data sent to the server will look something like this:
title=My+excellent+blog+post&content=This+is+the+content+of+my+excellent+blog+post.+I+hope+you+enjoy+it!&postId=34657 Even though the hidden input cannot be seen at all, its data is still submitted. Specifications Specification Status Comment HTML Living StandardThe definition of '<input type="hidden">' in that specification. Living Standard Initial definition ...
<input type="password"> - HTML: Hypertext Markup Language
ur guide on regular expressions; the 'u' flag is specified when compiling the regular expression, so that the pattern is treated as a sequence of Unicode code points, instead of as ASCII. No forward slashes should be specified around the pattern text. If the specified pattern is not specified or is invalid, no regular expression is applied and this attribute is ignored completely. Tip: Use the
title attribute to specify text that most browsers will display as a tooltip to explain what the requirements are to match the pattern. You should also include other explanatory text nearby. Use of a pattern is strongly recommended for password inputs, in order to help ensure that valid passwords using a wide assortment of character classes are selected and used by your users. With a pattern, you can...
...l content of the entered password, you can use the pattern attribute to establish a regular expression to be used to automatically ensure that your passwords meet those requirements. In this example, only values consisting of at least four and no more than eight hexadecimal digits are valid. <label for="hexId">Hex ID: </label> <input id="hexId" type="password" pattern="[0-9a-fA-F]{4,8}"
title="Enter an ID consisting of 4-8 hexadecimal digits" autocomplete="new-password"> disabled This Boolean attribute indicates that the password field is not available for interaction. Additionally, disabled field values aren't submitted with the form. Examples Requesting a Social Security number This example only accepts input which matches the format for a valid United States S...
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
present but is not specified or is invalid, no regular expression is applied and this attribute is ignored completely. If the pattern attribute is valid and a non-empty value does not match the pattern, constraint validation will prevent form submission. Tip: If using the pattern attribute, inform the user about the expected format by including explanatory text nearby. You can also include a
title attribute to explain what the requirements are to match the pattern; most browsers will display this
title as a tooltip. The visible explanation is required for accessibility. The tooltip is an enhancement. See Client-side validation for more information. placeholder The placeholder attribute is a string that provides a brief hint to the user as to what kind of information is expected...
...ement can take input focus (is focusable), if it should participate to sequential keyboard navigation. As all input types except for input of type hidden are focusable, this attribute should not be used on form controls, because doing so would require the management of the focus order for all elements within the document with the risk of harming usability and accessibility if done incorrectly.
title Global attribute valid for all elements, including all input types, containing a text representing advisory information related to the element it belongs to. Such information can typically, but not necessarily, be presented to the user as a tooltip. The
title should NOT be used as the primary explanation of the purpose of the form control. Instead, use the <label> element with a for attribute ...
<nextid>: The NeXT ID element (Obsolete) - HTML: Hypertext Markup Language
document for further editing. They want to add a couple new sections after the second section, appending four more sections at the end. When opening the document, the NeXT editor finds and reads this <NEXTID N="z8"> tag, and now knows to give the first of these new sections the name of z8 in the Table of Contents, and z14 to the content body. This might look like this: <HTML> <HEAD> <
TITLE> ... whatever ... </
TITLE> <LINK, META, BASE, etc. as applicable for the head of this document> <NEXTID N="z20"> </HEAD> <BODY> <A NAME="z0" HREF="#z4">FIRST SECTION HEADING</A> <A NAME="z1" HREF="#z5">SECOND SECTION HEADING</A> <A NAME="z8" HREF="#z14">NEWLY INSERTED THIRD SECTION HEADING</A> <A NAME="z9" HREF="#z15">NEWLY INSERTED FOURTH ...
...<P> ... whatever ... </P> <H2><A NAME="z19">TENTH SECTION HEADING</A></H1><P> ... whatever ... </P> </BODY> </HTML> They then forward a copy of this document to someone with a NeXT editor, and they delete sections z7 and z19, add ten more, z20 through z29, and then delete paragraphs z24 and z29. So then the NEXTID value is z30 when it's returned modified: <HTML> <HEAD> <
TITLE> ... whatever ... </
TITLE> <LINK, META, BASE, etc. as applicable for the head of this document> <NEXTID N="z30"> </HEAD> <BODY> <A NAME="z0" HREF="#z4">FIRST SECTION HEADING</A> <A NAME="z1" HREF="#z5">SECOND SECTION HEADING</A> <A NAME="z8" HREF="#z14">NEWLY INSERTED THIRD SECTION HEADING</A> <A NAME="z9" HREF="#z15">NEWLY INSERTED FOURTH ...
itemprop - HTML: Hypertext Markup Language
Hamilton <dt>Publication date <dd><time itemprop="pubdate" datetime="1996-01-26">26 January 1996</time> </dl> Structured data itemscope itemtype: itemid http://vocab.example.net/book: urn:isbn:0-330-34032-8 itemprop
title The Reality Dysfunction ...
...ollowing <div itemscope> <p itemprop="a">1</p> <p itemprop="b">test</p> <p itemprop="a">2</p> </div> And the following <div id="x"> <p itemprop="a">1</p> </div> <div itemscope itemref="x"> <p itemprop="b">test</p> <p itemprop="a">2</p> </div> Other examples HTML <dl itemscope itemtype="http://vocab.example.net/book" itemid="urn:isbn:0-330-34032-8"> <dt>
Title <dd itemprop="
title">The Reality Dysfunction <dt>Author <dd itemprop="author">Peter F. Hamilton <dt>Publication date <dd><time itemprop="pubdate" datetime="1996-01-26">26 January 1996</time> </dl> Structured data itemscope itemtype: itemid http://vocab.example.net/book: urn:isbn:0-330-34032-8 itemprop
title The Reality Dysfunction itemprop author Peter...
Link types - HTML: Hypertext Markup Language
the other using an <a>, <area>, <form>, or <link> element. List of the defined link types and their significance in HTML Link Type Description Allowed in these elements Not allowed in these elements alternate If the element is <link> and the rel attribute also contains the stylesheet type, the link defines an alternative style sheet; in that case the
title attribute must be present and not be the empty string. If the type is set to application/rss+xml or application/atom+xml, the link defines a syndication feed. The first one defined on the page is the default. Otherwise, the link defines an alternative page, of one of these types: for another medium, like a handheld device (if the media attribute is set) in another l...
...nd is only implemented by versions of Firefox prior to Firefox 63. <a>, <area>, <link> <form> stylesheet Defines an external resource to be used as a stylesheet. If the type is not set, the browser should assume it is a text/css stylesheet until further inspection. If used in combination with the alternate keyword, it defines an alternative style sheet; in that case the
title attribute must be present and not be the empty string. <link> <a>, <area>, <form> tag Indicates that the hyperlink refers to a document describing a tag that applies to this document. Note: This link type should not be set on links to a member of a tag cloud as these do not apply to a single document but to a set of pages. <a>, <area> <link>, <form> up ...
Error.prototype.stack - JavaScript
s of an issue. Different browsers set this value at different times. For example, Firefox sets it when creating an Error object, while PhantomJS sets it only when throwing the Error, and archived MSDN docs also seem to match the PhantomJS implementation. Examples Using the stack property The following HTML markup demonstrates the use of stack property. ...
...rowsers set this value at different times. For example, Firefox sets it when creating an Error object, while PhantomJS sets it only when throwing the Error, and archived MSDN docs also seem to match the PhantomJS implementation. Examples Using the stack property The following HTML markup demonstrates the use of stack property. ...
Object - JavaScript
} } Since JavaScript doesn't exactly have sub-class objects, prototype is a useful workaround to make a "base class" object of certain functions that act as objects. For example: var Person = function(name) { this.name = name; this.canTalk = true; }; Person.prototype.greet = function() { if (this.canTalk) { console.log('Hi, I am ' + this.name); } }; var Employee = function(name,
title) { Person.call(this, name); this.
title =
title; }; Employee.prototype = Object.create(Person.prototype); Employee.prototype.constructor = Employee; //If you don't set Object.prototype.constructor to Employee, //it will take prototype.constructor of Person (parent). //To avoid that, we set the prototype.cons...
...e; //If you don't set Object.prototype.constructor to Employee, //it will take prototype.constructor of Person (parent). //To avoid that, we set the prototype.constructor to Employee (child). Employee.prototype.greet = function() { if (this.canTalk) { console.log('Hi, I am ' + this.name + ', the ' + this.
title); } }; var Customer = function(name) { Person.call(this, name); }; Customer.prototype = Object.create(Person.prototype); Customer.prototype.constructor = Customer; //If you don't set Object.prototype.constructor to Customer, //it will take prototype.constructor of Person (parent). //To avoid that, we set t...
OpenSearch description format
bove to ensure that other user agents that don't support this element can safely ignore it. Autodiscovery of search plugins Web sites with search plugins can advertise them so Firefox users can easily install the plugins. To support autodiscovery, add a <link> element for each plugin to the <head> of your web page: <link rel="search" type="application/opensearchdescription+xml"
title="search
Title" href="pluginURL"> Replace the bolded items as explained below: search
Title The name of the search to perform, such as "Search MDC" or "Yahoo! Search". This must match your plugin file's <ShortName>. pluginURL The URL to the XML search plugin, so the browser can download it. If your site offers multiple search plugins, you can support autodiscovery for them all. For e...
...below: search
Title The name of the search to perform, such as "Search MDC" or "Yahoo! Search". This must match your plugin file's <ShortName>. pluginURL The URL to the XML search plugin, so the browser can download it. If your site offers multiple search plugins, you can support autodiscovery for them all. For example: <link rel="search" type="application/opensearchdescription+xml"
title="MySite: By Author" href="http://example.com/mysiteauthor.xml"> <link rel="search" type="application/opensearchdescription+xml"
title="MySite: By
Title" href="http://example.com/mysite
title.xml"> This way, your site can offer plugins to search by author, or by
title. In Firefox, an icon change in the search box indicates there's a provided search plugin. (See image, the green plus sign...
Populating the page: how browsers work - Web Performance
owser is finally able to make the request. Response Once we have an established connection to a web server, the browser sends an initial HTTP GET request on behalf of the user, which for websites is most often an HTML file. Once the server receives the request, it will reply with relevant response headers and the contents of the HTML. ...
...to make the request. Response Once we have an established connection to a web server, the browser sends an initial HTTP GET request on behalf of the user, which for websites is most often an HTML file. Once the server receives the request, it will reply with relevant response headers and the contents of the HTML. ...
requiredFeatures - SVG: Scalable Vector Graphics
#SVGDOM-dynamic The browser supports all of the DOM interfaces and methods that correspond to the language features for http://www.w3.org/TR/SVG11/feature#SVG-dynamic. http://www.w3.org/TR/SVG11/feature#CoreAttribute The browser supports the id, xml:base, xml:lang and xml:space attributes http://www.w3.org/TR/SVG11/feature#Structure The browser supports <svg>, <g>, <defs>, <desc>, <
title>, <metadata>, <symbol> and <use> elements. http://www.w3.org/TR/SVG11/feature#BasicStructure The browser supports <svg>, <g>, <defs>, <desc>, <
title>, <metadata> and <use> elements. http://www.w3.org/TR/SVG11/feature#ContainerAttribute The browser supports the enable-background attribute http://www.w3.org/TR/SVG11/feature#ConditionalProcessing The browser supports the <switch> e...
...ibute The browser supports the onbegin, onend, onrepeat and onload attributes http://www.w3.org/TR/SVG11/feature#Cursor The browser supports the <cursor> element http://www.w3.org/TR/SVG11/feature#Hyperlinking The browser supports the <a> element http://www.w3.org/TR/SVG11/feature#XlinkAttribute The browser supports the xlink:type, xlink:href, xlink:role, xlink:arcrole, xlink:
title, xlink:show and xlink:actuate attributes http://www.w3.org/TR/SVG11/feature#ExternalResourcesRequired The browser supports the externalResourcesRequired attribute http://www.w3.org/TR/SVG11/feature#View The browser supports the <view> element http://www.w3.org/TR/SVG11/feature#Script The browser supports the <script> element http://www.w3.org/TR/SVG11/feature#Animation The...
SVG Attribute reference - SVG: Scalable Vector Graphics
XLink Attributes xlink:href, xl...
... Y y y1 y2 yChannelSelector Z z zoomAndPan SVG attributes by category Generic Attributes Core attributes id, lang, tabindex, xml:base, xml:lang, xml:space Style Attributes class, style Conditional Processing Attributes externalResourcesRequired, requiredExtensions, requiredFeatures, systemLanguage. XLink Attributes xlink:href, xlink:type, xlink:role, xlink:arcrole, xlink:
title, xlink:show, xlink:actuate Presentation Attributes Note that all SVG presentation attributes can be used as CSS properties. alignment-baseline, baseline-shift, clip, clip-path, clip-rule, color, color-interpolation, color-interpolation-filters, color-profile, color-rendering, cursor, direction, display, dominant-baseline, enable-background, fill, fill-opacity, fill-rule, filter, flood-color, f...
SVG documentation index - SVG: Scalable Vector Graphics
ference IRI. The exact meaning of that link depends on the context of each element using it. 258 xlink:show Deprecated, SVG, SVG Attribute The xlink:show attribute indicates how a linked resource should be opened and is meant for XLink-aware processors. In case of a conflict, the target attribute has priority, since it can express a wider range of values. 259 xlink:
title Deprecated, SVG, SVG Attribute The xlink:
title attribute is used to describe the meaning of a link or resource in a human-readable fashion. 260 xlink:type Deprecated, SVG, SVG Attribute The xlink:type attribute identifies the type of XLink being used. In SVG, only simple links are available. 261 xml:base Deprecated, SVG, SVG Attribute The xml:ba...
...cs element consisting of text. It's possible to apply a gradient, pattern, clipping path, mask, or filter to <text>, like any other SVG graphics element. 372 <textPath> Element, Reference, SVG, SVG Text Content To render text along the shape of a <path>, enclose the text in a <textPath> element that has an href attribute with a reference to the <path> element. 373 <
title> -- the SVG accessible name element Element, Reference, SVG, SVG Descriptive The <
title> element provides an accessible, short-text description of any SVG container element or graphics element. 374 <tref> Element, Reference, SVG, SVG Text Content The textual content for a <text> SVG element can be either character data directly embedded within the <text> element or ...
Example - SVG: Scalable Vector Graphics
tries to move away from the average mote position. Combined, we get this very natural-looking behavior. This is done completely in W3C Standards-XHTML, SVG, and JavaScript-no Flash or any vendor-specific extensions. This example should work in Firefox 1.5 and above. ...
...the average mote position. Combined, we get this very natural-looking behavior. This is done completely in W3C Standards-XHTML, SVG, and JavaScript-no Flash or any vendor-specific extensions. This example should work in Firefox 1.5 and above. ...
SVG 1.1 Support in Firefox - SVG: Scalable Vector Graphics
ttributes: contentScriptType, contentStyleType, viewport, currentView Unimplemented bindings: getIntersectionList, getEnclosureList, checkIntersection, checkEnclosure g Implemented. defs Implemented. desc Implemented. Only stored in the DOM, no user interface.
title Implemented. The
title is displayed as a tooltip when the mouse hovers over the SVG object. metadata Implemented. Only stored in the DOM, no user interface. symbol Implemented. use Implemented. Doesn't completely follow <svg:use> cascading rules (bug 265894). Doesn't d...
...eFuncR Implemented. feFuncG Implemented. feFuncB Implemented. feFuncA Implemented. Cursor Module cursor Not implemented (bug 177193). Hyperlinking Module a Only xlink:href, xlink:show, xlink:target and xlink:
title attributes implemented. View Module view Implemented in Gecko 15.0 (bug 512525). . Scripting Module script Implemented. Animation Module animate Implemented set Implemented animateMotion Implemented ...
SVG 2 support in Mozilla - SVG: Scalable Vector Graphics
ment.unsuspendRedraw(), and SVGSVGElement.unsuspendRedrawAll() deprecated Turned into no-ops (bug 734079) externalResourcesRequired attribute removed Implementation status unknown auto value for width and height in <image> Implementation status unknown referencing entire document with <use> Implementation status unknown lang attribute on <desc> and <
title> Implemented (bug 721920) CSS transforms on outermost <svg> not affecting SVGSVGElement.currentScale or SVGSVGElement.currentTranslate Implementation status unknown rootElement attribute deprecated Implementation status unknown SVGElementInstance and SVGElementInstanceList and corresponding attributes on SVGUseElement removed Implementation status unknown ...
...ed Implementation status unknown Linking Change Notes Link SVG resources with fragment identifiers Implementation status unknown xlink:type, xlink:role, xlink:arcrole, xlink:show, and xlink:actuate attributes removed Implementation status unknown xlink:href attribute deprecated in favor of href Implemented (bug 1245751) xlink:
title attribute deprecated in favor of child <
title> Implementation status unknown Spaces in SVG view fragments Implementation status unknown pixel: and percent: spatial media fragments Implementation status unknown Linking to <view> elements does not cause implicit box transformation to show nearest ancestor <svg> element Implementation status unknown Un...
SVG In HTML Introduction - SVG: Scalable Vector Graphics
Overview This article and its associated example shows how to use inline SVG to provide a background picture for a form. It shows how JavaScript and CSS can be used to manipulate the picture in the same way you would script regular HTML. ...
... Overview This article and its associated example shows how to use inline SVG to provide a background picture for a form. It shows how JavaScript and CSS can be used to manipulate the picture in the same way you would script regular HTML. ...
Using shadow DOM - Web Components
ticle assumes you are already familiar with the concept of the DOM (Document Object Model) -- a tree-like structure of connected nodes that represents the different elements and strings of text appearing in a markup document (usually an HTML document in the case of web documents). ...
...ady familiar with the concept of the DOM (Document Object Model) -- a tree-like structure of connected nodes that represents the different elements and strings of text appearing in a markup document (usually an HTML document in the case of web documents). ...
Using templates and slots - Web Components
"attributes" named slot from its shadow root, the contents of that <dl> replace the "attributes" named slot from the shadow root. Because the second <element-details> doesn't explicitly reference the "attributes" named slot from its shadow root, its content for that named slot gets filled with the default content for it from the shadow root. ...
...slot from its shadow root, the contents of that <dl> replace the "attributes" named slot from the shadow root. Because the second <element-details> doesn't explicitly reference the "attributes" named slot from its shadow root, its content for that named slot gets filled with the default content for it from the shadow root. ...
port - Archive of obsolete content
d({ include: ['*'], contentScriptFile: self.data.url("content-script.js"), onAttach: setupListener }); function setupListener(worker) { worker.port.on('loaded', function(pageInfo) { console.log(pageInfo[0]); console.log(pageInfo[1]); }); } //content-script.js self.port.emit('loaded', [ document.location.toString(), document.
title ]); ...
Content Scripts - Archive of obsolete content
, "alert(theMessage);"); Second, if you define an event listener by direct assignment to a global event handler like onclick, then the assignment might be overridden by the page. ...
Module structure of the SDK - Archive of obsolete content
"sdk", to the module you want to use. For high-level modules this is just sdk/<module_name>, and for low-level modules it is sdk/<path_to_module>/<module_name>: // load the high-level "tabs" module var tabs = require("sdk/tabs"); // load the low-level "uuid" module var uuid = require('sdk/util/uuid'); The path to specify for a low-level module is given along with the module name itself in the
title of the module's documentation page (for example, system/environment). Although the SDK repository in GitHub includes copies of these modules, they are built into Firefox and by default, when you run or build an add-on using jpm run or jpm xpi, it is the versions of the modules in Firefox that are used. If you need to use a different version of the modules, you can do this by checking out the ver...
page-mod - Archive of obsolete content
n communicating using port. Mapping Workers to Tabs The worker has a tab property which returns the tab associated with this worker. You can use this to access the tabs API for the tab associated with a specific document: var pageMod = require("sdk/page-mod"); var tabs = require("sdk/tabs"); pageMod.PageMod({ include: ["*"], onAttach: function onAttach(worker) { console.log(worker.tab.
title); } }); Destroying Workers Workers generate a detach event when their associated document is closed: that is, when the tab is closed or when the associated window's unload event occurs. If you are maintaining a list of workers belonging to a page-mod, you can use this event to remove workers that are no longer valid. For example, if you maintain a list of workers attached to a page-mod: var...
page-worker - Archive of obsolete content
main add-on, which could store it using the simple-storage API. You can communicate with the script using either the postMessage() API or (preferably, usually) the port API. ...
widget - Archive of obsolete content
dy");', onMessage: function(message) { if (message == "ready") widget.postMessage("me too"); } }); Globals Constructors Widget(options) Creates a new widget. The widget is immediately added to the add-on bar. Parameters options : object Required options: Name Type label string A string description of the widget used for accessibility,
title bars, and error reporting. id string A string used to identify your widget in order to save its location when the user moves it in the browser. This string has to be unique and must not be changed over time. Optional options: Name Type content string An optional string value containing the displayed content of the widget...
tabs/utils - Archive of obsolete content
tab : tab A XUL tab element. Returns browser : getTabId(tab) Get the specified tab's ID. On Firefox it's derived from its linkedPanel property. Parameters tab : tab A XUL tab element. Returns id : the ID for this tab. getTabForId(id) Get the tab identified by id. Parameters id : On Firefox it's derived from its linkedPanel property. Returns tab : tab A XUL tab element. getTab
Title(tab) Get the
title of the document hosted by the specified tab, or the tab's label if the tab doesn't host a document. Parameters tab : tab A XUL tab element. Returns String : setTab
Title(tab,
title) Set the
title of the document hosted by the specified tab, or the tab's label if the tab doesn't host a document. Parameters tab : tab A XUL tab element.
title : String The new
title. g...
window/utils - Archive of obsolete content
d, including the whole DOM document, images, and any other sub-resources. Parameters window : nsIDOMWindow Returns boolean: true if the document is completely loaded. isBrowser(window) Returns true if the given window is a Firefox browser window: that is, its document has a "windowtype" of "chrome://browser/content/browser.xul". Parameters window : nsIDOMWindow Returns boolean getWindow
Title(window) Get the
title of the document hosted by the given window Parameters window: nsIDOMWindow Returns string: this document's
title. isXULBrowser(window) Returns true if the given window is a XUL window. Parameters window : nsIDOMWindow Returns boolean getFocusedWindow() Gets the child window within the topmost browser window that is focused. See nsIFocusManager for more details. ...
cfx to jpm - Archive of obsolete content
f --profiledir and --overload-modules, use --profile and --overload. Instead of using --force-mobile, explicitly add fennec to engines section of your package.json. Package.json fields Many package.json fields are implicit commands to cfx. In jpm, we've removed support for some of these fields, and are still working on supporting some others. Permanently removed fields data fullName - use
title instead lib packages tests icon64 Package.json escaping Where with cfx you might have had to escape with 2 upto 3 backslashes ( \ ), jpm only needs one now. ...
jpm - Archive of obsolete content
jpm sign Package your add-on as an XPI file, and then retrieve a new XPI signed by Mozilla. jpm init This command initializes a new add-on from scratch. Create a new directory, change into it, and run jpm init. mkdir my-addon cd my-addon jpm init You'll then be asked to supply some information about your add-on: this will be used to create your add-on's package.json file.
title name: this defaults to the name of the directory in which you are running jpm init. Unless an id field is present in package.json, jpm prepends "@" to name and use the result as the id field in the add-on's install manifest. version description entry point (which maps to "main" in package.json) author engines (supported applications) license Most of these fields have a default, which is ...
Displaying annotations - Archive of obsolete content
ion panel: a simple HTML file to use as a template a simple content script to build the panel's content These files will live in a new subdirectory of data which we'll call annotation. Annotation panel HTML <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <
title>Annotation</
title> <style media="all" type="text/css"> body { font: 100% arial, helvetica, sans-serif; background-color: #F5F5F5; } div { text-align:left; } </style> </head> <body> <div id="annotation"> </div> </body> </html> Save this in data/annotation as annotation.html. Annotation panel Content Script The annotation panel has a minimal content scr...
Open a Web Page - Archive of obsolete content
//www.example.com"); This function is asynchronous, so you don't immediately get back a tab object which you can examine. To do this, pass a callback function into open(). The callback is assigned to the onReady property, and will be passed the tab as an argument: var tabs = require("sdk/tabs"); tabs.open({ url: "http://www.example.com", onReady: function onReady(tab) { console.log(tab.
title); } }); Even then, you don't get direct access to any content hosted in the tab. To access tab content you need to attach a script to the tab using tab.attach(). This add-on loads a page, then attaches a script to the page which adds a red border to it: var tabs = require("sdk/tabs"); tabs.open({ url: "http://www.example.com", onReady: runScript }); function runScript(tab) { tab.atta...
Forms related code snippets - Archive of obsolete content
Here are some <form> related code snippets. Date picker (before implementing it in a working environment, please read the note about the const statement compatibility) <!doctype html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <
title>DatePicker Example - MDN</
title> <script type="text/javascript"> /*\ |*| |*| DatePicker Example MDNDeveloper Network |*| |*| https://developer.mozilla.org/docs/Code_snippets/Forms |*| https://developer.mozilla.org/User:fusionchess |*| |*| This snippet is released under the GNU Public License, version 3 or later. |*| http://www.gnu.org/licenses/gpl-3.0-standalone.html |*| \*/ (function () { function DatePicker (oTarget) { const oTable = document.createElement("table"), oHRow = document.createElement...
HTML in XUL for rich tooltips - Archive of obsolete content
This example demonstrates the dynamic injection of HTML into a XUL element. Specifically, we create a rich tooltip that uses HTML instead of plain text. Dynamic HTML in XUL Tooltip Insert the appropriate code from below into your XUL overlay. ...
HTML to DOM - Archive of obsolete content
t HTML string into DOM for easier manipulation. However, there are potential dangers involved in injecting remote content in a privileged context in your extension, so it can be desirable to parse the HTML safely. The function below will safely parse simple HTML and return a DOM object which can be manipulated like web page elements. This will remove tags like <script>, <style>, <head>, <body>, <
title>, and <iframe>. It will also remove all JavaScript, including element attributes that contain JavaScript. function HTMLParser(aHTMLString){ var html = document.implementation.createDocument("http://www.w3.org/1999/xhtml", "html", null), body = document.createElementNS("http://www.w3.org/1999/xhtml", "body"); html.documentElement.appendChild(body); body.appendChild(Components.classes["...
Sidebar - Archive of obsolete content
h as web pages can be safely loaded as sidebar in the "viewWebPanelsSidebar". Bookmarks with "Load this bookmark in sidebar" checked in the properties open in the "viewWebPanelsSidebar". A web page can use window.sidebar to create bookmark with that property. To open a page in the "viewWebPanelsSidebar" from chrome code (browser/addon/extension) such as from menuitem, it can call: openWebPanel(a
Title, aURI); Accessing the sidebar from a browser.xul script The sidebar content is always in a document separate from the main browser document (the sidebar is actually implemented as a XUL browser element). This means you can't directly access the sidebar content from a script referenced from a browser.xul overlay. To access your sidebar's window or document objects, you need to use the contentWi...
XPath - Archive of obsolete content
se { var tobj = obj.evaluate("/root/field/item",obj.documentElement,null, XPathResult.ANY_TYPE, null); var tmp = tobj.iterateNext(); while(tmp) { fields.push(tmp.textContent); tmp = tobj.iterateNext(); } } alert(fields); } //here is the demo xml file for xpath <?xml version="1.0"?> <root> <field> <item>Art_Id</item> <item>PSection</item> <item>Qkind</item> <item>Q
title</item> <item>Question</item> <item>Pic</item> <item>Answer1</item> <item>Answer2</item> <item>Answer3</item> <item>Answer4</item> </field> </root> //add by mooring 2008-11-15 16:16 china ...
Listening to events in Firefox extensions - Archive of obsolete content
wser or tabbrowser you wish to watch for events from. Keep in mind that the events may come from any frame within the browser or, for a tabbrowser, any of the browsers within it. Some of the more interesting DOM events you may wish to monitor are listed here: Event Description DOMLinkAdded Dispatched when a new HTML <link> element is detected in the document. DOM
TitleChanged Dispatched when the
title of the page changes. DOMContentLoaded Dispatched when the initial DOM for the page is completely loaded. load Dispatched after the page--including images--has first finished loading. unload Dispatched when the user has navigated away from the page. pageshow Dispatched when a page is newly displayed. pageh...
Adding Toolbars and Toolbar Buttons - Archive of obsolete content
verlay stuff. --> </overlay> One detail that is easy to overlook is the fact that the toolbarpalette element is outside of the window element. If you put the toolbarpalette element inside the window element in your overlay, some weird errors will begin to happen. Always set the label and tooltiptext attributes of a toolbarbutton. In the case of a toolbaritem element (discussed later), use the
title attribute instead of label. Tooltips are very important for users that want to know what a button does before clicking it. Setting the image for a toolbar button is done with CSS: #xulschoolhello-hello-world-button { list-style-image: url("chrome://xulschoolhello/skin/hello-world.png"); } It's not really that simple to set the image for a toolbar button, because we need to consider the app...
Adding sidebars - Archive of obsolete content
open either one from the View > Sidebar menu. They also have shortcuts to open or close them using the keyboard. The code required to add a sidebar is very simple, as explained in Creating a Firefox Sidebar. It's even simpler than that. All you need is to overlay the View Sidebar menu. <menupopup id="viewSidebarMenu"> <menuitem id="xulschoolhello-sidebar" label="&xulschoolhello.sidebar.
title;" accesskey="&xulschoolhello.sidebar.accesskey;" type="checkbox" autoCheck="false" group="sidebar" sidebarurl="chrome://xulschoolhello/content/sidebar.xul" sidebar
title="&xulschoolhello.sidebar.
title;" oncommand="toggleSidebar('xulschoolhello-sidebar');" /> </menupopup> The example in the MDC page includes a shortcut key combination to toggle the new sidebar. Keyboard short...
Handling Preferences - Archive of obsolete content
utton in a toolbar, you need to take into account that the opening behavior of a Preferences window is different depending on the operating system. This is how we do it: openPreferences : function() { if (null == this._preferencesWindow || this._preferencesWindow.closed) { let instantApply = Application.prefs.get("browser.preferences.instantApply"); let features = "chrome,
titlebar,toolbar,centerscreen" + (instantApply.value ? ",dialog=no" : ",modal"); this._preferencesWindow = window.openDialog( "chrome://xulschoolhello/content/preferencesWindow.xul", "xulschoolhello-preferences-window", features); } this._preferencesWindow.focus(); }, This code is based on the code that opens Preference windows from the Add-ons Manager. It does ...
The Essentials of an Extension - Archive of obsolete content
formation Firefox and other Mozilla applications need to install an add-on. Any errors or missing information will cause the installation process to fail, or the extension to be installed in a disabled state. The chrome.manifest File Chrome is the set of user interface elements of the application window that are outside of a window's content area. Toolbars, menu bars, progress bars, and window
title bars are all examples of elements that are typically part of the chrome. Taken from Chrome Registration. In other words, the chrome is everything you see in Firefox. All Firefox windows can be seen as having two parts: (1) the chrome and (2) possibly a content area, like the one that displays web pages in a Firefox tab. Windows like the Downloads window are pure chrome. Most of the code for an...
Tabbed browser - Archive of obsolete content
MUtils.defineLazyServiceGetter(this, "gSessionStore", "@mozilla.org/browser/sessionstore;1", "nsISessionStore"); // Create new tab, but don't load the content. var url = "https://developer.mozilla.org"; var tab = gBrowser.addTab(null, {relatedToCurrent: true}); gSessionStore.setTabState(tab, JSON.stringify({ entries: [ {
title: url } ], userTypedValue: url, userTypedClear: 2, lastAccessed: tab.lastAccessed, index: 1, hidden: false, attributes: {}, image: null })); Reusing tabs Rather than open a new browser or new tab each and every time one is needed, it is good practice to try to re-use an existing tab which already displays the desired URL--if one is already open. Following this practice minimizes...
Firefox addons developer guide - Archive of obsolete content
documents; Add abbreviation definition to acronyms; Add some link to the internal MDC documentation when it makes sense; Indent source code; Make sure documentation is relevant for all platforms: GNU/Linux, MacOS, Windows; Add anchor links to Figures & Listings; Add credits to original authors and license; COMPLETED Sometimes, interfaces names are misspelled: s/nsL/nsI; Talk about FUEL;
Titles of chapters and sub-headings should have CAPS for first letter of each word; We should add a part about bad and good practices (leaks, global scopes, ...); Add external resources (mozdev.org/community/books.html); Add to chapter 3 or 5 more informations about overlay (how to overlay some interesting part of Firefox like status bar, menus or toolbar) Add previous/next at the end of each chapt...
An Interview With Douglas Bowman of Wired News - Archive of obsolete content
mple CSS positioning; Vastly increased accessibility without special coding or user agent detection. Why did you pursue a standards-based redesign of Wired News? As Network Design Manager at Lycos for the last two years, I've been creating and documenting design standards for our network of sites. This includes rules and guidelines applying to everything from headers, footers, page hierarchy,
titles, typography, iconography, navigation, and others. So I'm very familiar with standards and the benefits of using them. With the Wired News design process, the scenario was reversed. As I was designing the product, I began discovering a broader set of Web standards, and was quickly swayed by the advantages I could see if we were to adopt them. It was a no-brainer to us that Wired News was a perfe...
Creating reusable content with CSS and XBL - Archive of obsolete content
you avoid linking everything at the document level, you can make self-contained parts that are easy to maintain and reuse. More details For more information about XBL bindings, see the XBL page in this wiki. Action: An XBL demonstration Make a new HTML document, doc6.html. Copy and paste the content from here: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"> <HTML> <HEAD> <
TITLE>Mozilla CSS Getting Started - XBL demonstration</
TITLE> <LINK rel="stylesheet" type="text/css" href="style6.css"> </HEAD> <BODY> <H1>XBL demonstration</H1> <DIV id="square">Click Me</DIV> </BODY> </HTML> Make a new CSS file, style6.css. This stylesheet contains the document style. Copy and paste the content from here: /*** XBL demonstration ***/ #square { -moz-binding: url("square.xbl#squ...
Localizing an extension - Archive of obsolete content
g strings in XUL files Create the needed locale files Each XUL file that comprises the user interface for your extension should have a locale file in its locale directory. Each locale file maps entity names referenced in the XUL files to the strings themselves. The preference dialog, whose XUL file is options.xul, has a corresponding options.dtd file that looks like this: <!ENTITY options_window_
title "StockWatcher 2 Preferences"> <!ENTITY options_symbol.label "Stock to watch: "> The "options_window_
title" entity maps to the string "StockWatcher 2 Preferences", which is used as the
title of the preference window. The stockwatcher2.dtd file contains the mappings for the stockwatcher2.xul file: <!ENTITY panel_loading "Loading..."> <!ENTITY menu_refresh_now.label "Refresh Now"> <!ENTITY menu...
Creating a Web based tone generator - Archive of obsolete content
in interval through the setInterval() function. The function mozWriteAudio() is called to write those samples produced in the audio stream. In order to always have samples to play, a buffer of 500 ms is created. The function mozCurrentSampleOffset() is used to know the position of the samples being played so that we can fill a 500 ms buffer of audio samples. <!DOCTYPE html> <html> <head> <
title>JavaScript Audio Write Example</
title> </head> <body> <input type="text" size="4" id="freq" value="440"><label for="hz">Hz</label> <button onclick="start()">play</button> <button onclick="stop()">stop</button> <script type="text/javascript"> function AudioDataDestination(sampleRate, readFn) { // Initialize the audio output. var audio = new Audio(); ...
Source code directories overview - Archive of obsolete content
that the content is a mail message, it looks up the appropriate listener (probably Netscape Messenger) and passes the mail message to it for display. It is generic and can hand the content off to internal components (like Messenger), to plug-ins or helper apps. view contains C interfaces and code for different types of views (e.g. scrolling view). A view contains content but does not contain the
title bar, borders or other decorations (which are contained by frames). This code serves to manipulate the individual content that it contains. For example, a scrolling view will find out the scroll bar positions and tell its content where to draw according the scroll bar thumbs. webshell contains C interfaces, C code, Linux shell scripts and other files for embedding Mozilla in other programs on var...
Drag and Drop Example - Archive of obsolete content
t the button has a default label. This example is fairly simple. One possible change is to use a custom flavour for the data instead of text. The problem with using text is that if the text from an external drag just happens to be set to button, a button will be created on the board. A custom type means that the board will only accept drags from the palette. ...
textbox.showCommentColumn - Archive of obsolete content
<< XUL Reference home showCommentColumn Obsolete since Gecko 1.9.1 Type: boolean If true, a comment column appears in the popup. For the URL history, the comment column will contain the page
titles associated with each URL. If this attribute is not specified, the comment column doesn't appear. As of Gecko 1.9.1, this attribute is now always specified in lower case. ...
Deprecated and defunct markup - Archive of obsolete content
ng affects value in textbox; not usable) <spring> (use @flex instead) <strut> (replaced by @debug?) <tabcontrol> (contained tabbox and tabpanel) <text> (like <label> or <description> but does not wrap; like <label crop="end">; had been used in menus/toolbars) <textfield> (like <textbox>) <thumb> (<button> with deprecated <gripper>; implements sliding box in center of scrolbar) <
title> (to add a caption on a <
titledbox> <
titledbox> (box with a frame) <
titledbutton> (attempt to combine text and images before <button>) <toolbarpaletteitem> Required to embed non-buttons in customisable toolbars --Neil 03 March 2011 <treebody> (old/experimental and unsupported XUL tags) Lives on as the internal name for the ancestor <treechildren> element --Neil 03 March 2011 <treec...
XUL Events - Archive of obsolete content
close This event is sent when a request has been made to close the window when the user presses the close button. If you place an event handler on the window element, you can trap the window close. If you call event.preventDefault() within the listener the window will not close. Note that the close event is only fired when the user presses the close button on the
titlebar; (i.e. not File -> Quit) use the unload event to capture all attempts to unload the window. attribute: onclose command This event handler is called when an element is activated. How it is activated varies for each element and in many cases, there are several ways to activate an element. For exampl...
Introduction to XUL - Archive of obsolete content
red as <broadcaster> elements in the XUL description, and are involved with the communication of changes of state between widgets. A widget or several widgets can arrange to have the value of one of their attributes be tied to a broadcaster node. This tie is defined within the XUL: <xul:window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <broadcaster id="canGoBack"/> <
titledbutton src="resource:/res/toolbar/TB_Back.gif" align="bottom" value="Back" onclick="BrowserBack()"> <observes element="canGoBack" attribute="disabled"/> </
titledbutton> </window> But it is up to the application code to locate the broadcasters within a window so it can punch them when necessary. Broadcasters can broadcast any change of state, which can be tied to the value of ...
controllers - Archive of obsolete content
<< XUL Reference controllers Type: nsIControllers A controllers list attached to the element. The controllers are used to respond to commands. The document's command dispatcher will locate controllers to handle a command by using the focused element's list. ...
Building Menus With Templates - Archive of obsolete content
The first rule matches all houses, while the second rule is used for streets. The content generated for each rule differs in only two ways. First, the menu tag is different (menuitem versus menu), and the label is taken from a different RDF predicate. At the outer level, the second rule match...
Template Builder Interface - Archive of obsolete content
HTML elements. This isn't a very common technique, however, here is an example of how this can be used: <html:div id="photosList" datasources="template-guide-photos5.rdf" ref="http://www.xulplanet.com/rdf/myphotos" xmlns:html="http://www.w3.org/1999/xhtml"> <html:h1>My Photos</html:h1> <template> <html:p uri="rdf:*"><textnode value="rdf:http://purl.org/dc/elements/1.1/
title"/></html:p> </template> </html:div> This example generates three paragraphs. Some static content before the <template> element displays a <h1> header. Since templates were designed for creating XUL content, sometimes there can be unusual results when using HTML. Sometimes this is due to different whitespace handling for HTML and XUL, which is why the content to generate in the above example is ...
Adding Buttons - Archive of obsolete content
n add align="start" to the window tag to prevent the stretching. The findfile.xul example Let's add this code to the file findfile.xul that we created in the previous section. The code needs to be inserted in-between the window tags. The code to add is shown in red below: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="findfile-window"
title="Find Files" orient="horizontal" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <button id="find-button" label="Find"/> <button id="cancel-button" label="Cancel"/> </window> You'll notice that the Cancel button was added also. The window has been given a horizontal orientation so that the two buttons appear beside each other. If you open the file ...
Adding HTML Elements - Archive of obsolete content
of HTML much like the one we used to declare XUL. This must be entered exactly as shown or it won't work correctly. Note that Mozilla does not actually download this URL, but it does recognize it as being HTML. Here is an example as it might be added to the find file window: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="findfile-window"
title="Find Files" orient="horizontal" xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> Then, you can use HTML tags as you would normally, keeping in mind the following: You must add a html: prefix to the beginning of each tag, assuming you declared the HTML namespace as above. The tags must be entered in lowercase. "Quotes" ...
Adding more elements - Archive of obsolete content
uitem label="Is"/> <menuitem label="Is Not"/> </menupopup> </menulist> <spacer style="width: 10px;"/> <textbox id="find-text" flex="1" style="min-width: 15em;"/> </hbox> <spacer style="height: 10px" flex="1"/> <hbox> Now when the dialog is resized, the two buttons will move so that they are always along the bottom of the dialog. The first spacer adds extra spacing in between the
title label and the search criteria elements. It might look nicer if there was a border around the search criteria. There are two ways to do this. We could use the CSS border property or we could use the groupbox element. This first method would require that we set the style on the box itself. We will use the latter method, however. A groupbox has the advantage that it draws a box with a nice beveled l...
Advanced Rules - Archive of obsolete content
lled the predicate and the last part is called the object. As a triple element, it would be expressed as follows: <triple subject="A Bookmark to mozilla.org" predicate="URL" object="www.mozilla.org"/> This has been simplified a bit from the real thing. The predicate would normally include the namespace, and the subject would be the bookmark's resource id, not the bookmark's
title as used here. In fact, the bookmark's
title would be another triple in the datasource using the Name predicate. You can replace the subject and object on the triple element with variable references, in which case values will be substituted for the variables. If no value is defined for a variable yet, the template builder will look up the value in the datasource and assign it to the variable. Let'...
Box Model Details - Archive of obsolete content
te aligns the buttons vertically. The result is that the buttons will be centered in the box in both directions. This example will work with a vertical box as well, although the second button will be underneath the first one, instead of beside it. ...
Box Objects - Archive of obsolete content
stored in the DOM. Retrieving Position and Size The box object provides six read only properties, x, y, screenX, screenY, width and height, for determining the currently displayed position and size of an element. All values returned are in pixels. x, y The x and y coordinates are referenced from the top left corner of the document in the window (that portion which excludes the window border and
title bar) and refer to the top left corner of the element, including CSS padding. CSS margins and borders* are excluded. The top left corner of the document is that which is obtained from screen.mozInnerScreenX, screen.mozInnerScreenY screenX, screenY The screenX and screenY coordinates are referenced from the absolute top left corner of the screen (screen.top,screen.left) and refer to the top left ...
Commands - Archive of obsolete content
View) in a browser window and selecting items from the list. You'll notice that the Delete command on the browser's Edit menu is enabled and that selecting it will delete a row. (See Discussion about opening this example). The example below isn't completely polished. Really, we should ensure that the selection and focus is adjusted appropriately after a deletion. ...
Custom Tree Views - Archive of obsolete content
et or change the view. function setView(){ document.getElementById('my-tree').view = treeView; } The following presents the example together. An inline script has been used here to simplify the example. Normally, you would put the script in an external script file. ...
Element Positioning - Archive of obsolete content
ute applies to the box containing the elements to be aligned, not to the elements themselves. For example, the first box below will have its children stretch, because that is the default. The second box has an align attribute, so its children will be placed centered. Example 5: Source View <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="yesno"
title="Question" orient="horizontal" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <hbox> <button label="Yes"/> <button label="No"/> </hbox> <hbox align="center"> <button label="Maybe"/> <button label="Perhaps"/> </hbox> </window> You can also use the style properties -moz-box-pack and -moz-box-align instead of specifying attributes. You m...
Features of a Window - Archive of obsolete content
size. If you leave it out, the size is determined by the elements that are in it. Gecko 1.9.2 note Starting in Gecko 1.9.2 (Firefox 3.6), overriding the position of a window using window features will not change the persisted values saved by the session store feature. That means the next time the window is opened, it will still open in the saved location. <window id="findfile-window"
title="Find Files" width="400" height="450" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> In this example, the window will open with a width of 400 pixels and a height of 450 pixels. Even if there aren't enough elements to fit this size, the window will still open at this size and there will be blank space in the remaining area. If there are too many elements, the window...
Focus and Selection - Archive of obsolete content
scussed in a later section on commands. For now, we'll look at some of the focus related features of the command dispatcher. You can retrieve the command dispatcher from a window using the document's commandDispatcher property. From there, you can get the focused element with the dispatcher's focusedElement property. The example below shows this. ...
Grids - Archive of obsolete content
place of the button element of course. If you wanted one particular cell to contain multiple elements, you can use a nested hbox or other box element. An hbox is a single element but you can put as many elements that you want inside it. For example: Example 2 : Source View <grid flex="1"> <columns> <column/> <column flex="1"/> </columns> <rows> <row> <label control="doc
title" value="Document
Title:"/> <textbox id="doc
title" flex="1"/> </row> <row> <label control="docpath" value="Path:"/> <hbox flex="1"> <textbox id="docpath" flex="1"/> <button label="Browse..."/> </hbox> </row> </rows> </grid> Notice in the image how the first column of elements containing the labels has only a single element in each row. The...
Introduction to RDF - Archive of obsolete content
declared so that the RDF elements are recognized properly. Inside, the RDF element, you will place the data. To see some example RDF/XML files, look at those provided with Mozilla. They have the extension rdf. RDF database Let's take the example of a bookmarks list generated from RDF. A bookmarks list contains a set of records, each with a set of data associated with it, such as a URL, a bookmark
title and a visited date. Think of the bookmarks as a database, which is stored as a large table with numerous fields. In the case of RDF however, the lists may be hierarchical as well. This is necessary so that we can have folders or categories of bookmarks. Each of the fields in an RDF database is a resource, each with a name associated with it. The name is described by a URI. For example, a selectio...
More Wizards - Archive of obsolete content
on the first page of the wizard. The function checkCode() is called whenever the first page is shown as indicated by the onpageshow attribute. It is also called whenever a key is pressed in the textbox, to determine whether the Next button should be enabled again. ...
Persistent Data - Archive of obsolete content
ute name to the persist attribute. You can add the persist attribute to any element and store any attribute. You might use unusual values if you adjust attributes using a script. Our Find Files Example Let's add the persist attribute to some of the elements in the find files dialog. To save the position of the window. To do this, we need to modify the window. <window id="findfile-window"
title="Find Files" persist="screenX screenY width height" orient="horizontal" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> This will cause the x and y position of the window and the width and height of the window to be saved. We could extend it further to save the collapsed state of the splitter. It doesn't really make sense to save the current tab state. Find files...
Templates - Archive of obsolete content
termine which rules apply to which RDF resource. When scanning for which rule applies to the data, each rule element is checked in sequence for a match. That means that the order in which you define rules is important. Earlier rules will override later rules. ...
XPCOM Interfaces - Archive of obsolete content
/www.mozilla.org","Mozilla",0,null); First, the component "@mozilla.org/browser/bookmarks-service;1" is retrieved and its service is placed in the variable bmarks. We use QueryInterface() to get the nsIBookmarksService interface. The function addBookmarkImmediately() provided by this interface can be used to add bookmarks. The first two parameters to this function are the bookmark's URL and its
title. The third parameter is the bookmark type which will normally be 0 and the last parameter is the character encoding of the document being bookmarked, which may be null. Next, we will see some of the interfaces provided with Mozilla that we can use. << PreviousNext >> ...
Using Remote XUL - Archive of obsolete content
</menupopup> </menu> <button label="Faq" value="https://www.mozilla.org/faq.html" /> <button label="Search" value="https://www.mozilla.org/search.html" /> </menubar> <iframe src="https://www.mozilla.org/" flex="1" /> </window> The menupopup element is a container for menu items. It represents the rectangular box that appears when you click a menu
title. The menuitem element represents a selectable item within the popup. Its label attribute contains the text to display in the item. Its value attribute, while defined in the XUL specification, has no specific function in XUL; it can store any data associated with the item. In our case we use it to store the URL of the page to load when the user selects the item from the menu. Source | Rendered ...
Writing Skinnable XUL and CSS - Archive of obsolete content
rohibited in XUL files without approval Any usages of inline style are extremely dangerous, since they are overriding the included skin, and must be approved before their usage will be allowed. Image chrome URLs should never occur in XUL. Any chrome URL that references an image in the skin is strictly forbidden in the XUL. If you find yourself needing to display an image from the skin, then use <
titledbutton> and style it rather than using <html:img>. The problem here is that you'll end up placing a restriction on the skin, which will force the skin designer to supply an image with the exact name you've specified. This is not healthy. Note that some particularly evil people put images chrome URLs in DTDs. This is even worse, and it also is strictly forbidden. Original Document Information ...
Accessibility/XUL Accessibility Reference - Archive of obsolete content
t spacer splitter stringbundle stringbundleset vbox window Elements not processed yet: action binding bindings broadcaster broadcasterset conditions content dialog dialogheader editor listcell member observes preference preferences prefpane prefwindow resizer richlistbox richlistitem resizer rule scrollbar scrollbox scrollcorner separator template textnode
titlebar toolbar toolbarbutton toolbargrippy toolbaritem toolbarpalette toolbarseparator toolbarset toolbarspacer toolbarspring toolbox tooltip treeseparator triple wizard wizardpage Cases to revisit: ...
elements - Archive of obsolete content
e preferences prefpane prefwindow progressmeter R radio radiogroup resizer richlistbox richlistitem resizer row rows rule S script scrollbar scrollbox scrollcorner separator spacer splitter stack statusbar statusbarpanel stringbundle stringbundleset T tab tabbrowser tabbox tabpanel tabpanels tabs template textnode textbox
titlebar toolbar toolbarbutton toolbargrippy toolbaritem toolbarpalette toolbarseparator toolbarset toolbarspacer toolbarspring toolbox tooltip tree treecell treechildren treecol treecols treeitem treerow treeseparator triple V vbox W window wizard wizardpage ...
menuitem - Archive of obsolete content
larger than this maximum width, you may be able to use the max-width CSS property (or the maxwidth attribute) to override this size. For example, for a menuitem in a menu you can add the following CSS rule when you want to use the value none: menupopup > menuitem, menupopup > menu { max-width: none; } description Type: string Descriptive text to appear in addition to the dialog
title. disabled Type: boolean Indicates whether the element is disabled or not. If this attribute is set, the element is disabled. Disabled elements are usually drawn with grayed-out text. If the element is disabled, it does not respond to user actions, it cannot be focused, and the command event will not fire. In the case of form elements, it will not be submitted. Do not set the attribute to ...
tree - Archive of obsolete content
XUL for the tree: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <?xml-stylesheet href="file://C:/main.css" type="text/css"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.
wizardpage - Archive of obsolete content
xamples | Attributes | Properties | Methods | Related ] This element defines a page in a wizard. The content in the pages should be placed inside the wizardpage element. More information is available in the XUL tutorial. Attributes description, label, next, pageid Properties next, pageid Attributes description Type: string Descriptive text to appear in addition to the dialog
title. label Type: string The label that will appear on the element. If this is left out, no text appears. For an editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem. next Type: id Set to the pageid of the next wizardpage after this one. When set, the page with this pageID is displayed when the Next button is...
MacFAQ - Archive of obsolete content
ch: "chrome://myXUL/content/hiddenWindow.xul" next take the code below and drop it in, to create the hiddenWindow.xul (Note: the debug function and nsICommandLine try/catch can be removed, all you need is the window.arguments[0]) <?xml version="1.0"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="myXUL_hidden" windowtype="myXUL:hiddenwindow"
title="" width="0" height="0" persist="screenX screenY width height sizemode" > <!-- Load the Mozilla helpers --> <script type="application/javascript" src="chrome://global/content/nsUserSettings.js" /> <script><![CDATA[ function debug(aLogString) { var mConsoleService = Components.classes["@mozilla.org/consoleservice;1"] .getService(Components.in...
reftest opportunities files - Archive of obsolete content
dbaron.org/css/test/sec1802 http://dbaron.org/css/test/sec1803 http://dbaron.org/css/test/outline http://dbaron.org/css/test/sq_small http://dbaron.org/css/test/sq_large Tests from mozilla source tree parser/htmlparser/tests/html/xmp005.html parser/htmlparser/tests/html/value001.html parser/htmlparser/tests/html/utf8001.html parser/htmlparser/tests/html/usascii.html parser/htmlparser/tests/html/
title01.html parser/htmlparser/tests/html/
title.html parser/htmlparser/tests/html/tiny.html parser/htmlparser/tests/html/thead001.html parser/htmlparser/tests/html/text003.html parser/htmlparser/tests/html/text002.html parser/htmlparser/tests/html/text001.html parser/htmlparser/tests/html/tbody001.html parser/htmlparser/tests/html/target01.html parser/htmlparser/tests/html/tag008.html parser/htmlparser...
Gecko Compatibility Handbook - Archive of obsolete content
ecko does not try to 'sniff' the MIME type for a document in order to reduce the possibility of unsecure, dangerous content masquerading as as a safe MIME type. Use Perl's HEAD utitility to determine the actual MIME type being used by the Web Server. Correct any incorrect Server MIME types. (related article) Stylesheet is not being recognized The presence of the
title attribute in a link element that references an external stylesheet can cause the stylesheet may be causing the external stylesheet to be ignored. Make sure that any stylesheet which should always be applied is persistent instead of preferred. (related article) Connecting to a secure site fails, but connects in Internet Explorer The Web Server does not properly i...
Mozilla.dev.apps.firefox-2006-10-06 - Archive of obsolete content
ptember 30 - October 6, 2006 Announcements Vista Compatibility Lab Mike Schroepfer announced the current work being done testing mozilla products with Vista. A wiki and IRC channel have been created to track their progress. Discussions Firefox trunk and rc1 slowdown using tabs Discussion regarding certain theme components (specifically alpha-transparency) creating a high CPU load on OS/2.
Title case capitalization rules in Firefox Discussion regarding rules for capitalizing the first letter of Firefox menu items in the FF UI. Engineering Student Project - Industry Coach Paul Betts from Ohio State University is looking for someone from Mozilla to be his "Industry Coach" for Engineering 494 - How Great Ideas Turn into Great Products. Mozilla is a great product afterall. Reload vs. reloa...
2006-10-06 - Archive of obsolete content
ptember 30 - October 6, 2006 Announcements Vista Compatibility Lab Mike Schroepfer announced the current work being done testing mozilla products with Vista. A wiki and IRC channel have been created to track their progress. Discussions Firefox trunk and rc1 slowdown using tabs Discussion regarding certain theme components (specifically alpha-transparency) creating a high CPU load on OS/2.
Title case capitalization rules in Firefox Discussion regarding rules for capitalizing the first letter of Firefox menu items in the FF UI. Engineering Student Project - Industry Coach Paul Betts from Ohio State University is looking for someone from Mozilla to be his "Industry Coach" for Engineering 494 - How Great Ideas Turn into Great Products. Mozilla is a great product afterall. Reload vs. reloa...
2006-11-24 - Archive of obsolete content
0.0.1 Discussions Quality of localized builds and process requirements Quality of localized builds and process requirements The Translate Toolkit MDNto PO: its current state and how to use it Discussion on clarifications on Translate Toolkit to avoid confusion. Feedback on L10n:Ownership draft Feedback on the L10n:Ownership draft at Mozilla wiki site detailed here. Summary vs. Live
Titles There seems to be a few locales that use "Summary" or a translation thereof instead of "Live
Titles" to name the UI part of microsummaries. The lxr query is detailed here. Meetings None for this week. Authors Paul Yanchun Gu (gpaul) Aditya Nanda Kuswanto(vipers101) ...
Element - Archive of obsolete content
ment) <link> (RSS Link Element) M <managingEditor> (RSS Managing Editor Element) N <name> (RSS Name Element) O P <pubDate> (RSS Published Date Element) Q R <rating> (RSS Rating Element) <rss> (RSS's Root "rss" Element) S <skipDays> (RSS Skip Days Element) <skipHours> (RSS Skip Hours Element) <source> (RSS Source Element) T <textinput> (RSS Text Input Element) <
title> (RSS
Title Element) <ttl> (RSS TTL Element) U <url> (RSS URL Element) V W <webMaster> (RSS Web Master Element) <width> (RSS Width Element) X Y Z ...
Confidentiality, Integrity, and Availability - Archive of obsolete content
on is accessible by authorized users. If an attacker is not able to compromise the first two elements of information security (see above) they may try to execute attacks like denial of service that would bring down the server, making the website unavailable to legitimate users due to lack of availability. Original Document Information Author(s): Karen Scarfone, Wayne Jansen, and Miles Tracy
Title: NIST Special Publication 800-123, Guide to General Server Security Last Updated Date: July 2008 Copyright Information: This document is not subject to copyright. ...
TCP/IP Security - Archive of obsolete content
data is being sent from the expected host. SSL authentication is typically performed one-way, authenticating the server to the client, but it can be performed mutually. Replay Protection. The same data is not delivered multiple times, and data is not delivered grossly out of order. Original Document Information Author(s): Sheila Frankel, Paul Hoffman, Angela Orebaugh, and Richard Park
Title: National Institute of Standards and Technology (NIST) Special Publication 800-113, Guide to SSL VPNs Last Updated Date: July 2008 Copyright Information: This document is not subject to copyright. ...
Building a Theme - Archive of obsolete content
toolbar's Styling Note In Firefox 4.0 and up, the highlight feature of DOM Inspector is broken. To workaround this, disable Hardware Acceleration in Firefox' Options. Open up the DOM Inspector now (located under the "Tools" menu), and go to "File->Inspect Chrome Document". This will be a menu containing all the XUL documents currently open in Firefox. Pick the first document with a web page
title, like "Firefox Start Page" and select it. For this tutorial, we're going to update the background color of the toolbars. Select the node finding tool (the arrow-plus-box in the top-left corner of the DOM Inspector), and click on any unused space on a toolbar. This should select a node of type "xul:toolbar" in the DOM Inspector. From here, you can play around with various different stylings for ...
Common Firefox theme issues and solutions - Archive of obsolete content
s a companion document to the AMO editors guide Common Theme Problems, which provides editors with "boilerplate" copy and paste review notes for common theme issues. This document was started on July 27, 2012 so it will take some time to completely fill in and some issues still need to have solutions written for them. Operating system specific issues Windows 7 Windows 7 Aero missing right-hand
title bar buttons When tabs are on top and the menu bar is disabled, Firefox is missing the min/max/restore/close button on the right side of the
title bar. Please see the following threads on MozillaZine for solutions to this issue: http://forums.mozillazine.org/viewtopic.php?f=18&t=2131121 http://forums.mozillazine.org/viewtopic.php?f=18&t=1953371&start=60 Windows 7 Aero not going into full scree...
-ms-accelerator - Archive of obsolete content
hat the "N" in the <label> element is a keyboard shortcut. When the option to "Hide keyboard navigation indicators until I use the Alt key" is enabled in the user's Display Properties, the "N" is not underlined until the user presses the Alt key. When Alt + N is pressed, the <input> element that defines an accesskey attribute value of "N" receives the focus. <!DOCTYPE html> <html> <head> <
title>Accelerator</
title> </head> <body> <label for="oName"><u style="-ms-accelerator: true; accelerator: true">N</u>ame: </label> <input type="text" id="oName" size="25" accesskey="N" value="Your name here" /> </body> </html> Specifications Not part of any specification. Remarks This property is supported by Windows 2000 and later. It enables users to hide na...
-ms-scrollbar-3dlight-color - Archive of obsolete content
<percentage>, <percentage>, <alpha-value>? )where <alpha-value> = <number> | <percentage><hue> = <number> | <angle> Examples The following example shows how to create a style rule that sets the -ms-scrollbar-3dlight-color property for a <textarea> element. Code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/scrollbarColor.htm <!DOCTYPE html> <html> <head> <
title>scrollbar-3dlight-color</
title> <style> .Blue3dLight { -ms-scrollbar-3dlight-color: blue; scrollbar-3dlight-color: blue; /* Use the standard when available. */ } </style> </head> <body> <textarea class="Blue3dLight">The top and left edges of the thumb and button-face elements in the scroll bar for this element will be blue.</textarea> </body> </html> Spec...
-ms-scrollbar-darkshadow-color - Archive of obsolete content
ercentage>, <percentage>, <alpha-value>? )where <alpha-value> = <number> | <percentage><hue> = <number> | <angle> Examples The following example shows how to create a style rule that sets the -ms-scrollbar-darkshadow-color property for a <textarea> element. Code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/scrollbarColor.htm <!DOCTYPE html> <html> <head> <
title>scrollbar-darkshadow-color</
title> <style> .BlueShadow { scrollbar-darkshadow-color: blue; } </style> </head> <body> <textarea class="BlueShadow">The gutter elements in the scroll bar for this element will be blue.</textarea> </body> </html> Specifications Not part of any specification. ...
Object.observe() - Archive of obsolete content
configure'}] Object.setPrototypeOf(obj, {}); // [{name: '__proto__', object: <obj>, type: 'setPrototype', oldValue: <prototype>}] Object.seal(obj); // [ // {name: 'foo', object: <obj>, type: 'reconfigure'}, // {name: 'bar', object: <obj>, type: 'reconfigure'}, // {object: <obj>, type: 'preventExtensions'} // ] Data Binding // A user model var user = { id: 0, name: 'Brendan Eich',
title: 'Mr.' }; // Create a greeting for the user function updateGreeting() { user.greeting = 'Hello, ' + user.
title + ' ' + user.name + '!'; } updateGreeting(); Object.observe(user, function(changes) { changes.forEach(function(change) { // Any time name or
title change, update the greeting if (change.name === 'name' || change.name === '
title') { updateGreeting(); } }); }); ...
Packages - Archive of obsolete content
: Any class in the Java package netscape.*. sun: Any class in the Java package sun.*. Examples Example: JavaScript function to create a Java dialog box The following JavaScript function creates a Java dialog box: function createWindow() { var theOwner = new Packages.java.awt.Frame(); var theWindow = new Packages.java.awt.Dialog(theOwner); theWindow.setSize(350, 200); theWindow.set
Title("Hello, World"); theWindow.setVisible(true); } In the previous example, the function instantiates theWindow as a new Packages object. The setSize, set
Title, and setVisible methods are all available to JavaScript as public methods of java.awt.Dialog. ...
Common causes of memory leaks in extensions - Extensions
r stored as weak references. Be careful with setInterval/setTimeout Using window.setInterval() or window.setTimeout() can be problematic, too, when it comes to zombie compartments. Consider the following example code that could be part of your browser.xul overlay: gBrowser.addEventListener("DOMContentLoaded", function(evt) { var contentDoc = evt.originalTarget; var i = 0; // Refresh the
title once each second setInterval(function() { contentDoc.
title = ++i; }, 1000); }, false); One would normally expect that the interval (or timer) would be destroyed as soon as the document unloads, in the same way that event listeners are automatically destroyed. However, while this is still true, the window.setInterval() in the example originates from the outer chrome window (browser.xul) ...
Game distribution - Game development
ith HTML5 gives you extra advantages, such as: Multiplatform bliss The technology itself is multiplatform, so you can write the code once and target multiple devices. This can range from low-end smartphones or tablets, through laptops and desktop computers, to smart TVs, watches or even a fridge if it can handle a modern enough browser. You don't need to have separate teams to work on the same
title targeting different platforms with only one code base to worry about. You can spend more time and money on Promotion and Monetization. Instant updates You don't have to wait several days to have your game's code updated. If your user finds a bug, you can quickly fix it, update the system and refresh the game on your server to provide players with the updated code almost instantly. Direct link ...
Building up a basic demo with A-Frame - Game development
t library file inside your directory (check the GitHub repository for latest stable a dev builds). Open the A-Frame documentation in a separate tab -- it is useful to refer to. HTML structure The first step is to create an HTML document -- inside your project directory, create a new index.html file, and save the follow HTML inside it: <!doctype html> <html> <head> <meta charset="utf-8"> <
title>MDN Games: A-Frame demo</
title> <script src="aframe.min.js"></script> </head> <body> <!-- HTML goes here --> </body> </html> This contains some basic information like the document charset and <
title>. The <script> element includes the A-Frame framework in the page; we will write our example code inside the <body> element. Initializing the scene A scene is the place where everything happens...
Create the Canvas and draw on it - Game development
ame inside. This can be done using HTML and the <canvas> element. The game's HTML The HTML document structure is quite simple, as the game will be rendered entirely on the <canvas> element. Using your favourite text editor, create a new HTML document, save it as index.html, in a sensible location, and add the following code to it: <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <
title>Gamedev Canvas Workshop</
title> <style> * { padding: 0; margin: 0; } canvas { background: #eee; display: block; margin: 0 auto; } </style> </head> <body> <canvas id="myCanvas" width="480" height="320"></canvas> <script> // JavaScript code goes here </script> </body> </html> We have a charset defined, <
title> and some basic CSS in the header. The body contains <canvas> and ...
Visual typescript game engine - Game development
lass for my canvas part and matter.ts (matter.js) implementation. It is injected to the Platformer to make full operated work. gamesList args for IOC constructor is for now just symbolic for now. (WIP) In ioc, you can make strong class dependency relations. Use it for your own structural changes. Main dependency file // Symbolic for now const plarformerGameInfo = { name: "Crypto-Runner",
title: "PLAY PLATFORMER CRYPTO RUNNER!", }; // Symbolic for now const gamesList: any[] = [ plarformerGameInfo, ]; const master = new Ioc(gamesList); const appIcon: AppIcon = new AppIcon(master.get.Browser); master.singlton(Platformer, master.get.Starter); console.log("Platformer: ", master.get.Platformer); master.get.Platformer.attachAppEvents(); Project structure builds/ is autogenerated. Don...
WebVTT - MDN Web Docs Glossary: Definitions of Web-related terms
WebVTT (Web Video Text Tracks) is a W3C specification for a file format marking up text track resources in combination with the HTML <track> element. WebVTT files provide metadata that is time-aligned with audio or video content like captions or sub
titles for video content, text video descriptions, chapters for content navigation, and more. Learn more General knowledge WebVTT on Wikipedia Technical reference WebVTT on MDN Specification ...
Assessment: Accessibility troubleshooting - Learn web development
deas for improvements that would make the website more accessible? Assessment or further help If you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for Accessibility troubleshooting". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone with ...
Test your skills: CSS and JavaScript accessibility - Learn web development
you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. You can write the code yourself, or use the starting point files linked to in the above sections. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for CSS accessibility 1 skill test". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone with...
CSS and JavaScript accessibility best practices - Learn web development
however rarely need to style emphasis elements in any significant way. The standard conventions of bold and italic text are very recognisable, and changing the style can cause confusion. For more on emphasis, see Emphasis and importance. Abbreviations An element that allows an abbreviation, acronym, or initialization to be associated with its expansion: <p>Web content is marked up using <abbr
title="Hypertext Markup Language">HTML</abbr>.</p> Again, you might want to style it in some simple way: abbr { color: #a60000; } The recognised styling convention for abbreviations is a dotted underline, and it is unwise to significantly deviate from this. For more on abbreviations, see Abbreviations. Links Hyperlinks -- the way you get to new places on the web: <p>Visit the <a href="https://w...
Mobile accessibility - Learn web development
utting data tends to be more annoying for users than the equivalent experience on desktop computers. It is more convenient to type text into form inputs using a desktop or laptop keyboard than a touchscreen virtual keyboard or a tiny mobile physical keyboard. For this reason, it is worth trying to minimize the amount of typing needed. As an example, instead of getting users to fill out their job
title each time using a regular text input, you could instead offer a <select> menu containing the most common options (which also helps with consistency in data entry), and offer an "Other" option that displays a text field to type any outliers into. You can see a simple example of this idea in action in common-job-types.html (see the common jobs example live). It is also worth considering the use of...
Test your skills: WAI-ARIA - Learn web development
you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. You can write the code yourself, or use the starting point files linked to in the above sections. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for WAI-ARIA 1 skill test". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone with a coding...
A cool-looking box - Learn web development
ot shows an example of what the finished design could look like: Assessment or further help If you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for Cool-looking box". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone with a coding prob...
Test your skills: The Cascade - Learn web development
you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. You can write the code yourself, or use the starting point files linked to in the above sections. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for Cascade skill test 1". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want to be assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone with a c...
Creating fancy letterheaded paper - Learn web development
ot shows an example of what the finished design could look like: Assessment or further help If you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for Creating fancy letterheaded paper". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone w...
Fundamental CSS comprehension - Learn web development
t shows an example of what the finished design should look like: Assessment or further help If you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for Fundamental CSS comprehension". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone with ...
Test your skills: Images and Form elements - Learn web development
you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. You can write the code yourself, or use the starting point files linked to in the above sections. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for Images skill test 1". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want to be assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone with a co...
Organizing your CSS - Learn web development
ibing this approach and promoting it means that even people who are not strictly following an OOCSS approach today will generally be reusing CSS in this way -- it has entered our understanding as a good way to approach things in general. BEM BEM stands for Block Element Modifier. In BEM a block is a standalone entity such as a button, menu, or logo. An element is something like a list item or a
title that is tied to the block it is in. A modifier is a flag on a block or element that changes the styling or behavior. You will be able to recognise code that uses BEM due to the extensive use of dashes and underscores in the CSS classes. For example, look at the classes applied to this HTML from the page about BEM Naming conventions: <form class="form form--theme-xmas form--simple"> <input clas...
Test your skills: Overflow - Learn web development
you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. You can write the code yourself, or use the starting point files linked to in the above sections. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for Overflow skill test 1". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want to be assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone with a ...
Attribute selectors - Learn web development
ks (study CSS first steps.) Objective: To learn what attribute selectors are and how to use them. Presence and value selectors These selectors enable the selection of an element based on the presence of an attribute alone (for example href), or on various different matches against the value of the attribute. Selector Example Description [attr] a[
title] Matches elements with an attr attribute (whose name is the value in square brackets). [attr=value] a[href="https://example.com"] Matches elements with an attr attribute whose value is exactly value -- the string inside the quotes. [attr~=value] p[class~="special"] Matches elements with an attr attribute whose value is exactly value, or contains value i...
Test your skills: The Box Model - Learn web development
you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. You can write the code yourself, or use the starting point files linked to in the above sections. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for Box Model skill test 1". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want to be assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone with a...
Test your skills: sizing - Learn web development
you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. You can write the code yourself, or use the starting point files linked to in the above sections. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for sizing skill test 1". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone with a coding p...
Test your skills: tables - Learn web development
you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. You can write the code yourself, or use the starting point files linked to in the above sections. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for tables skill test". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone with a coding pro...
Test your skills: backgrounds and borders - Learn web development
to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. You can write the code yourself, or use the starting point files linked to in the above sections. Write a post asking for assessment and/or help at the MDN Discourse forum. Add the "learning" tag to your post so we are able to more easily find it. Your post should include: A descriptive
title such as "Assessment wanted for Flexbox layout 1 skill test". Details of what you would like us to do -- for example what you have already tried, if you are stuck and need help,. A link to the example you want assessed or need help with, in an online editor. This is a good practice to get into -- it's very hard to help someone with a coding problem if you can't see their code. A link to t...
Test your skills: values and units - Learn web development
you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. You can write the code yourself, or use the starting point files linked to in the above sections. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for values and units skill test 1". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone with ...
Test your skills: Writing Modes and Logical Properties - Learn web development
you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. You can write the code yourself, or use the starting point files linked to in the above sections. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for Writing Modes skill test 1". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone with a c...
Test your skills: Flexbox - Learn web development
you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. You can write the code yourself, or use the starting point files linked to in the above sections. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for Flexbox layout 1 skill test". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone with a ...
Test your skills: floats - Learn web development
you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. You can write the code yourself, or use the starting point files linked to in the above sections. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for Float skill test". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone with a coding prob...
Test Your Skills: Fundamental layout comprehension - Learn web development
you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. You can write the code yourself, or use the starting point files linked to in the above sections. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for Fundamental Layout Comprehension". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone wi...
Test your skills: Grid Layout - Learn web development
If you'd like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. You can write the code yourself, or use the starting point files linked to in the above sections. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for Grid layout 1 skill test". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone with a cod...
Test your skills: Multicol - Learn web development
you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. You can write the code yourself, or use the starting point files linked to in the above sections. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for Multicol skill test 1". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone with a coding...
Test your skills: position - Learn web development
you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. You can write the code yourself, or use the starting point files linked to in the above sections. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for Position skill test 1". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone with a coding...
Responsive design - Learn web development
this was frustrating to mobile users who found themselves trapped in the site's mobile version and unable to access information they knew was on the full-featured desktop version of the site. Flexible layout before responsive design A number of approaches were developed to try to solve the downsides of the liquid or fixed-width methods of building websites. In 2004 Cameron Adams wrote a post en
titled Resolution dependent layout, describing a method of creating a design that could adapt to different screen resolutions. This approach required JavaScript to detect the screen resolution and load the correct CSS. Zoe Mickley Gillenwater was instrumental in her work to describe and formalize the different ways in which flexible sites could be created, attempting to find a happy medium between fil...
Test your skills: Media Queries and Responsive Design - Learn web development
you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. You can write the code yourself, or use the starting point files linked to in the above sections. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for Responsive Web Design assessment". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone wi...
Getting started with CSS - Learn web development
understand the basics of linking a CSS document to an HTML file, and be able to do simple text formatting with CSS. Starting with some HTML Our starting point is an HTML document. You can copy the code from below if you want to work on your own computer. Save the code below as index.html in a folder on your machine. <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <
title>Getting started with CSS</
title> </head> <body> <h1>I am a level one heading</h1> <p>This is a paragraph of text. In the text is a <span>span element</span> and also a <a href="http://example.com">link</a>.</p> <p>This is the second paragraph. It contains an <em>emphasized</em> element.</p> <ul> <li>Item one</li> <li>Item two</li> <li>Item <em>three</e...
Typesetting a community school homepage - Learn web development
ot shows an example of what the finished design could look like: Assessment or further help If you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for Typesetting a community school homepage". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help som...
What HTML features promote accessibility? - Learn web development
as it should be, a logical tabbing order should automatically fall into place. <ul> <li><a href="here.html" tabindex="1">Here</a></li> <li><a href="there.html" tabindex="3">There</a></li> <li><a href="anywhere.html" tabindex="2">Anywhere</a></li> </ul> In this example (which is used purely as a demonstration--do not do this), tabbing would jump from "Here" to "Anywhere" to "There". Link
Titles If you have a link that isn't self-descriptive, or the link destination could benefit from being explained in more detail, you can add information to a link using the
title attribute. <p>I'm really bad at writing link text. <a href="inept.html"
title="Why I'm rubbish at writing link text: An explanation and an apology.">Click here</a> to find out more.</p> Access Keys Access keys provide eas...
What is the difference between webpage, website, web server, and search engine? - Learn web development
, Bing, Yahoo, or DuckDuckGo. Search engines are normally accessed through a web browser (e.g. you can perform search engine searches directly in the address bar of Firefox, Chrome, etc.) or through a web page (e.g. bing.com or duckduckgo.com). Let's look at a simple analogy -- a public library. This is what you would generally do when visiting a library: Find a search index and look for the
title of the book you want. Make a note of the catalog number of the book. Go to the particular section containing the book, find the right catalog number, and get the book. Let's compare the library with a web server: The library is like a web server. It has several sections, which is similar to a web server hosting multiple websites. The different sections (science, math, history, etc.) in th...
Styling web forms - Learn web development
t : 498px; margin : 0 auto; padding: 1em; box-sizing: border-box; background : #FFF url(background.jpg); /* we create our grid */ display : grid; grid-gap : 20px; grid-template-columns : repeat(2, 1fr); grid-template-rows : 10em 1em 1em 1em; } Notice that we've used some CSS Grid and Flexbox to lay out the form. Using this we can easily position our elements, including the
title and all the form elements: h1 { font : 1em "typewriter", monospace; align-self : end; } #message { grid-row: 1 / 5; } #from, #reply { display: flex; } Labels and controls Now we can start working on the form elements themselves. First, let's ensure that the <label>s are given the right font: label { font : .8em "typewriter", sans-serif; } The text fields require some common ru...
Test your skills: Advanced styling - Learn web development
you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. You can write the code yourself, or use the starting point files linked to in the above sections. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for Advanced form styling 1 skill test". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone ...
Test your skills: Basic controls - Learn web development
you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. You can write the code yourself, or use the starting point files linked to in the above sections. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for Basic controls 1 skill test". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone with a ...
Test your skills: Form structure - Learn web development
you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. You can write the code yourself, or use the starting point files linked to in the above sections. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for Form structure 1 skill test". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone with a ...
Test your skills: Form validation - Learn web development
you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. You can write the code yourself, or use the starting point files linked to in the above sections. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for Form validation 1 skill test". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone with a...
Test your skills: HTML5 controls - Learn web development
you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. You can write the code yourself, or use the starting point files linked to in the above sections. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for HTML5 controls 1 skill test". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone with a ...
Test your skills: Other controls - Learn web development
you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. You can write the code yourself, or use the starting point files linked to in the above sections. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for Other controls 1 skill test". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone with a ...
Test your skills: Styling basics - Learn web development
you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. You can write the code yourself, or use the starting point files linked to in the above sections. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for Styling basics 1 skill test". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone with a ...
CSS basics - Learn web development
ixels on the right, bottom and left. The values set top, right, bottom, left, in that order. As with margin, you can use one, two, three, or four values, as documented in Padding Syntax. border: 5px solid black; This sets values for the width, style and color of the border. In this case, it's a five-pixel-wide, solid black border, on all sides of the body. Positioning and styling the main page
title h1 { margin: 0; padding: 20px 0; color: #00539F; text-shadow: 3px 3px 1px black; } You may have noticed there's a horrible gap at the top of the body. That happens because browsers apply default styling to the <h1> element (among others). That might seem like a bad idea, but the intent is to provide basic readability for unstyled pages. To eliminate the gap, we overwrite the browser's d...
Dealing with files - Learn web development
image you chose in the article "What will your website look like?" Copy the image you chose earlier into your images folder. Open up your index.html file, and insert the following code into the file exactly as shown. Don't worry about what it all means for now -- we'll look at the structures in more detail later in the series. <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <
title>My test page</
title> </head> <body> <img src="" alt="My test image"> </body> </html> The line <img src="" alt="My test image"> is the HTML code that inserts an image into the page. We need to tell the HTML where the image is. The image is inside the images directory, which is in the same directory as index.html. To walk down the file structure from index.html to our image, the file ...
Define terms with HTML - Learn web development
ially with <abbr>, so that screen readers read them appropriately and so that you can operate on all abbreviations uniformly. Just as with any new keyword, you should define your abbreviations the first time they occur. <p> <dfn><abbr>HTML</abbr> (hypertext markup language)</dfn> is a description language used to structure documents on the web. </p> The HTML spec does indeed set aside the
title attribute for expanding the abbreviation. However, this is not an acceptable alternative for providing an inline expansion. The contents of
title are completely hidden from your users, unless they're using a mouse and they happen to hover over the abbreviation. The spec duly acknowledges this as well. Improve accessibility <dfn> marks the keyword defined, and indicates that the current paragra...
Test your skills: Advanced HTML text - Learn web development
you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. You can write the code yourself, or use the starting point files linked to in the above sections. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for Advanced HTML text 1 skill test". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone wit...
Test your skills: HTML text basics - Learn web development
you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. You can write the code yourself, or use the starting point files linked to in the above sections. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for HTML text basics 1 skill test". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone with ...
Test your skills: Links - Learn web development
you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. You can write the code yourself, or use the starting point files linked to in the above sections. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for Links 1 skill test". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone with a coding pr...
Introduction to HTML - Learn web development
age. We also show how a typical HTML page is structured and how an HTML element is structured, and explain other important basic language features. Along the way, we'll play with some HTML to get you interested! What's in the head? Metadata in HTML The head of an HTML document is the part that is not displayed in the web browser when the page is loaded. It contains information such as the page <
title>, links to CSS (if you want to style your HTML content with CSS), links to custom favicons, and metadata (data about the HTML, such as who wrote it, and important keywords that describe the document). HTML text fundamentals One of HTML's main jobs is to give text meaning (also known as semantics), so that the browser knows how to display it correctly. This article looks at how to use HTML to br...
Test your skills: HTML images - Learn web development
you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. You can write the code yourself, or use the starting point files linked to in the above sections. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for HTML image basics 1 skill test". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone with...
Mozilla splash page - Learn web development
work into an online shareable editor such as CodePen, jsFiddle, or Glitch. Glitch is probably better for this example, as it allows you upload assets like images, whereas some of the other tools don't. Write a post asking for assessment and/or help at the MDN Discourse forum. Add the "learning" tag to your post so we are able to more easily find it. Your post should include: A descriptive
title such as "Assessment wanted for Mozilla splash page". Details of what you would like us to do -- for example what you have already tried, if you are stuck and need help,. A link to the example you want assessed or need help with, in an online editor. This is a good practice to get into -- it's very hard to help someone with a coding problem if you can't see their code. A link to the actua...
Multimedia and Embedding - Learn web development
article we'll look at how to use it in more depth, including basics, annotating it with captions using <figure>, and how it relates to CSS background images. Video and audio content Next, we'll look at how to use the HTML5 <video> and <audio> elements to embed video and audio on our pages, including basics, providing access to different file formats to different browsers, adding captions and sub
titles, and how to add fallbacks for older browsers. From <object> to <iframe> -- other embedding technologies At this point we'd like to take somewhat of a sideways step, looking at a couple of elements that allow you to embed a wide variety of content types into your webpages: the <iframe>, <embed> and <object> elements. <iframe>s are for embedding other web pages, and the other two allow you to em...
Assessment: Structuring planet data - Learn web development
aders with their rows/columns is a lot easier than the other way. Assessment or further help If you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for Structuring planet data". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone with a codi...
Structuring the web with HTML - Learn web development
tabular data on a webpage in an understandable, accessible way can be a challenge. This module covers basic table markup, along with more complex features such as implementing captions and summaries. Solving common HTML problems Use HTML to solve common problems provides links to sections of content explaining how to use HTML to solve very common problems when creating a webpage: dealing with
titles, adding images or videos, emphasizing content, creating a basic form, etc. ...
Image gallery - Learn web development
ts and tips You don't need to edit the HTML or CSS in any way. Assessment or further help If you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for Image gallery". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone with a coding problem...
Test your skills: Conditionals - Learn web development
you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. You can write the code yourself, or use the starting point files linked to in the above sections. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for Conditionals 1 skill test". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone with a co...
Test your skills: Events - Learn web development
you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. You can write the code yourself, or use the starting point files linked to in the above sections. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for Events 1 skill test". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone with a coding p...
Test your skills: Functions - Learn web development
you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. You can write the code yourself, or use the starting point files linked to in the above sections. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for Functions 1 skill test". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone with a codin...
Test your skills: Loops - Learn web development
you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. You can write the code yourself, or use the starting point files linked to in the above sections. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for Loops 1 skill test". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone with a coding pr...
Making decisions in your code — conditionals - Learn web development
elector('html'); document.body.style.padding = '10px'; function update(bgColor, textColor) { html.style.backgroundColor = bgColor; html.style.color = textColor; } select.onchange = function() { ( select.value === 'black' ) ? update('black','white') : update('white','black'); } Here we've got a <select> element to choose a theme (black or white), plus a simple <h1> to display a website
title. We also have a function called update(), which takes two colors as parameters (inputs). The website's background color is set to the first provided color, and its text color is set to the second provided color. Finally, we've also got an onchange event listener that serves to run a function containing a ternary operator. It starts with a test condition -- select.value === 'black'. If this retur...
Introduction to web APIs - Learn web development
mbined with APIs for creating animation loops (such as window.requestAnimationFrame()) and others to make constantly updating scenes like cartoons and games. Audio and Video APIs like HTMLMediaElement, the Web Audio API, and WebRTC allow you to do really interesting things with multimedia such as creating custom UI controls for playing audio and video, displaying text tracks like captions and sub
titles along with your videos, grabbing video from your web camera to be manipulated via a canvas (see above) or displayed on someone else's computer in a web conference, or adding effects to audio tracks (such as gain, distortion, panning, etc). Device APIs are basically APIs for manipulating and retrieving data from modern device hardware in a way that is useful for web apps. Examples include tellin...
Silly story generator - Learn web development
l instances of 'love' to 'like'. Remember, Strings are immutable! Assessment or further help If you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for Silly story generator". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone with a coding...
Test your skills: Arrays - Learn web development
you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. You can write the code yourself, or use the starting point files linked to in the above sections. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for Variables 1 skill test". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone with a codin...
Test your skills: Math - Learn web development
you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. You can write the code yourself, or use the starting point files linked to in the above sections. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for Math 1 skill test". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone with a coding pro...
Test your skills: Strings - Learn web development
you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. You can write the code yourself, or use the starting point files linked to in the above sections. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for Strings 1 skill test". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone with a coding ...
Test your skills: variables - Learn web development
If you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. You can write the code yourself, or use the starting point files linked to in the above sections. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for Variables 1 skill test". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone with a coding ...
What is JavaScript? - Learn web development
will produce an error because jquery will not be defined at the time the script runs. async should be used when you have a bunch of background scripts to load in, and you just want to get them in place as soon as possible. For example, maybe you have some game data files to load, which will be needed when the game actually begins, but for now you just want to get on with showing the game intro,
titles, and lobby, without them being blocked by script loading. Scripts loaded using the defer attribute (see below) will run in the order they appear in the page and execute them as soon as the script and content are downloaded: <script defer src="js/vendor/jquery.js"></script> <script defer src="js/script2.js"></script> <script defer src="js/script3.js"></script> All the scripts with the defer ...
Adding features to our bouncing balls demo - Learn web development
ime the evil circle eats a ball (causes it not to exist). Assessment or further help If you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for Adding bouncing balls features". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone with...
Test your skills: JSON - Learn web development
restrictions using CORS, but this is beyond the scope of what we are teaching here. Assessment or further help You can practice these examples in the Interactive Editor above. If you would like your work assessed, or are stuck and want to ask for help: Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for JSON skill test". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. Your code. A link to the actual task or assessment page, so we can find the question you want help with. ...
Test your skills: Object-oriented JavaScript - Learn web development
you would like your work assessed, or are stuck and want to ask for help: Put your work into an online shareable editor such as CodePen, jsFiddle, or Glitch. You can write the code yourself, or use the starting point files linked to in the above sections. Write a post asking for assessment and/or help at the MDN Discourse forum Learning category. Your post should include: A descriptive
title such as "Assessment wanted for OOJS 1 skill test". Details of what you have already tried, and what you would like us to do, e.g. if you are stuck and need help, or want an assessment. A link to the example you want assessed or need help with, in an online shareable editor (as mentioned in step 1 above). This is a good practice to get into -- it's very hard to help someone with a coding pro...
Learning area release notes - Learn web development
ist, the command line, package managers, and how to assemble your own functioning tool chain. March 2020 You'll now find "Test your skills" assessments accompanying the articles in the following modules: CSS building blocks JavaScript first steps JavaScript building blocks Introducing JavaScript objects January 2020 The HTML forms module has been significantly updated: It has been re
titled Web forms, and moved out of the HTML topic area to recognise that it covers more than just HTML form elements -- it also covers styling, validation, the basics of how to send data and process it on the server, and more besides. It has new examples available and techniques covered. It has a new structure to make for a more effective learning experience. More "Test your skills" sections have b...
Introduction to client-side frameworks - Learn web development
ions or focus management. In some cases, framework applications create accessibility barriers that do not exist for traditional websites. The biggest example of this is in client-side routing, as mentioned earlier. With traditional (server-side) routing, navigating the web has predictable results. The browser knows to set focus to the top of the page and assistive technologies will announce the
title of the page. These things happen every time you navigate to a new page. With client-side routing, your browser is not loading new web pages, so it doesn't know that it should automatically adjust focus or announce a new page
title. Framework authors have devoted immense time and labor to writing JavaScript that recreates these features, and even then, no framework has done so perfectly. The ups...
Getting started with React - Learn web development
ves. The public directory contains files that will be read by your browser while you're developing the app; the most important of these is index.html. React injects your code into this file so that your browser can run it. There's some other markup that helps create-react-app function, so take care not to edit it unless you know what you're doing. You very much should change the text inside the <
title> element in this file to reflect the
title of your application. Accurate page
titles are important for accessibility! The public directory will also be published when you build and deploy a production version of your app. We won't cover deployment in this tutorial, but you should be able to use a similar solution to that described in our Deploying our app tutorial. The package.json file contain...
Deployment and next steps - Learn web development
app only when there's a push to our master branch. Since our app will be published at a subdirectory (like https://your-user.gitlab.io/mdn-svelte-todo), we'll have to make the references to the JavaScript and CSS files in our public/index.html file relative. To do this, we just remove the leading slashes (/) from the /global.css, /build/bundle.css, and /build/bundle.js URLs, like this: <
title>Svelte To-Do list</
title> <link rel='icon' type='image/png' href='favicon.png'> <link rel='stylesheet' href='global.css'> <link rel='stylesheet' href='build/bundle.css'> <script defer src='build/bundle.js'></script> Do this now. Now we just have to commit and push our changes to GitLab. Do this by running the following commands: > git add public/index.html > git add .gitlab-ci.yml >...
Adding a new todo form: Vue events, methods, and models - Learn web development
input>, and a <button>. Update your template as follows: <template> <form> <label for="new-todo-input"> What needs to be done? </label> <input type="text" id="new-todo-input" name="new-todo" autocomplete="off" /> <button type="submit"> Add </button> </form> </template> So we now have a form component into which we can enter the
title of a new todo item (which will become a label for the corresponding ToDoItem when it is eventually rendered). Let's load this component into our app. Go back to App.vue and add the following import statement just below the previous one, inside your <script> element: import ToDoForm from './components/ToDoForm'; You also need to register the new component in your App component -- up...
Introduction to automated testing - Learn web development
rted with BrowserStack Let's get started with a BrowserStack Trial. Create a BrowserStack trial account. Sign in. This should happen automatically after you verify your e-mail address. When you first sign in, you should be on the Live testing page; if not, click the Live link in the top nav menu. If you are on Firefox or Chrome, you'll be prompted to Install a browser extension in a dialog
titled "Enable Local Testing" -- click the Install button to proceed. On other browsers you'll still be able to use some of the features (generally via Flash), but you might not get the full experience. The basics: Manual tests The BrowserStack Live dashboard allows you to choose what device and browser you want to test on -- Platforms in the left column, devices on the right. When you mouse over or...
Command line crash course - Learn web development
ked away in the cloud (it's not really a cloud), to microcomputers like the Raspberry PI Zero, and even to mobile phones. it provides direct access to the computer's underlying file system and low-level features, and is therefore incredibly useful for performing complex tasks rapidly, if you know what you are doing. It is also useful for automation -- for example to write a command to update the
titles of hundreds of files instantly, say from "ch01-xxxx.png" to "ch02-xxxx.png". If you updated the file names using your finder or explorer GUI app, it would take you a long time. Anyway, the terminal is not going away anytime soon. What does the terminal look like? Below you can see some of the different flavours of programs that are available that can get you to a terminal. The next images s...
Package management basics - Learn web development
, but otherwise it is very unopinionated about how you structure your project. Other tools can be very different, but at least Parcel makes it easy for our initial experiment. So now we need to add an index.html file to our working directory. Create index.html in your test directory, and give it the following contents: <!DOCTYPE html> <html lang="en-US"> <head> <meta charset="utf-8"> <
title>My test page</
title> </head> <body> <script src="./index.js"></script> </body> </html> Next, we need to add an index.js file in the same directory as index.html. For now index.js can be empty; it just needs to exist. Create this now. Having fun with Parcel Now we'll run our newly installed Parcel tool. In your terminal, run the following command: parcel index.html You should see s...
CustomizableUI.jsm
w.mozilla.org/keymaster/gatekeeper/there.is.only.xul', 'toolbaritem'); var image = aDocument.createElementNS('http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul', 'image'); image.setAttribute('src', 'chrome://branding/content/icon16.png'); var props = { id: 'navigator-throbber', //id in dom // SHOULD match id of that in cui.jsm (Line #2)
title: 'Activity Indicator', align: 'center', pack: 'center', mousethrough: 'always', removable: 'true', sdkstylewidget: 'true', overflows: false }; for (var p in props) { toolbaritem.setAttribute(p, props[p]); } toolbaritem.appendChild(image); return toolbaritem; } }); Whe...
PromiseWorker.jsm
ived. aTransferList Optional An optional array of Transferable objects to transfer ownership of. If the ownership of an object is transferred, it becomes unusable (neutered) in the context it was sent from, and it becomes available only to the worker it was sent to. Only MessagePort and ArrayBuffer objects can be transferred. To learn more on how to achieve this see the section in this article
titled Transferring special data from main thread to worker. Returns A Promise object. Transferring special data from main thread to worker The regular rules of workers apply; special data of MessagePort and ArrayBuffer objects can be transferred as of Firefox 40. There are two ways to transfer data. The first is with aTransferList argument and other with BasePromiseWorker.Meta. Both are done by t...
Bootstrapping a new locale
browser/chrome/browser) $ edit ab-CD/browser/chrome/browser/aboutCertError.dtd Read the top of the file to get any context on how to translate contained in the notes written by the developers or l10n-drivers. Localization notes will look like this: <!-- LOCALIZATION NOTES... --> After the localization notes, you will see a list of <!ENTITY> strings like the following: <!ENTITY certerror.page
title "Untrusted Connection"> You should go through each entity, translating the value in the parameters (e.g. Untrusted Connection in the example above), like so (example for Polish): <!ENTITY certerror.page
title "Niezaufane polaczenie"> Once you have translated all the <!ENTITY> strings in this file, you should save your work and open the next .dtd or .property file. You will need to go throug...
Localizing with Pontoon
s how you translate your first string: Hover over the text you want to translate with your mouse. An edit button appears over that text. Click on it to enable the translate mode. Replace the original text with its translation into your language. Click the save button to save your translation. Out-of-context Some strings are impossible to translate in-context, e.g. the contents of the <
title> tag in websites and strings with placeables or different plural forms. By clicking on the hamburger icon in the main toolbar, a list of all strings and available translations will open in the sidebar. You can also use the sidebar for out-of-context localization: Click on the string you'd like to translate. Translation panel with original string and its details (e.g. comments) opens. Tran...
Localizing without a specialized tool
wser) $ edit l10n-mozilla-1.9.2/x-testing/browser/chrome/browser/aboutCertError.dtd Read the top of the file to get any context on how to translate contained in the notes written by the developers or l10n-drivers. Localization notes will look like this: <!-- LOCALIZATION NOTES... --> After the localization notes, you will see a list of <!ENTITY> strings like the following: <!ENTITY certerror.page
title "Untrusted Connection"> You should go through each entity, translating the value in the parameters (e.g. Untrusted Connection in the example above), like so (example for Polish): <!ENTITY certerror.page
title "Niezaufane polaczenie"> Once you have translated all the <!ENTITY> strings in this file, you should save your work and open the next .dtd or .properties file. You will need to go through...
Basics
w> <mi>A</mi> <mo>=</mo> <mo>[</mo> <mtable> <mtr> <mtd><mn>1</mn></mtd> <mtd> <mtext><input id="input12" value="?" size="1"/></mtext> </mtd> </mtr> <mtr> <mtd> <mtext><input id="input21" value="?" size="1"/></mtext> </mtd> <mtd><mn>4</mn></mtd> </mtr> </mtable> <mo>]</mo> </mrow> </math> <div style="text-align:center"> Left size: <a class="control" href="javascript:incrementInput('input21', 1);"
title="increase input">+</a> <a class="control" href="javascript:incrementInput('input21',-1);"
title="decrease input">-</a> Right size: <a class="control" href="javascript:incrementInput('input12', 1);"
title="increase input">+</a> <a class="control" href="javascript:incrementInput('input12',-1);"
title="decrease input">-</a> <br/> (click these control bu...
Activity Monitor, Battery Status Menu and top
dependent formula that only factors in CPU usage and wakeup frequency. In both cases "Energy Impact" often correlates poorly with actual power consumption and should be avoided in favour of direct measurements that have clear physical meanings. What does "Average Energy Impact" measure? When the Energy tab of Activity Monitor is first opened, the "Average Energy Impact" column is empty and the
title bar says "Activity Monitor (Processing...)". After 5-10 seconds, the "Average Energy Impact" column is populated with values and the
title bar changes to "Activity Monitor (Applications in last 8 hours)". If you have top open during those 5-10 seconds you'll see that systemstats is running and using a lot of CPU, and so presumably the measurements are obtained from it. systemstats is a program t...
javascript.options.strict
JavaScript warnings are generated when code is executed that doesn't cause a run-time error, but is non-standard, poorly written, or prone to cause logic errors. This preference controls whether JavaScript warnings are logged to the JavaScript Console. Example : <html> <head> <
title>Sample</
title> </head> <body> <label id="name">Enter you First Name</label> <p id ="sample"></p> <script> "use strict" name1= "John" ; // This will cause and an error as variable not declared . var name2= "Peter"; document.getElementById("sample").innerHTML = name1; </script> </body> </html> Possible values and their effects: True: Show JavaScript errors and warnings. False: Show JavaScript errors only. (Default) See also: http://kb.mozillazine.org/Javascript.options.strict ...
Midas
to the window object inside the inline frame. This also avoids problems with bug 198155. In addition to the built-in commands, advanced editing can be done by manipulating the Selection and range objects. It is beneficial to be familiar with these objects when working with an editable document. Examples This example shows the basic structure described in the Notes section : <html> <head> <
title>Simple Edit Box</
title> </head> <body> <iframe id="MidasForm" src="about:blank" onload="this.contentDocument.designMode='on';" ></iframe> </body> </html> Methods Document.execCommand Executes the given command. Document.queryCommandEnabled Determines whether the given command can be executed on the document in its current state. Document.queryCommandIndeterm Determines w...
NSS 3.12.9 release notes
New and revised documents available since the release of NSS 3.11 include the following:</for> Build Instructions for NSS 3.11.4 and above NSS Shared DB Compatibility NSS 3.12.9 shared libraries are backward compatible with all older NSS 3.x shared libraries. A program linked with older NSS 3.x shared libraries will work with NSS 3.12.9...
NSS reference
ting the SSL Reference into the format described in the MDN Style Guide. If you are inclined to help with this migration, your help would be very much appreciated. The proposed chapters below are based on the chapters of the SSL Reference and the categories of functions in NSS Public Functions. Should a particular page require the use of an underscore, please see the documentation for the
Title Override Extension. Building and installing NSS Overview of an NSS application Based on "Overview of an SSL Application" in the SSL Reference. Getting started with NSS Based on "Getting Started With SSL" in the SSL Reference. Data types Based on "Selected SSL Types and Structures" in the SSL Reference. NSS initialization and shutdown NSS_Init NSS_InitReadWrite NSS_NoDB_Init NS...
Invariants
ngle global object) end-to-end. Lifetime invariants In some places, pointers to JSObjects and JSStrings must refer to live heap objects, but this is not a hard fast rule, especially for strings. Some JSStrings are allocated on the stack for quick operations. Some commonly used strings are allocated statically; see JSString::isStatic(). Most JSContext pointers must point to live contexts, but JS
Title::ownercx may point to one that has been destroyed! So code must check js_ValidContextPointer(ownercx) before dereferencing it. Shape invariants The shape guarantees hold whenever the property cache is enabled. Also, we never change the shape of the global object on trace. (Here "the global object" refers to the object at the end of the scope chain of the Function object we're executing.) Req...
SpiderMonkey 1.8
e undocumented but fairly stable. The APIs include the new JSTraceOp callback. ...
TPS Tab Lists
A tabs asset list is an array of objects with the following keys: uri: the uri of the tab, required.
title: the
title of the tab, optional. If specified, only used during verify actions. profile: the name of the profile the tab belongs to. Required for verify actions. For example: var tabs1 = [ { uri: "http://hg.mozilla.org/automation/crossweave/raw-file/2d9aca9585b6/pages/page1.html",
title: "Crossweave Test Page 1", profile: "profile1" }, { uri: "data:text/html,<html><head><
title>Hello</
title></head><body>Hello</body></html>",
title: "Hello", profile: "profile1" } ]; Tab lists and phase actions Tabs cannot be modified or deleted, only added or verified with the following functions: Tabs.add - opens the specified tabs in the browser window. Tabs.v...
Gecko events
e keyboard focus. Is Supported: yes EVENT_STATE_CHANGE An object's state has changed. Is Supported: yes States: STATE_FOCUSED, STATE_BUSY, XXX: EVENT_LOCATION_CHANGE An object has changed location, shape, or size. Is Supported: no EVENT_NAME_CHANGE An object's Name property has changed. Is Supported: yes Targets: TABLE_CELL - the cell of <xul:tree/>, any accessible for HTML element when @
title or @alt attribute is changed. EVENT_DESCRIPTION_CHANGE An object's Description property has changed. Is Supported: no EVENT_VALUE_CHANGE An object's Value property has changed. Is Supported: yes EVENT_HELP_CHANGE An object's help has changed. Is Supported: no EVENT_DEFACTION_CHANGE An object's default action has changed. Is Supported: no EVENT_ACTION_CHANGE An object's action has changed...
Gecko states
ISIBLE and STATE_OFFSCREEN set. In this case, the client application can communicate all items in the list to users. STATE_OFFSCREEN Scrolled off STATE_SIZEABLE The object can be resized. For example, a user could change the size of a window by clicking the border with a mouse and dragging the mouse. STATE_MOVEABLE Indicates that the object can be moved. For example, a user can click on the
titlebar for the object and drag the object to a new location. STATE_SELFVOICING The object or child uses text-to-speech (TTS) technology for description purposes. A speech-based accessibility aid does not announce information when an object with this state has the focus because the object automatically announces information. Isn't used STATE_FOCUSABLE The object can be focused. Applied to:...
XUL Accessibility
ting to this element by the control attribute, if the label element is found then use value attribute or its content. ...
Using the Places livemark service
parentFolderId, "Livemark name", uri("http://example.com/"), uri("http://example.com/rss.xml"), -1); The first parameter is the ID of the folder in which to create the livemark. The second parameter is the livemark's name as it will appear in the bookmark's
title. The third parameter is the URI of the site the livemark was created from (specified as an nsIURI object. Fourth argument is the URI of the actual RSS feed. The last argument takes in the index to insert at, or -1 to append the new livemark to the end of the folder. You can convert a string into an nsIURI using nsIIOService. When creating livemarks during startup, you should use the nsILivemarkSe...
Index
eir profile on a networked drive, query latency can be non-negligible 795 nsINavHistoryQueryOptions Developing Mozilla, Extensions, Interfaces, Interfaces:Scriptable, Places, XPCOM Interface Reference You can ask for the results to be pre-sorted. Since the DB has indices of many items, it can produce sorted results almost for free. Note: re-sorting is slower, as is sorting by
title or when you have a host name. 796 nsINavHistoryQueryResultNode Developing Mozilla, Extensions, Interfaces, Places, XPCOM, XPCOM API Reference Returns the queries that build the node's children; only valid for RESULT_TYPE_QUERY nodes. 797 nsINavHistoryResult Developing Mozilla, Extensions, Interfaces, Places, XPCOM, XPCOM API Reference Places results use a...
mozIPlaceInfo
or a Places entry 1.0 66 Introduced Gecko 2.0 Inherits from: nsISupports Last changed in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1) Attributes Attribute Type Description frecency long Read only: The frecency of the place. guid String Read only: The globally unique id of the place. placeId long Read only: The machine-local (internal) id of the place.
title String Read only: The
title associated with the place. uri nsIURI Read only: The URI of the place. visits mozIVisitInfo[] Read only: An array of mozIVisitInfo objects for the place. See also mozIAsyncHistory mozIVisitInfo ...
mozIPlacesAutoComplete
first on word boundaries, and if we do not get enough results, then match anywhere in each searchable term. MATCH_BOUNDARY 2 Match on word boundaries in each searchable term. MATCH_BEGINNING 3 Match only the beginning of each search term. BEHAVIOR_HISTORY 1 << 0 Search through history. BEHAVIOR_BOOKMARK 1 << 1 Search though bookmarks. BEHAVIOR_TAG 1 << 2 Search through tags. BEHAVIOR_
TITLE 1 << 3 Search the
title of pages. BEHAVIOR_URL 1 << 4 Search the URL of pages. BEHAVIOR_TYPED 1 << 5 Search for typed pages. BEHAVIOR_JAVASCRIPT 1 << 6 Search javascript: URLs. BEHAVIOR_OPENPAGE 1 << 7 Search for pages that have been marked as being opened, such as a tab in a tabbrowser. Methods registerOpenPage() Mark a page as being currently open. Note: Pages will not be automatica...
nsIAbCard
meAddress2 AString homeCity AString homeState AString homeZipCode AString homeCountry AString workAddress AString workAddress2 AString workCity AString workState AString workZipCode AString workCountry AString job
Title AString department AString company AString aimScreenName AString anniversaryYear AString anniversaryMonth AString anniversaryDay AString spouseName AString familyName AString defaultAddress AString category AString ...
nsIAccessibleDocument
ocument. Read only. Note: Renamed from document in Gecko 2.0 isEditable boolean True if the document is live in an editor. False if the document is being displayed but not edited. If a <div> is contentEditable, then it has its own document, with isEditable == true. Read only. Obsolete since Gecko 1.9 mimeType AString The mime type of the document. Read only.
title AString The
title of the document, as specified in the document. Read only. URL AString The URL of the document Read only. window nsIDOMWindow The nsIDOMWindow that the document resides in. Read only. windowHandle voidPtr The window handle for the OS window the document is being displayed in. For example, in Windows you can static cast it to an H...
nsIAccessibleStates
FSCREEN set. In this case, the client application can communicate all items in the list to users. STATE_OFFSCREEN 0x00010000 Scrolled off. STATE_SIZEABLE 0x00020000 The object can be resized. For example, a user could change the size of a window by clicking the border with a mouse and dragging the mouse. STATE_MOVEABLE 0x00040000 The object can be moved. For example, a user can click on the
titlebar for the object and drag the object to a new location. STATE_SELFVOICING 0x00080000 The object or child uses text-to-speech (TTS) technology for description purposes. A speech-based accessibility aid does not announce information when an object with this state has the focus because the object automatically announces information. Currently unused. STATE_FOCUSABLE 0x00100000 The object can be...
nsIDOMChromeWindow
aultButton); void restore(); void setCursor(in DOMString cursor); Attributes Attribute Type Description browserDOMWindow nsIBrowserDOMWindow The related nsIBrowserDOMWindow instance which provides access to yet another layer of utility functions by chrome script. It will be null for DOMWindows not corresponding to browsers. messageManager nsIChromeFrameMessageManager Read only.
title DOMString Obsolete since Gecko 1.9.1 windowState unsigned short Returns current window state, the value is one of STATE_* constants. Read only. Constants Constant Value Description STATE_MAXIMIZED 1 The window is maximized. STATE_MINIMIZED 2 The window is minimized. STATE_NORMAL 3 The window is normal. STATE_FULLSCREEN 4 The window is in full screen mode. Methods beginWindowMo...
nsIDOMWindowInternal
prompt). Method overview Firefox 3.5 note The prompt() and find() methods changed in Firefox 3.5 to make all their parameters optional; in previous versions, all parameters were required. ...
nsIDroppedLinkHandler
n Missing Exception Missing Description dropLink() Given a drop event, determines the link being dragged. If a uri is returned the caller can, for instance, load it. If null is returned, there is no valid link to be dropped. AString dropLink( in nsIDOMDragEvent aEvent, out AString aName, [optional] in boolean aDisallowInherit ); Parameters aEvent A drop event. aName The link
title if it exists, or an empty string otherwise. Return value A uri, or null if there is no valid link to be dropped. Exceptions thrown NS_ERROR_DOM_SECURITY_ERR Error will be thrown and the event canceled if the receiving target should not load the uri for security reasons. This will occur if the source of the drag initiated a link for dragging that it itself cannot access. This prevents a so...
nsIFeed
fetched on Mondays would specify "Monday" in this array. Note: This field is rarely implemented. skipHours nsIArray An array of the hours of the day during which the feed should not be fetched. The hours are represented as integer values from 0 (midnight) to 23 (11:00 PM), and are always indicated using UTC. Note: This field is rarely implemented. sub
title nsIFeedTextConstruct Returns a sub
title for the feed, based on its description, sub
title, and appropriate extensions. textInput nsIWritablePropertyBag2 Information about a text box that can be displayed along with the feed by aggregators that support it, to allow the reader to send a response back to the source of the feed. Note: This field is almost never used, and...
nsIFeedContainer
id AString A string that identifies the feed or entry. Not all feeds have these, but all major feed formats have IDs for each entry. link nsIURI A URI containing the primary link for the feed or entry. links nsIArray An array of all links for a feed or entry. rights nsIFeedTextConstruct The feed or entry's rights or license text.
title nsIFeedTextConstruct The feed or entry's
title. Keep in mind that some feeds have no
title, and some use markup in their
titles, so be cautious when decoding this attribute. updated AString A string containing the date the feed or entry was last updated, in RFC822 form. This string is parsable by JavaScript and mail code. Methods normalize() Synchronizes a container's f...
nsIFeedEntry
A string indicating the date on which the entry was published, in RFC822 format. This date is parsable by both JavaScript (via Date.parse()) and mail code. Note, that the related updated attribute is available from the nsIFeedContainer interface. summary nsIFeedTextConstruct A summary of the feed entry's content. This is generated automatically using the entry's description, sub
title, summary, content, and appropriate extensions. See also nsIFeedContainer Interwiki lin ...
nsIFileView
); Parameters filterString The filter to be applied to the file list. sort() Set the method used for sorting. void sort( in short sortType, in boolean reverseSort ); Parameters sortType One of the sort* constants. reverseSort true, results will be sorted in ascending order. ...
nsIJumpListItem
he jump list item type. Read only. Constants Constant Value Description JUMPLIST_ITEM_EMPTY 0 Empty list item. JUMPLIST_ITEM_SEPARATOR 1 Separator. JUMPLIST_ITEM_LINK 2 Web link item. JUMPLIST_ITEM_SHORTCUT 3 Application shortcut. Methods equals() Compare this item to another. Compares the type and other properties specific to this item's type: separator - type link - type, uri,
title shortcut - type, handler application boolean equals( in nsIJumpListItem item ); Parameters item Another nsIJumpListItem to compare to. Return value true if items are the same, otherwise false ...
Building an Account Manager Extension
</description> <vbox flex = "1"/> </page> As with the XUL page, the content of the property file relies on a very strict naming. As our Account Manager Extension is named "devmo-account", we are required to include a property named prefPanel-devmo-account. prefPanel-devmo-account=Devmo D...
nsIMsgFolder
id copyDataDone(); setJunkScoreForMessages() void setJunkScoreForMessages(in nsISupportsArray aMessages, in ACString aJunkScore); applyRetentionSettings() void applyRetentionSettings(); fetchMsgPreviewText() Get the beginning of the message bodies for the passed in keys and store them in the msg hdr property "preview". This is intended for new mail alerts,
title tips on folders with new messages, and perhaps
titletips/message preview in the thread pane. boolean fetchMsgPreviewText([array, size_is (aNumKeys)] in nsMsgKey aKeysToFetch, in unsigned long aNumKeys, in boolean aLocalOnly, in nsIUrlListener aUrlListener); addKeywordsToMessages() Used to set/clear tags - ...
nsITaskbarTabPreview
tead, call the nsIWinTaskbar.createTaskbarTabPreview(). Method overview void EnsureRegistration(); Violates the XPCOM interface guidelines nativeWindow GetHWND(); Violates the XPCOM interface guidelines void move(in nsITaskbarTabPreview aNext); Attributes Attribute Type Description icon imgIContainer The icon displayed next to the
title in the preview. This is null by default.
title DOMString The
title displayed above the thumbnail. By default, this is an empty string. Methods Violates the XPCOM interface guidelines EnsureRegistration() Used internally to ensure that the taskbar knows about this preview. If a preview is not registered, the API call to set its sibling (via the move() method) will fai...
nsITaskbarWindowPreview
nsIWinTaskbar.getTaskbarWindowPreview() to get the taskbar preview for a specific window. Window preview behavior By default, Windows implements much of the behavior for applications in a standard way. This interface's primary purpose is to let Gecko applications take control over parts of the preview; however, certain parts of the preview are not controlled using this interface. For example, the
title and icon for each preview always match the
title and icon of the corresponding window. If the enableCustomDrawing attribute is true, the controller you implement will start receiving calls to its nsITaskbarPreviewController.drawPreview() and nsITaskbarPreviewController.drawThumbnail() methods, as well as reads of its width, height, and thumbnailAccessRatio attributes. By default, however, Windows...
nsIWebBrowserChrome
s attribute. CHROME_TOOLBAR 32 Value for the chromeFlags attribute. CHROME_LOCATIONBAR 64 Value for the chromeFlags attribute. CHROME_STATUSBAR 128 Value for the chromeFlags attribute. CHROME_PERSONAL_TOOLBAR 256 Value for the chromeFlags attribute. CHROME_SCROLLBARS 512 Value for the chromeFlags attribute. CHROME_
TITLEBAR 1024 Value for the chromeFlags attribute. CHROME_EXTRA 2048 Value for the chromeFlags attribute. CHROME_WITH_SIZE 4096 Specifically for use with nsIWindowCreator. CHROME_WITH_POSITION 8192 Specifically for use with nsIWindowCreator. CHROME_WINDOW_MIN 16384 Represent special cases. CHROME_WINDOW_POPUP 32768 Represe...
nsIWebappsSupport
toolkit/components/webapps/nsIWebappsSupport.idlScriptable Please add a summary to this article. 1.0 66 Introduced Gecko 2.0 Inherits from: nsISupports Last changed in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1) Method overview void installApplication(in wstring
title, in wstring uri, in wstring iconUri, in wstring iconData); boolean isApplicationInstalled(in wstring uri); Methods installApplication() This method installs a web application. void installApplication( in wstring
title, in wstring uri, in wstring iconUri, in wstring iconData ); Parameters
title The user-friendly name of the application. uri The uri of the web application. iconUri The uri of icon of the web application. iconData A base64 encoded representation of the ap...
nsMsgSearchAttrib
gSearchAttribValue PhoneNumber = 23; const nsMsgSearchAttribValue WorkPhone = 24; const nsMsgSearchAttribValue HomePhone = 25; const nsMsgSearchAttribValue Fax = 26; const nsMsgSearchAttribValue Pager = 27; const nsMsgSearchAttribValue Mobile = 28; const nsMsgSearchAttribValue City = 29; const nsMsgSearchAttribValue Street = 30; const nsMsgSearchAttribValue
Title = 31; const nsMsgSearchAttribValue Organization = 32; const nsMsgSearchAttribValue Department = 33; // 34 - 43, reserved for ab / LDAP; const nsMsgSearchAttribValue HasAttachmentStatus = 44; const nsMsgSearchAttribValue JunkStatus = 45; const nsMsgSearchAttribValue JunkPercent = 46; const nsMsgSearchAttribValue JunkScoreOrigin = 47; const nsMsgSearchAttri...
nsIAbCard/Thunderbird3
e DisplayName, NickName SpouseName, FamilyName PrimaryEmail, SecondEmail Home Contact: HomeAddress, HomeAddress2, HomeCity, HomeState, HomeZipCode, HomeCountry HomePhone, HomePhoneType Work contact. ...
XUL Overlays
Thus, given the following base: ... <menu id="file-menu"> <menupopup id="menu_FilePopup"> <menuitem name="New"/> <menuitem name="Open"/> <menuitem name="Save"/> <menuitem name="Close"/> </menupo...
Index
ative to these methods is to directly access the element by it's ID as in the Detect When a Folder Opens example. 95 Access Window missing, thunderbird The window object represents the Window of the Thunderbird application as well as the currently opened tabs. You can do many things with the window object, such as accessing the height or width of the window/tab or setting its
title, registering timer events and much more. The Window API will give you the complete details. Since window is a global variable you can use it directly from your JavaScript file. 96 Access Window Area NeedsUpdate, missing, thunderbird This page has no content. Enrich MDC by contributing. 97 Add New Tab missing, thunderbird No summary! 98 Add Opti...
LDAP Support
CellularNumber mobile CellularNumber cellphone CellularNumber carphone WorkAddress postofficebox WorkAddress streetaddress WorkCity l WorkCity locality WorkState st WorkState region WorkZipCode postalcode WorkZipCode zip WorkCountry countryname Job
Title title Department ou Department orgunit Department department Department departmentnumber Company o Company company WorkCountry countryname _AimScreenName nscpaimscreenname WebPage1 workurl WebPage2 homeurl BirthYear birthyear Custom1 custom1 C...
Thunderbird Configuration Files
the following code in a terminal. $ cd $PROFILE # where $PROFILE is your profile folder $ touch user.js # create the empty JavaScript file Alternatively, open a Files window (if you're on Ubuntu. This will depend on which distribution you use), navigate to the profile folder, and right-click in some empty space on the right pane, then select New Document > Empty Document. The default name Un
titled Document should appear, with focus on the filename. Enter user.js to change the document's name. ...
Access Window
The Window API will give you the complete details. Since window is a global variable you can use it directly from your JavaScript file. ...
Using tab-modal prompts
pt = promptfact.getPrompt(window, Components.interfaces.nsIPrompt); var promptbag = prompt.QueryInterface(Components.interfaces.nsIWritablePropertyBag2); promptbag.setPropertyAsBool('allowTabModal', true); var check = {value: false}; //initial state of checkbox, however if no text is supplied the checkbox is not shown var input = {value: 'pre filled value'}; var ok = prompt.prompt.apply(null, ['
Title - but not shown in tab modal', 'Text goes here', input, 'Check text, if no text, checkbox is not shown', check]); //this here is just an alert, showing the values of the prompt prompt.alert.apply(null, ['
Title Not Shown In Modal', 'User Clicked OK: ' + ok + '\n' + 'Checked: ' + check.value + '\nInput Value: ' + input.value]); Note: Because the prompts are shown in a tab, if the tab is closed wh...
Mozilla
There are a lot of different memory allocators in the Mozilla source tree. This article looks over some of them and tries to sort out which should be used under what circumstances. Chrome registration Chrome is the set of user interface elements of the application window that are outside the window's content area. Toolbars, menu bars, progress bars, and window
title bars are all examples of elements that are typically part of the chrome. Command line options Command line options are used to specify various startup options for Mozilla applications.This page describes the commonly used options and how to use them. You can open the command line interface by pressing shift + F2. Co...
Streams - Plugins
see "Result Codes." For an example that demonstrates using this function with NPN_NewStream and NPN_Write, see "Example of Sending a Stream." Example of Sending a Stream The following code creates a new stream of HTML text displayed by the browser in a new window, writes it, and destroys the stream. Error handling has been omitted for simplicity. NPStream* stream; char* myData = "<html><head><
title>This is a message from my plug-in!</
title></head><body><p><strong>This is a message from my plug-in!</strong></p></body>/html>"; int32 myLength = strlen(myData) + 1; /* Create the stream. */ err = NPN_NewStream(instance, "text/html", "_blank", &stream); /* Push data into the stream. */ err = NPN_Write(instance, stream, myLength, myData); /* Delete the stream. */ err = NPN_DestroyStream(instanc...
Accessibility Inspector - Firefox Developer Tools
URL in the corresponding <a> element's href. DOMNode -- the type of DOM node that the item in the accessibility tree represents. You can click on the "target" icon that comes after it to select the node in the Page Inspector. Hovering over the "target" icon highlights the DOM node in the page content. description -- any further description provided on the element, usually by the content of a
title attribute. keyboardShortcut -- any keyboard shortcut that is available to activate the element, as specified in an accessKey attribute. Note that this works correctly as of Firefox 62 (bug 1467381). childCount -- the number of child items the current item has in the accessibility tree hierarchy. indexInParent -- an index value indicating what number child the item is, inside its parent. If the...
DOM Inspector internals - Firefox Developer Tools
ese features. The other Edit menu items are also used in several viewers' context menus. For that reason, only those menuitems' ids are referenced here, and the complete definitions are imported from editingOverlay.xul. Viewers which include one or more of these menuitems in their context menus follow the same practice. The tooltip used for the Inspect menus--the one used to show a document's
title (if any) and its URI for a given menuitem--is also defined here. commandOverlay.xul The popupOverlay.xul-provided menuitems that delegate to external command elements have their commands defined here. keysetOverlay.xul Some popupOverlay.xul-provided menuitems have their keys defined here. As of this writing, all of the keys that correspond to Edit menu items live in editingOverlay for no go...
Introduction to DOM Inspector - Firefox Developer Tools
sed from the File menu , and it will contain the list of currently loaded chrome windows and subdocuments. A browser window and the DOM Inspector are likely be already open and displayed in this list. The DOM Inspector keeps track of all the windows that are open, so to inspect the DOM of a particular window in the DOM Inspector, simply access that window as you would normally and then choose its
title from this dynamically updated menulist. Inspecting arbitrary URLs You may also inspect the DOM of arbitrary URLs by using the Inspect a URL menuitem in the File menu, or by just entering a URL into the DOM Inspector's address bar and clicking Inspect or pressing enter. For example, you can enter http://www.mozilla.org in the address bar and see the DOM structure of the mozilla.org home page. ...
Network request details - Firefox Developer Tools
"value": "max-age=106384710; includeSubDomains; preload" }, { "name": "vary", "value": "Accept-Encoding,Treat-as-Untrusted,X-Forwarded-Proto,Cookie,Authorization,X-Seven" }, { "name": "via", "value": "1.1 varnish (Varnish/5.1), 1.1 varnish (Varnish/5.1)" }, { "name": "x-analytics", "value": "ns=-1;special=Bad
title;WMF-Last-Access=11-Jun-2019;WMF-Last-Access-Global=11-Jun-2019;https=1" }, { "name": "x-cache", "value": "cp1075 pass, cp1075 pass" }, { "name": "x-cache-status", "value": "pass" }, { "name": "x-client-ip", "value": "204.210.158.136" }, { "name": "x-content-type-options", "value": "nosn...
about:debugging - Firefox Developer Tools
version running on your computer, you may see a message like the following: In Firefox 76 and above, the message can look like the following: See Connection for Firefox for Android 68 for more information. In the image above, there are three tabs open: Network or cache Recipe, Nightly Home, and About Nightly. To debug the contents of one of these tabs, click the Inspect button next to its
title. When you do, the Developer Tools open in a new tab. Above the usual list of tools, you can see information about the device you are connected to, including the fact that you are connected (in this example) via USB, to Firefox Preview, on a Pixel 2, as well as the
title of the page that you are debugging, and the address of the page. Starting in Firefox 78, the URL bar is editable, so that yo...
DataTransfer.setDragImage() - Web APIs
age. yOffset A long indicating the vertical offset within the image. Return value void Example This example shows how to use the setDragImage() method. Note the example refers to an image file named example.gif. If that file is present, it will be used as the drag image and if that file is not present, the browser will use its default drag image. demo <!DOCTYPE html> <html lang=en> <
title>Example of DataTransfer.setDragImage()</
title> <meta name="viewport" content="width=device-width"> <style> div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } </style> <script> function dragstart_handler(ev) { console.log("dragStart"); // Set the drag's format and data. Use the event target's i...
Document.getElementsByName() - Web APIs
object returns a NodeList Collection of elements with a given name in the document. Syntax var elements = document.getElementsByName(name); elements is a live NodeList Collection, meaning it automatically updates as new elements with the same name are added to/removed from the document. name is the value of the name attribute of the element(s). Example <!DOCTYPE html> <html lang="en"> <
title>Example: using document.getElementsByName</
title> <input type="hidden" name="up"> <input type="hidden" name="down"> <script> var up_names = document.getElementsByName("up"); console.log(up_names[0].tagName); // displays "INPUT" </script> </html> Notes The name attribute can only be applied in (X)HTML documents. The returned NodeList Collection contains all elements with the given name, ...
Document.head - Web APIs
The head read-only property of the Document interface returns the <head> element of the current document. Syntax var objRef = document.head; Value An HTMLHeadElement. Example <!doctype html> <head id="my-document-head"> <
title>Example: using document.head</
title> </head> <script> var theHead = document.head; console.log(theHead.id); // "my-document-head"; console.log( theHead === document.querySelector("head") ); // true </script> Notes document.head is read-only. Trying to assign a value to this property will fail silently or, in Strict Mode, throws a TypeError . Specifications Specification Status Comment HTML 5.1The definition of 'Document.head' in that specification. Recommendation HTML5The definition of 'Document.head' in...
Document - Web APIs
ument. Document.domain Gets/sets the domain of the current document. Document.lastModifiedRead only Returns the date on which the document was last modified. Document.locationRead only Returns the URI of the current document. Document.readyStateRead only Returns loading status of the document. Document.referrerRead only Returns the URI of the page that linked to this page. Document.
title Sets or gets the
title of the current document. Document.URLRead only Returns the document location as a string. Properties included from DocumentOrShadowRoot The Document interface includes the following properties defined on the DocumentOrShadowRoot mixin. Note that this is currently only implemented by Chrome; other browsers still implement them directly on the Document interface. Do...
DocumentOrShadowRoot.styleSheets - Web APIs
The styleSheets read-only property of the DocumentOrShadowRoot interface returns a StyleSheetList of CSSStyleSheet objects, for stylesheets explicitly linked into or embedded in a document. Examples function getStyleSheet(unique_
title) { for (var i=0; i<document.styleSheets.length; i++) { var sheet = document.styleSheets[i]; if (sheet.
title == unique_
title) { return sheet; } } } Notes The returned list is ordered as follows: StyleSheets retrieved from <link> headers are placed first, sorted in header order. StyleSheets retrieved from the DOM are placed after, sorted in tree order. Specifications Specification Status Comment Shadow DOMThe definition of 'DocumentOrShadowRoot' in that specification. Obsolete Initial definit...
Example - Web APIs
<html> <head> <
title>My Document</
title> <script type="text/javascript"> function change() { // document.getElementsByTagName("H1") returns a NodeList of the h1 // elements in the document, and the first is number 0: var header = document.getElementsByTagName("H1").item(0); // the firstChild of the header is a Text node: header.firstChild.data = "A dynamic document"; // now the header is "A dynamic document". var para = document.getElementsByTagName("P").item(0); para.firstChild.data = "This is the first paragraph."; // create a new Text node for the second paragraph var newText = document.createTextNode("This is the second paragraph."); // create a new Element to be the second paragraph var newElement = document.createElem...
Using the W3C DOM Level 1 Core - Web APIs
ubiquity of the DOM, this API is supported in all major browsers, including Mozilla Firefox and Microsoft Internet Explorer, and serves as a base for scripting on the web. What is a DOM tree? A DOM tree is a kind of tree whose nodes represent an HTML or XML document's contents. Each HTML or XML document has a unique DOM tree representation. For example, the following document <html> <head> <
title>My Document</
title> </head> <body> <h1>Header</h1> <p>Paragraph</p> </body> </html> has a DOM tree that looks like this: (Note that, although the above tree is similar to the above document's DOM tree, it's not identical, as the actual DOM tree preserves whitespace.) When a web browser parses an HTML document, it builds a DOM tree and then uses it to display the document. What does the...
How whitespace is handled by HTML, CSS, and in the DOM - Web APIs
ters that are outside of HTML elements in the original document are represented in the DOM. This is needed internally so that the editor can preserve formatting of documents. This means that: There will be some text nodes that contain only whitespace, and Some text nodes will have whitespace at the beginning or end. Take the following document, for example: <!DOCTYPE html> <html> <head> <
title>My Document</
title> </head> <body> <h1>Header</h1> <p> Paragraph </p> </body> </html> The DOM tree for this looks like so: Conserving whitespace characters in the DOM is useful in many ways, but there are certain places where this makes certain layouts more difficult to implement, and causes problems for developers who want to iterate through nodes in the DOM. We'll look at these, ...
Using Fetch - Web APIs
n(response => response.json()) .then(result => { console.log('Success:', result); }) .catch(error => { console.error('Error:', error); }); Uploading multiple files Files can be uploaded using an HTML <input type="file" multiple /> input element, FormData() and fetch(). ...
accessKeyLabel - Web APIs
The HTMLElement.accessKeyLabel read-only property returns a String that represents the element's assigned access key (if any); otherwise it returns an empty string. Syntax label = element.accessKeyLabel Example JavaScript var node = document.getElementById('btn1'); if (node.accessKeyLabel) { node.
title += ' [' + node.accessKeyLabel + ']'; } else { node.
title += ' [' + node.accessKey + ']'; } node.onclick = function () { var p = document.createElement('p'); p.textContent = 'Clicked!'; node.parentNode.appendChild(p); }; HTML <button accesskey="h"
title="Caption" id="btn1">Hover me</button> Result Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLElement.accessKeyLabel' in that specification. Living Stan...
HTMLElement.dir - Web APIs
e HTMLElement.dir property gets or sets the text writing directionality of the content of the current element. The text writing directionality of an element is which direction that text goes (for support of different language systems). Arabic languages and Hebrew are typical languages using the RTL directionality. An image can have its dir property set to "rtl" in which case the HTML attributes
title and alt will be formatted and defined as "rtl". When a table has its dir set to "rtl", the column order is arranged from right to left. When an element has its dir set to "auto", the direction of the element is determined based on its first strong directionality character, or default to the directionality of its parent element. Browsers might allow users to change the directionality of <input...
HTMLElement - Web APIs
ction... HTMLElement.spellcheck Is a Boolean that controls spell-checking. It is present on all HTML elements, though it doesn't have an effect on all of them. HTMLElement.style Is a CSSStyleDeclaration, an object representing the declarations of an element's style attributes. HTMLOrForeignElement.tabIndex Is a long representing the position of the element in the tabbing order. HTMLElement.
title Is a DOMString containing the text that appears in a popup box when mouse is over the element. HTMLElement.translate Is a Boolean representing the translation. Event handlers Most event handler properties, of the form onXYZ, are defined on the DocumentAndElementEventHandlers, GlobalEventHandlers or TouchEventHandlers interfaces and implemented by HTMLElement. In addition, the following ha...
HTMLImageElement.alt - Web APIs
. For compatibility reasons, browsers generally will accept an image without an alt attribute, but you should try to get into the habit of using it. Usage notes The fundamental guideline for the alt attribute is that every image's alternate text should be able to replace the image without altering the meaning of the page. You should never use alt for text that could be construed as a caption or
title. There are separate attributes and elements designed for those purposes. Examples Beyond that, there are additional guidelines for using alt appropriately which vary depending on what the image is being used for. These are shown in the examples below. Decorative images Images with no semantic meaning--such as those which are solely decorative--or of limited informational value, should have th...
HTMLImageElement.longDesc - Web APIs
Syntax descURL = htmlImageElement.longDesc; htmlImageElement.longDesc = descURL; Value A DOMString which may be either an empty string (indicating that no long description is available) or the URL of a file containing a long form description of the image's contents. ...
HTMLInputElement - Web APIs
minLength long: Returns / Sets the element's minlength attribute, containing the minimum number of characters (in Unicode code points) that the value can have. (If you set this to a negative number, an exception will be thrown.) pattern string: Returns / Sets the element's pattern attribute, containing a regular expression that the control's value is checked against. Use the
title attribute to describe the pattern to help the user. This attribute applies when the value of the type attribute is text, search, tel, url or email; otherwise it is ignored. placeholder string: Returns / Sets the element's placeholder attribute, containing a hint to the user of what can be entered in the control. The placeholder text must not contain carriage returns or line-feeds. Thi...
HTMLMediaElement.textTracks - Web APIs
a <video> that has several <track> children <video controls poster="/images/sample.gif"> <source src="sample.mp4" type="video/mp4"> <source src="sample.ogv" type="video/ogv"> <track kind="captions" src="sampleCaptions.vtt" srclang="en"> <track kind="descriptions" src="sampleDescriptions.vtt" srclang="en"> <track kind="chapters" src="sampleChapters.vtt" srclang="en"> <track kind="sub
titles" src="sampleSub
titles_de.vtt" srclang="de"> <track kind="sub
titles" src="sampleSub
titles_en.vtt" srclang="en"> <track kind="sub
titles" src="sampleSub
titles_ja.vtt" srclang="ja"> <track kind="sub
titles" src="sampleSub
titles_oz.vtt" srclang="oz"> <track kind="metadata" src="keyStage1.vtt" srclang="en" label="Key Stage 1"> <track kind="metadata" src="keyStage2.vtt" srclang="en" label="Key...
HTMLMediaElement - Web APIs
x 55. HTMLMediaElement.onmozinterruptend Sets the EventHandler called when the interruption is concluded. This was Firefox-specific, having been implemented for Firefox OS, and was removed in Firefox 55. Methods This interface also inherits methods from its ancestors HTMLElement, Element, Node, and EventTarget. HTMLMediaElement.addTextTrack() Adds a text track (such as a track for sub
titles) to a media element. HTMLMediaElement.captureStream() Returns MediaStream, captures a stream of the media content. HTMLMediaElement.canPlayType() Given a string specifying a MIME media type (potentially with the codecs parameter included), canPlayType() returns the string probably if the media should be playable, maybe if there's not enough information to determine whether the media will p...
The HTML DOM API - Web APIs
t HTMLParamElement HTMLPictureElement HTMLPreElement HTMLProgressElement HTMLQuoteElement HTMLScriptElement HTMLSelectElement HTMLSlotElement HTMLSourceElement HTMLSpanElement HTMLStyleElement HTMLTableCaptionElement HTMLTableCellElement HTMLTableColElement HTMLTableElement HTMLTableRowElement HTMLTableSectionElement HTMLTemplateElement HTMLTextAreaElement HTMLTimeElement HTML
TitleElement HTMLTrackElement HTMLUListElement HTMLUnknownElement HTMLVideoElement Deprecated HTML Element Interfaces HTMLMarqueeElement Obsolete HTML Element Interfaces HTMLBaseFontElement HTMLFontElement HTMLFrameElement HTMLFrameSetElement HTMLIsIndexElement HTMLMenuItemElement Web app and browser integration interfaces These interfaces offer access to the br...
IDBIndex.getKey() - Web APIs
.openCursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var tableRow = document.createElement('tr'); tableRow.innerHTML = '<td>' + cursor.value.id + '</td>' + '<td>' + cursor.value.lName + '</td>' + '<td>' + cursor.value.fName + '</td>' + '<td>' + cursor.value.j
Title + '</td>' + '<td>' + cursor.value.company + '</td>' + '<td>' + cursor.value.eMail + '</td>' + '<td>' + cursor.value.phone + '</td>' + '<td>' + cursor.value.age + '</td>'; tableEntry.appendChild(tableRow); cursor.continue(); } else { console.log('Entries all displayed.
IDBIndex.isAutoLocale - Web APIs
.openCursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var tableRow = document.createElement('tr'); tableRow.innerHTML = '<td>' + cursor.value.id + '</td>' + '<td>' + cursor.value.lName + '</td>' + '<td>' + cursor.value.fName + '</td>' + '<td>' + cursor.value.j
Title + '</td>' + '<td>' + cursor.value.company + '</td>' + '<td>' + cursor.value.eMail + '</td>' + '<td>' + cursor.value.phone + '</td>' + '<td>' + cursor.value.age + '</td>'; tableEntry.appendChild(tableRow); cursor.continue(); } else { console.log('Entries all displayed.
IDBIndex.keyPath - Web APIs
.openCursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var tableRow = document.createElement('tr'); tableRow.innerHTML = '<td>' + cursor.value.id + '</td>' + '<td>' + cursor.value.lName + '</td>' + '<td>' + cursor.value.fName + '</td>' + '<td>' + cursor.value.j
Title + '</td>' + '<td>' + cursor.value.company + '</td>' + '<td>' + cursor.value.eMail + '</td>' + '<td>' + cursor.value.phone + '</td>' + '<td>' + cursor.value.age + '</td>'; tableEntry.appendChild(tableRow); cursor.continue(); } else { console.log('Entries all displayed.
IDBIndex.locale - Web APIs
.openCursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var tableRow = document.createElement('tr'); tableRow.innerHTML = '<td>' + cursor.value.id + '</td>' + '<td>' + cursor.value.lName + '</td>' + '<td>' + cursor.value.fName + '</td>' + '<td>' + cursor.value.j
Title + '</td>' + '<td>' + cursor.value.company + '</td>' + '<td>' + cursor.value.eMail + '</td>' + '<td>' + cursor.value.phone + '</td>' + '<td>' + cursor.value.age + '</td>'; tableEntry.appendChild(tableRow); cursor.continue(); } else { console.log('Entries all displayed.
IDBIndex.multiEntry - Web APIs
.openCursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var tableRow = document.createElement('tr'); tableRow.innerHTML = '<td>' + cursor.value.id + '</td>' + '<td>' + cursor.value.lName + '</td>' + '<td>' + cursor.value.fName + '</td>' + '<td>' + cursor.value.j
Title + '</td>' + '<td>' + cursor.value.company + '</td>' + '<td>' + cursor.value.eMail + '</td>' + '<td>' + cursor.value.phone + '</td>' + '<td>' + cursor.value.age + '</td>'; tableEntry.appendChild(tableRow); cursor.continue(); } else { console.log('Entries all displayed.
IDBIndex.name - Web APIs
.openCursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var tableRow = document.createElement('tr'); tableRow.innerHTML = '<td>' + cursor.value.id + '</td>' + '<td>' + cursor.value.lName + '</td>' + '<td>' + cursor.value.fName + '</td>' + '<td>' + cursor.value.j
Title + '</td>' + '<td>' + cursor.value.company + '</td>' + '<td>' + cursor.value.eMail + '</td>' + '<td>' + cursor.value.phone + '</td>' + '<td>' + cursor.value.age + '</td>'; tableEntry.appendChild(tableRow); cursor.continue(); } else { console.log('Entries all displayed.
IDBIndex.objectStore - Web APIs
.openCursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var tableRow = document.createElement('tr'); tableRow.innerHTML = '<td>' + cursor.value.id + '</td>' + '<td>' + cursor.value.lName + '</td>' + '<td>' + cursor.value.fName + '</td>' + '<td>' + cursor.value.j
Title + '</td>' + '<td>' + cursor.value.company + '</td>' + '<td>' + cursor.value.eMail + '</td>' + '<td>' + cursor.value.phone + '</td>' + '<td>' + cursor.value.age + '</td>'; tableEntry.appendChild(tableRow); cursor.continue(); } else { console.log('Entries all displayed.
IDBIndex.openCursor() - Web APIs
.openCursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var tableRow = document.createElement('tr'); tableRow.innerHTML = '<td>' + cursor.value.id + '</td>' + '<td>' + cursor.value.lName + '</td>' + '<td>' + cursor.value.fName + '</td>' + '<td>' + cursor.value.j
Title + '</td>' + '<td>' + cursor.value.company + '</td>' + '<td>' + cursor.value.eMail + '</td>' + '<td>' + cursor.value.phone + '</td>' + '<td>' + cursor.value.age + '</td>'; tableEntry.appendChild(tableRow); cursor.continue(); } else { console.log('Entries all displayed.
IDBIndex.unique - Web APIs
.openCursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var tableRow = document.createElement('tr'); tableRow.innerHTML = '<td>' + cursor.value.id + '</td>' + '<td>' + cursor.value.lName + '</td>' + '<td>' + cursor.value.fName + '</td>' + '<td>' + cursor.value.j
Title + '</td>' + '<td>' + cursor.value.company + '</td>' + '<td>' + cursor.value.eMail + '</td>' + '<td>' + cursor.value.phone + '</td>' + '<td>' + cursor.value.age + '</td>'; tableEntry.appendChild(tableRow); cursor.continue(); } else { console.log('Entries all displayed.
IDBIndex - Web APIs
.openCursor().onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var tableRow = document.createElement('tr'); tableRow.innerHTML = '<td>' + cursor.value.id + '</td>' + '<td>' + cursor.value.lName + '</td>' + '<td>' + cursor.value.fName + '</td>' + '<td>' + cursor.value.j
Title + '</td>' + '<td>' + cursor.value.company + '</td>' + '<td>' + cursor.value.eMail + '</td>' + '<td>' + cursor.value.phone + '</td>' + '<td>' + cursor.value.age + '</td>'; tableEntry.appendChild(tableRow); cursor.continue(); } else { console.log('Entries all displayed.
IDBLocaleAwareKeyRange - Web APIs
{ var cursor = event.target.result; if(cursor) { var tableRow = document.createElement('tr'); tableRow.innerHTML = '<td>' + cursor.value.id + '</td>' + '<td>' + cursor.value.lName + '</td>' + '<td>' + cursor.value.fName + '</td>' + '<td>' + cursor.value.j
Title + '</td>' + '<td>' + cursor.value.company + '</td>' + '<td>' + cursor.value.eMail + '</td>' + '<td>' + cursor.value.phone + '</td>' + '<td>' + cursor.value.age + '</td>'; tableEntry.appendChild(tableRow); cursor.continue(); ...
IDBObjectStore.add() - Web APIs
nRequest.onsuccess = function(event) { note.innerHTML += '<li>Database initialised.</li>'; // store the result of opening the database in the db variable. ...
IDBObjectStore.autoIncrement - Web APIs
nRequest.onsuccess = function(event) { note.innerHTML += '<li>Database initialised.</li>'; // store the result of opening the database in the db variable. ...
IDBObjectStore.deleteIndex() - Web APIs
number has been submitted via the // window.indexedDB.open line above //it is only implemented in recent browsers DBOpenRequest.onupgradeneeded = function(event) { var db = this.result; db.onerror = function(event) { note.innerHTML += '<li>Error loading database.</li>'; }; // Create an objectStore for this database var objectStore = db.createObjectStore("toDoList", { keyPath: "task
Title" }); // define what data items the objectStore will contain objectStore.createIndex("hours", "hours", { unique: false }); objectStore.createIndex("minutes", "minutes", { unique: false }); objectStore.createIndex("day", "day", { unique: false }); objectStore.createIndex("month", "month", { unique: false }); objectStore.createIndex("year", "year", { unique: false }); objectStore...
IDBTransaction.onerror - Web APIs
onsuccess = function(event) { note.innerHTML += '<li>Database initialised.</li>'; // store the result of opening the database in the db variable. ...
IDBTransaction - Web APIs
ndexedDB.open("toDoList", 4); DBOpenRequest.onsuccess = function(event) { note.innerHTML += '<li>Database initialised.</li>'; // store the result of opening the database in the db // variable. ...
Browser storage limits and eviction criteria - Web APIs
onsidered obsolete; the "permanent" folder only stores IndexedDB persistent-type databases. It doesn't matter if box mode is "best-effort" or "persistent" -- data is stored under <profile>/storage/default. Note: In Firefox, you can find your profile folder by entering about:support in the URL bar, and pressing the Show in... button (e.g., Show in Finder on Mac OS X) next to the Profile Folder
title. Note: If you are looking around in your Profile at the data stored, you might see a fourth folder: persistent. Basically, the persistent folder was renamed to permanent a while ago to keep upgrades/migration simpler. Note: Users shouldn't add their own directories or files under <profile>/storage. This will cause storage initialization to fail; for example, open() will fire an error event.
KeyboardEvent.altKey - Web APIs
The KeyboardEvent.altKey read-only property is a Boolean that indicates if the alt key (Option or ? on OS X) was pressed (true) or not (false) when the event occured. Syntax var altKeyPressed = instanceOfKeyboardEvent.altKey Return value Boolean Examples <html> <head> <
title>altKey example</
title> <script type="text/javascript"> function showChar(e){ alert( "Key KeyDown: " + String.fromCharCode(e.charCode) + "\n" + "charCode: " + e.charCode + "\n" + "ALT key KeyDown: " + e.altKey + "\n" ); } </script> </head> <body onkeydown="showChar(event);"> <p> Press any character key, with or without holding down the ALT key.<br /> You can also use the SHIFT key together with the ALT key. </p> </body> </html> Specifications Specification Status Comment ...
Key Values - Web APIs
le" Toggles split screen display mode on and off. VK_SPLIT_SCREEN_TOGGLE GDK_KEY_SplitScreen (0x1008FF7D) Qt::Key_SplitScreen (0x010000ED) "STBInput" [3] Cycles among input modes on an external set-top box (STB). KEYCODE_STB_INPUT (180) "STBPower" [3] Toggles on and off an external STB. KEYCODE_STB_POWER (179) "Sub
title" Toggles the display of sub
titles on and off if they're available. VK_SUB
TITLE GDK_KEY_Sub
title (0x1008FF9A) KEYCODE_CAPTIONS (175) "Teletext" Toggles display of teletext, if available. VK_TELETEXT KEYCODE_TV_TELETEXT (233) "VideoModeNext" [3] Cycles through the available video modes. VK_VIDEO_MODE_NEXT GDK_KEY_Next_VMode (0x1008FE22...
Microdata DOM API - Web APIs
an earlier example: <section itemscope itemtype="http://example.org/animals#cat"> <h1 itemprop="name http://example.com/fn">Hedral</h1> <p itemprop="desc">Hedral is a male american domestic shorthair, with a fluffy <span itemprop="http://example.com/color">black</span> fur with <span itemprop="http://example.com/color">white</span> paws and belly.</p> <img itemprop="img" src="hedral.jpeg" alt=""
title="Hedral, age 18 months"> </section> ...it would result in the following output: name http://example.com/fn desc http://example.com/color img (The duplicate occurrence of "http://example.com/color" is not included in the list.) HTMLPropertiesCollection The HTMLPropertiesCollection interface is used for collections of elements that add name-value pairs to a particular item in the microdata mode...
Navigator.registerContentHandler() - Web APIs
Allows web sites to register themselves as possible handlers for content of a particular MIME type. Note: Web sites may only register content handlers for themselves. For security reasons, it's not possible for an extension or web site to register content handlers targeting other sites. Syntax navigator.registerContentHandler(mimeType, uri,
title); mimeType is the desired MIME type as a string. uri is the URI to the handler as a string.
title is the
title of the handler presented to the user as a string. Example navigator.registerContentHandler( "application/vnd.mozilla.maybe.feed", "http://www.example.tld/?foo=%s", "My Feed Reader" ); Notes For Firefox 2 and above, only the application/vnd.mozilla.maybe.feed, application/atom+xml, and application/rss+xml MIME types ...
Notification.body - Web APIs
Note: This feature is available in Web Workers. The body read-only property of the Notification interface indicates the body string of the notification, as specified in the body option of the Notification() constructor. Syntax var body = Notification.body; Value A DOMString. Examples function spawnNotification(theBody, theIcon, the
Title) { var options = { body: theBody, icon: theIcon } var n = new Notification(the
Title, options); console.log(n.body); } Specifications Specification Status Comment Notifications APIThe definition of 'body' in that specification. Living Standard Living standard ...
Notification.close() - Web APIs
n.close(); Parameters None. Returns Void. Examples In the following snippet, we have a simple function that when called creates an options object and then a new notification. At the end of the function, it also calls close() inside a addEventListener() function to remove the notification when the relevant content has been read on the webpage. function spawnNotification(theBody, theIcon, the
Title) { var options = { body: theBody, icon: theIcon }; var n = new Notification(the
Title,options); document.addEventListener('visibilitychange', function() { if (document.visibilityState === 'visible') { // The tab has become visible so clear the now-stale Notification. n.close(); } }); } Specifications Specification Status Comment Not...
Notification.icon - Web APIs
Notification interface contains the URL of an icon to be displayed as part of the notification, as specified in the icon option of the Notification() constructor. Syntax var icon = Notification.icon; Value A USVString. Examples In our To-do list app (view the app running live), we use the Notification() constructor to fire a notification, passing it arguments to specify the body, icon and
title we want. var notification = new Notification('To do list', { body: text, icon: img }); Specifications Specification Status Comment Notifications APIThe definition of 'icon' in that specification. Living Standard Living standard ...
Notification.requireInteraction - Web APIs
rty of the Notification interface returns a Boolean indicating that a notification should remain active until the user clicks or dismisses it, rather than closing automatically. Note: This can be set when the notification is first created by setting the requireInteraction option to true in the options object of the Notification.Notification() constructor. Syntax function spawnNotification(the
Title,theBody,shouldRequireInteraction) { var options = { body: theBody, requireInteraction: shouldRequireInteraction } var n = new Notification(the
Title,options); } Value A Boolean. Specifications Specification Status Comment Notifications APIThe definition of 'requireInteraction' in that specification. Living Standard Living standard. ...
Notification - Web APIs
n active until the user clicks or dismisses it, rather than closing automatically. Notification.silent Read only Specifies whether the notification should be silent -- i.e., no sounds or vibrations should be issued, regardless of the device settings. Notification.timestamp Read only Specifies the time at which a notification is created or applicable (past, present, or future). Notification.
title Read only The
title of the notification as specified in the first parameter of the constructor. Notification.vibrate Read only Specifies a vibration pattern for devices with vibration hardware to emit. Event handlers Notification.onclick A handler for the click event. It is triggered each time the user clicks on the notification. Notification.onclose A handler for the close event. It...
NotificationEvent.action - Web APIs
er clicked the notification somewhere other than an action button, or the notification does not have a button. The notification id is set during the creation of the Notification via the actions array attribute and can't be modified unless the notification is replaced. Returns A DOMString object. Example self.registration.showNotification("New articles available", { actions: [{action: "get",
title: "Get now."}] }); self.addEventListener('notificationclick', function(event) { event.notification.close(); if (event.action === 'get') { synchronizeReader(); } else { clients.openWindow("/reader"); } }, false); Specifications Specification Status Comment Notifications APIThe definition of 'action' in that specification. Living Standard Living s...
Notifications API - Web APIs
o allow notifications from this origin, or block them. Once a choice has been made, the setting will generally persist for the current session. Note: As of Firefox 44, the permissions for Notifications and Push have been merged. If permission is granted for notifications, push will also be enabled. Next, a new notification is created using the Notification() constructor. This must be passed a
title argument, and can optionally be passed an options object to specify options, such as text direction, body text, icon to display, notification sound to play, and more. In addition, the Notifications API spec specifies a number of additions to the ServiceWorker API, to allow service workers to fire notifications. Note: To find out more about using notifications in your own app, read Using the No...
RTCDataChannel.onerror - Web APIs
the example below, a data channel is established, and an onerror handler is added to it. The error handler passes information about the error to a UI library's alert box function to present an error message to the user. let pc = new RTCPeerConnection(); let dc = pc.createDataChannel("PlayerControl"); dc.onerror = function(event) { myUILibrary.doAlertBox({ 'Network Error', // Alert
title 'The error "' + event.message + '" occurred while handling player control network messages.', event.filename, event.lineno, event.colno }); } /* ... */ Specifications Specification Status Comment WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'RTCDataChannel.onerror' in that specification. Candidate Recommendat...
SVGStyleElement - Web APIs
on an attempt to change the value of a read-only attribute. This restriction was removed in SVG 2. SVGStyleElement.media A DOMString corresponding to the media attribute of the given element. SVG 1.1 defined that a DOMException is raised with code NO_MODIFICATION_ALLOWED_ERR on an attempt to change the value of a read-only attribute. This restriction was removed in SVG 2. SVGStyleElement.
title A DOMString corresponding to the
title attribute of the given element. SVG 1.1 defined that a DOMException is raised with code NO_MODIFICATION_ALLOWED_ERR on an attempt to change the value of a read-only attribute. This restriction was removed in SVG 2. Methods This interface doesn't implement any specific methods, but inherits methods from its parent interface, SVGElement and implements m...
ServiceWorkerRegistration.showNotification() - Web APIs
The showNotification() method of the ServiceWorkerRegistration interface creates a notification on an active service worker. Note: This feature is available in Web Workers. Syntax serviceWorkerRegistration.showNotification(
title, [options]); Parameters
title The
title that must be shown within the notification options Optional An object that allows configuring the notification. It can have the following properties: actions: An array of actions to display in the notification. The members of the array should be an object literal. It may contain the following values: action: A DOMString identifying a user action to be displayed on the notification.
title: A DOMString containing action text to be shown to the user. icon: A USVString containing the URL of an icon to ...
ServiceWorkerRegistration - Web APIs
nd is fired; it is fired any time the ServiceWorkerRegistration.installing property acquires a new service worker. Methods Also implements methods from its parent interface, EventTarget. ServiceWorkerRegistration.getNotifications() Returns a Promise that resolves to an array of Notification objects. ServiceWorkerRegistration.showNotification() Displays the notification with the requested
title. ServiceWorkerRegistration.update() Checks the server for an updated version of the service worker without consulting caches. ServiceWorkerRegistration.unregister() Unregisters the service worker registration and returns a Promise. The service worker will finish any ongoing operations before it is unregistered. Examples In this example, the code first checks whether the browser supports se...
Using Service Workers - Web APIs
l isn't a good overall control mechanism for asset caching and custom network requests. The previous attempt -- AppCache -- seemed to be a good idea because it allowed you to specify assets to cache really easily. However, it made many assumptions about what you were trying to do and then broke horribly when your app didn't follow those assumptions exactly. Read Jake Archibald's (unfortunately-
titled but well-written) Application Cache is a Douchebag for more details. Note: As of Firefox 44, when AppCache is used to provide offline support for a page a warning message is now displayed in the console advising developers to use Service workers instead (bug 1204581.) Service workers should finally fix these issues. Service worker syntax is more complex than that of AppCache, but the trade o...
StyleSheet - Web APIs
esenting the location of the stylesheet. StyleSheet.media Read only Returns a MediaList representing the intended destination medium for style information. StyleSheet.ownerNode Read only Returns a Node associating this style sheet with the current document. StyleSheet.parentStyleSheet Read only Returns a StyleSheet including this one, if any; returns null if there aren't any. StyleSheet.
title Read only Returns a DOMString representing the advisory
title of the current style sheet. StyleSheet.typeRead only Returns a DOMString representing the style sheet language for this style sheet. Specifications Specification Status Comment CSS Object Model (CSSOM)The definition of 'StyleSheet' in that specification. Working Draft No change from Document Object...
TextRange - Web APIs
llowing example is valid under IE9. The example gets the TextRange through document.selection, and sets the specified element to be selected. IE9 supports the standard alternative Range. var range = document.selection.createRange(); var element = document.getElementById("test"); range.moveToElementText(element); range.select(); // Selected "SomeTextToBeSelected" <!DOCTYPE html> <html> <head> <
title>TextRange Example</
title> </head> <body> <p id="test">SomeTextToBeSelected</p> </body> </html> Notes Use TextRange to Operate the Selection Valid only under IE9. The selection interface should be used first, if the browser allows it. document.selection property returns a non-standard selection object, and the selection.createRange() method creates a TextRange object consistent with the cu...
TextTrack - Web APIs
xt track associated with a particular <track> element. Properties This interface also inherits properties from EventTarget. TextTrack.activeCues Read only A TextTrackCueList object listing the currently active set of text track cues. Track cues are active if the current playback position of the media is between the cues' start and end times. Thus, for displayed cues such as captions or sub
titles, the active cues are currently being displayed. TextTrack.cues Read only A TextTrackCueList which contains all of the track's cues. TextTrack.id Read only A DOMString which identifies the track, if it has one. If it doesn't have an ID, then this value is an empty string (""). If the TextTrack is associated with a <track> element, then the track's ID matches the element's ID. TextTrack.inB...
VTTCue - Web APIs
f the cue. Methods getCueAsHTML() Returns the cue text as a DocumentFragment. Example HTML <video controls src="https://udn.realityripple.com/samples/c6/f8a3489533.webm"></video> CSS video { width: 320px; height: 180px; } JavaScript let video = document.querySelector('video'); video.addEventListener('loadedmetadata', () => { const track = video.addTextTrack("captions", "????Sub
titles", "zh_CN"); track.mode = "showing"; const cueCn = new VTTCue(0, 2.500, '????0?2.5????'); track.addCue(cueCn); const cueEn = new VTTCue(2.6, 4, 'Sub
titles will display between 2.6 and 4 seconds'); track.addCue(cueEn); }); Result Chrome: Please Open in JSFiddle to view the live sample. Embed live sample can not show sub
titles in Chrome. Specifications Specification ...
VideoTrack.kind - Web APIs
. Video track kind strings The kinds available for video tracks are: "alternative" A potential alternative to the main track, such as a different video take or a version of the soundtrack with only the music and no dialogue. "captions" A version of the main video track with captions burnt in. "main" The primary video track. "sign" A sign-language interpretation of an audio track. "sub
titles" A version of the main video track with sub
titles burnt in. "commentary" A video track containing a commentary. This might be used to contain the director's commentary track on a movie, for example. "" (empty string) The track doesn't have an explicit kind, or the kind provided by the track's metadata isn't recognized by the user agent. Specifications Specification Status ...
WebRTC API - Web APIs
established and opened using RTCPeerConnection, media streams (MediaStreams) and/or data channels (RTCDataChannels) can be added to the connection. Media streams can consist of any number of tracks of media information; tracks, which are represented by objects based on the MediaStreamTrack interface, may contain one of a number of types of media data, including audio, video, and text (such as sub
titles or even chapter names). Most streams consist of at least one audio track and likely also a video track, and can be used to send and receive both live media or stored media information (such as a streamed movie). You can also use the connection between two peers to exchange arbitrary binary data using the RTCDataChannel interface. This can be used for back-channel information, metadata exchange,...
Window.document - Web APIs
window.document returns a reference to the document contained in the window. Example console.log(window.document.
title); Specifications Specification Status Comment HTML Living StandardThe definition of 'Window.document' in that specification. Living Standard HTML5The definition of 'Window.document' in that specification. Recommendation ...
Window.locationbar - Web APIs
Returns the locationbar object, whose visibility can be checked. Syntax objRef = window.locationbar Example The following complete HTML example shows how the visible property of the locationbar object is used. <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <
title>Various DOM Tests</
title> <script> var visible = window.locationbar.visible; </script> </head> <body> <p>Various DOM Tests</p> </body> </html> Specifications Specification Status Comment HTML Living StandardThe definition of 'Window.locationbar' in that specification. Living Standard HTML5The definition of 'Window.locationbar' in that specification. Recommendation ...
Window.menubar - Web APIs
The Window.menubar property returns the menubar object, whose visibility can be checked. Syntax objRef = window.menubar Example The following complete HTML example demonstrates how the visible property of the menubar object is used. <html> <head> <
title>Various DOM Tests</
title> <script> var visible = window.menubar.visible; </script> </head> <body> <p>Various DOM Tests</p> </body> </html> Specifications Specification Status Comment HTML Living StandardThe definition of 'Window.menubar' in that specification. Living Standard HTML5The definition of 'Window.menubar' in that specification. Recommendation ...
Window.ondragdrop - Web APIs
Listener. See addEventListener for details. Example Fire an alert on dragdrop In this example, an event listener is added to the window (the event target). If, from an external source, a tab, a link, marked text or a file is dragged and dropped onto this window, the alert is fired. Note how event.stopPropagation(); prevents the browser from loading the dropped tab, link or file. <html> <head><
title>dragdroptest</
title> <script type="text/javascript"> window.addEventListener("dragdrop", testfunc, false); function testfunc(event) { alert("dragdrop!"); event.stopPropagation(); } </script> </head> <body> I am bodytext </body> </html> Specification Not part of specification. ...
Obsolete features - Web APIs
This page lists the obsolete windowFeatures parameter of window.open function. directories Obsolete since Gecko 2 Obsolete synonym of personalbar. In IE, it rendered the Links bar. Supported in Gecko up to 1.9.2 and in IE up to 6. fullscreen This feature no longer works in MSIE 6 SP2 the way it worked in MSIE 5.x. The Windows taskbar, as well as the
titlebar and the status bar of the window are not visible, nor accessible when fullscreen is enabled in MSIE 5.x. fullscreen always upsets users with large monitor screen or with dual monitor screen. Forcing fullscreen onto other users is also extremely unpopular and is considered an outright rude attempt to impose web author's viewing preferences onto users. fullscreen does not really work in MSIE 6 SP2. personalbar Obsolete sin...
Window.scrollbars - Web APIs
The Window.scrollbars property returns the scrollbars object, whose visibility can be checked. Syntax objRef = window.scrollbars Example The following complete HTML example shows how the visible property of the scrollbars object is used. <!doctype html> <html> <head> <
title>Various DOM Tests</
title> <script> let visibleScrollbars = window.scrollbars.visible; </script> </head> <body> <p>Various DOM Tests</p> </body> </html> Specifications Specification Status Comment HTML Living StandardThe definition of 'Window.scrollbars' in that specification. Living Standard HTML5The definition of 'Window.scrollbars' in that specification. Recommendation ...
Window.sidebar - Web APIs
Returns a sidebar object which contains several methods for registering add-ons with the browser. Methods The sidebar object returned has the following methods: Method Description (SeaMonkey) Description (Firefox) addPanel(
title, contentURL, "") Adds a sidebar panel. Obsolete since Firefox 23 (only present in SeaMonkey). End users can use the "load this bookmark in the sidebar" option instead. Also see Creating a Firefox sidebar. addPersistentPanel(
title, contentURL, "") Adds a sidebar panel, which is able to work in the background. AddSearchProvider(descriptionURL) Dummy function; does nothing. See Autodiscovery of search plugins. addSearchEngine(engineURL, iconURL, suggested
Title, suggestedCategory) Obsolete sinc...
Using the alert role - Accessibility
mative. Examples Example 1: Adding the role in the HTML code The snippet below shows how the alert role is added directly into the html source code. The moment the element finishes loading the screen reader should be notified of the alert. If the element was already in the original source code when the page loaded, the screen reader will announce the error immediately after announcing the page
title. <h2 role="alert">Your form could not be submitted because of 3 validation errors.</h2> Example 2: Dynamically adding an element with the alert role This snippet dynamically creates an element with an alert role and adds it to the document structure. let myAlert = document.createElement("p"); myAlert.setAttribute("role", "alert"); let myAlertText = document.createTextNode("You must agree with...
ARIA: Complementary role - Accessibility
Prefer HTML Using the <aside> element will automatically communicate a section has a role of complementary. If at all possible, prefer using it instead. Labeling landmarks Multiple landmarks If there is more than one complementary landmark role or <aside> element in a document, provide a label for each landmark using the aria-label attribute, or, if the aside has an appropriately descriptive
title, point to it with the aria-labelledby attribute. This label will allow an assistive technology user to be able to quickly understand the purpose of each landmark. <aside aria-label="Note about usage"> <!-- content --> </aside> ... <aside id="sidebar" aria-label="Sponsors"> <!-- content --> </aside> Redundant descriptions Screen readers will announce the type of role the landmark is. Bec...
ARIA: Region role - Accessibility
atically communicate a section has a role of region if it is given an accessible name. Developers should always prefer using the correct semantic HTML element, in this case <section>, over using ARIA. Associated WAI-ARIA Roles, States, and Properties aria-labelledby Use this attribute to label the region. Often, the value of the aria-labelledby attribute will be the id of the element used to
title the section. Keyboard Interactions None. Required JavaScript features None. Examples <div role="region" aria-labelledby="region-heading"> <h2 id="region-heading">This heading's <code>id</code> attribute helps this region have an accessible name</h2> <!-- region content --> </div> Accessibility concerns Use sparingly! Landmark roles are intended to be used sparingly, to identify larg...
Web applications and ARIA FAQ - Accessibility
L5 to ARIA When delivering content to browsers that aren't HTML5-aware, you may want to consider gracefully degrading to the use of ARIA where necessary. So, using the example of a progress bar, you can degrade gracefully to a role="progressbar" in cases where the <progressbar> tag isn't supported. Here is an example of the markup used for an HTML5 progress bar: <!DOCTYPE html> <html> <head><
title>Gracefully degrading progress bar</
title></head> <body> <progress id="progress-bar" value="0" max="100">0% complete</progress> <button id="update-button">Update</button> </body> </html> ... and here is the JavaScript code that will ensure the progress bar still works in older browsers: var progressBar = document.getElementById("progress-bar"); // Check to see if the browser support...
HTML To MSAA - Accessibility
Remarks The table below shows how Gecko maps HTML elements to MSAA. This table reflects mapping rules for specific elements only, it doesn't reflect any general rules applicable to all elements. For example, if name column has n/a value then it means specific elements doesn't provide own rules to calculate name but name can be computed from ARIA markup or @
title attribute. Map HTML element Role Name Value States Relations Actions Events Notes a ROLE_SYSTEM_ LINK n/a value of @href attribute STATE_SYSTEM_ SELECTABLE if @name attribute is presented STATE_SYSTEM_ LINKED if @href attribute is presented or click event listener is registered STATE_SYSTEM_ TRAVERSED if link is traversed n/a "jump" if @href is valid n/a br ROLE_SYSTEM_ WHITESPACE '\n' (new line char) STATE_SYSTEM...
Accessibility documentation index - Accessibility
91 HTML To MSAA Accessibility The table below shows how Gecko maps HTML elements to MSAA. This table reflects mapping rules for specific elements only, it doesn't reflect any general rules applicable to all elements. For example, if name column has n/a value then it means specific elements doesn't provide own rules to calculate name but name can be computed from ARIA markup or @
title attribute. 92 Implementing a Microsoft Active Accessibility (MSAA) Server Accessibility, MSAA, Microsoft, Server This document is for developers working to support MSAA in an application in order to make it accessible with 3rd party assistive technologies, as well as for hackers wishing to be involved in Mozilla's MSAA support specifically. 93 Keyboard-navigable Ja...
Web Accessibility: Understanding Colors and Luminance - Accessibility
e example further, brightness can be increased by adding the color white, which also reduces saturation. A common example is to add white to red to get the color pink. Pink is considered a desaturated red. Saturation and Luminance There is a loss of saturation at the extremes of luminance, at the extremes of black and white. NASA's article, Luminance Contrast in Color Graphics, in the section
titled, "The effect of luminance on saturation", points out that there is a loss of saturation at low luminances. and also, "..the loss of saturation at high luminances--the colors converge on white." The Special Case of "Red" Not all colors ("hue") are processed the same way by our brains. Human physiology and psychology are affected by the color "red" generally speaking, in ways different from th...
Perceivable - Accessibility
tion. No audio description tutorial is available yet. 1.2.2 Provide captions for web-based video (A) You should provide captions for video presented on the web (e.g., HTML5 video). This is for the benefit of people who can't hear the audio part of the video. See Video text tracks for HTML5 video captions, and Other multimedia content for other technologies. See also Add your own sub
titles & closed captions (YouTube). 1.2.3 Provide text transcript or audio description for web-based video (A) You should provide text transcripts or audio descriptions for video presented on the web (e.g., HTML5 video. This is for the benefit of people who can't see the visual part of the video, and don't get the full content from the audio alone. See Audio transcripts for transcript in...
Understandable - Accessibility
, or at the very least provide definitions somewhere in the surrounding text, or in a description list at the bottom of the page. 3.1.4 Abbreviations (AAA) Where abbreviations are used, you should provide an expansion of them, or a definition as required. The <abbr> element is often thought of as the preferred way to provide an expansion for an abbreviation -- it takes a
title attribute that contains the expansion, and this appears when the acronym is moused over. However, the
title contents are not accessible via keyboard, nor are they reliably read out by screenreaders. A better way to handle this is to again provide links to glossary pages containing the acronym expansion and explanation, or at the very least include them in the surrounding text in context. S...
font-weight - CSS: Cascading Style Sheets
nt has a low contrast color ratio. MDN Understanding WCAG, Guideline 1.4 explanations Understanding Success Criterion 1.4.8 | W3C Understanding WCAG 2.0 Formal definition Related at-rule@font-faceInitial valuenormalComputed valueas specified Formal syntax <font-weight-absolute>{1,2}where <font-weight-absolute> = normal | bold | <number <a href="/docs/CSS/Value_definition_syntax#Brackets"
title="Brackets: enclose several entities, combinators, and multipliers to transform them as a single component">[1,1000]> Examples Setting normal font weight in a @font-face rule The following finds a local Open Sans font or import it, and allows using the font for normal font weights. @font-face { font-family: "Open Sans"; src: local("Open Sans") format("woff2"), url("/fonts/OpenSans-R...
Attribute selectors - CSS: Cascading Style Sheets
The CSS attribute selector matches elements based on the presence or value of a given attribute. /* <a> elements with a
title attribute */ a[
title] { color: purple; } /* <a> elements with an href matching "https://example.org" */ a[href="https://example.org"] { color: green; } /* <a> elements with an href containing "example" */ a[href*="example"] { font-size: 2em; } /* <a> elements with an href ending ".org" */ a[href$=".org"] { font-style: italic; } /* <a> elements whose class attribute contains the word "logo" */ a[class~="logo"] { padding: 2px; } Syntax [attr] Represents elements with an attribute name of attr. [attr=value] Represents elements with an attribute name of attr whose value is exactly value. [attr~=value] Represents elements with an attribute name of at...
Ordering Flex Items - CSS: Cascading Style Sheets
f the news item is the key thing to highlight and would be the element that a user might jump to if they were tabbing between headings to find content they wanted to read. The card also has a date; the finished design we want to create is something like this. Visually the date appears above the heading, in the source. However, if the card was read out by a screen reader I would prefer that the
title was announced first and then the publication date. We can make this so using the order property. The card is going to be our flex container, with flex-direction set to column. I then give the date an order of -1. This pulls it up above the heading. These small tweaks are the sort of cases where the order property makes sense. Keep the logical order as the reading and tab order of the document...
Flow Layout and Overflow - CSS: Cascading Style Sheets
r discussion. This proposal would enable the adding of an ellipsis when text overflows in the block dimension. This is useful in the situation where you have a listing of articles, for example, and you display the listings in fixed height boxes which only take a limited amount of text. It may not be obvious to the reader that there is more content to click through to when clicking the box or the
title. An ellipsis indicates clearly the fact there is more content. The specification would allow a string of content or a regular ellipsis to be inserted. Summary Whether you are in continuous media on the web or in a Paged Media format such as print or EPUB, understanding how content overflows is useful when dealing with any layout method. By understanding how overflow works in normal flow, you sh...
Questions about CSS - CSS: Cascading Style Sheets
designer or the viewer. With CSS, the sources of style definition for a given document element are in this order of precedence: The STYLE attribute on an individual element tag The STYLE element that defines a specific style sheet containing style declarations or a LINK element that links to a separate document containing the STYLE element. In a Web page, the STYLE element is placed between the
TITLE statement and the BODY statement. An imported style sheet, using the CSS @import notation to automatically import and merge an external style sheet with the current style sheet Style attributes specified by the viewer to the browser The default style sheet assumed by the browser In general, the Web page creator's style sheet takes precedence, but it's recommended that browsers provide ways f...
animation-timing-function - CSS: Cascading Style Sheets
eApplies toall elements, ::before and ::after pseudo-elementsInheritednoComputed valueas specifiedAnimation typediscrete Formal syntax <timing-function>#where <timing-function> = linear | <cubic-bezier-timing-function> | <step-timing-function>where <cubic-bezier-timing-function> = ease | ease-in | ease-out | ease-in-out | cubic-bezier(<number <a href="/docs/CSS/Value_definition_syntax#Brackets"
title="Brackets: enclose several entities, combinators, and multipliers to transform them as a single component">[0,1]>, <number>, <number <a href="/docs/CSS/Value_definition_syntax#Brackets"
title="Brackets: enclose several entities, combinators, and multipliers to transform them as a single component">[0,1]>, <number>)<step-timing-function> = step-start | step-end | steps(<integer>[, <step-position>]...
appearance (-moz-appearance, -webkit-appearance) - CSS: Cascading Style Sheets
. -moz-window-button-minimize Firefox Removed in Firefox 64. -moz-window-button-restore Firefox Removed in Firefox 64. -moz-window-frame-bottom Firefox Removed in Firefox 64. -moz-window-frame-left Firefox Removed in Firefox 64. -moz-window-frame-right Firefox Removed in Firefox 64. -moz-window-
titlebar Firefox Removed in Firefox 64. -moz-window-
titlebar-maximized Firefox Removed in Firefox 64. Formal definition Initial valueautoApplies toall elementsInheritednoComputed valueas specifiedAnimation typediscrete Formal syntax none | auto | button | textfield | menulist-button | <compat-auto>where <compat-auto> = searchfield | textarea | push-button | slider...
attr() - CSS: Cascading Style Sheets
ies other than content is experimental, and support for the type-or-unit parameter is sparse. The attr() CSS function is used to retrieve the value of an attribute of the selected element and use it in the stylesheet. It can also be used on pseudo-elements, in which case the value of the attribute on the pseudo-element's originating element is returned. /* Simple usage */ attr(data-count); attr(
title); /* With type */ attr(src url); attr(data-count number); attr(data-width px); /* With fallback */ attr(data-count number, 0); attr(src url, ""); attr(data-width px, inherit); attr(data-something, "default"); Syntax Values attribute-name Is the name of an attribute on the HTML element referenced in the CSS. <type-or-unit> Is a keyword representing either the type of the attribute's v...
clip - CSS: Cascading Style Sheets
536px; height: 350px; } #top-left, #middle, #bottom-right { position: absolute; top: 0; } #top-left { left: 360px; clip: rect(0 175px 113px 0); } #middle { left: 280px; clip: rect(119px 255px 229px 80px); } #bottom-right { left: 200px; clip: rect(235px 335px 345px 160px); } HTML <p class="dotted-border"> <img src="https://udn.realityripple.com/samples/8f/15174f3500.jpg"
title="Original graphic"> <img id="top-left" src="https://udn.realityripple.com/samples/8f/15174f3500.jpg"
title="Graphic clipped to upper left"> <img id="middle" src="https://udn.realityripple.com/samples/8f/15174f3500.jpg"
title="Graphic clipped towards middle"> <img id="bottom-right" src="https://udn.realityripple.com/samples/8f/15174f3500.jpg"
title="Graphic clipped to bottom right"> </p> Re...
<color> - CSS: Cascading Style Sheets
se -moz-Field. See also -moz-EvenTreeRow. -moz-win-communicationstext Should be used for text in objects with -moz-appearance: -moz-win-communications-toolbox;. -moz-win-mediatext Should be used for text in objects with -moz-appearance: -moz-win-media-toolbox. -moz-win-accentcolor Used to access the Windows 10 custom accent color that you can set on the start menu, taskbar,
title bars, etc. -moz-win-accentcolortext Used to access the color of text placed over the Windows 10 custom accent color in the start menu, taskbar,
title bars, etc. Mozilla Color Preference Extensions -moz-activehyperlinktext User's preference for text color of active links. Should be used with the default document background color. -moz-default-background-color User's pref...
text-transform - CSS: Cascading Style Sheets
onverts the first letter of each word to uppercase. Other characters remain unchanged (they retain their original case as written in the element's text). A letter is defined as a character that is part of Unicode's Letter or Number general categories ; thus, any punctuation marks or symbols at the beginning of a word are ignored. Authors should not expect capitalize to follow language-specific
title casing conventions (such as skipping articles in English). The capitalize keyword was under-specified in CSS 1 and CSS 2.1. This resulted in differences between browsers in the way the first letter was calculated (Firefox considered - and _ as letters, but other browsers did not. Both Webkit and Gecko incorrectly considered letter-based symbols like (a) to be real letters. Internet Explorer 9 w...
transition-timing-function - CSS: Cascading Style Sheets
eApplies toall elements, ::before and ::after pseudo-elementsInheritednoComputed valueas specifiedAnimation typediscrete Formal syntax <timing-function>#where <timing-function> = linear | <cubic-bezier-timing-function> | <step-timing-function>where <cubic-bezier-timing-function> = ease | ease-in | ease-out | ease-in-out | cubic-bezier(<number <a href="/docs/CSS/Value_definition_syntax#Brackets"
title="Brackets: enclose several entities, combinators, and multipliers to transform them as a single component">[0,1]>, <number>, <number <a href="/docs/CSS/Value_definition_syntax#Brackets"
title="Brackets: enclose several entities, combinators, and multipliers to transform them as a single component">[0,1]>, <number>)<step-timing-function> = step-start | step-end | steps(<integer>[, <step-position>]...
transition - CSS: Cascading Style Sheets
here <single-transition> = [ none | <single-transition-property> ] | <time> | <timing-function> | <time>where <single-transition-property> = all | <custom-ident><timing-function> = linear | <cubic-bezier-timing-function> | <step-timing-function>where <cubic-bezier-timing-function> = ease | ease-in | ease-out | ease-in-out | cubic-bezier(<number <a href="/docs/CSS/Value_definition_syntax#Brackets"
title="Brackets: enclose several entities, combinators, and multipliers to transform them as a single component">[0,1]>, <number>, <number <a href="/docs/CSS/Value_definition_syntax#Brackets"
title="Brackets: enclose several entities, combinators, and multipliers to transform them as a single component">[0,1]>, <number>)<step-timing-function> = step-start | step-end | steps(<integer>[, <step-position>]...
Creating a cross-browser video player - Developer guides
-steel-battle-clip-medium.mp4" /> <param name="allowfullscreen" value="true" /> <param name="wmode" value="transparent" /> <param name="flashvars" value="controlbar=over&image=img/poster.jpg&file=flash-player.swf?videoUrl=video/tears-of-steel-battle-clip-medium.mp4" /> <img alt="Tears of Steel poster image" src="img/poster.jpg" width="1024" height="428"
title="No video playback possible, please download the video from the link below" /> </object> <!-- Offer download --> <a href="video/tears-of-steel-battle-clip-medium.mp4">Download MP4</a> </video> <figcaption>© Blender Foundation | <a href="http://mango.blender.org">mango.blender.org</a></figcaption> </figure> Even though this player will define its own custom control se...
Challenge solutions - Developer guides
Why use CSS Colors Challenge Without looking up a reference, find five more color names that work in your stylesheet. Solution CSS supports common color names like orange, yellow, blue, green, or black. It also supports some more exotic color names like chartreuse, fuschia, or burlywood. See CSS Color value for a complete list as well as other ways of specifying colors. ...
HTML5 - Developer guides
ia Using HTML5 audio and video The <audio> and <video> elements embed and allow the manipulation of new multimedia content. WebRTC This technology, where RTC stands for Real-Time Communication, allows connecting to other people and controlling videoconferencing directly in the browser, without the need for a plugin or an external application. Track and WebVTT The <track> element allows sub
titles and chapters. WebVTT is a text track format. 2D/3D graphics AND effects Canvas tutorial Learn about the new <canvas> element and how to draw graphs and other objects in Firefox. HTML5 Text API for <canvas> elements The HTML5 text API is now supported by <canvas> elements. WebGL WebGL brings 3D graphics to the Web by introducing an API that closely conforms to OpenGL ES 2.0 that can be ...
Index - Developer guides
ism for making them available through the browser's <audio> and <video> elements remains pretty much the same. Currently, to support all browsers we need to specify two formats, although with the adoption of MP3 and MP4 formats in Firefox and Opera, this is changing fast. You can find compatibility information in the Guide to media types and formats on the web. 7 Adding captions and sub
titles to HTML5 video HTML5, Media, WebVTT, captions, sub
titles, track In other articles we looked at how to build a cross browser video player using the HTMLMediaElement and Window.fullScreen APIs, and also at how to style the player. This article will take the same player and show how to add captions and sub
titles to it, using the WebVTT format and the <track> element. 8 Creating...
<h1>–<h6>: The HTML Section Heading elements - HTML: Hypertext Markup Language
ral-purpose resizing. Avoid skipping heading levels: always start from <h1>, next use <h2> and so on. You should only use one <h1> per page. Using more than one will not result in an error, but using only one is seen as a best practice. It makes logical sense -- <h1> is the most important heading, and tells you what the purpose of the overall page is. You wouldn't have a book with more than one
title, or a movie with more than one name! Having a single top-level
title is also arguably better for screenreader users, and SEO. Examples All headings The following code shows all the heading levels, in use. <h1>Heading level 1</h1> <h2>Heading level 2</h2> <h3>Heading level 3</h3> <h4>Heading level 4</h4> <h5>Heading level 5</h5> <h6>Heading level 6</h6> Here is the result of this code: E...
<acronym> - HTML: Hypertext Markup Language
moved in HTML5 and shouldn't be used anymore. Instead web developers should use the <abbr> element. Attributes This element only has global attributes, which are common to all elements. DOM Interface This element implements the HTMLElement interface. Implementation note: Up to Gecko 1.9.2 inclusive, Firefox implements the HTMLSpanElement interface for this element. Example <p>The <acronym
title="World Wide Web">WWW</acronym> is only a component of the Internet.</p> Default styling Though the purpose of this tag is purely for the convenience of the author, its default styling varies from one browser to another: Some browsers, like Internet Explorer, do not style it differently than a <span> element. Opera, Firefox, Chrome, and some others add a dotted underline to the content of t...
<b>: The Bring Attention To element - HTML: Hypertext Markup Language
(but not including any special importance). Do not confuse the <b> element with the <strong>, <em>, or <mark> elements. The <strong> element represents text of certain importance, <em> puts some emphasis on the text and the <mark> element represents text of certain relevance. The <b> element doesn't convey such special semantic information; use it only when no others fit. Similarly, do not mark
titles and headings using the <b> element. For this purpose, use the <h1> to <h6> tags. Further, stylesheets can change the default style of these elements, with the result that they are not necessarily displayed in bold. It is a good practice to use the class attribute on the <b> element in order to convey additional semantic information as needed (for example <b class="lead"> for the first sentence ...
<body>: The Document Body element - HTML: Hypertext Markup Language
method is non-conforming, use CSS color property on the element instead. topmargin The margin of the top of the body. This method is non-conforming, use CSS margin-top property on the element instead. vlink Color of text for visited hypertext links. This method is non-conforming, use CSS color property in conjunction with the :visited pseudo-class instead. Example <html> <head> <
title>Document
title</
title> </head> <body> <p>This is a paragraph</p> </body> </html> Specifications Specification Status Comment HTML Living StandardThe definition of '<body>' in that specification. Living Standard Changed the list of non-conforming features. HTML5The definition of '<body>' in that specification. Recommendation Obsoleted t...
<caption>: The Table Caption element - HTML: Hypertext Markup Language
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories None. Permitted content Flow content. Tag omission The end tag can be omitted if the element is not immediately followed by ASCII whitespace or a comment. Permitted parents A <table> element, as its first descendant. ...
<cite>: The Citation element - HTML: Hypertext Markup Language
The reference may be in an abbreviated form according to context-appropriate conventions related to citation metadata. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, phrasing content, palpable content. Permitted content Phrasing content. Tag omission None, both the starting and ending tag are mandatory. ...
<embed>: The Embed External Content element - HTML: Hypertext Markup Language
resource, in CSS pixels. This must be an absolute value; percentages are not allowed. Usage notes You can use the object-position property to adjust the positioning of the embedded object within the element's frame, and the object-fit property to control how the object's size is adjusted to fit within the frame. Examples <embed type="video/quicktime" src="movie.mov" width="640" height="480"
title="
Title of my video"> Accessibility concerns Use the
title attribute on an embed element to label its content so that people navigating with assistive technology such as a screen reader can understand what it contains. The
title's value should concisely describe the embedded content. Without a
title, they may not be able to determine what its embedded content is. This context shift can be confu...
<header> - HTML: Hypertext Markup Language
into specifications until HTML5, it actually existed at the very beginning of HTML. As seen in the very first website, it was originally used as the <head> element. At some point, it was decided to use a different name. This allowed <header> to be free to fill a different role later on. Attributes This element only includes the global attributes. ...
<html>: The HTML Document / Root element - HTML: Hypertext Markup Language
anguage to announce. The identifying language tag should describe the language used by the majority of the content of the page. Without it, screen readers will typically default to the operating system's set language, which may cause mispronunciations. Including a valid lang declaration on the <html> element also ensures that important metadata contained in the page's <head>, such as the page's <
title>, are also announced properly. MDN Understanding WCAG, Guideline 3.1 explanations Understanding Success Criterion 3.1.1 | W3C Understanding WCAG 2.0 Specifications Specification Status Comment HTML Living StandardThe definition of '<html>' in that specification. Living Standard HTML5The definition of '<html>' in that specification. Recommendat...
<input type="reset"> - HTML: Hypertext Markup Language
the user to know what the access key is! This is especially true since the modifiers are typically non-standard to avoid conflicts. When building a site, be sure to provide this information in a way that doesn't interfere with the site design (for example by providing an easily accessible link that points to information on what the site access keys are). Adding a tooltip to the button (using the
title attribute) can also help, although it's not a complete solution for accessibility purposes. Disabling and enabling a reset button To disable a reset button, simply specify the disabled global attribute on it, like so: <input type="reset" value="Disabled" disabled> You can enable and disable buttons at run time by simply setting disabled to true or false; in JavaScript this looks like btn.di...
<input type="search"> - HTML: Hypertext Markup Language
ur guide on regular expressions; the 'u' flag is specified when compiling the regular expression, so that the pattern is treated as a sequence of Unicode code points, instead of as ASCII. No forward slashes should be specified around the pattern text. If the specified pattern is not specified or is invalid, no regular expression is applied and this attribute is ignored completely. Tip: Use the
title attribute to specify text that most browsers will display as a tooltip to explain what the requirements are to match the pattern. You should also include other explanatory text nearby. See the section Specifying a pattern for details and an example. placeholder The placeholder attribute is a string that provides a brief hint to the user as to what kind of information is expected in the field.
<input type="submit"> - HTML: Hypertext Markup Language
ser will not know what the access key is! This is especially true since the modifiers are typically non-standard to avoid conflicts. When building a site, be sure to provide this information in a way that doesn't interfere with the site design (for example by providing an easily accessible link that points to information on what the site access keys are). Adding a tooltip to the button (using the
title attribute) can also help, although it's not a complete solution for accessibility purposes. Disabling and enabling a submit button To disable a submit button, simply specify the disabled global attribute on it, like so: <input type="submit" value="Disabled" disabled> You can enable and disable buttons at run time by simply setting disabled to true or false; in JavaScript this looks like btn...
<input type="tel"> - HTML: Hypertext Markup Language
ur guide on regular expressions; the 'u' flag is specified when compiling the regular expression, so that the pattern is treated as a sequence of Unicode code points, instead of as ASCII. No forward slashes should be specified around the pattern text. If the specified pattern is not specified or is invalid, no regular expression is applied and this attribute is ignored completely. Tip: Use the
title attribute to specify text that most browsers will display as a tooltip to explain what the requirements are to match the pattern. You should also include other explanatory text nearby. See Pattern validation below for details and an example. placeholder The placeholder attribute is a string that provides a brief hint to the user as to what kind of information is expected in the field. It shou...
<input type="text"> - HTML: Hypertext Markup Language
ur guide on regular expressions; the 'u' flag is specified when compiling the regular expression, so that the pattern is treated as a sequence of Unicode code points, instead of as ASCII. No forward slashes should be specified around the pattern text. If the specified pattern is not specified or is invalid, no regular expression is applied and this attribute is ignored completely. Tip: Use the
title attribute to specify text that most browsers will display as a tooltip to explain what the requirements are to match the pattern. You should also include other explanatory text nearby. See Specifying a pattern for further details and an example. placeholder The placeholder attribute is a string that provides a brief hint to the user as to what kind of information is expected in the field. It...
<label> - HTML: Hypertext Markup Language
label> <p> <a href="terms-and-conditions.html">Read our Terms and Conditions</a> </p> Headings Placing heading elements within a <label> interferes with many kinds of assistive technology, because headings are commonly used as a navigation aid. If the label's text needs to be adjusted visually, use CSS classes applied to the <label> element instead. If a form, or a section of a form needs a
title, use the <legend> element placed within a <fieldset>. Don't <label for="your-name"> <h3>Your name</h3> <input id="your-name" name="your-name" type="text"> </label> Do <label class="large-label" for="your-name"> Your name <input id="your-name" name="your-name" type="text"> </label> Buttons An <input> element with a type="button" declaration and a valid value attribute does not need...
<menuitem> - HTML: Hypertext Markup Language
s The <menu> element, where that element is in the popup menu state. (If specified, the type attribute of the <menu> element must be popup; if missing, the parent element of the <menu> must itself be a <menu> in the popup menu state.) Permitted ARIA roles None DOM interface HTMLMenuItemElement Attributes This element includes the global attributes; in particular
title can be used to describe the command, or provide usage hints. checked Boolean attribute which indicates whether the command is selected. May only be used when the type attribute is checkbox or radio. command Specifies the ID of a separate element, indicating a command to be invoked indirectly. May not be used within a menu item that also includes the attributes checked, disabled, icon, label...
Standard metadata names - HTML: Hypertext Markup Language
ith the name attribute giving the metadata name, and the content attribute giving the value. Standard metadata names defined in the HTML specification The HTML specification defines the following set of standard metadata names: application-name: the name of the application running in the web page. Note: Browsers may use this to identify the application. It is different from the <
title> element, which usually contain the application name, but may also contain information like the document name or a status. Simple web pages shouldn't define an application-name. author: the name of the document's author. description: a short and accurate summary of the content of the page. Several browsers, like Firefox and Opera, use this as the default description of bookmarked pag...
<meta>: The Document-level Metadata element - HTML: Hypertext Markup Language
Content categories Metadata content. If the itemprop attribute is present: flow content, phrasing content. Permitted content None, it is an empty element. Tag omission As it is a void element, the start tag must be present and the end tag must not be present. Permitted parents <meta charset>, <meta http-equiv>: a <head> element. ...
<style>: The Style Information element - HTML: Hypertext Markup Language
ied to. Its value is a media query, which defaults to all if the attribute is missing. nonce A cryptographic nonce (number used once) used to whitelist inline styles in a style-src Content-Security-Policy. The server must generate a unique nonce value each time it transmits a policy. It is critical to provide a nonce that cannot be guessed as bypassing a resource's policy is otherwise trivial.
title This attribute specifies alternative style sheet sets. Deprecated attributes scoped This attribute specifies that the styles only apply to the elements of its parent(s) and children. This attribute may be re-introduced in the future per https://github.com/w3c/csswg-drafts/issues/3547. If you want to use the attribute now, you can use a polyfill. Examples A simple styleshee...
<td>: The Table Data Cell element - HTML: Hypertext Markup Language
65534. Deprecated attributes abbr This attribute contains a short abbreviated description of the cell's content. Some user-agents, such as speech readers, may present this description before the content itself. Note: Do not use this attribute as it is obsolete in the latest standard. Alternatively, you can put the abbreviated description inside the cell and place the long content in the
title attribute. align This enumerated attribute specifies how the cell content's horizontal alignment will be handled. Possible values are: left: The content is aligned to the left of the cell. center: The content is centered in the cell. right: The content is aligned to the right of the cell. justify (with text only): The content is stretched out inside the cell so that it covers its ...
itemid - HTML: Hypertext Markup Language
how items with the same identifier are handled. Note: The WHATWG definition specifies that an itemid must be a URL. However, the following example correctly illustrates that a URN may also be used. This inconsistency may reflect the incomplete nature of the Microdata specification. Example HTML <dl itemscope itemtype="http://vocab.example.net/book" itemid="urn:isbn:0-330-34032-8"> <dt>
Title <dd itemprop="
title">The Reality Dysfunction <dt>Author <dd itemprop="author">Peter F. Hamilton <dt>Publication date <dd><time itemprop="pubdate" datetime="1996-01-26">26 January 1996</time> </dl> Structured data itemscope itemtype: itemid http://vocab.example.net/book: urn:isbn:0-330-34032-8 itemprop
title The Reality Dysfunction itemprop auth...
style - HTML: Hypertext Markup Language
m HTML5 HTML5The definition of 'style' in that specification. Recommendation Snapshot of HTML Living Standard. From HTML 4.01 Specification, it is now a true global attribute. HTML 4.01 SpecificationThe definition of 'style' in that specification. Recommendation Supported on all elements but <base>, <basefont>, <head>, <html>, <meta>, <param>, <script>, <style>, and <
title>. CSS Style Attributes Recommendation Defines the content of the style attribute. ...
Quirks Mode and Standards Mode - HTML: Hypertext Markup Language
ber of quirks implemented. How do browsers determine which mode to use? For HTML documents, browsers use a DOCTYPE in the beginning of the document to decide whether to handle it in quirks mode or standards mode. To ensure that your page uses full standards mode, make sure that your page has a DOCTYPE like in this example: <!DOCTYPE html> <html lang="en"> <head> <meta charset=UTF-8> <
title>Hello World!</
title> </head> <body> </body> </html> The DOCTYPE shown in the example, <!DOCTYPE html>, is the simplest possible, and the one recommended by HTML5. Earlier versions of the HTML standard recommended other variants, but all existing browsers today will use full standards mode for this DOCTYPE, even the dated Internet Explorer 6. There are no valid reasons to use a more complic...
Data URLs - HTTP
have been associated with data URLs, and navigating to them in the browser's top level. To mitigate such issues, top-level navigation to data:// URLs has been blocked in Firefox 59+ (release version, Nightly/Beta from 58), and we hope to see other browsers follow suit soon. See Blocking Top-Level Navigations to data URLs for Firefox 58 for more details. Specifications Specification
Title RFC 2397 The "data" URL scheme ...
Identifying resources on the Web - HTTP
s typed directly into the browser's URL bar, or the target of a link), although some browsers may delegate loading FTP content to another application. Examples https://developer.mozilla.org/docs/Learn tel:+1-816-555-1212 git@github.com:mdn/browser-compat-data.git ftp://example.org/resource.txt urn:isbn:9780141036144 mailto:help@supercyberhelpdesk.info Specifications Specification
Title RFC 7230, section 2.7: Uniform Resource Identifiers Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing ...
Content Security Policy (CSP) - HTTP
e policy section that was violated. Sample violation report Let's consider a page located at http://example.com/signup.html. It uses the following policy, disallowing everything but stylesheets from cdn.example.com. Content-Security-Policy: default-src 'none'; style-src cdn.example.com; report-uri /_/csp-reports The HTML of signup.html looks like this: <!DOCTYPE html> <html> <head> <
title>Sign Up</
title> <link rel="stylesheet" href="css/style.css"> </head> <body> ... Content ... </body> </html> Can you spot the mistake? Stylesheets are allowed to be loaded only from cdn.example.com, yet the website tries to load one from its own origin (http://example.com). A browser capable of enforcing CSP would send the following violation report as a POST request to http://examp...
Accept-Charset - HTTP
utf-8 or iso-8859-15. * Any charset not mentioned elsewhere in the header; * is used as a wildcard. ...
CSP: media-src - HTTP
ied only to inline scripts. CSP 3.0 allows it in the case of script-src for external scripts. Examples Violation cases Given this CSP header: Content-Security-Policy: media-src https://example.com/ The following <audio>, <video> and <track> elements are blocked and won't load: <audio src="https://not-example.com/audio"></audio> <video src="https://not-example.com/video"> <track kind="sub
titles" src="https://not-example.com/sub
titles"> </video> Specifications Specification Status Comment Content Security Policy Level 3The definition of 'media-src' in that specification. Working Draft No changes. Content Security Policy Level 2The definition of 'media-src' in that specification. Recommendation Initial definition. ...
Content-Security-Policy-Report-Only - HTTP
tion that was violated. Sample violation report Let's consider a page located at http://example.com/signup.html. It uses the following policy, disallowing everything but stylesheets from cdn.example.com. Content-Security-Policy-Report-Only: default-src 'none'; style-src cdn.example.com; report-uri /_/csp-reports The HTML of signup.html looks like this: <!DOCTYPE html> <html> <head> <
title>Sign Up</
title> <link rel="stylesheet" href="css/style.css"> </head> <body> ... Content ... </body> </html> Can you spot the violation? Stylesheets are only allowed to be loaded from cdn.example.com, yet the website tries to load one from its own origin (http://example.com). A browser capable of enforcing CSP will send the following violation report as a POST request to http://exam...
Content-Type - HTTP
-------------------974767299852498929531610575 Content-Disposition: form-data; name="description" some text -----------------------------974767299852498929531610575 Content-Disposition: form-data; name="myFile"; filename="foo.txt" Content-Type: text/plain (content of the uploaded file foo.txt) -----------------------------974767299852498929531610575-- Specifications Specification
Title RFC 7233, section 4.1: Content-Type in multipart Hypertext Transfer Protocol (HTTP/1.1): Range Requests RFC 7231, section 3.1.1.5: Content-Type Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content ...
Cookie - HTTP
ader name yes Syntax Cookie: <cookie-list> Cookie: name=value Cookie: name=value; name2=value2; name3=value3 <cookie-list> A list of name-value pairs in the form of <cookie-name>=<cookie-value>. Pairs in the list are separated by a semicolon and a space ('; '). Examples Cookie: PHPSESSID=298zf09hf012fh2; csrftoken=u32t4o3tb3gg43; _gat=1 Specifications Specification
Title RFC 6265, section 5.4: Cookie HTTP State Management Mechanism ...
Cookie2 - HTTP
The obsolete Cookie2 HTTP request header used to advise the server that the user agent understands "new-style" cookies, but nowadays user agents will use the Cookie header instead, not this one. Header type Request header Forbidden header name yes Examples Cookie2: $Version="1" Specifications Specification
Title RFC 2965: Cookie2 Historic specification of HTTP State Management Mechanism, obsoleted by RFC 6265 ...
Date - HTTP
hour> 2 digit hour number, e.g. "09" or "23". <minute> 2 digit minute number, e.g. "04" or "59". ...
Digest - HTTP
he result of applying the digest algorithm to the resource representation and encoding the result. The choice of digest algorithm also determines the encoding to use: for example SHA-256 uses base64 encoding. Examples Digest: sha-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE= Digest: sha-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=,unixsum=30637 Specifications Specification
Title draft-ietf-httpbis-digest-headers-latest Resource Digests for HTTP This header was originally defined in RFC 3230, but the definition of "selected representation" in RFC 7231 made the original definition inconsistent with current HTTP specifications. When released, The "Resource Digests for HTTP" draft therefore will obsolete RFC 3230 and will update the standard t...
ETag - HTTP
5d9f25f89d4" The server compares the client's ETag (sent with If-None-Match) with the ETag for its current version of the resource, and if both values match (that is, the resource has not changed), the server sends back a 304 Not Modified status, without a body, which tells the client that the cached version of the response is still good to use (fresh). Specifications Specification
Title RFC 7232, section 2.3: ETag Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests ...
Early-Data - HTTP
early data, and also indicates that the intermediary understands the 425 (Too Early) status code. ...
Expect-CT - HTTP
nless the site has 'proven' it can serve a certificate satisfying the certificate transparency requirements. Browsers implement their own trust model regarding which CT logs are considered trusted for the certificate to have been logged to. Builds of Chrome are designed to stop enforcing the Expect-CT policy 10 weeks after the installation's build date. Specifications Specification
Title Internet Draft Expect-CT Extension for HTTP ...
Expect - HTTP
n HTTP/1.1 Host: origin.example.com Content-Type: video/h264 Content-Length: 1234567890987 Expect: 100-continue The server now checks the request headers and may respond with a 100 (Continue) response to instruct the client to go ahead and send the message body, or it will send a 417 (Expectation Failed) status if any of the expectations cannot be met. Specifications Specification
Title RFC 7231, section 5.1.1: Expect Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content ...
Expires - HTTP
with the max-age or s-maxage directive in the response, the Expires header is ignored. ...
Forwarded - HTTP
ion, server, or proxy supports the standardized Forwarded header, the X-Forwarded-For header can be replaced. Note that IPv6 address are quoted and enclosed in square brackets in Forwarded. X-Forwarded-For: 123.34.567.89 Forwarded: for=123.34.567.89 X-Forwarded-For: 192.0.2.43, "[2001:db8:cafe::17]" Forwarded: for=192.0.2.43, for="[2001:db8:cafe::17]" Specifications Specification
Title RFC 7239, section 4: Forwarded Forwarded HTTP Extension ...
From - HTTP
ers, such as if the robot is sending excessive, unwanted, or invalid requests. ...
Host - HTTP
ks a Host header field or that contains more than one. ...
Regular expression syntax cheatsheet - JavaScript
Where "n" is a positive integer. A back reference to the last substring matching the n parenthetical in the regular expression (counting left parentheses). For example, /apple(,)\sorange\1/ matches "apple, orange," in "apple, orange, cherry, peach". \k<Name> A back reference to the last substring matching the Named capture group specified by <Name>. For example, /(?<
title>\w+), yes \k<
title>/ matches "Sir, yes Sir" in "Do you copy? Sir, yes Sir!". \k is used literally here to indicate the beginning of a back reference to a Named capture group. (?<Name>x) Named capturing group: Matches "x" and stores it on the groups property of the returned matches under the name specified by <Name>. The angle brackets (< and >) are required for...
Groups and ranges - JavaScript
Where "n" is a positive integer. A back reference to the last substring matching the n parenthetical in the regular expression (counting left parentheses). For example, /apple(,)\sorange\1/ matches "apple, orange," in "apple, orange, cherry, peach". \k<Name> A back reference to the last substring matching the Named capture group specified by <Name>. For example, /(?<
title>\w+), yes \k<
title>/ matches "Sir, yes Sir" in "Do you copy? Sir, yes Sir!". \k is used literally here to indicate the beginning of a back reference to a Named capture group. (?<Name>x) Named capturing group: Matches "x" and stores it on the groups property of the returned matches under the name specified by <Name>. The angle brackets (< and >) are required for...
About the JavaScript reference - JavaScript
If you're learning JavaScript, or need help understanding some of its capabilities or features, check out the JavaScript guide. The JavaScript language is intended to be used within some larger environment, be it a browser, server-side scripts, or similar. ...
Intl - JavaScript
runtime's default locale is used. A Unicode BCP 47 locale identifier consists of a language code, (optionally) a script code, (optionally) a region (or country) code, (optionally) one or more variant codes, and (optionally) one or more extension sequences, with all present components separated by hyphens. Locale identifiers are case-insensitive ASCII. However, it's conventional to use
title case (first letter capitalized, successive letters lower case) for script code, upper case for region codes, and lower case for everything else. For example: "hi": Hindi (language) "de-AT": German (language) as used in Austria (region) "zh-Hans-CN": Chinese (language) written in simplified characters (script) as used in China (region) "en-emodeng": English (language) in the "Early modern E...
Web media technologies
s, or as a destination for streamed video content. <video> can also be used as a way to link media APIs with other HTML and DOM technologies, including <canvas> (for frame grabbing and manipulation), for example. Accessible from JavaScript as HTMLVideoElement objects. <track> The HTML <track> element can be placed within an <audio> or <video> element to provide a reference to a WebVTT format sub
title or caption track to be used when playing the media. Accessible from JavaScript as HTMLTrackElement objects. <source> The HTML <source> element is used within an <audio> or <video> element to specify source media to present. Multiple sources can be used to provide the media in different formats, sizes, or resolutions. Accessible from JavaScript as HTMLSourceElement objects. APIs Media Capab...
Recommended Web Performance Timings: How long is too long? - Web Performance
indicating content will load (1 second), idling (50ms), animating (16.7s) and responding to user input (50 to 200ms). Load goal The 'Under a second' is often touted as optimal for load, but what does that mean? A second should be considered a rule in the maximum amount of time to indicate to a user that the request for new content was made and will load, such as the browser displaying the page
title and the background color of the page displaying. The first asset retrieved from a request is usually an HTML document, which then makes calls for additional assets. As noted in the description of the critical rendering path, when received, browsers immediately start processing the HTML, rendering the content as it is received rather than waiting for additional assets to load. Yes, one second f...
Add to Home screen - Progressive web apps (PWAs)
me screen. Note: You can find out a lot more about Chrome install banners from the article Web App Install Banners. If you choose not to add it to your Home screen at this point, you can do so later using the Add to Home screen icon in the main Chrome menu. Regardless of which browser you are using, when you choose to add the app to your Home screen, you'll see it appear along with a short
title, in the same way that native apps do. Tapping this icon opens it up, but as a fullscreen app, you'll no longer see the browser UI around it. How do you make an app A2HS-ready? To enable your app to be added to a Home screen, it needs the following: To be served over HTTPs -- the web is increasingly being moved in a more secure direction, and many modern web technologies (A2HS included) wi...
Installing and uninstalling web apps - Progressive web apps (PWAs)
o the home screen, but also lets the user customize its name. Upon clicking "Add," the app is included on the home screen. The installed web application Regardless of which browser and device you're using, when you choose to add the app to your home screen or app launcher, it'll show up there looking just like any application. Typically this means you'll see the app's icon along with a short
title. When you tap the web app's icon on the home screen, it opens up in a full screen web environment, without the browser's UI around it. ...
PWA developer guide - Progressive web apps (PWAs)
In the articles listed here, you'll find guides about every aspect of development specific to the greation of progressive web applications (PWAs). For all other documentation about web development, which generally pertains to PWAs as well, see our primary web development documentation. --->>>
Titles below are just for the list; give articles good SEO names and feel free to tweak those and this as needed... <<<--- Web app basics Introduction and getting started with PWA development some description Installing and uninstalling web apps An introductory guide to how a web app can be installed on the user's device... Using service workers to run offline description Alerting the user using notifications description Creating a web app from an existing site description Advanced top...
How to make PWAs installable - Progressive web apps (PWAs)
Internet require the service worker. If developing your app using Firefox, be aware that you will need a service worker to be compatible with Chromium-based browsers. The manifest file The key element is a web manifest file, which lists all the information about the website in a JSON format. It usually resides in the root folder of a web app. It contains useful information, such as the app's
title, paths to different-sized icons that can be used to represent the app on an OS (such as an icon on the home screen, an entry in the Start menu, or an icon on the desktop), and a background color to use in loading or splash screens. This information is needed for the browser to present the web app properly during the installation process, as well as within the device's app-launching interface, suc...
Media - Progressive web apps (PWAs)
there is an example of Mozilla's markup language for user interfaces. Action: Printing a document Note: This snippet only works on Firefox since it erroneously increments the CSS counter for fix-position elemnts. It shouldn not work in other browsers. See issue on css3-page. Make a new HTML document, doc4.html. Copy and paste the content from here: <!DOCTYPE html> <html> <head> <
title>Print sample</
title> <link rel="stylesheet" href="style4.css"> </head> <body> <h1>Section A</h1> <p>This is the first section...</p> <h1>Section B</h1> <p>This is the second section...</p> <div id="print-head"> Heading for paged media </div> <div id="print-foot"> Page: </div> </body> </html> Make a new stylesheet, style4.css. Copy and paste ...
class - SVG: Scalable Vector Graphics
DisplacementMap> <feFlood> <feGaussianBlur> <feImage> <feMerge> <feMorphology> <feOffset> <feSpecularLighting> <feTile> <feTurbulence> <filter> <font> <foreignObject> <g> <glyph> <glyphRef> <image> <line> <linearGradient> <marker> <mask> <missing-glyph> <path> <pattern> <polygon> <polyline> <radialGradient> <rect> <stop> <svg> <switch> <symbol> <text> <textPath> <
title> <tref> <tspan> <use> ...
<a> - SVG: Scalable Vector Graphics
Attributes Most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility XLink Attributes Most notably: xlink:
title ARIA Attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, a...
<altGlyph> - SVG: Scalable Vector Graphics
Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of '<altGlyph>' in that specification. Recommendation Initial definition ...
<feComposite> - SVG: Scalable Vector Graphics
Core attributes >> Presentation attributes >> Filter primitive attributes >> class style Specific attributes in in2 operator k1 k2 k3 k4 DOM Interface This element implements the SVGFECompositeElement interface. Example SVG <svg width="330" height="195" viewBox="0 0 1100 650" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <
title>Example feComposite - Examples of feComposite operations</
title> <desc>Four rows of six pairs of overlapping triangles depicting the six different feComposite operators under different opacity values and different clearing of the background.</desc> <defs> <desc>Define two sets of six filters for each of the six compositing operators. The first set wipes out the ba...
<pattern> - SVG: Scalable Vector Graphics
Attributes Most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-events, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility XLink Attributes Most notably: xlink:
title Usage notes CategoriesContainer elementPermitted contentAny number of the following elements, in any order:Animation elementsDescriptive elementsShape elementsStructural elementsGradient elements<a>, <altGlyphDef>, <clipPath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignObject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> Specificati...
<style> - SVG: Scalable Vector Graphics
stroke: maroon; stroke-width: 2px; } </style> <circle cx="5" cy="5" r="4" /> </svg> Attributes type This attribute defines type of the style sheet language to use as a media type string. Value type: <string>; Default value: text/css; Animatable: no media This attribute defines to which media the style applies. Value type: <string>; Default value: all; Animatable: no
title This attribute the
title of the style sheet which can be used to switch between alternate style sheets. Value type: <string>; Default value: none; Animatable: no Global attributes Core Attributes Most notably: id Styling Attributes class, style Event Attributes Global event attributes, Document element event attributes Usage notes CategoriesNonePermitted contentAny elements or char...
<textPath> - SVG: Scalable Vector Graphics
elledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role XLink Attributes xlink:
title Usage notes CategoriesText content element, Text content child elementPermitted contentCharacter data and any number of the following elements, in any order:Descriptive elements<a>, <altGlyph>, <animate>, <animateColor>, <set>, <tref>, <tspan> Specifications Specification Status Comment Scalable Vector Graphics (SVG) 2The definition of '<textPath>' in that specifi...
Namespaces crash course - SVG: Scalable Vector Graphics
advantages, but it also required a very real problem to be solved. Naturally, each XML dialect defines the meaning of the markup element names described in its specification. The problem with mixing content from different XML dialects in a single XML document is that the elements defined by one dialect may have the same name as elements defined by another. For example, both XHTML and SVG have a <
title> element. How should the user agent distinguish between the two? In fact how does the user agent tell when XML content is something it knows about, and not just a meaningless XML file containing arbitrary element names unknown to it? Contrary to popular opinion, the answer to this question is not "it can tell from the DOCTYPE declaration". DTDs were never designed with mixed content in mind, and...
Other Resources - SVG: Scalable Vector Graphics
Here is a list of additional resources on SVG: Mozilla SVG Resources SVG.org SVGBasics Tutorials W3C SVG Homepage SVG Wiki http://wiki.svg.org/index.php?
title=..._Configuration I moved this from the Other Resources category, not sure why it's in other resources -Nickolay http://developer.mozilla.org/en/docs...%28external%29 ...
For Further Reading - XSLT: Extensible Stylesheet Language Transformations
IBM's extensive XML developer site. This book is somewhat less comprehensive than Michael Kay's, but it covers the basics well, and offers some intriguing examples. http://www.amazon.com/Xslt-Doug-Tidwell/dp/0596000537 Learning XML, Second Edition Author: Erik T. Ray Length: 432 pages Publisher: O'Reilly Media; 2 edition (September 22, 2003) ISBN: 0596004206 As the
title indicates, this is an overview of XML generally. Chapter 6 is devoted specifically to XSLT. http://www.amazon.com/gp/product/0596004206 Digital Websites World Wide Web Consortium The W3C homepage: http://www.w3.org/ The main XSL page: http://www.w3.org/Style/XSL/ The version 1.0 Recommendation for XSLT: http://www.w3.org/TR/xslt Archive of public style (CSS and XSLT) d...
Compiling from Rust to WebAssembly - WebAssembly
figure Webpack. Create webpack.config.js and put the following in it: const path = require('path'); module.exports = { entry: "./index.js", output: { path: path.resolve(__dirname, "dist"), filename: "index.js", }, mode: "development" }; Now we need an HTML file; create index.html and give it the following contents: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <
title>hello-wasm example</
title> </head> <body> <script src="./index.js"></script> </body> </html> Finally, create the index.js referenced in the HTML file and give it these contents: const js = import("./node_modules/hello-wasm/hello_wasm.js"); js.then(js => { js.greet("WebAssembly"); }); Note that you need to fill in your npm username again. This imports the new module from the node_m...