Search completed in 1.06 seconds.
Index - Web APIs
460 cssstyledeclaration.item() api, cssom, method, reference the cssstyledeclaration.item() method interface returns a css property name from a cssstyledeclaration by
index 461 cssstyledeclaration.length api, cssom, property, reference the read-only property returns an integer that represents the number of style declarations in this css declaration block.
... 489 cssunparsedvalue.keys() api, css typed object model api, cssunparsedvalue, constructor, experimental, houdini, method, needsexample, reference, keys() the cssunparsedvalue.keys() method returns a new array iterator object that contains the keys for each
index in the array.
... 491 cssunparsedvalue.values() api, css typed object model api, cssunparsedvalue, constructor, experimental, houdini, method, needsexample, reference, values() the cssunparsedvalue.values() method returns a new array iterator object that contains the values for each
index in the cssunparsedvalue object.
...And 165 more matches
Using IndexedDB - Web APIs
indexeddb is a way for you to persistently store data inside a user's browser.
... about this document this tutorial walks you through using the asynchronous api of
indexeddb.
... if you are not familiar with
indexeddb, you should first read basic concepts about
indexeddb.
...And 68 more matches
Index
12
index found 1275 pages: 13 interfacing with the xpcom cycle collector firefox 3, xpcom this is a quick overview of the cycle collector introduced into xpcom for firefox 3, including a description of the steps involved in modifying an existing c++ class to participate in xpcom cycle collection.
... 20 components.classes xpcom:language bindings, xpconnect components.classes is a read-only object whose properties are classes
indexed by contractid.
... 21 components.classesbyid xpcom:language bindings, xpconnect components.classesbyid is a read-only object whose properties are classes
indexed by cid.
...And 29 more matches
Index - Archive of obsolete content
46
indexed-db add-on sdk exposes the
indexeddb api to add-ons.
... 815 completedefault
index xul attributes, xul reference no summary!
... 816 completeselected
index no summary!
...And 26 more matches
IDBIndex - Web APIs
idb
index interface of the
indexeddb api provides asynchronous access to an
index in a database.
... an
index is a kind of object store for looking up records in another object store, called the referenced object store.
... you can retrieve records in an object store through the primary key or by using an
index.
...And 26 more matches
IndexedDB API - Web APIs
indexeddb is a low-level api for client-side storage of significant amounts of structured data, including files/blobs.
... this api uses
indexes to enable high-performance searches of this data.
...
indexeddb provides a solution.
...And 24 more matches
Index - Archive of obsolete content
68 completedefault
index xul attributes, xul reference no summary!
... 69 completeselected
index no summary!
... 81 custom
index xul attributes, xul reference no summary!
...And 21 more matches
IDBIndexSync - Web APIs
important: the synchronous version of the
indexeddb api was originally intended for use only with web workers, and was eventually removed from the spec because its need was questionable.
... the idb
indexsync interface of the
indexeddb api provides synchronous access to an
index in a database.
...void openobjectcursor (in optional idbkeyrange range, in optional unsigned short direction) raises (idbdatabaseexception); any put (in any value, in optional any key) raises (idbdatabaseexception); void remove (in any key) raises (idbdatabaseexception); attributes attribute type description keypath readonly domstring the key path of this
index.
...And 19 more matches
Content Index API - Web APIs
the content
index api allows developers to register their offline enabled content with the browser.
...content
indexing allows developers to tell the browser about their specific offline content.
... the content
index api is an extension to service workers, which allows developers to add urls and metadata of already cached pages, under the scope of the current service worker.
...And 17 more matches
IDBObjectStore.createIndex() - Web APIs
the create
index() method of the idbobjectstore interface creates and returns a new idb
index object in the connected database.
... bear in mind that
indexeddb
indexes can contain any javascript data type;
indexeddb uses the structured clone algorithm to serialize stored objects, which allows for storage of simple and complex objects.
... syntax var myidb
index = objectstore.create
index(
indexname, keypath); var myidb
index = objectstore.create
index(
indexname, keypath, objectparameters); parameters
indexname the name of the
index to create.
...And 16 more matches
Array.prototype.indexOf() - JavaScript
the
indexof() method returns the first
index at which a given element can be found in the array, or -1 if it is not present.
... syntax arr.
indexof(searchelement[, from
index]) parameters searchelement element to locate in the array.
... from
index optional the
index to start the search at.
...And 16 more matches
Array.prototype.lastIndexOf() - JavaScript
the last
indexof() method returns the last
index at which a given element can be found in the array, or -1 if it is not present.
... the array is searched backwards, starting at from
index.
... syntax arr.last
indexof(searchelement[, from
index]) parameters searchelement element to locate in the array.
...And 16 more matches
String.prototype.indexOf() - JavaScript
the
indexof() method returns the
index within the calling string object of the first occurrence of the specified value, starting the search at from
index.
... note: for the array method, see array.prototype.
indexof().
... syntax str.
indexof(searchvalue [, from
index]) parameters searchvalue the string value to search for.
...And 16 more matches
TypedArray.prototype.findIndex() - JavaScript
the find
index() method returns an
index in the typed array, if an element in the typed array satisfies the provided testing function.
... see also the find() method, which returns the value of a found element in the typed array instead of its
index.
... syntax typedarray.find
index(callback[, thisarg]) parameters callback function to execute on each value in the typed array, taking three arguments: element the current element being processed in the typed array.
...And 16 more matches
Indexed collections - JavaScript
« previousnext » this chapter introduces collections of data which are ordered by an
index value.
... array object an array is an ordered list of values that you refer to with a name and an
index.
... for example, consider an array called emp, which contains employees' names
indexed by their numerical employee number.
...And 14 more matches
Array.prototype.findIndex() - JavaScript
the find
index() method returns the
index of the first element in the array that satisfies the provided testing function.
... see also the find() method, which returns the value of an array element, instead of its
index.
... syntax arr.find
index(callback( element[,
index[, array]] )[, thisarg]) parameters callback a function to execute on each value in the array until the function returns true, indicating that the satisfying element was found.
...And 14 more matches
tabindex - HTML: Hypertext Markup Language
the tab
index 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).
... it accepts an integer as a value, with different results depending on the integer's value: a negative value (usually tab
index="-1") means that the element is not reachable via sequential keyboard navigation, but could be focused with javascript or visually by clicking with the mouse.
...the user won't be able to focus any element with a negative tab
index using the keyboard, but a script can do so by calling the focus() method.
...And 12 more matches
Index
11
index index, mdn meta, spidermonkey found 550 pages: 12 introduction to the javascript shell spidermonkey to get the spidermonkey javascript shell, see the spidermonkey build documentation or download a compiled binary for your platform from the nightly builds.
... 188 js_aliaselement jsapi reference, obsolete, spidermonkey js_aliaselement assigns an alternate
index number for an element or numeric property associated with a native object.
...name is the element's current
index in the object, and alias is the alternate
index to assign to the element.
...And 10 more matches
IDBIndex.name - Web APIs
the name property of the idb
index interface contains a string which names the
index.
... syntax var
indexname = idb
index.name; idb
index.name =
indexname; value a domstring specifying a name for the
index.
... exceptions there are a several exceptions which can occur when you attempt to change an
index's name.
...And 10 more matches
String.prototype.lastIndexOf() - JavaScript
the last
indexof() method returns the
index within the calling string object of the last occurrence of the specified value, searching backwards from from
index.
... syntax str.last
indexof(searchvalue[, from
index]) parameters searchvalue a string representing the value to search for.
... if searchvalue is an empty string, then from
index is returned.
...And 10 more matches
ContentIndex - Web APIs
the content
index interface of the content
index api allows developers to register their offline enabled content with the browser.
... methods content
index.add registers an item with the content
index.
... content
index.delete unregisters an item from the currently
indexed content.
...And 9 more matches
<isindex> - HTML: Hypertext Markup Language
summary <is
index> was an obsolete html element that put a text field in a page for querying the document.
... <is
index> provided a single line text input for entering a query string.
... <is
index> is removed html standard.
...And 9 more matches
TypedArray.prototype.lastIndexOf() - JavaScript
the last
indexof() method returns the last
index at which a given element can be found in the typed array, or -1 if it is not present.
... the typed array is searched backwards, starting at from
index.
... this method has the same algorithm as array.prototype.last
indexof().
...And 9 more matches
IDBIndex.getKey() - Web APIs
the getkey() method of the idb
index interface returns an idbrequest object, and, in a separate thread, finds either the primary key that corresponds to the given key in this
index or the first corresponding primary key, if key is set to an idbkeyrange.
...note that this doesn't return the whole record as idb
index.get does.
... syntax var request = my
index.getkey(key); parameters key optional a key or idbkeyrange that identifies a record to be retrieved.
...And 8 more matches
IDBIndex.unique - Web APIs
the unique read-only property returns a boolean that states whether the
index allows duplicate keys.
... this is decided when the
index is created, using the idbobjectstore.create
index method.
... this method takes an optional parameter, unique, which if set to true means that the
index will not be able to accept duplicate entries.
...And 8 more matches
RegExpInstance.lastIndex - JavaScript
the last
index is a read/write integer property of regular expression instances that specifies the
index at which to start the next match.
... property attributes of regexpinstance.last
index writable yes enumerable no configurable no description this property is set only if the regular expression instance used the g flag to indicate a global search, or the y flag to indicate a sticky search.
... the following rules apply: if last
index is greater than the length of the string, test() and exec() fail, then last
index is set to 0.
...And 8 more matches
TypedArray.prototype.indexOf() - JavaScript
the
indexof() method returns the first
index at which a given element can be found in the typed array, or -1 if it is not present.
... this method has the same algorithm as array.prototype.
indexof().
... syntax typedarray.
indexof(searchelement[, from
index = 0]) parameters searchelement element to locate in the typed array.
...And 8 more matches
PR_NewThreadPrivateIndex
returns a new
index for a per-thread private data table and optionally associates a destructor with the data that will be assigned to the
index.
... syntax #include <prthread.h> prstatus pr_newthreadprivate
index( pruintn *new
index, prthreadprivatedtor destructor); parameters pr_newthreadprivate
index has the following parameters: new
index on output, an
index that is valid for all threads in the process.
... you use this
index with pr_setthreadprivate and pr_getthreadprivate.
...And 7 more matches
HTMLIsIndexElement - Web APIs
the htmlis
indexelement interface provides special properties (beyond the regular htmlelement interface it also has available to it by inheritance) for manipulating <is
index> elements.
... the <is
index> element has been deprecated in html4 and removed in html5.
... this latest specification requires that this element implements htmlunknownelement rather than htmlis
indexelement.
...And 7 more matches
IDBIndex.count() - Web APIs
the count() method of the idb
index interface returns an idbrequest object, and in a separate thread, returns the number of records within a key range.
... syntax var request = my
index.count(); var request = my
index.count(key); parameters key optional the key or key range that identifies the record to be counted.
... exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idb
index's transaction is inactive.
...And 7 more matches
IDBIndex.openKeyCursor() - Web APIs
the openkeycursor() method of the idb
index interface returns an idbrequest object, and, in a separate thread, creates a cursor over the specified key range, as arranged by this
index.
... note: cursors returned by openkeycursor() do not make the referenced value available as idb
index.opencursor does.
... syntax var request = my
index.openkeycursor(); var request = my
index.openkeycursor(range); var request = my
index.openkeycursor(range, direction); parameters range optional a key or idbkeyrange to use as the cursor's range.
...And 7 more matches
IDBObjectStore.deleteIndex() - Web APIs
the delete
index() method of the idbobjectstore interface destroys the
index with the specified name in the connected database, used during a version upgrade.
...note that this method synchronously modifies the idbobjectstore.
indexnames property.
... syntax objectstore.delete
index(
indexname); parameters
indexname the name of the existing
index to remove.
...And 7 more matches
IDBObjectStore.index() - Web APIs
the
index() method of the idbobjectstore interface opens a named
index in the current object store, after which it can be used to, for example, return a series of records sorted by that
index using a cursor.
... syntax var
index = objectstore.
index(name); parameters name the name of the
index to open.
... return value an idb
index object for accessing the
index.
...And 7 more matches
IDBIndex.get() - Web APIs
the get() method of the idb
index interface returns an idbrequest object, and, in a separate thread, finds either the value in the referenced object store that corresponds to the given key or the first corresponding value, if key is set to an idbkeyrange.
... syntax var request = my
index.get(key); parameters key optional a key or idbkeyrange that identifies the record to be retrieved.
... exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idb
index's transaction is inactive.
...And 6 more matches
IDBIndex.keyPath - Web APIs
the keypath property of the idb
index interface returns the key path of the current
index.
... if null, this
index is not auto-populated.
... syntax var mykeypath = my
index.keypath; value any data type that can be used as a key path.
...And 6 more matches
IDBIndex.multiEntry - Web APIs
the multientry read-only property of the idb
index interface returns a boolean value that affects how the
index behaves when the result of evaluating the
index's key path yields an array.
... this is decided when the
index is created, using the idbobjectstore.create
index method.
... syntax var ismultientry = my
index.multientry; value a boolean: value effect true there is one record in the
index for each item in an array of keys.
...And 6 more matches
IDBIndex.objectStore - Web APIs
the objectstore property of the idb
index interface returns the name of the object store referenced by the current
index.
... syntax var myidbobjectstore = my
index.objectstore; value an idbobjectstore.
... example in the following example we open a transaction and an object store, then get the
index lname from a simple contacts database.
...And 6 more matches
IDBIndex.openCursor() - Web APIs
the opencursor() method of the idb
index interface returns an idbrequest object, and, in a separate thread, creates a cursor over the specified key range.
... syntax var request = my
index.opencursor(); var request = my
index.opencursor(range); var request = my
index.opencursor(range, direction); parameters range optional a key or idbkeyrange to use as the cursor's range.
... exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idb
index's transaction is inactive.
...And 6 more matches
Using z-index - CSS: Cascading Style Sheets
the first part of this article, stacking without the z-
index property, explains how stacking is arranged by default.
... if you want to create a custom stacking order, you can use the z-
index property on a positioned element.
... the z-
index property can be specified with an integer value (positive, zero, or negative), which represents the position of the element along the z-axis.
...And 6 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
found 528 pages: # page tags and summary 1 mdn web docs glossary: definitions of web-related terms beginner, definitions, dictionary, glossary,
index, landing, terminology web technologies contain long lists of jargon and abbreviations that are used in documentation and coding.
...google, bing, etc.) use crawlers to build
indexes.
...in addition to traditional methods like frequency analysis and
index of coincidence, cryptanalysis includes more recent methods, like linear cryptanalysis or differential cryptanalysis, that can break more advanced ciphers.
...And 5 more matches
ContentIndexEvent() - Web APIs
the content
indexevent() constructor creates a new content
indexevent object whose type and other options are configured as specified.
... syntax var content
indexevent = new content
indexevent(type, content
indexeventinit); parameters type a domstring indicating the event which occurred.
... for content
indexevent, this is always delete.
...And 5 more matches
ContentIndexEvent - Web APIs
the content
indexevent interface of the content
index api defines the object used to represent the contentdelete event.
...it contains the id of the
indexed content to be removed.
...it is not fired when the content
index.delete method is called.
...And 5 more matches
HTMLOrForeignElement.tabIndex - Web APIs
the tab
index property of the htmlorforeignelement interface represents the tab order of the current element.
... tab order is as follows: elements with a positive tab
index.
... elements that have identical tab
index values should be navigated in the order they appear.
...And 5 more matches
indexed-db - Archive of obsolete content
experimental exposes the
indexeddb api to add-ons.
... usage scripts running in web pages can access
indexeddb via the window object.
... for example: window.
indexeddb = window.
indexeddb || window.webkit
indexeddb || window.moz
indexeddb || window.ms
indexeddb; var request = window.
indexeddb.open("mydatabase"); request.onerror = function(event) { console.log("failure"); }; request.onsuccess = function(event) { console.log("success"); }; because your main add-on code can't access the dom, you can't do this.
...And 4 more matches
ContentIndex.delete() - Web APIs
the delete() method of the content
index interface unregisters an item from the currently
indexed content.
... calling delete() only affects the
index.
... syntax content
index.delete(id).then(...); parameters this method receives no parameters.
...And 4 more matches
IDBObjectStore.indexNames - Web APIs
the
indexnames read-only property of the idbobjectstore interface returns a list of the names of
indexes on objects in this object store.
... syntax var my
indexnames = objectstore.
indexnames; value a domstringlist.
...after the object store has been created, we log objectstore.
indexnames to the console.
...And 4 more matches
Understanding CSS z-index - CSS: Cascading Style Sheets
the z-
index attribute lets you adjust the order of the layering of objects when rendering content.
...z position can be controlled with the css z-
index property.
... using z-
index appears extremely easy: a single property, assigned a single integer number, with an easy-to-understand behaviour.
...And 4 more matches
z-index - CSS: Cascading Style Sheets
the z-
index css property sets the z-order of a positioned element and its descendants or flex items.
... overlapping elements with a larger z-
index cover those with a smaller one.
... for a positioned box (that is, one with any position other than static), the z-
index property specifies: the stack level of the box in the current stacking context.
...And 4 more matches
Index
28 gloda thunderbird 3, thunderbird thunderbird includes a new message
indexing and search system (gloda) that improves search performance, provides sophisticated full-text search capabilities and categorized search results.
... 31 gloda
indexing this page provides a big-picture summary of what the
indexer does; please see the source for nitty-gritty details or if this page seems to be wrong.
... gloda
indexer provides the core
indexing logic.
...And 3 more matches
IDBIndex.getAllKeys() - Web APIs
the getallkeys() method of the idb
index interface instantly retrieves the primary keys of all objects inside the
index, setting them as the result of the request object.
... syntax var allkeysrequest = idb
index.getallkeys(); var allkeysrequest = idb
index.getallkeys(query); var allkeysrequest = idb
index.getallkeys(query, count); parameters query optional a key or an idbkeyrange identifying the keys to retrieve.
... exceptions this method may raise a domexception of the following types: exception description transactioninactiveerror this idb
index's transaction is inactive.
...And 3 more matches
RTCIceCandidate.sdpMLineIndex - Web APIs
the read-only sdpmline
index property on the rtcicecandidate interface is a zero-based
index of the m-line describing the media associated with the candidate.
... this value is specified when creating the rtcicecandidate by setting the corresponding sdpmline
index value in the rtcicecandidateinit object when creating a new candidate with new rtcicecandidate().
... if you instead call rtcicecandidate() with a string parameter containing the candidate m-line text, the value of sdpmline
index is extracted from the m-line.
...And 3 more matches
WebGL2RenderingContext.getUniformBlockIndex() - Web APIs
the webgl2renderingcontext.getuniformblock
index() method of the webgl 2 api retrieves the
index of a uniform block within a webglprogram.
... syntax gluint gl.getuniformblock
index(program, uniformblockname); parameters program a webglprogram containing the uniform block.
... uniformname a domstring specifying the name of the uniform block to whose
index to retrieve.
...And 3 more matches
color-index - CSS: Cascading Style Sheets
the color-
index css media feature can be used to test the number of entries in the output device's color lookup table.
... syntax the color-
index feature is specified as an <integer> value representing the number of entries in the output device's color lookup table.
... (this value is zero if the device does not use such a table.) it is a range feature, meaning that you can also use the prefixed min-color-
index and max-color-
index variants to query minimum and maximum values, respectively.
...And 3 more matches
application/http-index-format specification - Archive of obsolete content
the application/http-
index-format file format is an attempt to provide a generic, extensible file listing format that is principly machine readable.
... 200 defines the field names for the 201 file
index code.
... 300 a url pointing to the directory represented by the
index if there is one.
...And 2 more matches
Index - Learn web development
found 348 pages: # page tags and summary 1 learn web development beginner, css, html,
index, intro, landing, learn, web welcome to the mdn learning area.
... 36 getting started with the web beginner, css, design, guide, html,
index, l10n:priority, publishing, theory it's a lot of work to create a professional website, so if you're new to web development, we encourage you to start small.
... 47
index index, learn, mdn meta found 348 pages: 48 javascript — dynamic client-side scripting beginner, codingscripting, javascript, javascripting beginner, landing, module, topic, l10n:priority javascript is a programming language that allows you to implement complex things on web pages.
...And 2 more matches
IndexedDB - Firefox Developer Tools
when you select an origin inside the
indexed db storage type in the storage tree of the storage inspector, a table lists the details of all the databases present for that origin.
... note: the data shown in an
indexeddb database is a snapshot of the data as it was when you opened the storage inspector tool.
... when an
indexeddb database is selected in the storage tree, details about all the object stores are listed in the table.
...And 2 more matches
ContentIndex.add() - Web APIs
the add() method of the content
index interface registers an item with the content
index.
... syntax content
index.add(contentdescription).then(...); parameters contentdescription the item registered is an object containing the following data: id: a unique string identifier.
... examples 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.
...And 2 more matches
ContentIndex.getAll() - Web APIs
the getall() method of the content
index interface returns a promise that resolves with an iterable list of content
index entries.
... syntax var
indexedcontent = content
index.getall(); parameters this method receives no parameters.
...if there are no items in the content
index, an empty array is returned.
...And 2 more matches
ContentIndexEvent.id - Web APIs
the read-only id property of the content
indexevent interface is a string which identifies the deleted content
index via it's id.
... syntax var id = content
indexevent.id; value a string representation of the deleted content
index id.
... examples this example listens for the contentdelete event and logs the removed content
index id.
...And 2 more matches
IDBIndex.getAll() - Web APIs
the getall() method of the idb
index interface retrieves all objects that are inside the
index.
... syntax var getallkeysrequest = idb
index.getall(); var getallkeysrequest = idb
index.getall(query); var getallkeysrequest = idb
index.getall(query, count); parameters query optional a key or an idbkeyrange identifying the records to retrieve.
... exceptions this method may raise a domexception of the following types: exception description transactioninactiveerror this idb
index's transaction is inactive.
...And 2 more matches
IDBIndex.locale - Web APIs
the locale read-only property of the idb
index interface returns the locale of the
index (for example en-us, or pl) if it had a locale value specified upon its creation (see create
index()'s optionalparameters.) note that this property always returns the current locale being used in this
index, in other words, it never returns "auto".
... syntax var my
index = objectstore.
index('
index'); console.log(my
index.locale); value a domstring.
... example in the following example we open a transaction and an object store, then get the
index lname from a simple contacts database.
...And 2 more matches
HTML documentation index - HTML: Hypertext Markup Language
31 tab
index global attributes, html, reference the tab
index 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).
... 53 html documentation
index html,
index, mdn meta a comprehensive
index list of all the available html documentation.
... 143 <is
index> deprecated, element, html, reference, web <is
index> was an obsolete html element that put a text field in a page for querying the document.
...And 2 more matches
nsIDirIndexListener
netwerk/streamconv/public/nsidir
indexlistener.idlscriptable this interface is used to receive contents of directory
index listings from a protocol.
... they can then be transformed into an output format (such as rdf, html and so on) inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void on
indexavailable(in nsirequest arequest, in nsisupports actxt, in nsidir
index a
index); void oninformationavailable(in nsirequest arequest, in nsisupports actxt, in astring ainfo); methods on
indexavailable() called for each directory entry.
... void on
indexavailable( in nsirequest arequest, in nsisupports actxt, in nsidir
index a
index ); parameters arequest the request.
... actxt opaque parameter a
index new
index to add.
Gamepad.index - Web APIs
the gamepad.
index property of the gamepad interface returns an integer that is auto-incremented to be unique for each device currently connected to the system.
... this can be used to distinguish multiple controllers; a gamepad that is disconnected and reconnected will retain the same
index.
... syntax readonly attribute long
index; example window.addeventlistener("gamepadconnected", function() { var gp = navigator.getgamepads()[0]; gamepadinfo.innerhtml = "gamepad connected at
index " + gp.
index + ": " + gp.id + "."; }); value a number.
... specifications specification status comment gamepadthe definition of 'gamepad.
index' in that specification.
IDBIndex.isAutoLocale - Web APIs
the isautolocale read-only property of the idb
index interface returns a boolean indicating whether the
index had a locale value of auto specified upon its creation (see create
index()'s optionalparameters.) syntax var my
index = objectstore.
index('
index'); console.log(my
index.isautolocale); value a boolean.
... example in the following example we open a transaction and an object store, then get the
index lname from a simple contacts database.
... we then open a basic cursor on the
index using idb
index.opencursor — this works the same as opening a cursor directly on an objectstore using idbobjectstore.opencursor except that the returned records are sorted based on the
index, not the primary key.
... function displaydataby
index() { tableentry.innerhtml = ''; var transaction = db.transaction(['contactslist'], 'readonly'); var objectstore = transaction.objectstore('contactslist'); var my
index = objectstore.
index('lname'); console.log(my
index.isautolocale); my
index.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.jtitle + '</td>' + '<td>' + cursor.value.compan...
RTCIceCandidateInit.sdpMLineIndex - Web APIs
the optional property sdpmline
index in the rtcicecandidateinit dictionary specifies the value of the rtcicecandidate object's sdpmline
index property.
... value a number containing a 0-based
index into the set of m-lines providing media descriptions, indicating which media source is associated with the candidate, or null if no such association is available.
... note: attempting to add a candidate (using addicecandidate()) that has a value of null for either sdpmid or sdpmline
index will throw a typeerror exception.
... specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicecandidateinit.sdpmline
index' in that specification.
WebGL2RenderingContext.getIndexedParameter() - Web APIs
the webgl2renderingcontext.get
indexedparameter() method of the webgl 2 api returns
indexed information about a given target.
... syntax any gl.get
indexedparameter(target,
index); parameters target a glenum specifying the target for which to return information.
...
index a gluint specifying the
index of the target that is queried.
... examples var binding = gl.get
indexedparameter(gl.transform_feedback_buffer_binding, 0); specifications specification status comment webgl 2.0the definition of 'get
indexedparameter' in that specification.
WindowOrWorkerGlobalScope.indexedDB - Web APIs
the
indexeddb read-only property of the windoworworkerglobalscope mixin provides a mechanism for applications to asynchronously access the capabilities of
indexed databases.
... syntax var idbfactory = self.
indexeddb; value an idbfactory object.
... example the following code creates a request for a database to be opened asychronously, after which the database is opened when the request's onsuccess handler is fired: var db; function opendb() { var dbopenrequest = window.
indexeddb.open('todolist'); dbopenrequest.onsuccess = function(e) { db = dbopenrequest.result; } } specifications specification status comment
indexed database api draftthe definition of '
indexeddb' in that specification.
...
indexed database api 2.0the definition of '
indexeddb' in that specification.
MathML documentation index - MathML
8 mathml documentation
index index, mathml found 40 pages: 9 mathml element reference mathml, mathml reference this is an alphabetical list of mathml presentation elements.
... 25 <mroot> mathml, mathml reference, mathml:element, mathml:general layout schemata the mathml <mroot> element is used to display roots with an explicit
index.
... two arguments are accepted, which leads to the syntax: <mroot> base
index </mroot>.
... 29 <msqrt> mathml, mathml reference, mathml:element, mathml:general layout schemata the mathml <msqrt> element is used to display square roots (no
index is displayed).
Index of archived content - Archive of obsolete content
ecycle sdk and xul comparison testing the add-on sdk two types of scripts working with events xul migration guide high-level apis addon-page base64 clipboard context-menu hotkeys
indexed-db l10n notifications page-mod page-worker panel passwords private-browsing querystring request selection self simple-prefs simple-storage system tabs timers u...
... xulrunner 2.0 release notes xulrunner faq xulrunner hall of fame xulrunner tips xulrunner/old releases toolkit.defaultchromefeatures toolkit.defaultchromeuri toolkit.singletonwindowtype xulauncher ant script to assemble an extension application/http-
index-format specification calicalendarview calicalendarviewcontroller califiletype mozilla.dev.platform faq reftest opportunities files symsrv_convert xbdesignmode.js archived open web documentation browser detection and cross browser support browser feature detectio...
... 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 makefile - .mk files misc top level bypassing security restrictions and signing code...
currentIndex - Archive of obsolete content
« xul reference current
index type: integer set to the row
index of the tree caret in the tree.
...<script language ="javascript"> function treerowclicked(){ var tree = document.getelementbyid("my-tree"); var selection = tree.view.selection; var celltext = tree.view.getcelltext(tree.current
index, tree.columns.getcolumnat(0)); alert(celltext); } </script> <tree id="my-tree" seltype="single" onselect="treerowclicked()"> <treecols> <treecol label="title" flex="1"/><treecol label="url" flex="1"/> </treecols> <treechildren> <treeitem> <treerow> <treecell label="joe@somewhere.com"/> <treecell label="top secret plans"/> </treerow> </treeitem> ...
... <treeitem> <treerow> <treecell label="mel@whereever.com"/> <treecell label="let's do lunch"/> </treerow> </treeitem> </treechildren> </tree> see also listbox.current
index ...
IndexedDB - MDN Web Docs Glossary: Definitions of Web-related terms
indexeddb is a web api for storing large data structures within browsers and
indexing them for high-performance searching.
... like an sql-based rdbms,
indexeddb is a transactional database system.
... learn more the
indexeddb api on mdn the w3c specification for
indexeddb ...
nsIDirIndex
netwerk/streamconv/public/nsidir
index.idlscriptable a class holding information about a directory
index.
...this is encoded with the encoding specified in the nsidir
indexparser, and is also escaped.
... see also nsidir
indexlistener nsidir
indexparser ...
Using IndexedDB in chrome
the
indexeddb api is typically used to store data in the user's browser from content javascript.
... (see using
indexeddb for an overview.) however, the apis can also be accessed from system-privileged javascript using the components.utils.importglobalproperties() function: components.utils.importglobalproperties(["
indexeddb"]); // from here on, it's like using
indexeddb from content var req =
indexeddb.open("my-database"); // ...
... if you are creating a sandbox, and want
indexeddb to be available in it, use the wantglobalproperties option in the sandbox constructor: var options = { "wantglobalproperties": ["
indexeddb"] } var principal = cc["@mozilla.org/systemprincipal;1"].createinstance(ci.nsiprincipal); var sandbox = components.utils.sandbox(principal, options); // the sandbox will have access to
indexeddb var sandboxscript = 'var req =
indexeddb.open("my-database");'; components.utils.evalinsandbox(sandboxscript, sandbox); before firefox 33, you would access
indexeddb from chrome code using the initwindowless method of the nsi
indexeddatabasemanager service.
Index - Firefox Developer Tools
underneath the magnifying glass it shows the color value for the current pixel using whichever scheme you've selected in settings > inspector > default color unit: 34
index tools found 158 pages: 35 json viewer firefox includes a json viewer.
... 105 storage inspector cookies, dev tools, firefox, guide,
indexeddb, local storage, session storage, storage, tools the storage inspector enables you to inspect various types of storage that a web page can use.
...this table contains the following columns: 109
indexeddb dev tools, firefox, guide,
indexeddb, storage, storage inspector, tools, l10n:priority when you select an origin inside the
indexed db storage type in the storage tree of the storage inspector, a table lists the details of all the databases present for that origin.
HTMLTableRowElement.rowIndex - Web APIs
the htmltablerowelement.row
index read-only property represents the position of a row in relation to the whole <table>.
... syntax var
index = htmltablerowelement.row
index value returns the
index of the row, or -1 if the row is not part of a table.
...thead> <tbody> <tr><td>bananas</td> <td>$2</td></tr> <tr><td>oranges</td> <td>$8</td></tr> <tr><td>top sirloin</td> <td>$20</td></tr> </tbody> <tfoot> <tr><td>total</td> <td>$30</td></tr> </tfoot> </table> javascript let rows = document.queryselectorall('tr'); rows.foreach((row) => { let z = document.createelement("td"); z.textcontent = `(row #${row.row
index})`; row.appendchild(z); }); result ...
ServiceWorkerRegistration.index - Web APIs
the
index read-only property of the serviceworkerregistration interface returns a reference to the content
index interface, which allows for
indexing of offline content.
... syntax var a content
index object = serviceworkerregistration.
index; value a content
index object examples you can access the property from either your main script or the registered service worker.
... here is an example from the main script: // reference registration const registration = await navigator.serviceworker.ready; // feature detection if ('
index' in registration) { // content
index api functionality const content
index = registration.
index; } from the service worker: // service worker script const content
index = self.registration.
index; specifications specification status comment unknownthe definition of '
index' in that specification.
SourceBufferList: indexed property getter - Web APIs
the
indexed property getter of the sourcebufferlist interface allows the sourcebuffer objects in the list to be accessed with an array operator (i.e.
... [].) syntax var mysourcebuffer = sourcebufferlist[
index]; parameters
index the
index position of the sourcebuffer object you want to return.
... exceptions no specific exceptions are thrown, but if the supplied
index is great than or equal to sourcebufferlist.length, the operation will return undefined.
SpeechRecognitionEvent.resultIndex - Web APIs
the result
index read-only property of the speechrecognitionevent interface returns the lowest
index value result in the speechrecognitionresultlist "array" that has actually changed.
... syntax var myresult
index = event.result
index; value a number.
... examples recognition.onresult = function(event) { var color = event.results[0][0].transcript; diagnostic.textcontent = 'result received: ' + color + '.'; bg.style.backgroundcolor = color; console.log(event.result
index); // returns 0 if there is only one result } specifications specification status comment web speech apithe definition of 'result
index' in that specification.
SpeechSynthesisEvent.charIndex - Web APIs
the char
index read-only property of the speechsynthesisutterance interface returns the
index position of the character in the speechsynthesisutterance.text that was being spoken when the event was triggered.
... syntax event.char
index; value a number.
... examples utterthis.onpause = function(event) { var char = event.utterance.text.charat(event.char
index); console.log('speech paused at character ' + event.char
index + ' of "' + event.utterance.text + '", which is "' + char + '".'); } specifications specification status comment web speech apithe definition of 'char
index' in that specification.
VideoTrackList.selectedIndex - Web APIs
the read-only videotracklist property selected
index returns the
index of the currently selected track, if any, or -1 otherwise.
... syntax var
index = videotracklist.selected
index; value a number indicating the
index of the currently selected track, if any, or -1 otherwise.
... specifications specification status comment html living standardthe definition of 'videotracklist: selected
index' in that specification.
tabindex - SVG: Scalable Vector Graphics
the tab
index attribute allows you to control whether an element is focusable and to define the relative order of the element for the purposes of sequential focus navigation.
... html, body, svg { height: 100%; } <?xml version="1.0"?> <svg viewbox="0 0 260 260" xmlns="http://www.w3.org/2000/svg"> <circle cx="60" cy="60" r="15" tab
index="1" /> <circle cx="60" cy="160" r="30" tab
index="3" /> <circle cx="160" cy="60" r="30" tab
index="2" /> <circle cx="160" cy="160" r="60" tab
index="4" /> </svg> usage notes value valid integer default value none animatable no valid integer relative order of the element for the purposes of sequential focus navigation.
... specifications specification status comment scalable vector graphics (svg) 2the definition of 'tab
index' in that specification.
getBrowserIndexForDocument - Archive of obsolete content
« xul reference home getbrowser
indexfordocument( document ) return type: integer returns the
index of the browser for the specified document in the tabbrowser the method was invoked on.
... the returned
index is dependent on the tabs in the tabbrowser and is invalidated when the tab ordering changes.
getIndexOfFirstVisibleRow - Archive of obsolete content
« xul reference home get
indexoffirstvisiblerow() return type: integer returns the
index of the first displayed row.
... note that this is not the same as the first row -- if the displayed items have been scrolled down, this function will retrieve the
index of the first row that the user can see.
scrollToIndex - Archive of obsolete content
« xul reference home scrollto
index(
index ) return type: no return value scrolls the element to the specified
index.
... this is different than ensure
indexisvisible because the view is always scrolled.
listbox.currentIndex - Archive of obsolete content
« xul reference current
index type: integer set to the
index of the currently focused item in the list.
...(or, on some platforms, typeof(listboxcurrent
index) will be undefined) in a single selection list, the current
index will always be the same as the selected
index.
IndexInParent
« nsiaccessible page summary the 0-based
index of this accessible in its parent's list of children, or -1 if this accessible does not have a parent.
... attribute long
indexinparent; ...
nsIDirIndexParser
netwerk/streamconv/public/nsidir
indexlistener.idlscriptable a parser for 'application/http-
index-format' directories.
... listener nsidir
indexlistener the interface to use as a callback for new entries.
HTMLSelectElement.selectedIndex - Web APIs
the htmlselectelement.selected
index is a long that reflects the
index of the first or last selected <option> element, depending on the value of multiple.
... syntax var
index = selectelem.selected
index; selectelem.selected
index =
index; example html <p id="p">selected
index: 0</p> <select id="select"> <option selected>option a</option> <option>option b</option> <option>option c</option> <option>option d</option> <option>option e</option> </select> javascript var selectelem = document.getelementbyid('select') var pelem = document.getelementbyid('p') // when a new <option> is selected selectelem.addeventlistener('change', function() { var
index = selectelem.selected
index; // add that data to the <p> pelem.innerhtml = 'selected
index: ' +
index; }) specifications specification status comment html living standardthe definition of 'htmlselectelement'...
OES_element_index_uint - Web APIs
the oes_element_
index_uint extension is part of the webgl api and adds support for gl.unsigned_int types to webglrenderingcontext.drawelements().
... examples var ext = gl.getextension('oes_element_
index_uint'); gl.drawelements(gl.points, 8, gl.unsigned_int, 0); specifications specification status comment oes_element_
index_uintthe definition of 'oes_element_
index_uint' in that specification.
HTTP Index - HTTP
39 http
index http,
index this page lists all mdn http pages along with their summary and tags.
... 161
index http, http header,
index found 122 pages: 162 keep-alive general header, http, http header, reference the keep-alive general header allows the sender to hint about how the connection may be used to set a timeout and a maximum amount of requests.
SVG documentation index - SVG: Scalable Vector Graphics
213 tab
index svg, svg attribute the tab
index attribute allows you to control whether an element is focusable and to define the relative order of the element for the purposes of sequential focus navigation.
...many browsers support svg images in: 292 svg documentation
index svg found 383 pages: 293 svg element reference drawing, elements, responsive design, svg, svg reference, vector graphics, l10n:priority svg drawings and images are created using a wide array of elements which are dedicated to the construction, drawing, and layout of vector images and diagrams.
Index - WebAssembly
2 caching compiled webassembly modules caching,
indexeddb, javascript, module, webassembly, compile, wasm caching is useful for improving the performance of an app — we can store compiled webassembly modules on the client so they don't have to be downloaded and compiled every time.
... 8
index index, webassembly found 12 pages: 9 loading and running webassembly code fetch, javascript, webassembly, xmlhttprequest, bytecode to use webassembly in javascript, you first need to pull your module into memory before compilation/instantiation.
ensureIndexIsVisible - Archive of obsolete content
« xul reference home ensure
indexisvisible(
index ) return type: no return value if the item at the specified
index is not currently visible to the user the displayed items are scrolled so that it is.
Index - Developer guides
29
index guide,
index found 31 pages: 30 introduction to web development beginner, css, codingscripting, development, html, javascript, web whether you're just getting started with web development, or are just expanding your horizons into new realms of web awesomeness, the links here should help you get started.
Index - HTTP
82
index http, http header,
index found 115 pages: 83 keep-alive general header, http, http header, reference the keep-alive general header allows the sender to hint about how the connection may be used to set a timeout and a maximum amount of requests.
Index - XPath
55
index index, reference, xpath, xslt found 57 pages: 56 introduction to using xpath in javascript add-ons, dom, extensions, javascript, transforming_xml_with_xslt, web development, xml, xpath, xslt this document describes the interface for using xpath in javascript internally, in extensions, and from websites.
Bytecode Descriptions
bigint operands: (uint32_t bigint
index) stack: ⇒ bigint push the bigint constant script->getbigint(bigint
index).
... string operands: (uint32_t atom
index) stack: ⇒ string push the string constant script->getatom(atom
index).
...this is used for code like ++obj[
index], which must do both a jsop::getelem and a jsop::setelem with the same property key.
...And 86 more matches
IAccessibleTable
in this case iaccessible2.
indexinparent() will return the child
index which then can be used when calling row
index() and column
index().
...when the table cells are not direct children of a table, the object representing the cell can define a "table-cell-
index" object attribute identifying the 0 based table cell
index.
...the "table-cell-
index" attribute can be used just like a child
index of the typical case.
...And 51 more matches
Basic concepts - Web APIs
indexeddb is a way for you to persistently store data inside a user's browser.
...
indexeddb is useful for applications that store a large amount of data (for example, a catalog of dvds in a lending library) and applications that don't need persistent internet connectivity to work (for example, mail clients, to-do lists, and notepads).
... about this document this introduction discusses essential concepts and terminology in
indexeddb.
...And 51 more matches
mozIStorageBindingParams
method overview void bindby
index(in unsigned long a
index, in nsivariant avalue); void bindblobby
index(in unsigned long a
index, [array, const, size_is(avaluesize)] in octet avalue, in unsigned long avaluesize); void binddoubleby
index(in unsigned long a
index, in double avalue); native code only!
... void bindint32by
index(in unsigned long a
index, in long avalue); native code only!
... void bindint64by
index(in unsigned long a
index, in long long avalue); native code only!
...And 48 more matches
nsINavBookmarksService
ts.interfaces.nsinavbookmarksservice); method overview void addobserver(in nsinavbookmarkobserver observer, in boolean ownsweak); void beginupdatebatch(); obsolete since gecko 1.9 void changebookmarkuri(in long long aitemid, in nsiuri anewuri); long long createdynamiccontainer(in long long aparentfolder, in autf8string aname, in astring acontractid, in long a
index); note: renamed from createcontainer in gecko 1.9 obsolete since gecko 13.0 long long createfolder(in long long aparentfolder, in autf8string name, in long
index); void endupdatebatch(); obsolete since gecko 1.9 void exportbookmarkshtml(in nsifile file); obsolete since gecko 1.9 nsiuri getbookmarkedurifor(in nsiuri auri); void getbookmarkfolderstarray(...
...ong afolder, in astring asubfolder); obsolete since gecko 2.0 long long getfolderidforitem(in long long aitemid); boolean getfolderreadonly(in long long aitemid); astring getfoldertitle(in print64 folder); obsolete since gecko 1.9 nsiuri getfolderuri(in print64 folder); obsolete since gecko 1.9 long long getidforitemat(in long long aparentid, in long a
index); 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 getitem
index(in long long aitemid); prtime getitemlastmodified(in long long aitemid); autf8string getitemtitle(in long long aitemid); u...
...rdforuri(in nsiuri auri); obsolete since gecko 40.0 nsitransaction getremovefoldertransaction(in long long aitemid); nsiuri geturiforkeyword(in astring keyword); obsolete since gecko 40.0 void importbookmarkshtml(in nsiuri url); obsolete since gecko 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 a
index, in autf8string atitle); void insertitem(in print64 folder, in nsiuri item, in print32
index); obsolete since gecko 1.9 long long ...
...And 47 more matches
nsIMsgDBView
void docommand(in nsmsgviewcommandtypevalue command); void docommandwithfolder(in nsmsgviewcommandtypevalue command, in nsimsgfolder destfolder); void getcommandstatus(in nsmsgviewcommandtypevalue command, out boolean selectable_p, out nsmsgviewcommandcheckstatevalue selected_p); void viewnavigate(in nsmsgnavigationtypevalue motion, out nsmsgkey resultid, out nsmsgview
index result
index, out nsmsgview
index thread
index, in boolean wrap); boolean navigatestatus(in nsmsgnavigationtypevalue motion); nsmsgkey getkeyat(in nsmsgview
index index); nsimsgdbhdr getmsghdrat(in nsmsgview
index index); nsimsgfolder getfolderforview
index(in nsmsgview
index index); acstring geturiforview
index(in nsmsgview
index index); nsimsgdbview ...
...clonedbview(in nsimessenger amessengerinstance, in nsimsgwindow amsgwindow, in nsimsgdbviewcommandupdater acommandupdater); void geturisforselection([array, size_is(count)] out string uris, out unsigned long count); void getindicesforselection([array, size_is(count)] out nsmsgview
index indices, out unsigned long count); void loadmessagebymsgkey(in nsmsgkey amsgkey); void loadmessagebyview
index(in nsmsgview
index a
index); void loadmessagebyurl(in string aurl); void reloadmessage(); void reloadmessagewithallparts(); void selectmsgbykey(in nsmsgkey key); void selectfoldermsgbykey(in nsimsgfolder afolder, in nsmsgkey akey); void ondeletecompleted(in boolean succeeded); nsmsgview
index find
indexfromkey(i...
...n nsmsgkey amsgkey, in boolean aexpand); void expandandselectthreadby
index(in nsmsgview
index a
index, in boolean aaugment); void addcolumnhandler(in astring acolumn, in nsimsgcustomcolumnhandler ahandler); void removecolumnhandler(in astring acolumn); nsimsgcustomcolumnhandler getcolumnhandler(in astring acolumn); attributes attribute type description viewtype nsmsgviewtypevalue readonly: type of view.
...And 33 more matches
nsITreeView
method overview boolean candrop(in long
index, in long orientation, in nsidomdatatransfer datatransfer); boolean candropbeforeafter(in long
index, in boolean before); obsolete since gecko 1.8 boolean candropon(in long
index); obsolete since gecko 1.8 void cyclecell(in long row, in nsitreecolumn col); void cycleheader(in nsitreecolumn col); void drop(in long row, in long orientation, in nsidomdata...
...in nsisupportsarray properties obsolete since gecko 22); astring getcelltext(in long row, in nsitreecolumn col); astring getcellvalue(in long row, in nsitreecolumn col); astring getcolumnproperties(in nsitreecolumn col, in nsisupportsarray properties obsolete since gecko 22); astring getimagesrc(in long row, in nsitreecolumn col); long getlevel(in long
index); long getparent
index(in long row
index); long getprogressmode(in long row, in nsitreecolumn col); astring getrowproperties(in long
index, in nsisupportsarray properties obsolete since gecko 22); boolean hasnextsibling(in long row
index, in long after
index); boolean iscontainer(in long
index); boolean iscontainerempty(in long
index); bo...
...olean iscontaineropen(in long
index); boolean iseditable(in long row, in nsitreecolumn col); boolean isselectable(in long row, in nsitreecolumn col); boolean isseparator(in long
index); boolean issorted(); void performaction(in wstring action); void performactiononcell(in wstring action, in long row, in nsitreecolumn col); void performactiononrow(in wstring action, in long row); void selectionchanged(); void setcelltext(in long row, in nsitreecolumn col, in astring value); void setcellvalue(in long row, in nsitreecolumn col, in astring value); void settree(in nsitreeboxobject tree); void toggleopenstate(in long
index); attributes attribute type description ...
...And 33 more matches
mozIStorageStatement
method overview void initialize(in mozistorageconnection adbconnection, in autf8string asqlstatement); obsolete since gecko 1.9.1 void finalize(); mozistoragestatement clone(); autf8string getparametername(in unsigned long aparam
index); unsigned long getparameter
index(in autf8string aname); autf8string getcolumnname(in unsigned long acolumn
index); unsigned long getcolumn
index(in autf8string aname); void reset(); astring escapestringforlike(in astring avalue, in wchar aescapechar); void bindparameters(in mozistoragebindingparamsarray aparameters); mozistoragebindin...
...gparamsarray newbindingparamsarray(); void bindutf8stringparameter(in unsigned long aparam
index, in autf8string avalue); void bindstringparameter(in unsigned long aparam
index, in astring avalue); void binddoubleparameter(in unsigned long aparam
index, in double avalue); void bindint32parameter(in unsigned long aparam
index, in long avalue); void bindint64parameter(in unsigned long aparam
index, in long long avalue); void bindnullparameter(in unsigned long aparam
index); void bindblobparameter(in unsigned long aparam
index, [array,const,size_is(avaluesize)] in octet avalue, in unsigned long avaluesize); mozistoragependingstatement executeasync(mozistoragestatementcallback acallback); boolean executestep(); boo...
... getparametername() obtains the name of the parameter for the specified
index.
...And 32 more matches
nsIAccessibleTable
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview nsiaccessible getcellat(in long row
index, in long column
index); note: renamed from cellrefat in gecko 1.9.2 long getcell
indexat(in long row
index, in long column
index); note: renamed from get
indexat in gecko 1.9.2 astring getcolumndescription(in long column
index); long getcolumnextentat(in long row, in long column); long getcolumn
indexat(in long cell
index); note: renamed from getcolumnat
index in gecko 1.9.2 void getrowandcolumnindicesat(in long cell
index, out long row
index, out long column
index); astring getrowdescr...
...iption(in long row
index); long getrowextentat(in long row, in long column); long getrow
indexat(in long cell
index); note: renamed from getrowat
index in gecko 1.9.2 void getselectedcellindices(out unsigned long cellsarraysize, [retval, array, size_is(cellsarraysize)] out long cellsarray); note: renamed from getselectedcells in gecko 1.9.2 void getselectedcolumnindices(out unsigned long columnsarraysize, [retval, array, size_is(columnsarraysize)] out long columnsarray); note: renamed from getselectedcolumns in gecko 1.9.2 void getselectedrowindices(out unsigned long rowsarraysize, [retval, array, size_is(rowsarraysize)] out long rowsarray); note: renamed from getselectedrows in gecko 1.9.2 boolean iscellselected(in long row
index, in long column...
...
index); boolean iscolumnselected(in long column
index); boolean isprobablyforlayout(); boolean isrowselected(in long row
index); void selectcolumn(in long column
index); void selectrow(in long row
index); void unselectcolumn(in long column
index); void unselectrow(in long row
index); attributes attribute type description caption nsiaccessible the caption accessible for the table.
...And 32 more matches
StringView - Archive of obsolete content
math.min(math.max(nlength, 0) + nstartidx, noutptlen) : noutptlen) - 1; } else { /* input is stringview */ vsource = vinput.rawdata; ninptlen = vinput.make
index(); nstartidx = ncharstart = noffset ?
...*/ /* instances' methods */ stringview.prototype.make
index = function (nchrlength, nstartfrom) { var atarget = this.rawdata, nchrend, nrawlength = atarget.length, nstartidx = nstartfrom || 0, nidxend = nstartidx, nstopatchr = isnan(nchrlength) ?
... infinity : nchrlength; if (nchrlength + 1 > atarget.length) { throw new rangeerror("stringview.prototype.make
index - the offset can\'t be major than the length of the array - 1."); } switch (this.encoding) { case "utf-8": var npart; for (nchrend = 0; nidxend < nrawlength && nchrend < nstopatchr; nchrend++) { npart = atarget[nidxend]; nidxend += npart > 251 && npart < 254 && nidxend + 5 < nrawlength ?
...And 28 more matches
JavaScript Daemons Management - Archive of obsolete content
if (arguments.length < 2) { throw new typeerror("daemon - not enough arguments"); } if (oowner) { this.owner = oowner }; this.task = ftask; if (isfinite(nrate) && nrate > 0) { this.rate = math.floor(nrate); } if (nlen > 0) { this.length = math.floor(nlen); } if (fonstart) { this.onstart = fonstart; } if (finit) { this.onstop = finit; finit.call(oowner, this.
index, this.length, this.backw); } } /* create the daemon.blank() constructor and the global daemon.context object */ daemon.blank = function () {}; daemon.context = daemon.blank.prototype; /* make love with the gc :-) */ daemon.blank.prototype = /* important!
... of the daemon */ daemon.prototype.owner = daemon.context; daemon.prototype.task = null; daemon.prototype.rate = 100; daemon.prototype.length = infinity; daemon.prototype.reversals = 0; daemon.prototype.onstart = null; daemon.prototype.onstop = null; /* these properties should be read-only after the creation of the daemon */ daemon.prototype.session = -1; daemon.prototype.
index = 0; daemon.prototype.paused = true; daemon.prototype.backw = true; /* system required daemon global object methods */ daemon.forcecall = function (odmn) { odmn.
index += odmn.backw ?
... -1 : 1; var bbreak = odmn.task.call(odmn.owner, odmn.
index, odmn.length, odmn.backw) === false, bend = odmn.isatend(), binvert = odmn.reversals > 0; if (bend && !binvert || bbreak) { odmn.pause(); return false; } if (bend && binvert) { odmn.backw = !odmn.backw; odmn.reversals--; } return true; }; /* system not required daemon global object methods */ /** * daemon global object optional methods (shortcuts).
...And 28 more matches
IAccessibleText
[propget] hresult ncharacters([out] long ncharacters ); [propget] hresult newtext([out] ia2textsegment newtext ); [propget] hresult nselections([out] long nselections ); [propget] hresult offsetatpoint([in] long x, [in] long y, [in] enum ia2coordinatetype coordtype, [out] long offset ); [propget] hresult oldtext([out] ia2textsegment oldtext ); hresult removeselection([in] long selection
index ); hresult scrollsubstringto([in] long start
index, [in] long end
index, [in] enum ia2scrolltype scrolltype ); hresult scrollsubstringtopoint([in] long start
index, [in] long end
index, [in] enum ia2coordinatetype coordinatetype, [in] long x, [in] long y ); [propget] hresult selection([in] long selection
index, [out] long startoffset, [out] long endoffset ); hresult setcaretoffset([in] long of...
...fset ); hresult setselection([in] long selection
index, [in] long startoffset, [in] long endoffset ); [propget] hresult text([in] long startoffset, [in] long endoffset, [out] bstr text ); [propget] hresult textafteroffset([in] long offset, [in] enum ia2textboundarytype boundarytype, [out] long startoffset, [out] long endoffset, [out] bstr text ); [propget] hresult textatoffset([in] long offset, [in] enum ia2textboundarytype boundarytype, [out] long startoffset, [out] long endoffset, [out] bstr text ); [propget] hresult textbeforeoffset([in] long offset, [in] enum ia2textboundarytype boundarytype, [out] long startoffset, [out] long endoffset, [out] bstr text ); methods addselection() adds a text() selection().
...[propget] hresult characterextents( [in] long offset, [in] enum ia2coordinatetype coordtype, [out] long x, [out] long y, [out] long width, [out] long height ); parameters offset
index of the character for which to return its bounding box.
...And 28 more matches
Eclipse CDT
system requirements eclipse will use a lot of memory to fully
index the mozilla source tree to provide code assistance features (easily 4 gb of ram, although this will drop to just over 1 gb if you restart after
indexing is complete).
...when eclipse's
indexer tries to process the mozilla source, eclipse will need considerably more memory than the limits imposed by its default configuration.
...set an initial heap space of 1 gb and max heap space of 5 gb, say, by modifying the values of the following two lines in eclipse.ini: -xms1g -xmx5g if you fail to increase these limits, then you will likely find that eclipse either hangs when it tries to
index the mozilla source or else that the code intelligence is very broken after the
indexing "completes".
...And 24 more matches
Client-side storage - Learn web development
new school: web storage and
indexeddb the "easier" features we mentioned above are as follows: the web storage api provides a very simple syntax for storing and retrieving smaller, data items consisting of a name and a corresponding value.
... the
indexeddb api provides the browser with a complete database system for storing complex data.
... next, note how our html references a javascript file called
index.js (see line 40).
...And 22 more matches
nsINavBookmarkObserver
1.0 (firefox 21.0 / thunderbird 21.0 / seamonkey 2.18) method overview void onbeforeitemremoved(in long long aitemid, in unsigned short aitemtype, in long long aparentid, in acstring aguid, in acstring aparentguid); obsolete since gecko 21.0 void onbeginupdatebatch(); void onendupdatebatch(); void onfolderadded(in print64 folder, in print64 parent, in print32
index); obsolete since gecko 1.9 void onfolderchanged(in print64 folder, in acstring property); obsolete since gecko 1.9 void onfoldermoved(in print64 folder, in print64 oldparent, in print32 old
index, in print64 newparent, in print32 new
index); 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 a
index, in unsigned short aitemtype, in nsiuri auri, in autf8string atitle, 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, in long aold
index, in long long anewparentid, in long anew
index, in unsigned short aitemtype, in acstring aguid, in acstring aoldparentguid, in acstring anewparentguid); void onitemremoved(in long long aitemid, in long long aparentid, in long ai...
...string aparentguid); void onitemreplaced(in print64 folder, in nsiuri item, in nsiuri newitem); obsolete since gecko 1.9 void onitemvisited(in long long aitemid, in long long avisitid, in prtime atime, in unsigned long atransitiontype, in nsiuri auri, in long long aparentid, in acstring aguid, in acstring aparentguid); void onseparatoradded(in print64 parent, in print32
index); obsolete since gecko 1.9 void onseparatorremoved(in print64 parent, in print32
index); obsolete since gecko 1.9 methods onbeforeitemremoved() obsolete since gecko 21.0 (firefox 21.0 / thunderbird 21.0 / seamonkey 2.18) note: this method was removed in gecko 21.0 as part of bug 826409.
...And 20 more matches
IDBObjectStoreSync - Web APIs
important: the synchronous version of the
indexeddb api was originally intended for use only with web workers, and was eventually removed from the spec because its need was questionable.
... the idbobjectstoresync interface of the
indexeddb api provides synchronous access to an object store of a database.
... method overview any add (in any value, in optional any key) raises (idbdatabaseexception); idb
indexsync create
index (in domstring name, in domstring storename, in domstring keypath, in optional boolean unique); any get (in any key) raises (idbdatabaseexception); idbcursorsync opencursor (in optional idbkeyrange range, in optional unsigned short direction) raises (idbdatabaseexception); idb
indexsync open
index (in domstring name) raises (idbdatabaseexception); any put (in any value, in optional any key) raises (idbdatabaseexception); void remove (in any key) raises (idbdatabaseexception); void remove
index (in domstring
indexname) raises (idbdatabaseexception); attributes attribute type description...
...And 20 more matches
listbox - Archive of obsolete content
attributes disabled, disablekeynavigation, preference, rows, seltype, suppressonselect, tab
index, value properties accessibletype, current
index, currentitem, disabled, disablekeynavigation, itemcount, listboxobject, selectedcount, selected
index, selecteditem, selecteditems, seltype, suppressonselect, tab
index, value methods additemtoselection, appenditem, clearselection, ensureelementisvisible, ensure
indexisvisible, get
indexoffirstvisiblerow, get
indexofitem, getitemat
index, getnumb...
...erofvisiblerows, getrowcount, getselecteditem, insertitemat, invertselection, movebyoffset, removeitemat, removeitemfromselection, scrollto
index, selectall, selectitem, selectitemrange, timedselect, toggleitemselection examples <listbox id="thelist"> <listitem label="ruby"/> <listitem label="emerald"/> <listitem label="sapphire" selected="true"/> <listitem label="diamond"/> </listbox> <listbox id="thelist" rows="10" width="400"> <listhead> <listheader label="1ct gem" width="240"/> <listheader label="price" width="150"/> </listhead> <listcols> <listcol/> <listcol flex="1"/> </listcols> </listbox> var thelist = document.getelementbyid('thelist'); gems = [ {gem: "ruby", price: "$3,500 - $4,600"}, {gem: "emerald", price: "$700 - 4,250"}, ...
... tab
index type: integer the tab order of the element.
...And 19 more matches
richlistbox - Archive of obsolete content
attributes disabled, disablekeynavigation, preference, seltype, suppressonselect, tab
index, value properties accessibletype, current
index, currentitem, disabled, disablekeynavigation, itemcount, scrollboxobject, selectedcount, selected
index, selecteditem, selecteditems, seltype, suppressonselect, tab
index, value methods additemtoselection, appenditem, clearselection, ensureelementisvisible, ensure
indexisvisible, get
indexoffirstvisiblerow, get
indexofitem, getitemat
index, getnu...
...mberofvisiblerows, getrowcount, getselecteditem, insertitemat, invertselection, movebyoffset, removeitemat, removeitemfromselection, scrollto
index, selectall, selectitem, selectitemrange, timedselect, toggleitemselection examples <richlistbox> <richlistitem> <description>a xul description!</description> </richlistitem> <richlistitem> <button label="a xul button"/> </richlistitem> </richlistbox> the richlistbox element contains multiple richlistitem elements, which can contain any content.
... tab
index type: integer the tab order of the element.
...And 19 more matches
Creating a Help Content Pack - Archive of obsolete content
content packs include help documents written in xhtml, a content pack descriptor file written in rdf, and a table of contents,
index, and glossary (also written in rdf).
... the contents of a content pack content packs consist of a general pack description file, table of contents,
index, search, glossary, and help documents.
...the content pack descriptor file outlines the framework of the contents of the pack by pointing to the files describing the table of contents,
index, and glossary rdf files.
...And 18 more matches
mozIStorageValueArray
last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports method overview long gettypeof
index(in unsigned long a
index); long getint32(in unsigned long a
index); long long getint64(in unsigned long a
index); double getdouble(in unsigned long a
index); autf8string getutf8string(in unsigned long a
index); astring getstring(in unsigned long a
index); void getblob(in unsigned long a
index, out unsigned long adatasize, [array,size_is(adatasize)] o...
...ut octet adata); boolean getisnull(in unsigned long a
index); attributes attribute type description numentries unsigned long the number of entries in the array.
... methods gettypeof
index() returns the type of the value at the given column
index.
...And 17 more matches
Keyboard-navigable JavaScript widgets - Accessibility
using tab
index by default, when people use the tab key to browse a webpage, only interactive elements (like links, form controls) get focused.
... with the tab
index global attribute, authors can make other elements focusable, too.
...to do this, authors can set tab
index to any positive number.
...And 17 more matches
Array - JavaScript
arrays cannot use strings as element
indexes (as in an associative array) but must use integers.
... common operations create an array let fruits = ['apple', 'banana'] console.log(fruits.length) // 2 access an array item using the
index position let first = fruits[0] // apple let last = fruits[fruits.length - 1] // banana loop over an array fruits.foreach(function(item,
index, array) { console.log(item,
index) }) // apple 0 // banana 1 add an item to the end of an array let newlength = fruits.push('orange') // ["apple", "banana", "orange"] remove an item from the end of an array let last = fruits.pop() // remove ora...
...nge (from the end) // ["apple", "banana"] remove an item from the beginning of an array let first = fruits.shift() // remove apple from the front // ["banana"] add an item to the beginning of an array let newlength = fruits.unshift('strawberry') // add to the front // ["strawberry", "banana"] find the
index of an item in the array fruits.push('mango') // ["strawberry", "banana", "mango"] let pos = fruits.
indexof('banana') // 1 remove an item by
index position let removeditem = fruits.splice(pos, 1) // this is how to remove an item // ["strawberry", "mango"] remove items from an
index position let vegetables = ['cabbage', 'turnip', 'radish', 'carrot'] console.log(vegetables) // ["cabbage", "turnip", "radish", "carrot"] let pos = 1 let n = 2 let removeditems = vegetables.splice(...
...And 17 more matches
nsITreeSelection
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void adjustselection(in long
index, in long count); void clearrange(in long start
index, in long end
index); void clearselection(); void getrangeat(in long i, out long min, out long max); long getrangecount(); void invalidateselection(); void invertselection(); boolean isselected(in long
index); void rangedselect(in long start
index, in long end
index, in boolean augment); void select(in long
index); void selectall(); void timedselect(in long
index, in ...
...long delay); void toggleselect(in long
index); attributes attribute type description count long the number of rows currently selected in this tree.
... current
index long the current item (the one with focus).
...And 16 more matches
Understanding WebAssembly text format - WebAssembly
the local.get/local.set commands refer to the item to be got/set by its numeric
index: parameters are referred to first, in order of their declaration, followed by locals in order of their declaration.
... like locals, functions are identified by an
index by default, but for convenience, they can be named.
... calling functions from other functions in the same module the call instruction calls a single function, given its
index or name.
...And 16 more matches
Color picker tool - CSS: Cascading Style Sheets
-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="z
index" class="ui-input-slider" data-topic="z-
index" data-info="z-
index" data-max="20" data-sensivity="10"></div> </div> </div> css /* * color picker tool */ .ui-color-picker { width: 420px; margin: 0; border: 1px solid #ddd; background-color: #fff; display: table; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; } ...
...-box; } /* preview color */ .ui-color-picker .preview { width: 95px; height: 53px; margin: 5px; margin-top: 10px; border: 1px solid #ddd; background-image: url("https://mdn.mozillademos.org/files/5705/alpha.png"); float: left; position: relative; } .ui-color-picker .preview:before { height: 100%; width: 50%; left: 50%; top: 0; content: ""; background: #fff; position: absolute; z-
index: 1; } .ui-color-picker .preview-color { width: 100%; height: 100%; background-color: rgba(255, 0, 0, 0.5); position: absolute; z-
index: 1; } .ui-color-picker .switch_mode { width: 10px; height: 20px; position: relative; border-radius: 5px 0 0 5px; border: 1px solid #ddd; background-color: #eee; left: -12px; top: -1px; z-
index: 1; transition: all 0.5s; } .ui-color-picker .switch_...
...mples .sample:hover { cursor: pointer; border-color: #bbb; transform: scale(1.15); border-radius: 3px; } #picker-samples .sample[data-active='true'] { border-color: #999; } #picker-samples .sample[data-active='true']:after { content: ""; position: absolute; background: url('https://mdn.mozillademos.org/files/6065/arrow.png') center no-repeat; width: 100%; height: 12px; top: -12px; z-
index: 2; } #picker-samples #add-icon { width: 100%; height: 100%; position: relative; box-shadow: inset 0px 0px 2px 0px #ddd; } #picker-samples #add-icon:hover { cursor: pointer; border-color: #ddd; box-shadow: inset 0px 0px 5px 0px #ccc; } #picker-samples #add-icon:before, #picker-samples #add-icon:after { content: ""; position: absolute; background-color: #eee; box-shadow: 0 0 1px 0 #e...
...And 15 more matches
Textbox (XPFE autocomplete) - Archive of obsolete content
attributes accesskey, alwaysopenpopup, autocompletesearch, autocompletesearchparam, autofill, autofillaftermatch, autofill, completedefault
index, crop, disableautocomplete, disableautocomplete, disabled, disablehistory, enablehistory, focused, forcecomplete, forcecomplete, highlightnonmatches, ignoreblurwhilesearching, ignoreblurwhilesearching, inputtooltiptext, label, maxlength, maxrows, minresultsforpopup, minresultsforpopup, nomatch, onchange, onerrorcommand, oninput, onsearchcomplete, ontextcommand, ontextentered, ontextrevert, ontext...
...reverted, open, readonly, searchsessions, showcommentcolumn, showcommentcolumn, showpopup, size, tab
index, tabscrolling, tabscrolling, timeout, type, useraction, value properties accessible, alwaysopenpopup, autofill, autofillaftermatch, completedefault
index, crop, disableautocomplete, disabled, editable, focused, forcecomplete, highlightnonmatches, ignoreblurwhilesearching, inputfield, issearching, iswaiting, label, maxlength, maxrows, minresultsforpopup, nomatch, open, popup, popupopen, resultspopup, searchcount, searchparam, searchsessions, selectionend, selectionstart, sessioncount, showcommentcolumn, showpopup, size, tab
index, tabscrolling, textlength, textvalue, timeout, type, useraction, value methods addsession, clearresults, getdefaultsession, getresulta...
...as of gecko 1.9.1, this attribute is superseded by the completedefault
index attribute.
...And 14 more matches
IAccessibleTable2
[propget] hresult cellat( [in] long row, [in] long column, [out] iunknown cell ); parameters row the 0 based row
index for which to retrieve the cell.
... column the 0 based column
index for which to retrieve the cell.
... cell if both row and column
index are valid then the corresponding accessible object is returned that represents the requested cell regardless of whether the cell is currently visible (on the screen).
...And 14 more matches
Box-shadow generator - CSS: Cascading Style Sheets
es" class="category"> <div class="title"> class element properties </div> <div class="group"> <div class="group property"> <div class="ui-slider-name"> border </div> <div class="ui-checkbox" data-topic='border-state' data-state="true"></div> </div> <div id="z-
index" class="slidergroup"> <div class="ui-slider-name"> z-
index </div> <div class="ui-slider-btn-set" data-topic="z-
index" data-type="sub"></div> <div class="ui-slider" data-topic="z-
index" data-min="-10" data-max="10" data-step="1"></div> <div class="ui-slider-btn-set" data-topi...
...c="z-
index" data-type="add"></div> <div class="ui-slider-input" data-topic="z-
index"></div> </div> <div class="slidergroup"> <div class="ui-slider-name"> top </div> <div class="ui-slider-btn-set" data-topic="top" data-type="sub"></div> <div class="ui-slider" data-topic="top" data-min="-500" data-max="500" data-step="1"> </div> <div class="ui-slider-btn-set" data-topic="top" data-type="add"></div> <div class="ui-slider-input" data-topic="top" data-unit="px"></div> </div> <div class="slidergroup"> <div class="ui-slider-name">...
...0;"> <div class="output" data-topic="element" data-name="element" data-prop="width height background-color position=[relative] box-shadow"> </div> <div class="output" data-topic="before" data-name="element:before" data-prop="content=[""] position=[absolute] width height top left z-
index background-color box-shadow transform -webkit-transform -ms-transform"> </div> <div class="output" data-topic="after" data-name="element:after" data-prop="content=[""] position=[absolute] width height top left z-
index background-color box-shadow transform -webkit-transform -ms-transform"> </div> ...
...And 14 more matches
Image file type and format guide - Web media technologies
conceptually similar to the animated gif format which has been in use for decades, apng is more capable in that it supports a variety of color depths, whereas animated gif supports only 8-bit
indexed color.
...
indexed color 1, 2, 4, and 8 each pixel is a d-bit value indicating an
index into a color palette which is contained within a plte chunk in the apng file; the colors in the palette all use an 8-bit depth.
...these features include: support for different bit depths,
indexed color, alpha channels, and different pixel orders (by default, bmp is written from bottom-left corner toward the right and top, rather than from the top-left corner toward the right and bottom).
...And 14 more matches
Manipulating Lists - Archive of obsolete content
the new item is inserted at this
index, so, in the example, the new item will be added at position 3 while the item previously at that position will now be at position 4.
...the removeitemat() function will remove the item at a specific
index.
... list selection the nsidomxulselectcontrolelement interface provides two additonal properties, selected
index and selecteditem.
...And 13 more matches
XBL Example - Archive of obsolete content
example 1 : source <binding id="slideshow"> <content> <xul:vbox flex="1"> <xul:deck xbl:inherits="selected
index" selected
index="0" flex="1"> <children/> </xul:deck> <xul:hbox> <xul:button xbl:inherits="label=previoustext"/> <xul:label flex="1"/> <xul:button xbl:inherits="label=nexttext"/> </xul:hbox> </xul:vbox> </content> </binding> this binding creates the slideshow structure that we want.
...the selected
index is inherited by the deck, so we may set the initial page in the xul.
...when getting this custom property, it will need to retrieve the value of the selected
index attribute of the deck, which holds the number of the currently displayed page.
...And 13 more matches
Package management basics - Learn web development
the default
index.js is fine for now — press return.
...open it up and it should look something like this: { "name": "parcel-experiment", "version": "1.0.0", "description": "a simple npm package to learn about using npm", "main": "
index.js", "scripts": { "test": "echo \"error: no test specified\" && exit 1" }, "author": "chris mills", "license": "isc" } so this is the config file that defines your package.
... parcel expects an
index.html and an
index.js file to work with, but otherwise it is very unopinionated about how you structure your project.
...And 13 more matches
IAccessibleEditableText
hresult copytext( [in] long startoffset, [in] long endoffset ); parameters startoffset start
index of the text to moved into the clipboard.
...endoffset end
index of the text to moved into the clipboard.
...hresult cuttext( [in] long startoffset, [in] long endoffset ); parameters startoffset start
index of the text to be deleted.
...And 13 more matches
nsITreeBoxObject
d in gecko 1.9 (firefox 3) inherits from: nsisupports to get the treeboxobject for a tree: let boxobject = tree.boxobject; boxobject.queryinterface("components.interfaces.nsitreeboxobject"); or simply: let boxobject = tree.treeboxobject; method overview long getfirstvisiblerow(); long getlastvisiblerow(); long getpagelength(); void ensurerowisvisible(in long
index); void ensurecellisvisible(in long row, in nsitreecolumn col); void scrolltorow(in long
index); void scrollbylines(in long numlines); void scrollbypages(in long numpages); void scrolltocell(in long row, in nsitreecolumn col); void scrolltocolumn(in nsitreecolumn col); void scrolltohorizontalposition(in long horizontalposition); ...
... void invalidate(); void invalidatecolumn(in nsitreecolumn col); void invalidaterow(in long
index); void invalidatecell(in long row, in nsitreecolumn col); void invalidaterange(in long start
index, in long end
index); void invalidatecolumnrange(in long start
index, in long end
index, in nsitreecolumn col); long getrowat(in long x, in long y); void getcellat(in long x, in long y, out long row, out nsitreecolumn col, out acstring childelt); void getcoordsforcellitem(in long row, in nsitreecolumn col, in acstring element, out long x, out long y, out long width, out long height); boolean iscellcropped(in long row, in nsitreecolumn col); void rowcountchanged(in long
index, in long count); void beginupdat...
... methods getfirstvisiblerow() get the
index of the first visible row.
...And 13 more matches
IDBObjectStore - Web APIs
the idbobjectstore interface of the
indexeddb api represents an object store in a database.
... properties idbobjectstore.
indexnames read only a list of the names of
indexes on objects in this object store.
... idbobjectstore.create
index() creates a new
index during a version upgrade, returning a new idb
index object in the connected database.
...And 13 more matches
Atomics - JavaScript
static methods atomics.add() adds the provided value to the existing value at the specified
index of the array.
... returns the old value at that
index.
... atomics.and() computes a bitwise and on the value at the specified
index of the array with the provided value.
...And 13 more matches
TypedArray - JavaScript
typedarray.prototype.entries() returns a new array iterator object that contains the key/value pairs for each
index in the array.
... typedarray.prototype.fill() fills all the elements of an array from a start
index to an end
index with a static value.
... typedarray.prototype.find
index() returns the found
index in the array, if an element in the array satisfies the provided testing function or -1 if not found.
...And 13 more matches
tabs - Archive of obsolete content
nb: you can add some other elements to tabs such as button, but they will receive an
index.
... activating them will not change the selected
index.
... attributes closebutton, disableclose, disabled, onclosetab, onnewtab, onselect, setfocus, selected
index, tabbox, tab
index, tooltiptextnew, value, properties accessibletype, disabled, itemcount, selected
index, selecteditem, tab
index, value, methods advanceselectedtab, appenditem, get
indexofitem, getitemat
index, insertitemat, removeitemat examples (example needed) attributes closebutton obsolete since gecko 1.9.2 type: boolean if this attribute is set to true, the tabs row will have a "new tab" button and "close" button on the ends.
...And 12 more matches
Using the Gamepad API - Web APIs
you can use gamepadconnected like this: window.addeventlistener("gamepadconnected", function(e) { console.log("gamepad connected at
index %d: %s.
... %d buttons, %d axes.", e.gamepad.
index, e.gamepad.id, e.gamepad.buttons.length, e.gamepad.axes.length); }); each gamepad has a unique id associated with it, which is available on the event's gamepad property.
...gamepadconnected), a second event is dispatched to the focused window, gamepaddisconnected: window.addeventlistener("gamepaddisconnected", function(e) { console.log("gamepad disconnected from
index %d: %s", e.gamepad.
index, e.gamepad.id); }); the gamepad's
index property will be unique per-device connected to the system, even if multiple controllers of the same type are used.
...And 12 more matches
Tree Selection - Archive of obsolete content
<tree id="treeset" onselect="alert('you selected something!');"> tree indices the tree has a property current
index, which can be used to get the currently selected item, where the first row is 0.
...the first item (at
index 0) will be the first top-level item.
... the next item at
index 1 will be its first child.
...And 11 more matches
Creating hyperlinks - Learn web development
inside the root, we have an
index.html file and a contacts.html.
... in a real website,
index.html would be our home page or landing page (a web page that serves as the entry point for a website or a particular section of a website.).
...these each have a single file inside them — a pdf (project-brief.pdf) and an
index.html file, respectively.
...And 11 more matches
How to implement a custom autocomplete search component
re/modules/xpcomutils.jsm'); const class_id = components.id('x753d830-ba1e-11e0-962b-0800200c9a66'); // ← change this const class_name = "basic autocomplete"; const contract_id = '@mozilla.org/autocomplete/search;1?name=basic-autocomplete'; /** * @constructor * * @implements {nsiautocompleteresult} * * @param {string} searchstring * @param {number} searchresult * @param {number} default
index * @param {string} errordescription * @param {array.<string>} results * @param {array.<string>|null=} comments */ function providerautocompleteresult(searchstring, searchresult, default
index, errordescription, results, comments) { this._searchstring = searchstring; this._searchresult = searchresult; this._default
index = default
index; this._errordescription = errordescription; this.
..._results = results; this._comments = comments; } providerautocompleteresult.prototype = { _searchstring: "", _searchresult: 0, _default
index: 0, _errordescription: "", _results: [], _comments: [], /** * @return {string} the original search string */ get searchstring() { return this._searchstring; }, /** * @return {number} the result code of this result object, either: * result_ignored (invalid searchstring) * result_failure (failure) * result_nomatch (no matches found) * result_success (matches found) */ get searchresult() { return this._searchresult; }, /** * @return {number} the
index of the default item that should be entered if * none is selected */ get default
index() { return this._default
index...
...; }, /** * @return {string} description of the cause of a search failure */ get errordescription() { return this._errordescription; }, /** * @return {number} the number of matches */ get matchcount() { return this._results.length; }, /** * @return {string} the value of the result at the given
index */ getvalueat: function(
index) { return this._results[
index]; }, /** * @return {string} the comment of the result at the given
index */ getcommentat: function(
index) { if (this._comments) return this._comments[
index]; else return ''; }, /** * @return {string} the style hint for the result at the given
index */ getstyleat: function(
index) { if (!this._comments || !this._comments[
index]) return nu...
...And 11 more matches
The stacking context - CSS: Cascading Style Sheets
the stacking context in the previous part of this article, using z-
index, the rendering order of certain elements is influenced by their z-
index value.
... element with a position value absolute or relative and z-
index value other than auto.
... element that is a child of a flex (flexbox) container, with z-
index value other than auto.
...And 11 more matches
String.prototype.slice() - JavaScript
syntax str.slice(begin
index[, end
index]) parameters begin
index the zero-based
index at which to begin extraction.
... if negative, it is treated as str.length + begin
index.
... (for example, if begin
index is -3 it is treated as str.length - 3.) if begin
index is greater than or equal to str.length, slice() returns an empty string.
...And 11 more matches
Eclipse CDT Manual Setup
some of it like the section on building the
index and usage tips are still relevant, and other parts still may provide useful background information to understand it in more detail on how eclipse works.
... to be able to provide really good code assistance for a project's source code, ides like eclipse need to carry out a thorough static analysis of the project's source files, to build up a picture of the code (what eclipse is trying to do when it "
indexes" the source.) static analysis involves parsing the source files, so naturally it can only produce good results if it has a sensible set of preprocessor defines, include paths and pre-include files for each source file.
...versely, note this very carefully: if you configure eclipse to invoke a build process that is parallelized, silenced, or that fails to identify the directory that the compiler is being run from, then it will mess up the compiler options that eclipse associates with your files, and that in turn will significantly degrade the quality of the code assistance that eclipse will provide after it next re-
indexes the code.
...And 10 more matches
nsINavHistoryResultObserver
annoname); void nodedateaddedchanged(in nsinavhistoryresultnode anode, in prtime anewvalue); void nodehistorydetailschanged(in nsinavhistoryresultnode anode, in prtime anewvisitdate, in unsigned long anewaccesscount); void nodeiconchanged(in nsinavhistoryresultnode anode); void nodeinserted(in nsinavhistorycontainerresultnode aparent, in nsinavhistoryresultnode anode, in unsigned long anew
index); void nodekeywordchanged(in nsinavhistoryresultnode anode, in autf8string anewkeyword); void nodelastmodifiedchanged(in nsinavhistoryresultnode anode, in prtime anewvalue); void nodemoved(in nsinavhistoryresultnode anode, in nsinavhistorycontainerresultnode aoldparent, in unsigned long aold
index, in nsinavhistorycontainerresultnode anewparent, in unsigned long anew
index); void noderemove...
...d(in nsinavhistorycontainerresultnode aparent, in nsinavhistoryresultnode aitem, in unsigned long aold
index); void nodereplaced(in nsinavhistorycontainerresultnode aparentnode, in nsinavhistoryresultnode aoldnode, in nsinavhistoryresultnode anewnode, in unsigned long a
index); void nodetagschanged(in nsinavhistoryresultnode anode); void nodetitlechanged(in nsinavhistoryresultnode anode, in autf8string anewtitle); void nodeurichanged(in nsinavhistoryresultnode anode, in autf8string anewuri); void sortingchanged(in unsigned short sortingmode); attributes attribute type description result nsinavhistoryresult the nsinavhistoryresult this observer monitors.
...the item previously at the specified
index (if any) and everything below it is shifted down by one.
...And 10 more matches
nsINavHistoryResultViewer
detailschanged(in nsinavhistoryresultnode anode, in prtime anewvisitdate, in unsigned long anewaccesscount); void nodeiconchanged(in nsinavhistoryresultnode anode); void nodekeywordchanged(in nsinavhistoryresultnode anode, in autf8string anewkeyword); void nodemoved(in nsinavhistoryresultnode anode, in nsinavhistorycontainerresultnode aoldparent, in unsigned long aold
index, in nsinavhistorycontainerresultnode anewparent, in unsigned long anew
index); void nodetitlechanged(in nsinavhistoryresultnode anode, in autf8string anewtitle); void noderemoved(in nsinavhistorycontainerresultnode aparent, in nsinavhistoryresultnode anode, in unsigned long aold
index); void nodetagschanged(in nsinavhistoryresultnode anode); void nodeurichanged...
...(in nsinavhistoryresultnode anode, in autf8string anewuri); void nodereplaced(in nsinavhistorycontainerresultnode parent, in nsinavhistoryresultnode olditem, in nsinavhistoryresultnode newitem, in unsigned long
index); void nodeinserted(in nsinavhistorycontainerresultnode aparent, in nsinavhistoryresultnode anode , in unsigned long anew
index); void sortingchanged(in unsigned short sortingmode); attributes attribute type description result nsinavhistoryresult the nsinavhistoryresult this viewer monitors.
... nodemoved() called when a node is moved from aoldparent at aold
index to anewparent at anew
index.
...And 10 more matches
BigInt64Array - JavaScript
once established, you can reference elements in the array using the object's methods, or by using standard array
index syntax (that is, using bracket notation).
... bigint64array.prototype.entries() returns a new array iterator object that contains the key/value pairs for each
index in the array.
... bigint64array.prototype.fill() fills all the elements of an array from a start
index to an end
index with a static value.
...And 10 more matches
BigUint64Array - JavaScript
once established, you can reference elements in the array using the object's methods, or by using standard array
index syntax (that is, using bracket notation).
... biguint64array.prototype.entries() returns a new array iterator object that contains the key/value pairs for each
index in the array.
... biguint64array.prototype.fill() fills all the elements of an array from a start
index to an end
index with a static value.
...And 10 more matches
Float32Array - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array
index syntax (that is, using bracket notation).
... float32array.prototype.entries() returns a new array iterator object that contains the key/value pairs for each
index in the array.
... float32array.prototype.fill() fills all the elements of an array from a start
index to an end
index with a static value.
...And 10 more matches
Float64Array - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array
index syntax (that is, using bracket notation).
... float64array.prototype.entries() returns a new array iterator object that contains the key/value pairs for each
index in the array.
... float64array.prototype.fill() fills all the elements of an array from a start
index to an end
index with a static value.
...And 10 more matches
Int16Array - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array
index syntax (that is, using bracket notation).
... int16array.prototype.entries() returns a new array iterator object that contains the key/value pairs for each
index in the array.
... int16array.prototype.fill() fills all the elements of an array from a start
index to an end
index with a static value.
...And 10 more matches
Int32Array - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array
index syntax (that is, using bracket notation).
... int32array.prototype.entries() returns a new array iterator object that contains the key/value pairs for each
index in the array.
... int32array.prototype.fill() fills all the elements of an array from a start
index to an end
index with a static value.
...And 10 more matches
Int8Array - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array
index syntax (that is, using bracket notation).
... int8array.prototype.entries() returns a new array iterator object that contains the key/value pairs for each
index in the array.
... int8array.prototype.fill() fills all the elements of an array from a start
index to an end
index with a static value.
...And 10 more matches
Uint16Array - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array
index syntax (that is, using bracket notation).
... uint16array.prototype.entries() returns a new array iterator object that contains the key/value pairs for each
index in the array.
... uint16array.prototype.fill() fills all the elements of an array from a start
index to an end
index with a static value.
...And 10 more matches
Uint32Array - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array
index syntax (that is, using bracket notation).
... uint32array.prototype.entries() returns a new array iterator object that contains the key/value pairs for each
index in the array.
... uint32array.prototype.fill() fills all the elements of an array from a start
index to an end
index with a static value.
...And 10 more matches
Uint8Array - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array
index syntax (that is, using bracket notation).
... uint8array.prototype.entries() returns a new array iterator object that contains the key/value pairs for each
index in the array.
... uint8array.prototype.fill() fills all the elements of an array from a start
index to an end
index with a static value.
...And 10 more matches
Uint8ClampedArray - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array
index syntax (that is, using bracket notation).
... uint8clampedarray.prototype.entries() returns a new array iterator object that contains the key/value pairs for each
index in the array.
... uint8clampedarray.prototype.fill() fills all the elements of an array from a start
index to an end
index with a static value.
...And 10 more matches
jspage - Archive of obsolete content
++){d[b].implement(c);}};native.typize=function(a,b){if(!a.type){a.type=function(c){return($type(c)===b); };}};(function(){var a={array:array,date:date,function:function,number:number,regexp:regexp,string:string};for(var h in a){new native({name:h,initialize:a[h],protect:true}); }var d={"boolean":boolean,"native":native,object:object};for(var c in d){native.typize(d[c],c);}var f={array:["concat","
indexof","join","last
indexof","pop","push","reverse","shift","slice","sort","splice","tostring","unshift","valueof"],string:["charat","charcodeat","concat","
indexof","last
indexof","match","replace","search","slice","split","substr","substring","tolowercase","touppercase","valueof"]}; for(var e in f){for(var b=f[e].length;b--;){native.genericize(a[e],f[e][b],true);}}})();var hash=new native({name:"hash"...
...ument.prototype[b]=a;}});document.prototype={$family:{name:"document"}}; new document(document);array.implement({every:function(c,d){for(var b=0,a=this.length;b<a;b++){if(!c.call(d,this[b],b,this)){return false;}}return true; },filter:function(d,e){var c=[];for(var b=0,a=this.length;b<a;b++){if(d.call(e,this[b],b,this)){c.push(this[b]);}}return c;},clean:function(){return this.filter($defined); },
indexof:function(c,d){var a=this.length;for(var b=(d<0)?math.max(0,a+d):d||0;b<a;b++){if(this[b]===c){return b;}}return -1;},map:function(d,e){var c=[]; for(var b=0,a=this.length;b<a;b++){c[b]=d.call(e,this[b],b,this);}return c;},some:function(c,d){for(var b=0,a=this.length;b<a;b++){if(c.call(d,this[b],b,this)){return true; }}return false;},associate:function(c){var d={},b=math.min(this.length,c.length...
...);for(var a=0;a<b;a++){d[c[a]]=this[a];}return d;},link:function(c){var a={}; for(var e=0,b=this.length;e<b;e++){for(var d in c){if(c[d](this[e])){a[d]=this[e];delete c[d];break;}}}return a;},contains:function(a,b){return this.
indexof(a,b)!=-1; },extend:function(c){for(var b=0,a=c.length;b<a;b++){this.push(c[b]);}return this;},getlast:function(){return(this.length)?this[this.length-1]:null;},getrandom:function(){return(this.length)?this[$random(0,this.length-1)]:null; },include:function(a){if(!this.contains(a)){this.push(a);}return this;},combine:function(c){for(var b=0,a=c.length;b<a;b++){this.include(c[b]);}return this; },erase:function(b){for(var a=this.length;a--;a){if(this[a]===b){this.splice(a,1);}}return this;},empty:function(){this.length=0;return this;},flatten:function(){var d=[]; for...
...And 9 more matches
textbox (Toolkit autocomplete) - Archive of obsolete content
attributes accesskey, autocompletepopup, autocompletesearch, autocompletesearchparam, completedefault
index, completeselected
index,crop, disableautocomplete, disabled, disablekeynavigation, enablehistory, focused, forcecomplete, highlightnonmatches, ignoreblurwhilesearching, inputtooltiptext, label, maxlength, maxrows, minresultsforpopup, nomatch, onchange, oninput, onsearchcomplete, ontextentered, ontextreverted, open, readonly,showcommentcolumn, showimagecolumn, size, tab
index, tabscrolling, timeout,...
... type, value properties accessibletype, completedefault
index, controller, crop, disableautocomplete, disablekeynavigation, disabled, editable, focused, forcecomplete, highlightnonmatches, ignoreblurwhilesearching, inputfield, label, maxlength, maxrows, minresultsforpopup, open, popup, popupopen, searchcount, searchparam, selectionend, selectionstart, showcommentcolumn, showimagecolumn,size, tab
index, tabscrolling, textlength, textvalue, timeout, type, value methods getsearchat, onsearchcomplete, ontextentered, ontextreverted, select, setselectionrange examples <textbox type="autocomplete" autocompletesearch="history"/> attributes accesskey type: character this should be set to a character that is used as a shortcut key.
... completedefault
index new in thunderbird 3 requires seamonkey 2.0 type: boolean if true, the best match value will be filled into the textbox as the user types.
...And 9 more matches
source-editor.jsm
back); void removeeventlistener(string aeventtype, function acallback); undo stack operations boolean canredo(); boolean canundo(); void endcompoundchange(); boolean redo(); void resetundo(); void startcompoundchange(); boolean undo(); display management operations void focus(); number gettop
index(); boolean hasfocus(); void settop
index(number atop
index); content management operations number getcharcount(); string getindentationstring(); string getlinedelimiter(); number getlinecount(); number getlineend(number aline
index, boolean aincludedelimiter); number getlinestart(number aline
index); string ge...
... void dropselection(); number getcaretoffset(); object getcaretposition(); object getselection(); void setcaretoffset(number aoffset); void setcaretposition(number aline, [optional] number acolumn, [optional] number aalign); void setselection(number astart, number aend); breakpoint management void addbreakpoint(number aline
index, [optional] string acondition); array getbreakpoints(); boolean removebreakpoint(number aline
index); properties attribute type description dirty boolean set this value to false whenever you save the text; the editor will update it to true when the content is changed.
...
index number an integer value indicating the result of the most recent find operation; this is the
index into the text at which str was found, or -1 if the string wasn't found.
...And 9 more matches
Places Developer Guide
bookmarks.default_
index, // the position of the bookmark in its parent folder.
... bookmarks.default_
index); // the position of the new folder in its parent folder.
... bookmarks.default_
index); // the position of the separator in its parent folder.
...And 9 more matches
XPCOM array guide
in this document the term array refers to a container for multiple objects with a numeric, zero-based
index.
...to use
indexof without providing a comparator, they must also define an operator==.
...instead of incrementally accessing each element of the array by its
index, the arrays provide a way to pass in a callback function that will be called for each element in the array.
...And 9 more matches
nsISessionStore
method overview void deletetabvalue(in nsidomnode atab, in astring akey); void deletewindowvalue(in nsidomwindow awindow, in astring akey); nsidomnode duplicatetab(in nsidomwindow awindow, in nsidomnode atab); nsidomnode forgetclosedtab(in nsidomwindow awindow, in unsigned long a
index); nsidomnode forgetclosedwindow(in unsigned long a
index); astring getbrowserstate(); unsigned long getclosedtabcount(in nsidomwindow awindow); astring getclosedtabdata(in nsidomwindow awindow); unsigned long getclosedwindowcount(); astring getclosedwindowdata(); astring gettabstate(in nsidomnode atab); astring gettabvalu...
...in nsidomnode atab, in astring astate); void settabvalue(in nsidomnode atab, in astring akey, in astring astringvalue); void setwindowstate(in nsidomwindow awindow, in astring astate, in boolean aoverwrite); void setwindowvalue(in nsidomwindow awindow, in astring akey, in astring astringvalue); nsidomnode undoclosetab(in nsidomwindow awindow, in unsigned long a
index); nsidomwindow undoclosewindow(in unsigned long a
index); attributes attribute type description canrestorelastsession boolean is it possible to restore the previous session.
... forgetclosedtab() nsidomnode forgetclosedtab( in nsidomwindow awindow, in unsigned long a
index ); parameters awindow is the browser window associated with the closed tab.
...And 9 more matches
nsITransactionList
inherits from: nsisupports last changed in gecko 1.7 method overview nsitransactionlist getchildlistforitem(in long a
index); nsitransaction getitem(in long a
index); long getnumchildrenforitem(in long a
index); boolean itemisbatch(in long a
index); attributes attribute type description numitems long the number of transactions contained in this list.
... methods getchildlistforitem() returns the list of children associated with the item at a
index.
...nsitransactionlist getchildlistforitem( in long a
index ); parameters a
index the
index of the item in the list.
...And 9 more matches
SVGNumberList - Web APIs
note: starting in gecko 5.0,the svgnumberlist dom interface is now
indexable and can be accessed like arrays.
... interface overview also implement none methods void clear() svgnumber initialize(in svgnumber newitem) svgnumber getitem(in unsigned long
index) svgnumber insertitembefore(in svgnumber newitem, in unsigned long
index) svgnumber replaceitem(in svgnumber newitem, in unsigned long
index) svgnumber removeitem(in unsigned long
index) svgnumber appenditem(in svgnumber newitem) properties readonly unsigned long numberofitems readonly unsigned long length normative document svg 1.1 (2nd edition) properties name type description numberofitems unsigned long the number of items in the list.
... getitem(in unsigned long
index) svgnumber returns the specified item from the list.
...And 9 more matches
ARIA: cell role - Accessibility
a cell can contain a number of property attributes clarifying the cell's position within the tabular data structure, including aria-col
index, aria-colspan, aria-row
index, and aria-rowspan.
... aria-col
index attribute the aria-col
index attribute is only needed if columns are hidden from the dom.
...the aria-col
index defines an element's column
index or position with respect to the total number of columns within a row.
...And 9 more matches
Stacking context example 1 - CSS: Cascading Style Sheets
« css « understanding css z-
index stacking context example 1 let's start with a basic example.
... in the root stacking context we have two divs (div #1 and div #3), both relatively positioned, but without z-
index properties.
... inside div #1 there is an absolutely positioned div #2, while in div #3 there is an absolutely positioned div #4, both without z-
index properties.
...And 9 more matches
Array.prototype.reduce() - JavaScript
the reducer function takes four arguments: accumulator (acc) current value (cur) current
index (idx) source array (src) your reducer function's returned value is assigned to the accumulator, whose value is remembered across each iteration throughout the array, and ultimately becomes the final, single resulting value.
... syntax arr.reduce(callback( accumulator, currentvalue, [,
index[, array]] )[, initialvalue]) parameters callback a function to execute on each element in the array (except for the first, if no initialvalue is supplied).
...
index optional the
index of the current element being processed in the array.
...And 9 more matches
menulist - Archive of obsolete content
attributes accesskey, crop, disableautoselect, disabled, editable, focused, image, label, oncommand, open, preference, readonly, sizetopopup, tab
index, value properties accessibletype, crop, description, disableautoselect, disabled, editable, editor, image, inputfield, itemcount, label, menuboxobject, menupopup, open, selected
index, selecteditem, tab
index, value methods appenditem, contains, get
indexofitem, getitemat
index, insertitemat, removeallitems, removeitemat, select examples <menulist> <menupopup> <menuitem label="op...
... tab
index type: integer the tab order of the element.
...elements with a higher tab
index are later in the tab sequence.
...And 8 more matches
radiogroup - Archive of obsolete content
attributes disabled, focused, preference, tab
index, value properties accessibletype, disabled, focuseditem, itemcount, selected
index, selecteditem, tab
index, value methods appenditem, checkadjacentelement, get
indexofitem, getitemat
index, insertitemat, removeitemat examples <radiogroup> <radio id="orange" label="red"/> <radio id="violet" label="green" selected="true"/> <radio id="yellow" label="blue"/> </radiogroup> attribut...
... tab
index type: integer the tab order of the element.
...elements with a higher tab
index are later in the tab sequence.
...And 8 more matches
How to build custom form controls - Learn web development
the tab
index attribute is what allows the user to focus the control.
...--> <div class="select" tab
index="0"> <!-- this container will be used to display the current value of the control --> <span class="value">cherry</span> <!-- this container will contain all the options available for our control.
... .select:after { content : "â–¼"; /* we use the unicode character u+25bc; make sure to set a charset meta tag */ position: absolute; z-
index : 1; /* this will be important to keep the arrow from overlapping the list of options */ top : 0; right : 0; box-sizing : border-box; height : 100%; width : 2em; padding-top : .1em; border-left : .2em solid #000; border-radius: 0 .1em .1em 0; background-color : #000; color : #fff; text-align : center; } next, let's style the list of options: .select .optlist ...
...And 8 more matches
nsIAccessibleText
out long startoffset, out long endoffset); nsipersistentproperties gettextattributes(in boolean includedefattrs, in long offset, out long rangestartoffset, out long rangeendoffset); astring gettextbeforeoffset(in long offset, in nsaccessibletextboundary boundarytype, out long startoffset, out long endoffset); void removeselection(in long selectionnum); void scrollsubstringto(in long start
index, in long end
index, in unsigned long scrolltype); void scrollsubstringtopoint(in long start
index, in long end
index, in unsigned long coordinatetype, in long x, in long y); void setselectionbounds(in long selectionnum, in long startoffset, in long endoffset); attributes attribute type description caretoffset long the current current caret offset.
...void getcharacterextents( in long offset, out long x, out long y, out long width, out long height, in unsigned long coordtype ); parameters offset
index of the character for which to return its bounding box.
...long getoffsetatpoint( in long x, in long y, in unsigned long coordtype ); parameters x the position's x value for which to look up the
index of the character that is rendered on to the display at that point.
...And 8 more matches
Add to iPhoto
these are declared near the top of the code: const osstatus = ctypes.int32_t; const cf
index = ctypes.long; const optionbits = ctypes.uint32_t; osstatus used to represent the status code resulting from an operation.
... cf
index a core foundation long integer type used to represent
indexes into lists.
...in c, the declaration looks like this: typedef struct { cf
index location; cf
index length; } cfrange; to declare this for use with js-ctypes, we use the following code: this.cfrange = new ctypes.structtype("cfrange", [ {'location': ctypes.int32_t}, {'length': ctypes.int32_t}]); this defines corefoundation.cfrange to represent this data type, comprised of two 32-bit integer fields called location and length.
...And 8 more matches
IDBDatabase - Web APIs
the idbdatabase interface of the
indexeddb api provides a connection to a database; you can use an idbdatabase object to open a transaction on your database then create, manipulate, and delete objects (data) in that database.
... note: everything you do in
indexeddb always happens in the context of a transaction, representing interactions with data in the database.
... all objects in
indexeddb — including object stores,
indexes, and cursors — are tied to a particular transaction.
...And 8 more matches
SVGLengthList - Web APIs
note: starting in gecko 5.0,the svglengthlist dom interface is now
indexable and can be accessed like arrays interface overview also implement none methods void clear() svglength initialize(in svglength newitem) svglength getitem(in unsigned long
index) svglength insertitembefore(in svglength newitem, in unsigned long
index) svglength replaceitem(in svglength newitem, in unsigned long
index) svglength removeitem(in unsigned long
index) svglength appenditem(in svglength newitem) properties ...
... getitem(in unsigned long
index) svglength returns the specified item from the list.
... insertitembefore(in svglength newitem, in unsigned long
index) svglength inserts a new item into the list at the specified position.
...And 8 more matches
SVGPathSegList - Web APIs
interface overview also implement none methods void clear() svgpathseg initialize(in svgpathseg newitem) svgpathseg getitem(in unsigned long
index) svgpathseg insertitembefore(in svgpathseg newitem, in unsigned long
index) svgpathseg replaceitem(in svgpathseg newitem, in unsigned long
index) svgpathseg removeitem(in unsigned long
index) svgpathseg appenditem(in svgpathseg newitem) properties readonly unsigned long numbe...
... getitem(in unsigned long
index) svgpathseg returns the specified item from the list.
... insertitembefore(in svgpathseg newitem, in unsigned long
index) svgpathseg inserts a new item into the list at the specified position.
...And 8 more matches
SVGPointList - Web APIs
interface overview also implement none methods void clear() svgpoint initialize(in svgpoint newitem) svgpoint getitem(in unsigned long
index) svgpoint insertitembefore(in svgpoint newitem, in unsigned long
index) svgpoint replaceitem(in svgpoint newitem, in unsigned long
index) svgpoint removeitem(in unsigned long
index) svgpoint appenditem(in svgpoint newitem) properties readonly unsigned long numberofitems ...
... getitem(in unsigned long
index) svgpoint returns the specified item from the list.
... insertitembefore(in svgpoint newitem, in unsigned long
index) svgpoint inserts a new item into the list at the specified position.
...And 8 more matches
SVGStringList - Web APIs
interface overview also implement none methods void clear() domstring initialize(in domstring newitem) domstring getitem(in unsigned long
index) domstring insertitembefore(in domstring newitem, in unsigned long
index) domstring replaceitem(in domstring newitem, in unsigned long
index) domstring removeitem(in unsigned long
index) domstring appenditem(in domstring newitem) properties readonly unsigned long numberofitems readonly unsigned long length normative docu...
... getitem(in unsigned long
index) domstring returns the specified item from the list.
... insertitembefore(in domstring newitem, in unsigned long
index) domstring inserts a new item into the list at the specified position.
...And 8 more matches
SVGTransformList - Web APIs
note: starting in gecko 9.0,the svgtransformlist dom interface is now
indexable and can be accessed like arrays interface overview also implement none methods void clear() svgtransform initialize(in svgtransform newitem) svgtransform getitem(in unsigned long
index) svgtransform insertitembefore(in svgtransform newitem, in unsigned long
index) svgtransform replaceitem(in svgtransform newitem, in unsigned long
index) svgtransform removeitem(in unsigned long
index) svgtransform appenditem(in ...
... getitem(in unsigned long
index) svgtransform returns the specified item from the list.
... insertitembefore(in svgtransform newitem, in unsigned long
index) svgtransform inserts a new item into the list at the specified position.
...And 8 more matches
WebGLRenderingContext.vertexAttribPointer() - Web APIs
syntax void gl.vertexattribpointer(
index, size, type, normalized, stride, offset); parameters
index a gluint specifying the
index of the vertex attribute that is to be modified.
... attribute
index for each attribute, you must specify its
index.
...you have two options: either you specify the
index yourself.
...And 8 more matches
ARIA: row role - Accessibility
a row can contain a number of attributes clarifying the row's role, including aria-col
index, aria-level, aria-row
index, and aria-selected.
... aria-col
index attribute the aria-col
index attribute is only needed if columns are hidden from the dom.
...when placed on the row, the aria-col
index defines an element's column
index or position with respect to the total number of columns within a row.
...And 8 more matches
Linear-gradient Generator - CSS: Cascading Style Sheets
: border-box; box-sizing: border-box; } /* preview color */ .ui-color-picker .preview { width: 95px; height: 53px; margin: 5px; margin-top: 10px; border: 1px solid #ddd; background-image: url("images/alpha.png"); float: left; position: relative; } .ui-color-picker .preview:before { height: 100%; width: 50%; left: 50%; top: 0; content: ""; background: #fff; position: absolute; z-
index: 1; } .ui-color-picker .preview-color { width: 100%; height: 100%; background-color: rgba(255, 0, 0, 0.5); position: absolute; z-
index: 1; } .ui-color-picker .switch_mode { width: 10px; height: 20px; position: relative; border-radius: 5px 0 0 5px; border: 1px solid #ddd; background-color: #eee; left: -12px; top: -1px; z-
index: 1; transition: all 0.5s; } .ui-color-picker .switch_...
...8b20; } /* dropdown select button */ .ui-dropdown-select { padding: 0 0.75em; color: #fff; line-height: 2em; } /* dropdown list */ .ui-dropdown-list { width: 100%; height: 150px; max-height: 150px; margin: 0; padding: 0 0.3em; border: 1px solid #3490d2; border-color: #208b20; background: #666; background-color: #eef1f5; color: #000; position: absolute; top: 100%; left: 0; z-
index: 100; overflow: hidden; transition: all 0.3s; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } .ui-dropdown-list:hover { overflow: auto; } .ui-dropdown-list[data-hidden='true'] { height: 0 !important; opacity: 0; visibility: hidden; } .ui-dropdown[data-position='left'] .ui-dropdown-list { left: -100%; top: 0; } .ui-dropdown[data-position='rig...
...container { width: 1000px; height: 100%; display: table; margin: 0 auto; } #gradient-container { width: 450px; height: 250px; min-width: 8px; min-height: 8px; margin: 100px auto; border: 1px solid #ddd; position: relative; } #gradient-container[data-alpha="true"]:after { content: ""; width: 100%; height: 100%; background: url('images/canvas-pattern.png'); position: absolute; z-
index: -1; } /** * gradient axis */ .gradient-axis { width: 125%; height: 4px; margin: -3px 0 0 0; border: 1px solid #ccc; position: absolute; top: 50%; left: 0; opacity: 0.5; } .gradient-axis[data-active='true'] { opacity: 1; z-
index: 1; } .gradient-axis:after { content: ""; width: 25px; height: 100%; background-color: #ccc; position: absolute; left: 0; top: 0; } .gradient-axi...
...And 8 more matches
Array.prototype.find() - JavaScript
if you need the
index of the found element in the array, use find
index().
... if you need to find the
index of a value, use array.prototype.
indexof().
... (it’s similar to find
index(), but checks each element for equality with the value instead of using a testing function.) if you need to find if a value exists in an array, use array.prototype.includes().
...And 8 more matches
String.prototype.charAt() - JavaScript
syntax let character = str.charat(
index) parameters
index an integer between 0 and str.length - 1.
... if the
index cannot be converted to the integer or no
index is provided, the default is 0, so the first character of str is returned.
... return value a string representing the character (exactly one utf-16 code unit) at the specified
index.
...And 8 more matches
tabbrowser - Archive of obsolete content
ack, cangoforward, contentdocument, contenttitle, contentvieweredit, contentviewerfile, contentwindow, currenturi, docshell, documentcharsetinfo, homepage, markupdocumentviewer, securityui, selectedbrowser, selectedtab, sessionhistory, tabcontainer, tabs, visibletabs, webbrowserfind, webnavigation, webprogress methods addprogresslistener, addtab, addtabsprogresslistener,appendgroup, getbrowserat
index, getbrowser
indexfordocument, getbrowserfordocument, getbrowserfortab, geticon, getnotificationbox, gettabforbrowser, gettabmodalpromptbox, goback, gobackgroup, goforward, goforwardgroup, gohome, goto
index, loadgroup, loadonetab, loadtabs, loaduri, loaduriwithflags, movetabto, pintab, reload, reloadalltabs, reloadtab, reloadwithflags, removealltabsbut, removecurrenttab, removeprogresslistener, rem...
...ovetab, removetabsprogresslistener,replacegroup, selecttabat
index, seticon, showonlythesetabs, stop, unpintab attributes autocompleteenabled type: boolean set to true to enable autocomplete of fields.
... getbrowserat
index(
index ) return type: browser element returns a browser at the specified tab
index.
...And 7 more matches
tree - Archive of obsolete content
attributes disablekeynavigation, disabled, editable, enablecolumndrag, flags, hidecolumnpicker, onselect, rows, seltype, statedatasource, tab
index, treelines properties accessibletype, builderview, columns, contentview, current
index, disablekeynavigation, disabled, editingcolumn, editingrow, enablecolumndrag, firstordinalcolumn, inputfield, seltype, selstyle, tab
index, treeboxobject, view examples a tree with several columns <tree flex="1" rows="2"> <treecols> <treecol id="sender" label="sender" flex="1"/> <treecol id="s...
... tab
index type: integer the tab order of the element.
...elements with a higher tab
index are later in the tab sequence.
...And 7 more matches
Useful string methods - Learn web development
this can be done using the
indexof() method, which takes a single parameter — the substring you want to search for.
... if the substring is found inside the main string, it returns a number representing the
index position of the substring — which character number of the main string the substring starts at.
... try this: browsertype.
indexof('zilla'); this gives us a result of 2, because the substring "zilla" starts at position 2 (0, 1, 2 — so 3 characters in) inside "mozilla".
...And 7 more matches
IAccessibleHyperlink
start
index() and end
index() are indices with respect to the text exposed by iaccessibletext.
...method overview [propget] hresult anchor([in] long
index, [out] variant anchor ); [propget] hresult anchortarget([in] long
index, [out] variant anchortarget ); [propget] hresult end
index([out] long
index ); [propget] hresult start
index([out] long
index ); [propget] hresult valid([out] boolean valid ); methods anchor() returns an object that represents the link anchor, as appropriate for the link at the specified
index.
... [propget] hresult anchor( [in] long
index, [out] variant anchor ); parameters
index a 0 based
index identifies the anchor when, as in the case of an image map, there is more than one link represented by this object.
...And 7 more matches
nsIAccessibleHyperLink
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview nsiaccessible getanchor(in long
index); note: renamed from getobject in gecko 1.9 nsiuri geturi(in long
index); boolean isselected(); obsolete since gecko 1.9 boolean isvalid(); obsolete since gecko 1.9 attributes attribute type description anchorcount long the number of anchors within this hyperlink.
... end
index long the end offset of the hyperlink accessible within the parent accessible.
... note: the link itself is represented by one embedded character within the parent text, so the end
index should be start
index + 1.
...And 7 more matches
WindowOrWorkerGlobalScope.setInterval() - Web APIs
wner; } this.task = ftask; if (isfinite(nrate) && nrate > 0) { this.rate = math.floor(nrate); } if (nlen > 0) { this.length = math.floor(nlen); } } minidaemon.prototype.owner = null; minidaemon.prototype.task = null; minidaemon.prototype.rate = 100; minidaemon.prototype.length = infinity; /* these properties should be read-only */ minidaemon.prototype.session = -1; minidaemon.prototype.
index = 0; minidaemon.prototype.paused = true; minidaemon.prototype.backw = true; /* global methods */ minidaemon.forcecall = function (odmn) { odmn.
index += odmn.backw ?
... -1 : 1; if (odmn.task.call(odmn.owner, odmn.
index, odmn.length, odmn.backw) === false || odmn.isatend()) { odmn.pause(); return false; } return true; }; /* instances methods */ minidaemon.prototype.isatend = function () { return this.backw ?
... isfinite(this.length) && this.
index < 1 : this.
index + 1 > this.length; }; minidaemon.prototype.synchronize = function () { if (this.paused) { return; } clearinterval(this.session); this.session = setinterval(minidaemon.forcecall, this.rate, this); }; minidaemon.prototype.pause = function () { clearinterval(this.session); this.paused = true; }; minidaemon.prototype.start = function (breverse) { var bbackw = boolean(breverse); if (this.backw === bbackw && (this.isatend() || !this.paused)) { return; } this.backw = bbackw; this.paused = false; this.synchronize(); }; minidaemon passes arguments to the callback function.
...And 7 more matches
ARIA: grid role - Accessibility
<table role="grid" aria-labelledby="id-select-your-seat"> <caption id="id-select-your-seat">select your seat</caption> <tbody role="presentation"> <tr role="presentation"> <td></td> <th>row a</th> <th>row b</th> </tr> <tr> <th scope="row">aisle 1</th> <td tab
index="0"> <button id="1a" tab
index="-1">1a</button> </td> <td tab
index="-1"> <button id="1b" tab
index="-1">1b</button> </td> <!-- more columns --> </tr> <tr> <th scope="row">aisle 2</th> <td tab
index="-1"> <button id="2a" tab
index="-1">2a</button> </td> <td tab
index="-1"> <button id="2b" tab
index="-1">2b</button> ...
...ria-label="thursday">t</th> <th role="columnheader" aria-label="friday">f</th> <th role="columnheader" aria-label="saturday">s</th> </tr> </thead> <tbody role="rowgroup"> <tr role="row"> <th scope="row" role="rowheader">week 35</th> <td>26</td> <td>27</td> <td>28</td> <td>29</td> <td>30</td> <td>31</td> <td role="gridcell" tab
index="-1">1</td> </tr> <tr role="row"> <th scope="row" role="rowheader">week 36</th> <td role="gridcell" tab
index="-1"> 2 </td> <td role="gridcell" tab
index="-1"> 3 </td> <td role="gridcell" tab
index="-1"> 4 </td> <td role="gridcell" tab
index="-1"> 5 </td> <td role="gridcell" tab
index="-1"> 6...
... </td> <td role="gridcell" tab
index="-1"> 7 </td> <td role="gridcell" tab
index="-1"> 8 </td> </tr> <tr role="row"> <th scope="row" role="rowheader">week 37</th> <td role="gridcell" tab
index="-1"> 9 </td> <td role="gridcell" tab
index="-1"> 10 </td> <td role="gridcell" tab
index="-1"> 11 </td> <td role="gridcell" tab
index="-1"> 12 </td> <td role="gridcell" tab
index="-1"> 13 </td> <td role="gridcell" tab
index="-1"> 14 </td> <td role="gridcell" tab
index="-1"> 15 </td> </tr> <tr role="row"> <th scope="row" role="rowheader">week 38</th> <td role="gridcell" tab
index="-1"> 16 ...
...And 7 more matches
ARIA: tab role - Accessibility
the first tab has tab
index=0 on it, which we will later change to whatever tab has aria-selected=true.
... all of the tabpanel elements have tab
index=0 to make them tabbable, and all but the currently active one have the hidden attribute, which we will change with javascript.
... there is some basic styling applied that restyles the buttons and changes the z-
index to of tab elements to give the illusion of it connecting to the tabpanel for active elements, and the illusion that inactive elements are behind the active tabpanel.
...And 7 more matches
Keyboard - Accessibility
most interactive elements are focusable by default; you can make an element focusable by adding a tab
index=0 attribute value to it.
... however, you should only add tab
index if you have also made the element interactive, for example, by defining appropriate event handlers keyboard events.
... see also tab
index global html attribute global event handlers: onkeydown global event handlers: onkeyup avoid using tab
index attribute greater than zero the tab
index attribute indicates that an element is focusable using the keyboard.
...And 7 more matches
Stacking context example 3 - CSS: Cascading Style Sheets
« css « understanding css z-
index stacking context example 3 this last example shows problems that arise when mixing several positioned elements in a multi-level html hierarchy and when z-
indexes are assigned using class selectors.
...in order to put it above all first-level menus, a z-
index is used.
... so a third-level menu will be stacked under the following second-level menus, because all second-level menus share the same z-
index value and the default stacking rules apply.
...And 7 more matches
RegExp.prototype.exec() - JavaScript
they store a last
index from the previous match.
... return value if the match succeeds, the exec() method returns an array (with extra properties
index and input; see below) and updates the last
index property of the regular expression object.
... if the match fails, the exec() method returns null, and sets last
index to 0.
...And 7 more matches
String.prototype.substring() - JavaScript
the substring() method returns the part of the string between the start and end
indexes, or to the end of the string.
... syntax str.substring(
indexstart[,
indexend]) parameters
indexstart the
index of the first character to include in the returned substring.
...
indexend optional the
index of the first character to exclude from the returned substring.
...And 7 more matches
Tree View Details - Archive of obsolete content
the getparent
index method is expected to return the parent row of a given row, that is, the row before it with a lower nesting value.
... note: as of this writing (gecko 2.0), custom nsitreeview implementations must be prepared to handle a call to toggleopenstate for any row
index which returns true for a call to iscontainer, regardless of whether the container is empty.
... review of the methods here is a review of the methods needed to implement hierarchical views: getlevel(row) hasnextsibling(row, after
index) getparent
index(row) iscontainer(row) iscontainerempty(row) iscontaineropen(row) toggleopenstate(row) the after
index argument to hasnextsibling function is used as optimization to only start looking for the next sibling after that point.
...And 6 more matches
XForms Repeat Element - Archive of obsolete content
node set binding special start
index - optional 1-based initial value of the repeat
index.
... behaviour focusing a generated control may change the current
index of the containing repeat element.
... the
index is equal to the
index of the control set that the focused control belongs to.
...And 6 more matches
WAI-ARIA basics - Learn web development
where this is unavoidable, wai-aria provides a means to allow other elements to receive focus (using tab
index).
...you can try taking a copy of our original files (see
index.html and style.css), or navigating to our website-aria-roles example (see it live), which has a structure like this: <header> <h1>...</h1> <nav role="navigation"> <ul>...</ul> <form role="search"> <!-- search form --> </form> </nav> </header> <main> <article role="article">...</article> <aside role="complementary">...</aside> </main> <footer>...</footer> we've als...
... in terms of making non-focusable code focusable, wai-aria extends the tab
index attribute with some new values: tab
index="0" — as indicated above, this value allows elements that are not normally tabbable to become tabbable.
...And 6 more matches
Positioning - Learn web development
introducing z-
index all this absolute positioning is good fun, but there is another thing we haven't considered yet — when elements start to overlap, what determines which elements appear on top of which other elements?
...yes, you can, by using the z-
index property.
... "z-
index" is a reference to the z-axis.
...And 6 more matches
Routing in Ember - Learn web development
creating the routes let's start by creating three new routes: "
index", "active" and "completed".
... to do this you’ll need to enter the following commands into your terminal, inside the root directory of your app: ember generate route
index ember generate route completed ember generate route active the second and third commands should have not only generated new files, but also updated an existing file, app/router.js.
... creating the "
index" route did not add a route definition line to router.js, because like with url navigation and javascript module loading, "
index" is a special word that indicates the default route to render, load, etc.
...And 6 more matches
Getting started with React - Learn web development
its initial file structure looks like this: moz-todo-react ├── readme.md ├── node_modules ├── package.json ├── package-lock.json ├── .gitignore ├── public │ ├── favicon.ico │ ├──
index.html │ └── manifest.json └── src ├── app.css ├── app.js ├── app.test.js ├──
index.css ├──
index.js ├── logo.svg └── serviceworker.js the src directory is where we'll spend most of our time, as it's where the source code for our application lives.
... 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.
... interrogating the
index let’s open src/
index.js, because that's where the app component is being used.
...And 6 more matches
IAccessibleHypertext
method overview [propget] hresult hyperlink([in] long
index, [out] iaccessiblehyperlink hyperlink ); [propget] hresult hyperlink
index([in] long char
index, [out] long hyperlink
index ); [propget] hresult nhyperlinks([out] long hyperlinkcount ); methods hyperlink() returns the specified link.
...[propget] hresult hyperlink( [in] long
index, [out] iaccessiblehyperlink hyperlink ); parameters
index this 0 based
index specifies the hyperlink to return.
... hyperlink if the given
index is valid, that is it lies in the interval from 0 to the number of links minus one, a reference to the specified hyperlink object is returned.
...And 6 more matches
IAccessibleTableCell
1.0 66 introduced gecko 1.9.2 inherits from: iunknown last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method overview [propget] hresult columnextent([out] long ncolumnsspanned ); [propget] hresult columnheadercells([out, size_is(, ncolumnheadercells,)] iunknown cellaccessibles, [out] long ncolumnheadercells ); [propget] hresult column
index([out] long column
index ); [propget] hresult isselected([out] boolean isselected ); [propget] hresult rowcolumnextents([out] long row, [out] long column, [out] long rowextents, [out] long columnextents, [out] boolean isselected ); [propget] hresult rowextent([out] long nrowsspanned ); [propget] hresult rowheadercells([out, size_is(, nrowheadercells,)] iunknown cellaccessibles, [out] long n...
...rowheadercells ); [propget] hresult row
index([out] long row
index ); [propget] hresult table([out] iunknown table ); methods columnextent() returns the number of columns occupied by this cell accessible.
...column
index() translates this cell accessible into the corresponding column
index.
...And 6 more matches
nsIAccessibleHyperText
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview nsiaccessiblehyperlink getlink(in long link
index); long getlink
index(in long char
index); long getselectedlink
index(); obsolete since gecko 1.9 attributes attribute type description linkcount long the number of links contained within this hypertext object.
...note: renamed from links in gecko 1.9 methods getlink() retrieves the nsiaccessiblehyperlink object at the given link
index.
... nsiaccessiblehyperlink getlink( in long link
index ); parameters link
index 0-based
index of the link that is to be retrieved.
...And 6 more matches
nsIArray
inherits from: nsisupports last changed in gecko 1.7 an
indexed collection of elements.
...
indexes are zero-based, such that the last element in the array is stored at the
index length-1.
...method overview nsisimpleenumerator enumerate(); unsigned long
indexof(in unsigned long start
index, in nsisupports element); void queryelementat(in unsigned long
index, in nsiidref uuid, [iid_is(uuid), retval] out nsqiresult result); attributes attribute type description length unsigned long the number of elements in the array.
...And 6 more matches
nsIDialogParamBlock
inherits from: nsisupports last changed in gecko 1.7 method overview print32 getint( in print32 in
index ); wstring getstring( in print32 in
index ); void setint( in print32 in
index, in print32 inint ); void setnumberstrings( in print32 innumstrings ); void setstring( in print32 in
index, in wstring instring); attributes attribute type description objects nsimutablearray a place where you can store an nsimutablearray to pass nsisupports.
...print32 getint( in print32 in
index ); parameters in
index the
index of the integer to get.
... return value the previously set integer, or 0 if no integer has been previously set at that
index.
...And 6 more matches
nsIMutableArray
method overview void appendelement(in nsisupports element, in boolean weak); void clear(); void insertelementat(in nsisupports element, in unsigned long
index, in boolean weak); void removeelementat(in unsigned long
index); void replaceelementat(in nsisupports element, in unsigned long
index, in boolean weak); methods appendelement() append an element at the end of the array.
...void insertelementat( in nsisupports element, in unsigned long
index, in boolean weak ); parameters element the element to insert.
...
index the position in the array: if the position is lower than the current length of the array, the elements at that position and onwards are bumped one position up.
...And 6 more matches
Border-image generator - CSS: Cascading Style Sheets
own select button */ .ui-dropdown-select { height: inherit; padding: 0 0.75em; color: #fff; line-height: 2em; } /* dropdown list */ .ui-dropdown-list { width: 100%; height: 150px; max-height: 150px; margin: 0; padding: 0 0.3em; border: 3px solid #3490d2; border-color: #208b20; background: #666; background-color: #eef1f5; color: #000; position: absolute; top: 2em; left: 0; z-
index: 100; overflow: hidden; transition: all 0.3s; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } .ui-dropdown-list:hover { overflow: auto; } .ui-dropdown-list[data-hidden='true'] { height: 0 !important; opacity: 0; visibility: hidden; } .ui-dropdown[data-position='left'] .ui-dropdown-list { left: -100%; top: 0; } .ui-dropdown[data-position='rig...
...l:focus { box-shadow: 0px 0px 3px -1px #379b4a; /*#68ace8; */ border-color: rgba(55, 155, 74, 0.5); width: 450px; } /* * visible area */ #preview_section { position: relative; min-height: 400px; } /* image control */ #subject { width: 300px; height: 300px; background-repeat: no-repeat; background-size: 100%; background-color: #fff; border: 1px solid #ccc; position: absolute; z-
index: 10; top: 15%; left: 10%; box-shadow: 0 0 3px 0 #bababa; transition-property: width, height; transition-duration: 0.1s; } #subject .guideline { background-color: rgba(255, 255, 255, 0.7); border: 1px solid rgba(0, 0, 0, 0.3); position: absolute; } #subject .guideline:hover { background-color: #f00; } #subject .guideline[data-active] { background-color: #f00; z-
index: 10; } #subjec...
...fo='top'] { top: -10px; left: -50px; } #subject .tooltip2[data-info='right'] { top: -30px; right: -20px; } #subject .tooltip2[data-info='bottom'] { top: -10px; right: -50px; } #subject .tooltip2[data-info='left'] { bottom: -30px; right: -20px; } /* preview */ #preview { width: 30%; height: 50%; background-color: #fff; text-align: center; overflow: hidden; position: absolute; z-
index: 10; left: 60%; top: 15%; border-radius: 2px; border-image-width: 20px; border-image-repeat: round; border-style: solid; box-shadow: 0 0 3px 0 #bababa; } #preview .resize-handle { width: 10px; height: 10px; background: url("https://mdn.mozillademos.org/files/6027/resize.png") center center no-repeat; position: absolute; bottom: 0; right: 0; } #preview .resize-handle:hover { c...
...And 6 more matches
String.prototype.charCodeAt() - JavaScript
the charcodeat() method returns an integer between 0 and 65535 representing the utf-16 code unit at the given
index.
... syntax str.charcodeat(
index) parameters
index an integer greater than or equal to 0 and less than the length of the string.
... if
index is not a number, it defaults to 0.
...And 6 more matches
Tamarin build documentation - Archive of obsolete content
$ make cppflags=-davmplus_verbose additional instructions for non-android cross-platform tamarin-redux build on osx 10.6 (snow leopard) (to build tamarin-central on mac please see previous cross-platform instructions here: https://developer.mozilla.org/
index.php?title=en/tamarin/tamarin_build_documentation&revision=21 the bug when building on snow leopard (bug 537817) has been fixed in the tamarin-redux repo.
... - download the android 2.3.3 mac sdk zip file from http://developer.android.com/sdk/
index.html.
... - download the r5b mac ndk zip file from http://developer.android.com/sdk/ndk/
index.html.
...And 5 more matches
Dealing with files - Learn web development
the most common things we'll have on any website project we create are an
index html file and folders to contain images, style files, and script files.
... let's create these now:
index.html: this file will generally contain your homepage content, that is, the text and images that people see when they first go to your site.
... using your text editor, create a new file called
index.html and save it just inside your test-site folder.
...And 5 more matches
Displaying Places information using views
example uses to get the nsinavhistoryresultnode at a specific row: var treeview = document.getelementbyid("myplacestreeview"); var row
index = 0; var historyresultnode = treeview.view.nodefortree
index(row
index); to get the row
index of a specific nsinavhistoryresultnode: var treeview = document.getelementbyid("myplacestreeview"); var row
index = treeview.view.tree
indexfornode(historyresultnode); to select a row in the tree whose node has a specific uri: var treeview = document.getelementbyid("myplacestreeview"); treeview.selectpl...
... the following javascript creates a new placestreeview instance but overrides two of its nsitreeview methods to display columns not present in the built-in tree view: var view = new placestreeview(); view._getcelltext = view.getcelltext; view.getcelltext = function (arow
index, acol) { // handle our special columns.
... switch (acol.id || acol.element.getattribute("anonid")) { // uri for all nodes (like folders), not just uri nodes (like bookmarks) case "fulluri": return this.nodefortree
index(arow
index).uri; break; //
index of node in parent container case "
indexinparent": return this.nodefortree
index(arow
index).bookmark
index; break; // is the row even or odd?
...And 5 more matches
MathML Accessibility in Mozilla
a base root
index root a3 __________ the third root of a __________ cube root of a, end of root cube root of a.
... a base 3 root
index root a3+4 __________ the 3 plus 4 root of a __________ 3 + 4 root of a, end of root 3 plus 4 root of a.
... a base 3+4 root
index root a34 __________ the 3 over 4 root of a __________ fraction start, 3 over 4, end of fraction root of a, end of root fraction start.
...And 5 more matches
Setting up CDT to work on SpiderMonkey
step 1 - preparing a spidermonkey build for cdt to
index all code, spidermonkey has to be built with debug information.
... at this point, the
indexer starts running and already produces a pretty decent
index of much of spidermonkey.
... still, there are a quite a few things that cdt does not pick up yet: for everything to be
indexed, cdt has to be aware of the project's build details.
...And 5 more matches
nsIAutoCompleteInput
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview acstring getsearchat(in unsigned long
index); void onsearchbegin(); void onsearchcomplete(); boolean ontextentered(); boolean ontextreverted(); void selecttextrange(in long start
index, in long end
index); attributes attribute type description completedefault
index boolean if a search result has its default
index set, this will optionally try to complete the text in ...
...the textbox to the entire text of the result at the default
index as the user types.
... completeselected
index boolean if true, the text in the text field will be autocompleted as the user selects from the popup list.
...And 5 more matches
nsICollection
inherits from: nsiserializable last changed in gecko 1.7 method overview void appendelement(in nsisupports item); void clear(); pruint32 count(); nsienumerator enumerate(); nsisupports getelementat(in pruint32
index); void queryelementat(in pruint32
index, in nsiidref uuid, [iid_is(uuid),retval] out nsqiresult result); void removeelement(in nsisupports item); void setelementat(in pruint32
index, in nsisupports item); methods appendelement() appends a new item to the collection.
...getelementat() returns the element at the specified
index into the collection.
... nsisupports getelementat( in pruint32
index ); parameters
index the
index position of the item to be returned.
...And 5 more matches
nsIControllers
to create an instance, use: var controllers = components.classes["@mozilla.org/xul/xul-controllers;1"] .createinstance(components.interfaces.nsicontrollers); method overview void appendcontroller(in nsicontroller controller); nsicontroller getcontrollerat(in unsigned long
index); nsicontroller getcontrollerbyid(in unsigned long controllerid); unsigned long getcontrollercount(); nsicontroller getcontrollerforcommand(in string command); unsigned long getcontrollerid(in nsicontroller controller); void insertcontrollerat(in unsigned long
index, in nsicontroller controller); void removecontroller(in nsicontroller controller); nsicontroller removecontrollerat(in...
... unsigned long
index); attributes attribute type description commanddispatcher nsidomxulcommanddispatcher obsolete since gecko 1.9 methods appendcontroller() adds a controller to the end of the list.
...nsicontroller getcontrollerat( in unsigned long
index ); parameters
index the position of the wanted controller.
...And 5 more matches
nsINavHistoryResultTreeViewer
method overview nsinavhistoryresultnode nodefortree
index(in unsigned long a
index); unsigned long tree
indexfornode(in nsinavhistoryresultnode anode); attributes attribute type description collapseduplicates boolean controls whether duplicate adjacent elements are collapsed into a single item in the tree.
...obsolete since gecko 1.9 constants constant value description
index_invisible 0xffffffff returned by tree
indexfornode() when the requested node isn't visible (such as when its parent is collapsed).
... methods nodefortree
index() returns the node for a given row
index.
...And 5 more matches
nsISHistory
to create an instance, use: var shistory = components.classes["@mozilla.org/browser/shistory;1"] .createinstance(components.interfaces.nsishistory); method overview void addshistorylistener(in nsishistorylistener alistener); nsishentry getentryat
index(in long
index, in boolean modify
index); void purgehistory(in long numentries); void reloadcurrententry(); void removeshistorylistener(in nsishistorylistener alistener); attributes attribute type description count long the number of toplevel documents currently available in session history.
...
index long the
index of the current document in session history.
... requested
index long the
index of the last document that started to load that is not yet finished loading.
...And 5 more matches
WebIDL bindings
notes: need to document the setup for
indexed and named setters/creators/deleters.
... example interface for a single value iterator: interface longiterable { iterable<long>; getter long(unsigned long
index); readonly attribute unsigned long length; }; for single value iterator interfaces, we treat the interface as an
indexed getter, as required by the spec.
... see the
indexed getter implementation section for more information on building this kind of structure.
...And 5 more matches
DataTransfer - Web APIs
deprecated methods datatransfer.mozcleardataat() removes the data associated with the given format for an item at the specified
index.
... the
index is in the range from zero to the number of items minus one.
... datatransfer.mozgetdataat() retrieves the data associated with the given format for an item at the specified
index, or null if it does not exist.
...And 5 more matches
Dragging and Dropping Multiple Items - Web APIs
these are methods that mirror the types property as well as the getdata(), setdata() and cleardata() methods, however, they take an additional argument that specifies the
index of the item to retrieve, modify or remove.
...the last argument specifies the
index of the item to add.
...using 0 as the
index is equivalent to calling setdata().
...And 5 more matches
IDBTransaction - Web APIs
the idbtransaction interface of the
indexeddb api provides a static, asynchronous transaction on a database using event handler attributes.
...trying to add() the same key twice, or put() with the same
index key with a uniqueness constraint.
... firefox durability guarantees note that as of firefox 40,
indexeddb transactions have relaxed durability guarantees to increase performance (see bug 1112702.) previously in a readwrite transaction idbtransaction.oncomplete was fired only when all data was guaranteed to have been flushed to disk.
...And 5 more matches
Array.prototype.every() - JavaScript
syntax arr.every(callback(element[,
index[, array]])[, thisarg]) parameters callback a function to test for each element, taking three arguments: element the current element being processed in the array.
...
index optional the
index of the current element being processed in the array.
... callback is invoked only for array
indexes which have assigned values.
...And 5 more matches
Array.prototype.filter() - JavaScript
syntax let newarray = arr.filter(callback(element[,
index, [array]])[, thisarg]) parameters callback function is a predicate, to test each element of the array.
...
indexoptional the
index of the current element being processed in the array.
...callback is invoked only for
indexes of the array which have assigned values; it is not invoked for
indexes which have been deleted or which have never been assigned values.
...And 5 more matches
Array.prototype.includes() - JavaScript
syntax arr.includes(valuetofind[, from
index]) parameters valuetofind the value to search for.
... from
index optional the position in this array at which to begin searching for valuetofind.
... the first element to be searched is found at from
index for positive values of from
index, or at arr.length + from
index for negative values of from
index (using the absolute value of from
index as the number of elements from the end of the array at which to start the search).
...And 5 more matches
Array.prototype.map() - JavaScript
syntax let new_array = arr.map(function callback( currentvalue[,
index[, array]]) { // return element for new_array }[, thisarg]) parameters callback function that is called for every element of arr.
...
indexoptional the
index of the current element being processed in the array.
...callback is invoked only for
indexes of the array which have assigned values (including undefined).
...And 5 more matches
Array.prototype.slice() - JavaScript
the slice() method returns a shallow copy of a portion of an array into a new array object selected from start to end (end not included) where start and end represent the
index of items in that array.
... syntax arr.slice([start[, end]]) parameters start optional zero-based
index at which to start extraction.
... a negative
index can be used, indicating an offset from the end of the sequence.
...And 5 more matches
String - JavaScript
some of the most-used operations on strings are to check their length, to build and concatenate them using the + and += string operators, checking for the existence or location of substrings with the
indexof() method, or extracting substrings with the substring() method.
...the first is the charat() method: return 'cat'.charat(1) // returns "a" the other way (introduced in ecmascript 5) is to treat the string as an array-like object, where individual characters correspond to a numerical
index: return 'cat'[1] // returns "a" when using bracket notation for character access, attempting to delete or assign a value to these properties will not succeed.
... instance methods string.prototype.charat(
index) returns the character (exactly one utf-16 code unit) at the specified
index.
...And 5 more matches
places/bookmarks - Archive of obsolete content
save(bookmarks).on("data", function (saved, input) { // a data event is called once for each item saved, as well // as implicit items, like `group` console.log(input === group || ~bookmarks.
indexof(input)); // true }).on("end", function (saves, inputs) { // like the previous example, the "end" event returns an // array of all of our updated saves.
...
index number the
index of the bookmark within its group.
...
index number the
index of the bookmark group within its parent group.
...And 4 more matches
textbox - Archive of obsolete content
attributes cols, decimalplaces, disabled, emptytext, hidespinbuttons, increment, label, max, maxlength, min, multiline, newlines, onblur, onchange, onfocus, oninput, placeholder, preference, readonly, rows, searchbutton, size, spellcheck, tab
index, timeout, type, value, wrap, wraparound properties accessibletype, clickselectsall, decimalplaces, decimalsymbol, defaultvalue, disabled, editor, emptytext, increment, inputfield, label, max, maxlength, min, placeholder, readonly, searchbutton, selectionend, selectionstart, size, spinbuttons, tab
index, textlength, timeout, type, value, valuenumber, wraparound methods decrease, increase,...
... tab
index type: integer the tab order of the element.
...elements with a higher tab
index are later in the tab sequence.
...And 4 more matches
PR_SetThreadPrivate
syntax #include <prthread.h> prstatus pr_setthreadprivate(pruintn
index, void *priv); parameters pr_setthreadprivate has the following parameters:
index an
index into the per-thread private data table.
... if the
index is invalid, pr_failure.
... description if the thread already has non-null private data associated with it, and if the destructor function for the
index is known (not null), nspr calls the destructor function associated with the
index before setting the new data value.
...And 4 more matches
IAccessibleAction
method overview [propget] hresult description([in] long action
index, [out] bstr description ); hresult doaction([in] long action
index ); [propget] hresult keybinding([in] long action
index, [in] long nmaxbindings, [out, size_is(,nmaxbindings), length_is(, nbindings)] bstr keybindings, [out] long nbindings ); [propget] hresult localizedname([in] long action
index, [out] bstr localizedname ); hresult nactions([out,retval] long nactions ); [propget] hresult ...
...name([in] long action
index, [out] bstr name ); methods description() returns a description of the specified action of the object.
... [propget] hresult description( [in] long action
index, [out] bstr description ); parameters action
index 0 based
index specifying which action's description to return.
...And 4 more matches
nsIAccessible
nsiaccessible.parent to get the parent accessible nsiaccessible.nextsibling, nsiaccessible.previoussibling to get sibling accessibles nsiaccessible.firstchild, nsiaccessible.lastchild to get first and last child nsiaccessible.children, nsiaccessible.getchildat(), nsiaccessible.childcount to navigate through the children by
index accessible position you can use nsiaccessible.
indexinparent to get accessible
index in its parent.
...ds nsiaccessible.getchildatpoint() to get child accessible from point nsiaccessible.getaccessibletoleft(), nsiaccessible.getaccessibletoright(), nsiaccessible.getaccessibleabove() or nsiaccessible.getaccessiblebelow() to get left, right, top or below placed accessible methods getkeybindings provides array of localized string of global keyboard accelerator for the given action
index supported by accessible.
... getchildat this method returns nth accessible child using zero-based
index or last child if
index than less than zero.
...And 4 more matches
nsICommandLine
method overview long findflag(in astring aflag, in boolean acasesensitive); astring getargument(in long a
index); boolean handleflag(in astring aflag, in boolean acasesensitive); astring handleflagwithparam(in astring aflag, in boolean acasesensitive); void removearguments(in long astart, in long aend); nsifile resolvefile(in astring aargument); nsiuri resolveuri(in astring aargument); attributes attribute type description length long number of arguments in the command line.
... return value the position of the flag in the command line, or -1 if the flag is not found.getargument() gets the value an argument from the array of command-line arguments, given the
index into the argument list.
...astring getargument( in long a
index ); parameters a
index the argument to retrieve.
...And 4 more matches
nsINavHistoryContainerResultNode
1.0 66 introduced gecko 1.9 inherits from: nsinavhistoryresultnode last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview nsinavhistoryresultnode findnodebydetails(in autf8string auristring, in prtime atime, in long long aitemid, in boolean arecursive); nsinavhistoryresultnode getchild(in unsigned long a
index); unsigned long getchild
index(in nsinavhistoryresultnode anode); attributes attribute type description childcount unsigned long the number of child nodes; accessing this throws an ns_error_not_available exception of containeropen is false.
... getchild() returns the child node at the specified
index.
... nsinavhistoryresultnode getchild( in unsigned long a
index ); parameters a
index the
index into the child list of the node to fetch.
...And 4 more matches
nsISupportsArray
inherits from: nsicollection last changed in gecko 1.7 method overview boolean appendelements(in nsisupportsarray aelements); violates the xpcom interface guidelines nsisupportsarray clone(); void compact(); void deleteelementat(in unsigned long a
index); void deletelastelement(in nsisupports aelement); nsisupports elementat(in unsigned long a
index); violates the xpcom interface guidelines boolean enumeratebackwards(in nsisupportsarrayenumfunc afunc, in voidptr adata); violates the xpcom interface guidelines boolean enumerateforwards(in nsisupportsarrayenumfunc afunc, in voidptr adata); violates the xpcom interface guidelines boolean equals([const] in nsisupportsarray other); violates...
... the xpcom interface guidelines long get
indexof(in nsisupports apossibleelement); long get
indexofstartingat(in nsisupports apossibleelement, in unsigned long astart
index); long getlast
indexof(in nsisupports apossibleelement); long
indexof([const] in nsisupports apossibleelement); violates the xpcom interface guidelines long
indexofstartingat([const] in nsisupports apossibleelement, in unsigned long astart
index); violates the xpcom interface guidelines boolean insertelementat(in nsisupports aelement, in unsigned long a
index); violates the xpcom interface guidelines boolean insertelementsat(in nsisupportsarray aother, in unsigned long a
index); violates the xpcom interface guidelines long last
indexof([const] in nsisupports apossibleelement); violates the xpcom interface guidelines ...
... boolean moveelement(in long afrom, in long ato); violates the xpcom interface guidelines boolean removeelementat(in unsigned long a
index); violates the xpcom interface guidelines boolean removeelementsat(in unsigned long a
index, in unsigned long acount); violates the xpcom interface guidelines boolean removelastelement([const] in nsisupports aelement); violates the xpcom interface guidelines boolean replaceelementat(in nsisupports aelement, in unsigned long a
index); violates the xpcom interface guidelines boolean sizeto(in long asize); violates the xpcom interface guidelines methods violates the xpcom interface guidelines appendelements() boolean appendelements( in nsisupportsarray aelements ); parameters aelements return value clone() nsisupportsarray clone(); para...
...And 4 more matches
AudioNode.disconnect() - Web APIs
output optional an
index describing which output from the current audionode is to be disconnected.
... the
index numbers are defined according to the number of output channels (see audio channels).
... if this parameter is out-of-bound, an
indexsizeerror exception is thrown.
...And 4 more matches
Element.classList - Web APIs
string.prototype.trim polyfill if (!"".trim) string.prototype.trim = function(){ return this.replace(/^[\s]+|[\s]+$/g, ''); }; (function(window){"use strict"; // prevent global namespace pollution if(!window.domexception) (domexception = function(reason){this.message = reason}).prototype = new error; var wsre = /[\11\12\14\15\40]/, ws
index = 0, checkifvalidclasslistentry = function(o, v) { if (v === "") throw new domexception( "failed to execute '" + o + "' on 'domtokenlist': the token provided must not be empty." ); if((ws
index=v.search(wsre))!==-1) throw new domexception("failed to execute '"+o+"' on 'domtokenlist': " + "the token provided ('"+v[ws
index]+"') contains html space characters, which are not valid in token...
...len = protoobjproto.length; a: for(var ci = 0, clen = protoobjproto.length = tokens.length, sub = 0; ci !== clen; ++ci){ for(var inneri=0; inneri!==ci; ++inneri) if(tokens[inneri]===tokens[ci]) {sub++; continue a;} restokenlist[ci-sub] = tokens[ci]; } for (var i=clen-sub; i < oldlen; ++i) delete restokenlist[i]; //remove trailing
indexs if(prop !== "classlist") return; skippropchange = 1, target.classlist = restokenlist, target.classname = strval; skippropchange = 0, restokenlist.length = tokens.length - sub; } } function polyfillclasslist(ele){ if (!ele || !("innerhtml" in ele)) throw typeerror("illegal invocation"); ele.detachevent( "onpropertychange", whenpr...
...bjproto.length; a: for(var ci = 0, clen = protoobjproto.length = toks.length, sub = 0; ci !== clen; ++ci){ for(var inneri=0; inneri!==ci; ++inneri) if(toks[inneri]===toks[ci]) {sub++; continue a;} restokenlist[ci-sub] = toks[ci]; } for (var i=clen-sub; i < oldlen; ++i) delete restokenlist[i]; //remove trailing
indexs } }); defineproperty(ele, " uclp", { // for accessing the hidden prototype enumerable: 0, configurable: 0, writeable: 0, value: protoobj.prototype }); defineproperty(protoobjproto, " ucl", { enumerable: 0, configurable: 0, writeable: 0, value: ele }); } else { ele.classlist=restokenlist, ele[" ucl"]=restokenlist, ele[" uclp"]=protoobj.p...
...And 4 more matches
HTMLTableElement.insertRow() - Web APIs
to insert the row into a specific <tbody>: let specific_tbody = document.getelementbyid(tbody_id); let row = specific_tbody.insertrow(
index) note: insertrow() inserts the row directly into the table.
... syntax var newrow = htmltableelement.insertrow(
index); htmltableelement is a reference to an html <table> element.
... parameters
index optional the row
index of the new row.
...And 4 more matches
HTMLTextAreaElement - Web APIs
selectionend unsigned long: returns / sets the
index of the end of selected text.
... if no text is selected, contains the
index of the character that follows the input cursor.
... selectionstart unsigned long: returns / sets the
index of the beginning of selected text.
...And 4 more matches
IDBCursor - Web APIs
the idbcursor interface of the
indexeddb api represents a cursor for traversing or iterating over multiple records in a database.
... the cursor has a source that indicates which
index or object store it is iterating over.
...operations are performed on the underlying
index or object store.
...And 4 more matches
Checking when a deadline is due - Web APIs
in this article we look at a complex example involving checking the current time and date against a deadline stored via
indexeddb.
... 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.
... note: the db variable stores a reference to the
indexeddb database instance; we can then use various properties of this variable to manipulate the data.
...And 4 more matches
NodeList.item() - Web APIs
returns a node from a nodelist by
index.
...a value of null is returned if the
index is out of range, and a typeerror is thrown if no argument is provided.
... syntax nodeitem = nodelist.item(
index) nodelist is a nodelist.
...And 4 more matches
Using Service Workers - Web APIs
an install event is always the first one sent to a service worker (this can be used to start the process of populating an
indexeddb, and caching site assets).
...(see the browser compatibility section for more information.) if you want to use this now, you could consider using a polyfill like the one available in google's topeka demo, or perhaps store your assets in
indexeddb.
... let’s start this section by looking at a code sample — this is the first block you’ll find in our service worker: self.addeventlistener('install', (event) => { event.waituntil( caches.open('v1').then((cache) => { return cache.addall([ './sw-test/', './sw-test/
index.html', './sw-test/style.css', './sw-test/app.js', './sw-test/image-list.js', './sw-test/star-wars-logo.jpg', './sw-test/gallery/', './sw-test/gallery/bountyhunters.jpg', './sw-test/gallery/mylittlevader.jpg', './sw-test/gallery/snowtroopers.jpg' ]); }) ); }); here we add an install event listener to the service worker (hence self), and then chain a extendableevent.waituntil() method onto the event — this ensures that...
...And 4 more matches
WebGLRenderingContext.enableVertexAttribArray() - Web APIs
the webglrenderingcontext method enablevertexattribarray(), part of the webgl api, turns on the generic vertex attribute array at the specified
index into the list of attribute arrays.
...attributes are referenced by an
index number into the list of attributes maintained by the gpu.
... syntax void gl.enablevertexattribarray(
index); parameters
index a gluint specifying the
index number that uniquely identifies the vertex attribute to enable.
...And 4 more matches
Architecture - Accessibility
this allows at's to find its position within that text, because the hyperlink interface exposes a start and end
index.
... in fact, the end
index will always be 1 larger than the start
index, because the object is always represented by a single '\xfffc' character.
... how does an at deal with text (a) to get the embedded object for an embedded object char: link
index = iahypertext::getlink
index(offset) iahyperlink*object = iahypertext::getlink(link
index) iaccessible* accessible = qi/qs(object) (b) to get the offset in the parent text for a given embedded object: qi/qa to iahyperlink if not successful, then it is not embedded in text, so it's position in parent should be determined just by ia2::
indexinparent, which will return its child offset within...
...And 4 more matches
Border-radius generator - CSS: Cascading Style Sheets
osition: relative; } #preview .content { width: 100%; height: 100%; display: block; } #preview input { color: #333; border: 1px solid #ccc; border-radius: 3px; } #subject { width: 400px; height: 150px; margin: 0 auto; border: 3px solid #c60; background: #fff; position: relative; } .radius { width: 50%; height: 50%; border: 1px solid #ccc; display: none; position: absolute; z-
index: 1; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } .handle { width: 16px; height: 16px; position: absolute; z-
index: 2; } .handle-top-left { top: -12px; left: -12px; cursor: se-resize; background: url("https://mdn.mozillademos.org/files/5677/resize-handle.png") top left no-repeat; } .handle-top-right { top: -12px; right: -12px; cursor: sw-r...
...ht { bottom: -12px; right: -12px; cursor: nw-resize; background: url("https://mdn.mozillademos.org/files/5677/resize-handle.png") bottom right no-repeat; } .handle-bottom-left { bottom: -12px; left: -12px; cursor: ne-resize; background: url("https://mdn.mozillademos.org/files/5677/resize-handle.png") bottom left no-repeat; } .radius-container { position: absolute; display : block; z-
index: 1; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } /* top left */ #top-left { top: 0; left: 0; } #top-left .radius { border-top-left-radius: 100%; top: 0; left: 0; } /* top right */ #top-right { top: 0; right: 0; } #top-right .radius { border-top-right-radius: 100%; top: 0; right: 0; } /* bottom right */ #bottom-right { bottom: 0; righ...
...t: 0; } #bottom-right .radius { border-bottom-right-radius: 100%; bottom: 0; right: 0; } /* bottom left */ #bottom-left { bottom: 0; left: 0; } #bottom-left .radius { border-bottom-left-radius: 100%; bottom: 0; } /* input sliders */ #preview .ui-input-slider { margin: 10px; position: absolute; z-
index: 10; } #radius-ui-sliders { width: 100%; height: 100%; min-height: 75px; min-width: 150px; padding: 20px 50px; top: -20px; left: -50px; position: relative; } #tlr { top: -30px; left: -50px; display: none; } #tlw { top: -30px; left: 30px; } #tlh { top: 20px; left: -50px; } #trr { top: -30px; right: -50px; display: none; } #trw { top: -30px; right: 30px; } #trh { top: 20px; right: -50px; } #brr { bottom: -30px; right: -50px; display: none; } #brw { b...
...And 4 more matches
Stacking context example 2 - CSS: Cascading Style Sheets
« css « understanding css z-
index stacking context example 2 this is a very simple example, but it is the key for understanding the concept of stacking context.
... there are the same four divs of the previous example, but now z-
index properties are assigned on both levels of the hierarchy.
... you can see that div #2 (z-
index: 2) is above div #3 (z-
index: 1), because they both belong to the same stacking context (the root one), so z-
index values rule how elements are stacked.
...And 4 more matches
Event reference
abort event
indexeddb a transaction has been aborted.
... blocked
indexeddb an open connection to a database is blocking a versionchange transaction on the same database.
... complete
indexeddb a transaction successfully completed.
...And 4 more matches
Standard metadata names - HTML: Hypertext Markup Language
googlebot, a synonym of robots, is only followed by googlebot (the
indexing crawler for google).
...it is a comma-separated list of the values below: values for the content of <meta name="robots"> value description used by
index allows the robot to
index the page (default).
... all no
index requests the robot to not
index the page.
...And 4 more matches
Regular expressions - JavaScript
it returns the
index of the match, or -1 if the search fails.
...yarray = myre.exec('cdbbdbsbz'); if you do not need to access the properties of the regular expression, an alternative way of creating myarray is with this script: var myarray = /d(b+)d/g.exec('cdbbdbsbz'); // similar to "cdbbdbsbz".match(/d(b+)d/g); however, // "cdbbdbsbz".match(/d(b+)d/g) outputs array [ "dbbd" ], while // /d(b+)d/g.exec('cdbbdbsbz') outputs array [ 'dbbd', 'bb',
index: 1, input: 'cdbbdbsbz' ].
... object property or
index description in this example myarray the matched string and all remembered substrings.
...And 4 more matches
Array.prototype.some() - JavaScript
syntax arr.some(callback(element[,
index[, array]])[, thisarg]) parameters callback a function to test for each element, taking three arguments: element the current element being processed in the array.
...
indexoptional the
index of the current element being processed in the array.
...callback is invoked only for
indexes of the array with assigned values.
...And 4 more matches
RegExp.prototype.test() - JavaScript
test() returns a boolean, unlike the string.prototype.search() method (which returns the
index of a match, or -1 if not found).
... the following example logs a message which depends on the success of the test: function testinput(re, str) { let midstring; if (re.test(str)) { midstring = 'contains'; } else { midstring = 'does not contain'; } console.log(`${str} ${midstring} ${re.source}`); } using test() on a regex with the "global" flag when a regex has the global flag set, test() will advance the last
index of the regex.
... (regexp.prototype.exec() also advances the last
index property.) further calls to test(str) will resume searching str starting from last
index.
...And 4 more matches
SharedArrayBuffer.prototype.slice() - JavaScript
if either begin or end is negative, it refers to an
index from the end of the array, as opposed to from the beginning.
... syntax sab.slice() sab.slice(begin) sab.slice(begin, end) parameters begin optional zero-based
index at which to begin extraction.
... a negative
index can be used, indicating an offset from the end of the sequence.
...And 4 more matches
Creating Event Targets - Archive of obsolete content
then open "
index.js" and add the following code: var {cc, ci} = require("chrome"); var { xpcomutils } = require("resource://gre/modules/xpcomutils.jsm"); var bookmarkservice = cc["@mozilla.org/browser/nav-bookmarks-service;1"] .getservice(ci.nsinavbookmarksservice); var bookmarkobserver = { onitemadded: function(aitemid, afolder, a
index) { console.log("added ", bookmarkservice.ge...
... and add the following code: var { emit, on, once, off } = require("sdk/event/core"); var {cc, ci} = require("chrome"); var { xpcomutils }= require("resource://gre/modules/xpcomutils.jsm"); var bookmarkservice = cc["@mozilla.org/browser/nav-bookmarks-service;1"] .getservice(ci.nsinavbookmarksservice); var bookmarkobserver = { onitemadded: function(aitemid, afolder, a
index) { emit(exports, "added", bookmarkservice.getbookmarkuri(aitemid).spec); }, onitemvisited: function(aitemid, avisitid, time) { emit(exports, "visited", bookmarkservice.getbookmarkuri(aitemid).spec); }, queryinterface: xpcomutils.generateqi([ci.nsinavbookmarkobserver]) }; bookmarkservice.addobserver(bookmarkobserver, false); exports.on = on.bind(null, exports); exports.once = onc...
...for example, we can adapt "
index.js" as follows: var bookmarks = require("./bookmarks"); function logadded(uri) { console.log("added: " + uri); } function logvisited(uri) { console.log("visited: " + uri); } exports.main = function() { bookmarks.on("added", logadded); bookmarks.on("visited", logvisited); }; exports.onunload = function() { bookmarks.removelistener("added", logadded); bookmarks.removelistener("visi...
...And 3 more matches
Bookmarks - Archive of obsolete content
(), // uri of the bookmark null, // shortcut win.document.title, // description win.document.characterset, // charset null, // postdata bookmarksservice.getbookmarkstoolbarfolder(), // bookmark folder 0); //
index in the folder firefox 3 firefox 3 provides a reworked set of api for working with history and bookmarks.
...for example, to create a new folder in the bookmarks menu: var menufolder = bmsvc.bookmarksmenufolder; // bookmarks menu folder var newfolderid = bmsvc.createfolder(menufolder, "folder name here", bmsvc.default_
index); this code locates the bookmarks menu's folder, then creates a new folder named "folder name here" in it.
... specifying default_
index as the
index at which to insert the new folder places it at the end of the list.
...And 3 more matches
Tabbed browser - Archive of obsolete 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.
...mediator); var browserenumerator = wm.getenumerator("navigator:browser"); // check each browser instance for our url var found = false; while (!found && browserenumerator.hasmoreelements()) { var browserwin = browserenumerator.getnext(); var tabbrowser = browserwin.gbrowser; // check each tab of this browser instance var numtabs = tabbrowser.browsers.length; for (var
index = 0;
index < numtabs;
index++) { var currentbrowser = tabbrowser.getbrowserat
index(
index); if (url == currentbrowser.currenturi.spec) { // the url is already opened.
... tabbrowser.selectedtab = tabbrowser.tabcontainer.childnodes[
index]; // focus *this* browser-window browserwin.focus(); found = true; break; } } } // our url isn't open.
...And 3 more matches
Running Tamarin performance tests - Archive of obsolete content
ersion of avm2 --vmargs2 args to pass to avm2, if not specified --vmargs will be used --nooptimize do not optimize files when compiling --perfm parse the perfm results from avm --csv= also output to csv file, filename required --csvappend append to csv file instead of overwriting --score compute and print geometric mean of scores --
index=
index file to use (must end with .py) --save
index= save results to given
index file name option details
indexing: there are two command line flags that control
indexing: --
index and —save
index both require an
index filename to be specified after the flag.
... "--
index index.py" will load
index.py and run all of the tests in that
index and report results normalized to the
index values.
... a subset of the tests in the
index can be run by passing what tests you want to run after specifying the
index file.
...And 3 more matches
Building accessible custom components in XUL - Archive of obsolete content
in html documents, you can make any element focusable with the tab
index attribute.
... in xul, there is no tab
index attribute; to make a xul element focusable, you need to use a mozilla-specific css property, -moz-user-focus: normal.
...(); } } function spreadsheet_down(current) { var next = find_cell_down(current); if (next) { next.focus(); } } function spreadsheet_left(current) { var next = find_cell_left(current); if (next) { next.focus(); } } function spreadsheet_right(current) { var next = find_cell_right(current); if (next) { next.focus(); } } function get_
index_within_parent(current) { var arsiblings = current.parentnode.childnodes; for (var i = 0; i < arsiblings.length; i++) { if (arsiblings[i] == current) { return i; } } return -1; } function find_cell_up(current) { var row = get_
index_within_parent(current); var arsiblings = current.parentnode.childnodes; return row == 0 ?
...And 3 more matches
Template and Tree Listeners - Archive of obsolete content
var somelistener = { item: null, willrebuild : function(builder) { this.item = builder.getresourceat
index(builder.root.current
index); }, didrebuild : function(builder) { if (this.item) { var idx = builder.get
indexofresource(this.item) if (idx != -1) builder.root.view.selection.select(idx); } } }; tree.builder.addlistener(somelistener); this example is very simple and just saves and restores the selected
index after a rebuild.
...the example above makes use of the getresourceat
index and get
indexofresource methods.
... these two methods are available for tree builders and will convert between an
index in the tree and the associated member resource for the item at the
index.
...And 3 more matches
wizard - Archive of obsolete content
attributes firstpage, lastpage, pagestep, title, windowtype properties canadvance, canrewind, currentpage, onfirstpage, onlastpage, pagecount, page
index, pagestep, title, wizardpages methods advance, cancel, extra1, extra2, getbutton, getpagebyid, goto, rewind examples <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <wizard id="thewizard" title="secret code wizard" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script> function checkcode(){ document.getelementbyid(...
... use the cancancel property to indicate to the user (by disabling the cancel button) that they cannot can pagestep type: integer the
index of the current page.
... onfirstpage type: boolean this property is set to true if the user is on the first page, which may or may not be the first
index.
...And 3 more matches
Practical positioning examples - Learn web development
the second rule we'll add here makes it so that a panel with a class of active-panel set on it will have a z-
index of 1 applied to it, which will make it sit above the other panels (positioned elements have a z-
index of 0 by default, which would put them below).
... .info-box article { position: absolute; top: 0; left: 0; height: 352px; padding: 10px; color: white; background-color: #a60000; } .info-box .active-panel { z-
index: 1; } adding our javascript the final step to getting this feature working is to add some javascript.
...when run, the function is passed a reference to the particular tab it is being run for, and an
index number i that indentifies the tab's position in the tabs array.
...And 3 more matches
Multiprocess on Windows
arraydata contains seven fields: iid miid; ulong mmethod
index; ulong marrayparam
index; vartype marrayparamtype; iid marrayparamiid; ulong mlengthparam
index; flag mflag; miid is the uuid of the interface owning the function.
... mmethod
index is the vtable
index of the function within its interface.
... this
index must take into account the vtable(s) of parent interfaces.
...And 3 more matches
Performance best practices for Firefox front-end engineers
you can put something on its own layer by setting its z-
index, or by setting the will-change on the node, though this should be used sparingly.
... use
indexeddb for storage appcache and localstorage are synchronous storage apis that will block the main thread when you use them.
...
indexeddb is preferable, as the api is asynchronous (all disk operations occur off of the main thread), and can be accessed from web workers.
...And 3 more matches
Parser API
s source location, the field is null; otherwise it is an object consisting of a start position (the position of the first character of the parsed source region) and an end position (the position of the first character after the parsed source region): interface sourcelocation { source: string | null; start: position; end: position; } each position object consists of a line number (1-
indexed) and a column number (0-
indexed): interface position { line: uint32 >= 1; column: uint32 >= 0; } programs interface program <: node { type: "program"; body: [ statement ]; } a complete program source tree.
... interface graphexpression <: expression { type: "graphexpression";
index: uint32; expression: literal; } a graph expression, aka "sharp literal," such as #1={ self: #1# }.
... interface graph
indexexpression <: expression { type: "graph
indexexpression";
index: uint32; } a graph
index expression, aka "sharp variable," such as #1#.
...And 3 more matches
Secure Development Guidelines
unsigned int 0 - +4294967295 64 signed long long -9223372036854775808 - +9223372036854775807 unsigned long long 0 - +18446744073709551615 int vuln_funct(int size) { char buf[1024]; if (size > sizeof(buf) - 1) return -1; } signedness issues: don’t mix signed and unsigned integers use unsigned integers for sizes, offsets, and
indexes casting and truncation example: void vuln_funct() { u_int32_t size1 = 0xffffffff; u_int16_t size2 = size1; void *ptr = malloc(size2); if (!ptr) exit(exit_failure); memcpy(ptr, user_data, size1); } casting issues: sign extension example: int main() { int32_t new_size = 0; int8_t size = 0xff; new_size = size; printf("0x%08x\r\n", ne...
...w_size); } casting issues: sign extension prevention be careful with signed integers use unsigned integers for sizes, offsets, and
indexes denial of service: divide by zero example: int main() { int a, b; if (argc != 3) return 1; a = atoi(argv[1]); b = atoi(argv[2]); return a/b; } denial of service: divide int_min by -1 example: int main(int argc, char **argv) { int a, b; if (argc != 3) return 1; a = atoi(argv[1]); b = atoi(argv[2]); return b ?
... most memory allocators use a linked list or binary tree bbv: off-by-one the array
index starts at 0 not at 1 char array[1024]; array[0] = first element!
...And 3 more matches
IAccessible2
] bstr attributes ); [propget] hresult extendedrole([out] bstr extendedrole ); [propget] hresult extendedstates([in] long maxextendedstates, [out, size_is(,maxextendedstates), length_is(, nextendedstates)] bstr extendedstates, [out] long nextendedstates ); [propget] hresult groupposition([out] long grouplevel, [out] long similaritemsingroup, [out] long positioningroup ); [propget] hresult
indexinparent([out] long
indexinparent ); [propget] hresult locale([out] ia2locale locale ); [propget] hresult localizedextendedrole([out] bstr localizedextendedrole ); [propget] hresult localizedextendedstates([in] long maxlocalizedextendedstates, [out, size_is(,maxlocalizedextendedstates), length_is(, nlocalizedextendedstates)] bstr localizedextendedstates, [out] long nlocalizedextendedstates )...
...; [propget] hresult nextendedstates([out] long nextendedstates ); [propget] hresult nrelations([out] long nrelations ); [propget] hresult relation([in] long relation
index, [out] iaccessiblerelation relation ); [propget] hresult relations([in] long maxrelations, [out, size_is(maxrelations), length_is( nrelations)] iaccessiblerelation relations, [out] long nrelations ); hresult role([out] long role ); hresult scrollto([in] enum ia2scrolltype scrolltype ); hresult scrolltopoint([in] enum ia2coordinatetype coordinatetype, [in] long x, [in] long y ); [propget] hresult states([out] accessiblestates states ); [propget] hresult uniqueid([out] long uniqueid ); [propget] hresult windowhandle([out] hwnd windowhandle ); methods attributes() returns the attributes specific to this iac...
...this is an
index into the objects in the current group, not an
index into all the objects at the same group level.
...And 3 more matches
nsIAccessibleTreeCache
nsiaccessible getcachedtreeitemaccessible( in long arow, in nsitreecolumn acolumn ); parameters arow the row
index.
...void invalidatecache( in long arow, in long acount ); parameters arow row
index the invalidation starts from.
...void treeviewinvalidated( in long astartrow, in long aendrow, in long astartcol, in long aendcol ); parameters astartrow row
index invalidation starts from.
...And 3 more matches
nsIDOMHTMLTimeRanges
each time range represented by an nsidomhtmltimeranges object has an
index number; you call the start() and end() methods to obtain the start and end times of each range, specifying the
index number of the range to look up.
... last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) inherits from: nsisupports method overview float start(in unsigned long
index); float end(in unsigned long
index); attributes attribute type description length unsigned long the number of ranges represented by the nsidomhtmltimeranges object.
...float end( in unsigned long
index ); parameters
index the
index to the time range whose end time is to be returned.
...And 3 more matches
nsIDOMWindowUtils
to get this interface, use: var domwindowutils = window.windowutils; method overview void activatenativemenuitemat(in astring
indexstring); void clearmozafterpaintevents(); pruint32 comparecanvases(in nsidomhtmlcanvaselement acanvas1, in nsidomhtmlcanvaselement acanvas2, out unsigned long amaxdifference); double computeanimationdistance(in nsidomelement element, in astring property, in astring value1, in astring value2); nsicompositionstringsynthesizer createcompositionstringsynthesizer...
...sshell(in nsidomnode atarget, in nsidomevent aevent, in boolean atrusted); nsidomelement elementfrompoint(in float ax, in float ay, in boolean aignorerootscrollframe, in boolean aflushlayout); void entermodalstate(); nsidomelement findelementwithviewid(in nsviewid aid); void focus(in nsidomelement aelement); void forceupdatenativemenuat(in astring
indexstring); void garbagecollect([optional] in nsicyclecollectorlistener alistener); short getcursortype(); astring getdocumentmetadata(in astring aname); nsidomwindow getouterwindowwithid(in unsigned long long aouterwindowid); long getpccountscriptcount(); astring getpccountscriptsummary(in long ascript); astring getpccountscrip...
... void activatenativemenuitemat( in astring
indexstring ); parameters
indexstring clearmozafterpaintevents() void clearmozafterpaintevents(); parameters none.
...And 3 more matches
nsITreeContentView
last changed in gecko 1.8.0 inherits from: nsisupports method overview long get
indexofitem(in nsidomelement item); nsidomelement getitemat
index(in long
index); attributes attribute type description root nsidomelement the element in the dom which this view uses as root content.
...obsolete since gecko 1.8 methods get
indexofitem() retrieve the
index associated with the specified content item.
... long get
indexofitem( in nsidomelement item ); parameters item a tree row for which to find the row
index.
...And 3 more matches
Storage Inspector - Firefox Developer Tools
indexeddb — all
indexeddb databases created by the page or any iframes inside the page, their object stores and the items stored in these object stores.
...for
indexed db or local storage an origin is a combination of protocol + hostname.
... under "cache storage", objects are organized by origin and then by the name of the cache:
indexeddb objects are organized by origin, then by database name, then by object store name: with the cookies, local storage, and session storage types, there's only one level in the hierarchy, so stored items are listed directly under each origin: you can click on each item in the tree to expand or collapse its children.
...And 3 more matches
AudioNode.connect() - Web APIs
syntax var destinationnode = audionode.connect(destination, output
index, input
index); audionode.connect(destination, output
index); parameters destination the audionode or audioparam to which to connect.
... output
index optional an
index specifying which output of the current audionode to connect to the destination.
... the
index numbers are defined according to the number of output channels (see audio channels).
...And 3 more matches
CSSStyleDeclaration.item() - Web APIs
the cssstyledeclaration.item() method interface returns a css property name from a cssstyledeclaration by
index.
... this method doesn't throw exceptions as long as you provide arguments; the empty string is returned if the
index is out of range and a typeerror is thrown if no argument is provided.
... syntax var propertyname = style.item(
index); parameters
index is the
index of the node to be fetched.
...And 3 more matches
CSSStyleSheet.insertRule() - Web APIs
syntax stylesheet.insertrule(rule [,
index]) parameters rule a domstring containing the rule to be inserted.
...
index optional a positive integer less than or equal to stylesheet.cssrules.length, representing the newly inserted rule's position in cssstylesheet.cssrules.
...see browser compatibility for details.) return value the newly inserted rule's
index within the stylesheet's rule-list.
...And 3 more matches
HTMLTableRowElement.insertCell() - Web APIs
syntax var newcell = htmltablerowelement.insertcell(
index); htmltablerowelement is a reference to an html <tr> element.
... parameters
index optional
index is the cell
index of the new cell.
... if
index is -1 or equal to the number of cells, the cell is appended as the last cell in the row.
...And 3 more matches
IDBFactory.open() - Web APIs
syntax for the current standard: var idbopendbrequest =
indexeddb.open(name); var idbopendbrequest =
indexeddb.open(name, version); parameters name the name of the database.
... example example of calling open with the current specification's version parameter: var request = window.
indexeddb.open("todolist", 4); in the following code snippet, we make a request to open a database, and include handlers for the success and error cases.
...window.
indexeddb = window.
indexeddb || window.moz
indexeddb || window.webkit
indexeddb || window.ms
indexeddb; // don't use "var
indexeddb = ..." if you're not in a function.
...And 3 more matches
IDBFactory - Web APIs
the idbfactory interface of the
indexeddb api lets applications asynchronously access the
indexed databases.
... the object that implements the interface is window.
indexeddb.
...window.
indexeddb = window.
indexeddb || window.moz
indexeddb || window.webkit
indexeddb || window.ms
indexeddb; // don't use "var
indexeddb = ..." if you're not in a function.
...And 3 more matches
IDBOpenDBRequest.onupgradeneeded - Web APIs
var request = window.
indexeddb.open("library", 3); // this event handles the event whereby a new version of the // database needs to be created.
... either one has not been created // before, or a new version number has been submitted via the // window.
indexeddb.open line above.
... var store = db.createobjectstore("books", {keypath: "isbn"}); var title
index = store.create
index("by_title", "title", {unique: true}); var author
index = store.create
index("by_author", "author"); } if (event.oldversion < 2) { // version 2 introduces a new
index of books by year.
...And 3 more matches
IDBRequest.transaction - Web APIs
if a version upgrade is needed when opening a database then during the upgradeneeded event handler the transaction property will be an idbtransaction with mode equal to "versionchange", and can be used to access existing object stores and
indexes, or abort the the upgrade.
...ansaction that originated this request is " + updatetitlerequest.transaction); // when this new request succeeds, run the displaydata() // function again to update the display updatetitlerequest.onsuccess = function() { displaydata(); }; }; this example shows how a the transaction property can be used during a version upgrade to access existing object stores:​ var openrequest =
indexeddb.open('db', 2); console.log(openrequest.transaction); // will log "null".
... db.createobjectstore('books'); } if (event.oldversion < 2) { // upgrading from v1 database: add
index on "title" to "books" store.
...And 3 more matches
Key Values - Web APIs
this has
index 0 among the colored keys.
...this has
index 1 among the colored keys.
...this has
index 2 among the colored keys.
...And 3 more matches
Array.prototype.reduceRight() - JavaScript
syntax arr.reduceright(callback(accumulator, currentvalue[,
index[, array]])[, initialvalue]) parameters callback function to execute on each value in the array, taking four arguments: accumulator the value previously returned in the last invocation of the callback, or initialvalue, if supplied.
...
indexoptional the
index of the current element being processed in the array.
... description reduceright executes the callback function once for each element present in the array, excluding holes in the array, receiving four arguments: the initial value (or value from the previous callback call), the value of the current element, the current
index, and the array over which iteration is occurring.
...And 3 more matches
Array.prototype.forEach() - JavaScript
syntax arr.foreach(callback(currentvalue [,
index [, array]])[, thisarg]) parameters callback function to execute on each element.
...
index optional the
index currentvalue in the array.
...it is not invoked for
index properties that have been deleted or are uninitialized.
...And 3 more matches
String.prototype.substr() - JavaScript
the substr() method returns a portion of the string, starting at the specified
index and extending for a given number of characters afterwards.
... syntax str.substr(start[, length]) parameters start the
index of the first character to include in the returned substring.
... description substr() extracts length characters from a str, counting from the start
index.
...And 3 more matches
TypedArray.prototype.find() - JavaScript
see also the find
index() method, which returns the
index of a found element in the typed array instead of its value.
...
index the
index of the current element being processed in the typed array.
...callback is invoked only for
indexes of the typed array which have assigned values; it is not invoked for
indexes which have been deleted or which have never been assigned values.
...And 3 more matches
TypedArray.prototype.slice() - JavaScript
syntax typedarray.slice([begin[, end]]) parameters begin optional zero-based
index at which to begin extraction.
... a negative
index can be used, indicating an offset from the end of the sequence.
... if begin is undefined, slice begins from
index 0.
...And 3 more matches
Caching compiled WebAssembly modules - WebAssembly
warning: experimental webassembly.module
indexeddb serialization support is being removed from browsers; see bug 1469395 and this spec issue.
... caching via
indexeddb
indexeddb is a transactional database system that allows you to store and retrieve structured data on the client-side.
... setting up a caching library because
indexeddb is a somewhat old-fashioned api, we wanted to provide a library function to speed up writing caching code, and make it work better along with today's more modern apis.
...And 3 more matches
Modules - Archive of obsolete content
any property defined on the global object will be accessible from both scripts: //
index.js: loadscript("www.foo.com/a.js"); foo; // => 3 // a.js: foo = 3; exporting names the script loader we obtained from the components object allows us load scripts from other locations, but its api is rather limited.
...this becomes a problem when two scripts try to define the same property: //
index.js: loadscript("www.foo.com/a.js"); loadscript("www.foo.com/b.js"); foo; // => 5 // a.js: foo = 3; // b.js: foo = 5; in the above example, the value of foo depends on the order in which the subscripts are loaded: there is no way to access the property foo defined by "a.js", since it is overwritten by "b.js".
...using this new version of loadscript, we can now rewrite our earlier example as follows: //
index.js: let a = loadscript("www.foo.com/a.js"); let b = loadscript("www.foo.com/b.js"); a.foo // => 3 b.foo; // => 5 // a.js: foo = 3; // b.js: foo = 5; importing names in addition to exporting properties from the script being loaded to the loading script, we can also import properties from the loading script to the script being loaded: function loadscript(url, imports) { let global = { ...
...And 2 more matches
Modifying a XUL Interface - Archive of obsolete content
the radiogroup's selected
index property may be used to do this.
... the selected
index property may be used to retrieve the
index of the selected radio button in the group and well as change it.
...example 7 : source view <script> function updatestate(){ var name = document.getelementbyid("name"); var s
index = document.getelementbyid("group").selected
index; name.disabled = s
index == 0; } </script> <radiogroup id="group" onselect="updatestate();"> <radio label="random name" selected="true"/> <hbox> <radio label="specify a name:"/> <textbox id="name" value="jim" disabled="true"/> </hbox> </radiogroup> in this example a function updatestate() is called whenever a select event is fired ...
...And 2 more matches
arrowscrollbox - Archive of obsolete content
attributes clicktoscroll, disabled, smoothscroll, tab
index properties disabled, scrollboxobject, scrollincrement, smoothscroll, tab
index methods ensureelementisvisible, scrollby
index, scrollbypixels examples <arrowscrollbox orient="vertical" flex="1"> <button label="red"/> <button label="blue"/> <button label="green"/> <button label="yellow"/> <button label="orange"/> <button label="silver"/> <button label="lavender"/> <but...
... tab
index type: integer the tab order of the element.
...elements with a higher tab
index are later in the tab sequence.
...And 2 more matches
deck - Archive of obsolete content
the selected
index attribute determines which child is displayed.
... attributes selected
index properties selected
index, selectedpanel examples <deck selected
index="2"> <description value="this is the first page"/> <button label="this is the second page"/> <box> <description value="this is the third page"/> <button label="this is also the third page"/> </box> </deck> attributes selected
index type: integer gets and sets the
index of the currently selected panel.
... the first item is at
index 0.
...And 2 more matches
listitem - Archive of obsolete content
attributes accesskey, checked, command, crop, current, disabled, image, label, preference, selected, tab
index, type, value properties accesskey, accessible, checked, control, crop, current, disabled, image, label, selected, tab
index, value style classes listitem-iconic examples <listbox id="thelist"> <listitem label="ruby"/> <listitem label="emerald"/> <listitem label="sapphire" selected="true"/> <listitem label="diamond"/> </listbox> attributes accesskey type: character...
...to change the selection, set either the selected
index or selecteditem property of the containing element.
... tab
index type: integer the tab order of the element.
...And 2 more matches
menu - Archive of obsolete content
attributes acceltext, accesskey, allowevents, command, crop, disabled, image, label, menuactive, open, sizetopopup, tab
index, value properties accessibletype, accesskey, command, control, crop, disabled, image, itemcount, label, labelelement, menupopup, open, parentcontainer, selected, tab
index, value methods appenditem, get
indexofitem, getitemat
index, insertitemat, removeitemat style classes menu-iconic example <menubar id="sample-menubar"> <menu id="file-menu" label="file"> <menupopup id="file-po...
... get
indexofitem( item ) return type: integer returns the zero-based position of the specified item.
... getitemat
index(
index ) return type: element returns the element that is at the specified
index.
...And 2 more matches
menuitem - Archive of obsolete content
attributes acceltext, accesskey, allowevents, autocheck, checked, closemenu, command, crop, description, disabled, image, key, label, name, selected, tab
index, type, validate, value properties accessibletype, accesskey, command, control, crop, disabled, image, label, labelelement, parentcontainer, selected, tab
index, value style classes menuitem-iconic, menuitem-non-iconic examples <menulist> <menupopup> <menuitem label="option 1" value="1"/> <menuitem label="option 2" value="2"/> <menuitem label="option 3" value="3"/> ...
...to change the selection, set either the selected
index or selecteditem property of the containing element.
... tab
index type: integer the tab order of the element.
...And 2 more matches
menuseparator - Archive of obsolete content
attributes acceltext, accesskey, allowevents, command, crop, disabled, image, label, selected, tab
index, value properties accessibletype, accesskey, command, control, crop, disabled, image, label, labelelement, parentcontainer, selected, tab
index, value examples <menu label="menu"> <menupopup> <menuitem label="item1"/> <menuseparator/> <menuitem label="item2"/> <menuitem label="item3"/> </menupopup> </menu> attributes acceltext type: string text that appears beside the menu label to indicate the shortcut k...
...to change the selection, set either the selected
index or selecteditem property of the containing element.
... tab
index type: integer the tab order of the element.
...And 2 more matches
radio - Archive of obsolete content
attributes accesskey, command, crop, disabled, focused, group, image, label, selected, tab
index, value properties accesskey, accessibletype, control, crop, disabled, image, label, radiogroup, selected, tab
index, value examples <radiogroup> <radio id="orange" label="red" accesskey="r"/> <radio id="violet" label="green" accesskey="g" selected="true"/> <radio id="yellow" label="blue" accesskey="b" disabled="true"/> </radiogroup> attributes accesskey type: characte...
...to change the selection, set either the selected
index or selecteditem property of the containing element.
... tab
index type: integer the tab order of the element.
...And 2 more matches
richlistitem - Archive of obsolete content
attributes disabled, searchlabel, selected, tab
index, value properties accessible, control, disabled, label, selected, tab
index, value examples (example needed) attributes disabled type: boolean indicates whether the element is disabled or not.
...to change the selection, set either the selected
index or selecteditem property of the containing element.
... tab
index type: integer the tab order of the element.
...And 2 more matches
tab - Archive of obsolete content
attributes accesskey, afterselected, beforeselected, command, crop, disabled, first-tab, image, label, last-tab, linkedpanel, oncommand, pending, pinned, selected, tab
index, unread, validate, value properties accesskey, accessibletype, command, control, crop, disabled, image, label, linkedpanel, selected, tab
index, value examples (example needed) attributes accesskey type: character this should be set to a character that is used as a shortcut key.
...if this attribute is not used, the tab will be connected to the panel at the corresponding
index in the tabpanels element that the tab is in its tabs container.
... tab
index type: integer the tab order of the element.
...And 2 more matches
Implementation Status - Archive of obsolete content
specification chapter
index here we give an overview of xforms 1.1 specification chapters and the current status of the mozilla support.
... 3.3.1 model supported 3.3.2 instance partial instance element with two child element does not trigger exception 337302; 3.3.3 submission partial no support for @indent and complex schema validation 278761; 278762; 3.3.4 bind partial using the
index() function in binds does not work.
... 7.6.2 is-card-number() unsupported 7.7.1 avg() supported 7.7.2 min() supported 7.7.3 max() supported 7.7.4 count-non-empty() supported 7.7.5
index() partial binds using
index() are not working 292333; 7.7.6 power() supported 7.7.7 random() supported 7.7.8 compare() supported 7.8.1 if() supported 7.8.2 property() partial ...
...And 2 more matches
CSS FAQ - Learn web development
how does z-
index relate to positioning?
... the z-
index property specifies the stack order of elements.
... an element with a higher z-
index/stack order is always rendered in front of an element with a lower z-
index/stack order on the screen.
...And 2 more matches
Example 4 - Learn web development
background : #f0f0f0; background : -webkit-linear-gradient(90deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); background : linear-gradient(0deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); } .select .value { display : inline-block; width : 100%; overflow : hidden; white-space : nowrap; text-overflow : ellipsis; vertical-align: top; } .select:after { content : "â–¼"; position: absolute; z-
index : 1; height : 100%; width : 2em; /* 20px */ top : 0; right : 0; padding-top : .1em; -moz-box-sizing : border-box; box-sizing : border-box; text-align : center; border-left : .2em solid #000; border-radius: 0 .1em .1em 0; background-color : #000; color : #fff; } .select .optlist { z-
index : 2; list-style: none; margin : 0; padding: 0; background:...
...tive'); }; function toggleoptlist(select, show) { var optlist = select.queryselector('.optlist'); optlist.classlist.toggle('hidden'); } function highlightoption(select, option) { var optionlist = select.queryselectorall('.option'); optionlist.foreach(function (other) { other.classlist.remove('highlight'); }); option.classlist.add('highlight'); }; function updatevalue(select,
index) { var nativewidget = select.previouselementsibling; var value = select.queryselector('.value'); var optionlist = select.queryselectorall('.option'); nativewidget.selected
index =
index; value.innerhtml = optionlist[
index].innerhtml; highlightoption(select, optionlist[
index]); }; function get
index(select) { var nativewidget = select.previouselementsibling; return nativewidget.se...
...lected
index; }; // ------------- // // event binding // // ------------- // window.addeventlistener("load", function () { var form = document.queryselector('form'); form.classlist.remove("no-widget"); form.classlist.add("widget"); }); window.addeventlistener('load', function () { var selectlist = document.queryselectorall('.select'); selectlist.foreach(function (select) { var optionlist = select.queryselectorall('.option'); optionlist.foreach(function (option) { option.addeventlistener('mouseover', function () { highlightoption(select, option); }); }); select.addeventlistener('click', function (event) { toggleoptlist(select); }); select.addeventlistener('focus', function (event) { activeselect(select, selectlist); });...
...And 2 more matches
Example 5 - Learn web development
background : #f0f0f0; background : -webkit-linear-gradient(90deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); background : linear-gradient(0deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); } .select .value { display : inline-block; width : 100%; overflow : hidden; white-space : nowrap; text-overflow : ellipsis; vertical-align: top; } .select:after { content : "â–¼"; position: absolute; z-
index : 1; height : 100%; width : 2em; /* 20px */ top : 0; right : 0; padding-top : .1em; -moz-box-sizing : border-box; box-sizing : border-box; text-align : center; border-left : .2em solid #000; border-radius: 0 .1em .1em 0; background-color : #000; color : #fff; } .select .optlist { z-
index : 2; list-style: none; margin : 0; padding: 0; background:...
...tive'); }; function toggleoptlist(select, show) { var optlist = select.queryselector('.optlist'); optlist.classlist.toggle('hidden'); } function highlightoption(select, option) { var optionlist = select.queryselectorall('.option'); optionlist.foreach(function (other) { other.classlist.remove('highlight'); }); option.classlist.add('highlight'); }; function updatevalue(select,
index) { var nativewidget = select.previouselementsibling; var value = select.queryselector('.value'); var optionlist = select.queryselectorall('.option'); optionlist.foreach(function (other) { other.setattribute('aria-selected', 'false'); }); optionlist[
index].setattribute('aria-selected', 'true'); nativewidget.selected
index =
index; value.innerhtml = optionlist[
index].innerhtml...
...; highlightoption(select, optionlist[
index]); }; function get
index(select) { var nativewidget = select.previouselementsibling; return nativewidget.selected
index; }; // ------------- // // event binding // // ------------- // window.addeventlistener("load", function () { var form = document.queryselector('form'); form.classlist.remove("no-widget"); form.classlist.add("widget"); }); window.addeventlistener('load', function () { var selectlist = document.queryselectorall('.select'); selectlist.foreach(function (select) { var optionlist = select.queryselectorall('.option'), selected
index = get
index(select); select.tab
index = 0; select.previouselementsibling.tab
index = -1; updatevalue(select, selected
index); optionlist.foreach(function (option, i...
...And 2 more matches
Accessibility in React - Learn web development
this isn't a problem — we can make any element programmatically focusable by adding the attribute tab
index="-1" to it.
...you can't press tab to focus on an element with a tab
index of -1 the same way you could do with a <button> or <a> element (this can be done using tab
index="0", but that's not really appropriate in this case).
... let's add the tab
index attribute — written as tab
index in jsx — to the heading above our list of tasks, along with our headingref: <h2 id="list-heading" tab
index="-1" ref={listheadingref}> {headingtext} </h2> note: the tab
index attribute is great for accessibility edge-cases, but you should take great care to not overuse it.
...And 2 more matches
TypeScript support in Svelte - Learn web development
ing) { todos = [...todos, { id: newtodoid, name, completed: false }] $alert = `todo '${name}' has been added` } function removetodo(todo: todotype) { todos = todos.filter(t => t.id !== todo.id) todosstatus.focus() // give focus to status heading $alert = `todo '${todo.name}' has been deleted` } function updatetodo(todo: todotype) { const i = todos.find
index(t => t.id === todo.id) if (todos[i].name !== todo.name) $alert = `todo '${todos[i].name}' has been renamed to '${todo.name}'` if (todos[i].completed !== todo.completed) $alert = `todo '${todos[i].name}' marked as ${todo.completed ?
...update the let headingel line with the following: let headingel: htmlelement finally, you'll notice the following error reported, related to where we set the tab
index attribute.
... that's because typescript is type-checking the <h2> element and expects tab
index to be of type number.
...And 2 more matches
Focus management with Vue refs - Learn web development
we also need to add a tab
index="-1" to it — this makes the element programmatically focusable (i.e.
... inside app.vue, update your <h2> as follows: <h2 id="list-summary" ref="listsummary" tab
index="-1">{{listsummary}}</h2> note: tab
index is a really powerful tool for handling certian accessibility problems.
...over-using tab
index="-1" can cause problems for all sorts of users, so only use it exactly where you need to.
...And 2 more matches
Command line crash course - Learn web development
now save the following code in a new file called
index.js, inside your test directory: const myobj = { a:1,b:{c:2}} function printme(obj){console.log(obj.b.c)} printme(myobj) we can run prettier against a codebase to just check if our code wants adjusting.
... cd into your directory, and try running this command: prettier --check
index.js you should get on output along the lines of checking formatting...
...
index.js code style issues found in the above file(s).
...And 2 more matches
Deploying our app - Learn web development
instead of running the server with npx parcel src/
index.html, we can run it with npx parcel build src/
index.html and parcel will build everything ready for production instead of just running it for development and testing purposes.
... "build": "parcel build src/
index.html" } note: if the scripts property already has a command inside it, put a comma at the end of it.
...src.99d8a31a.js.map 446.15 kb 63ms dist/src.99d8a31a.js 172.51 kb 5.55s dist/stars.7f1dd035.svg 6.31 kb 145ms dist/asteriod2.3ead4904.svg 3.51 kb 155ms dist/asteriod1.698d75e9.svg 2.9 kb 153ms dist/src.84f2edd1.css.map 2.57 kb 3ms dist/src.84f2edd1.css 1.25 kb 1.53s dist/bg.084d3fd3.svg 795 b 147ms dist/
index.html 354 b 944ms try it now!
...And 2 more matches
Accessibility API cross-reference
for an
index, use <
index> with a <l>(list) inside.
...the difference between these things are n/a internal_frame, option_pane, frame, directory_pane, root_pane, layered_pane, scroll_pane, viewport desktop_frame, directory_pane, frame, layered_pane, option_pane, root_pane, scroll_pane, viewport a window in an mdi applicaton internal_frame internal_frame, n/a invisible layer z-
indexed to the front, for temporary content.
... n/a n/a aria-colcount defines an element's column
index or position with respect to the total number of columns within a table, grid, or treegrid.
...And 2 more matches
Debugging Table Reflow
ell 3</td> <td>cell 4</td> </tr> </table> rendering: <colgroup><col><col width="50%"><col width="1*"><col></colgroup>cell 1cell 2cell 3cell 4 it will produce the following log at the entrance of assignnonpctcolwidths: assignnonpctcolwidths en max=4500 count=0 ***start table dump*** mcolwidths=-1 -1 -1 -1 col frame cache -> 0=00b93138 1=00b931f0 2=024dd728 3=024dd780 **start col dump** col
index=0 isanonymous=0 constraint=0 widths=-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 **end col dump** **start col dump** col
index=1 isanonymous=0 constraint=0 widths=-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 **end col dump** **start col dump** col
index=2 isanonymous=0 constraint=0 widths=-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 **end col dump** **start col dump** col
index=3 isanonymous=0 constraint=0 widths=-1 -1 -1 -1 -1 -...
...the
index of the column, whether it is anonymous and what kind of constrained has been appliedcol
index=0 isanonymous=0 constraint=0.
...leaving assignnonpctcolwidths shows that already to all columns a width of 360 twips has been assigned assignnonpctcolwidths ex ***start table dump*** mcolwidths=360 360 360 360 col frame cache -> 0=00b93138 1=00b931f0 2=024dd728 3=024dd780 **start col dump** col
index=0 isanonymous=0 constraint=0 widths=360 540 1230 -1 -1 -1 -1 -1 -1 360 **end col dump** **start col dump** col
index=1 isanonymous=0 constraint=0 widths=360 540 -1 -1 -1 -1 -1 -1 -1 360 **end col dump** **start col dump** col
index=2 isanonymous=0 constraint=3 widths=360 540 -1 -1 -1 -1 -1 -1 540 360 **end col dump** **start col dump** col
index=3 isanonymous=0 constraint=0 widths=360 ...
...And 2 more matches
Python binding for NSS
in other words they can be iterated over,
indexed by position, or used as slices.
... nss/nspr objects whose collection elements can be referenced by name support associative
indexing.
... hostentry objects now support iteration and
indexing of their networkaddress members.
...And 2 more matches
Property cache
non-adding cache entries {.kpc=pc, .kshape=kshape, .vshape()=vshape, .scope
index()=scope
index, .proto
index()=proto
index, .vword=vword} this type of entry is created for all instructions that use the property cache.
... when the operand to the instruction at pc is an object obj with shape kshape, let pobj = the object found by walking scope
index steps up the parent chain and then proto
index steps up the prototype chain.
...the jit handles situations where scope
index ≠ 0 or proto
index > 1 specially.
...And 2 more matches
JS_AliasElement
create an aliased
index entry for an existing numeric property of a native object.
...this name corresponds to a string representation of the element's current
index number.
... description js_aliaselement assigns an alternate
index number for an element or numeric property associated with a native object.
...And 2 more matches
JS_LookupElement
syntax bool js_lookupelement(jscontext *cx, js::handleobject obj, uint32_t
index, js::mutablehandlevalue vp); name type description cx jscontext * the context in which to look up the property.
...
index uint32_t the numeric id of the property to look up.
...on success, *vp receives the stored value of obj[
index], or undefined if the element does not exist.
...And 2 more matches
XForms Accessibility
u can try the following link to test xforms accessibility: visual xforms elements in xhtml document at bugzilla.mozilla.org visual xforms elements in xul document at bugzilla.mozilla.org you can see xforms sample tests at mozilla xforms project there are set of tests at beaufour.dk w3c's xforms test at w3.org keyboard navigation issues navigation sequence though xforms spec declares nav
index attribute to define the navigation sequence (see 1.0 specs or 1.1 specs) but rich schwerdtfeger (distinguished engineer, swg accessibility architect/strategist chair, ibm accessibility architecture review board) gave some clarification about nav
index.
... he wrote: nav
index was in xforms - it was stripped out as it was believed the focus model was dependent on the content which used it.
... so, yes we don't care about nav
index in xforms.
...And 2 more matches
Manipulating bookmarks using Places
for example, to create a new folder in the bookmarks menu: var menufolder = bmsvc.bookmarksmenufolder; // bookmarks menu folder var newfolderid = bmsvc.createfolder(menufolder, "folder name here", bmsvc.default_
index); this code locates the bookmarks menu's folder, then creates a new folder named "folder name here" in it.
... specifying default_
index as the
index at which to insert the new folder places it at the end of the list.
... var ios = components.classes["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice); var uri = ios.newuri("http://google.com/", null, null); var newbkmkid = bmsvc.insertbookmark(newfolderid, uri, bmsvc.default_
index, ""); this example instantiates the nsiioservice and uses it to create an nsiuri referring to the google web site, then calls nsinavbookmarksservice.insertbookmark() to create a new bookmark to google, placing it at the end of the bookmarks folder referenced by newbkmkid.
...And 2 more matches
GetChildAt
« nsiaccessible page summary this method returns nth accessible child using zero-based
index.
... nsiaccessible getchildat( in long achild
index ); parameters achild
index[in] the
index of the nth child.
... return value returns nth accessible child using zero-based
index.
...And 2 more matches
nsIAccessibleSelectable
inherits from: nsisupports last changed in gecko 1.7 method overview void addchildtoselection(in long
index); void clearselection(); nsiarray getselectedchildren(); boolean ischildselected(in long
index); nsiaccessible refselection(in long
index); void removechildfromselection(in long
index); boolean selectallselection(); attributes attribute type description selectioncount long the number of accessible children currently selected.
...void addchildtoselection( in long
index ); parameters
index the zero-based accessible child
index.
...boolean ischildselected( in long
index ); parameters
index the zero-based accessible child
index.
...And 2 more matches
nsILivemarkService
to use this service, use: var livemarkservice = components.classes["@mozilla.org/browser/livemark-service;2"] .getservice(components.interfaces.nsilivemarkservice); method overview long long createlivemark(in long long folder, in astring name, in nsiuri siteuri, in nsiuri feeduri, in long
index); long long createlivemarkfolderonly(in long long folder, in astring name, in nsiuri siteuri, in nsiuri feeduri, in long
index); nsiuri getfeeduri(in long long container); long long getlivemarkidforfeeduri(in nsiuri afeeduri); nsiuri getsiteuri(in long long container); boolean islivemark(in long long folder); void reloadalllivemarks(); ...
... long long createlivemark( in long long folder, in astring name, in nsiuri siteuri, in nsiuri feeduri, in long
index ); parameters folder the id of the parent folder.
...
index the
index to insert at, or -1 to append to the end of the list.
...And 2 more matches
nsIMsgThread
inherits from: nsisupports method overview void addchild(in nsimsgdbhdr child, in nsimsgdbhdr inreplyto, in boolean threadinthread, in nsidbchangeannouncer announcer); nsimsgdbhdr getchildat(in long
index); nsmsgkey getchildkeyat(in long
index); nsimsgdbhdr getchild(in nsmsgkey msgkey); nsimsgdbhdr getchildhdrat(in long
index); nsimsgdbhdr getroothdr(out long
index); void removechildat(in long
index); void removechildhdr(in nsimsgdbhdr child, in nsidbchangeannouncer announcer); void markchildread(in boolean bread); nsimsgdbhdr getfirstunreadchild(); nsisimpleenumerator enumeratemessages(in nsmsgkey parent); ...
... getchildat() returns the message at an
index.
... nsimsgdbhdr getchildat(in long
index); parameters
index the
index to get the message from getchildkeyat() nsmsgkey getchildkeyat(in long
index); parameters
index the
index to get the key from getchild() nsimsgdbhdr getchild(in nsmsgkey msgkey); parameters msgkey the
index to get the key from getchildhdrat() nsimsgdbhdr getchildhdrat(in long
index); parameters
index the
index to get the message from.
...And 2 more matches
nsIPromptService
return value
index of the button pressed prompt() shows a dialog with an edit field and an optional, labeled checkbox.
... aoutselection contains the
index of the selected item in the list when this method returns true.
... if you call this method from javascript, this argument is wrapped in an object with an attribute named 'value' which holds the selected
index.
...And 2 more matches
nsIRadioInterfaceLayer
to create an instance, use: var radiointerfacelayer = components.classes["@mozilla.org/telephony/system-worker-manager;1"] .getservice(components.interfaces.nsiinterfacerequestor) .createinstance(components.interfaces.nsiradiointerfacelayer); method overview void answercall(in unsigned long call
index); void deactivatedatacall(in domstring cid, in domstring reason); void dial(in domstring number); void enumeratecalls(in nsiriltelephonycallback callback); void getdatacalllist(); unsigned short getnumberofmessagesfortext(in domstring text); void hangup(in unsigned long call
index); void registercallback(in nsiriltelephonycallback callback); void registerdatacallcallback(in nsirild...
...atacallback callback); void rejectcall(in unsigned long call
index); void sendsms(in domstring number, in domstring message, in long requestid, in unsigned long long processid); void setupdatacall(in long radiotech, in domstring apn, in domstring user, in domstring passwd, in long chappap, in domstring pdptype); void starttone(in domstring dtmfchar); void stoptone(); void unregistercallback(in nsiriltelephonycallback callback); void unregisterdatacallcallback(in nsirildatacallback callback); attributes attribute type description currentstate jsval read only.
...e_held 7 call_state_resuming 8 call_state_disconnecting 9 call_state_disconnected 10 call_state_incoming 11 datacall_state_unknown 0 datacall_state_connecting 1 datacall_state_connected 2 datacall_state_disconnecting 3 datacall_state_disconnected 4 call_state_ringing 2 obsolete since gecko 14.0 methods answercall() void answercall( in unsigned long call
index ); parameters call
index missing description exceptions thrown missing exception missing description deactivatedatacall() void deactivatedatacall( in domstring cid, in domstring reason ); parameters cid missing description reason missing description exceptions thrown missing exception missing description dial() functionality for making and managing phone calls.
...And 2 more matches
Storage
similarly, the c++ looks like this: nscomptr<mozistoragestatement> statement; rv = dbconn->createstatement(ns_literal_cstring("select * from table_name where column_name = ?1"), getter_addrefs(statement)); ns_ensure_success(rv, rv); this example uses the numbered placeholder
indexed by zero for a parameter to be bound later (described in binding parameters).
... note: numerical
indexes for parameters are always one less than the number you write in the sql.
... the use of numerical
indexes for parameters is strongly discouraged in javascript where named parameters are much easier to use.
...And 2 more matches
DataTransfer.mozClearDataAt() - Web APIs
the datatransfer.mozcleardataat() method removes the data associated with the given format for an item at the specified
index.
... the
index must be in the range from zero to the number of items minus one.
... removing the last format for a particular
index removes that item entirely, shifting the remaining items down and changing their indices.
...And 2 more matches
DataTransfer.mozSetDataAt() - Web APIs
the datatransfer.mozsetdataat() method is used to add data to a specific
index in the drag event's data transfer object.
... a data transfer may store multiple items, each at a given zero-based
index.
... mozsetdataat() may only be called with an
index argument less than mozitemcount in which case an existing item is modified, or equal to mozitemcount in which case a new item is added, and the mozitemcount is incremented by one.
...And 2 more matches
HTMLSelectElement - Web APIs
htmlselectelement.selected
index a long reflecting the
index of the first selected <option> element.
...you can also access an item by specifying the
index in array-style brackets or parentheses, without calling this method explicitly.
... htmlselectelement.remove() removes the element at the specified
index from the options collection for this select element.
...And 2 more matches
HTMLTableElement - Web APIs
it inserts it in the rows collection immediately before the <tr> element at the given
index position.
...if the
index is -1, the new row is appended to the collection.
... if the
index is smaller than -1 or greater than the number of rows in the collection, a domexception with the value
indexsizeerror is raised.
...And 2 more matches
HTMLTableRowElement - Web APIs
htmltablerowelement.row
index read only returns a long value which gives the logical position of the row within the entire table.
... htmltablerowelement.sectionrow
index read only returns a long value which gives the logical position of the row within the table section it belongs to.
...if the given position is greater (or equal as it starts at zero) than the amount of cells in the row, or is smaller than 0, it raises a domexception with the
indexsizeerror value.
...And 2 more matches
IDBCursor.delete() - Web APIs
be aware that you can't call delete() (or idbcursor.update()) on cursors obtained from idb
index.openkeycursor().
... for such needs, you have to use idb
index.opencursor() instead.
... invalidstateerror the cursor was created using idb
index.openkeycursor, is currently being iterated, or has iterated past its end.
...And 2 more matches
IDBCursor.source - Web APIs
the source read-only property of the idbcursor interface returns the idbobjectstore or idb
index that the cursor is iterating over.
... syntax var source = cursor.source; value the idbobjectstore or idb
index that the cursor is iterating over.
...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: "albumtitle", name: "rushalbumlist"…} the cursor does not require us to select the data based on a key; we can just grab all of it.
...And 2 more matches
IDBCursor.update() - Web APIs
be aware that you can't call update() (or idbcursor.delete()) on cursors obtained from idb
index.openkeycursor().
... for such needs, you have to use idb
index.opencursor() instead.
... invalidstateerror the cursor was created using idb
index.openkeycursor, is currently being iterated, or has iterated past its end.
...And 2 more matches
IDBCursorSync - Web APIs
important: the synchronous version of the
indexeddb api was originally intended for use only with web workers, and was eventually removed from the spec because its need was questionable.
... the idbcursorsync interface of the
indexeddb api represents a cursor for iterating over multiple records in a database.
...operations are performed on the underlying
index or object store.
...And 2 more matches
IDBCursorWithValue - Web APIs
the idbcursorwithvalue interface of the
indexeddb api represents a cursor for traversing or iterating over multiple records in a database.
... the cursor has a source that indicates which
index or object store it is iterating over.
...operations are performed on the underlying
index or object store.
...And 2 more matches
IDBDatabase.createObjectStore() - Web APIs
the createobjectstore() method of the idbdatabase interface creates and returns a new object store or
index.
... example // let us open our database var request = window.
indexeddb.open("todolist", 4); // this handler is called when a new version of the database // is created, either when one has not been created before // or when a new version number is submitted by calling // window.
indexeddb.open().
...request.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: "tasktitle" }); // define what data items the objectstore will contain objectstore.create
index("hours", "hours", { unique: false }); objectstore.create
index("minutes", "minutes", { unique: false }); objectstore.create
index("day", "day", { unique: false }); objectstore.create
index("month", "month", { unique: false }); objectstore.create
index("year", "year", { unique: false }); objectstore.create
index("notified", "notified", { unique: false }); note.innerhtml += "<li>object sto...
...And 2 more matches
IDBDatabase.transaction() - Web APIs
if you need to open the object store in readwrite mode to change data, you would use the following: var transaction = db.transaction('my-store-name', "readwrite"); as of firefox 40,
indexeddb transactions have relaxed durability guarantees to increase performance (see bug 1112702), which is the same behaviour as other
indexeddb-supporting browsers.
...you're storing critical data that cannot be recomputed later) you can force a transaction to flush to disk before delivering the complete event by creating a transaction using the experimental (non-standard) readwriteflush mode (see idbdatabase.transaction.) this is currently experimental, and can only be used if the dom.
indexeddb.experimental pref is set to true in about:config.
...for a complete example, see our to-do notifications app (view example live.) var db; // let us open our database var dbopenrequest = window.
indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
...And 2 more matches
IDBDatabaseSync - Web APIs
important: the synchronous version of the
indexeddb api was originally intended for use only with web workers, and was eventually removed from the spec because its need was questionable.
... the databasesync interface in the
indexeddb api represents a synchronous connection to a database.
... removeobjectstore() destroys an object store with the given name, as well as all
indexes that reference that object store.
...And 2 more matches
IDBEnvironment - Web APIs
important: the
indexeddb property that was previously defined in this mixin is instead now windoworworkerglobalscope.
indexeddb (that is, defined as a member of the windoworworkerglobalscope mixin).
... the idbenvironment helper of the
indexeddb api contains the
indexeddb property, which provides access to
indexeddb functionality.
... it is the top level
indexeddb interface implemented by the window and worker objects.
...And 2 more matches
IDBFactory.cmp() - Web APIs
the cmp() method of the idbfactory interface compares two values as keys to determine equality and ordering for
indexeddb operations, such as storing and iterating.
... note: do not use this method for comparing arbitrary javascript values, because many javascript values are either not valid
indexeddb keys (booleans and objects, for example) or are treated as equivalent
indexeddb keys (for example, since
indexeddb ignores arrays with non-numeric properties and treats them as empty arrays, so any non-numeric arrays are treated as equivalent).
... syntax var result =
indexeddb.cmp(first, second); parameters first the first key to compare.
...And 2 more matches
IDBOpenDBRequest - Web APIs
the idbopendbrequest interface of the
indexeddb api provides access to the results of requests to open or delete databases (performed using idbfactory.open and idbfactory.deletedatabase), using specific event handler attributes.
...for a full working example, see our to-do notifications app (view example live.) var db; // let us open our database var dbopenrequest = window.
indexeddb.open("todolist", 4); // these event handlers act on the database being opened.
...this is used a lot below db = dbopenrequest.result; // run the displaydata() function to populate the task // listwith all the to-do list data already in the idb displaydata(); }; // this event handles the event whereby a new version of // the database needs to be created either one has not // been created before, or a new version 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: "tasktitle" }); // define what data items the obje...
...And 2 more matches
IDBRequest.source - Web APIs
the source read-only property of the idbrequest interface returns the source of the request, such as an
index or an object store.
... if no source exists (such as when calling
indexeddb.open), it returns null.
... syntax var idb
index = request.source; var idbcursor = request.source; var idbobjectstore = request.source; value an object representing the source of the request, such as an idb
index, idbobjectstore or idbcursor.
...And 2 more matches
IDBRequest - Web APIs
the idbrequest interface of the
indexeddb api provides access to results of asynchronous requests to databases and database objects using event handler attributes.
... idbrequest.source read only the source of the request, such as an idb
index or an idbobjectstore.
...for a full working example, see our to-do notifications app (view example live.) var db; // let us open our database var dbopenrequest = window.
indexeddb.open("todolist", 4); // these two event handlers act on the database being // opened successfully, or not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database.
...And 2 more matches
IDBTransaction: abort event - Web APIs
the abort event is fired when an
indexeddb transaction is aborted.
... bubbles yes cancelable no interface event event handler property onabort this can happen for any of the following reasons: bad requests, (for example, trying to add the same key twice, or put the same
index key when the key has a uniqueness constraint), an explicit abort() call an uncaught exception in the request's success/error handler, an i/o error (an actual failure to write to disk, for example disk detached, or other os/hardware failure) quota exceeded.
... // 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: 'tasktitle' }); // define what data items the objectstore will contain objectstore.create
index('hours', 'hours', { unique: false }); objectstore.create
index('minutes', 'minutes', { unique: false }); objectstore.create
index('day', 'day', { unique: false...
...And 2 more matches
IDBTransaction.oncomplete - Web APIs
as of firefox 40,
indexeddb transactions have relaxed durability guarantees to increase performance (see bug 1112702), which is the same behaviour as other
indexeddb-supporting browsers.
...you're storing critical data that cannot be recomputed later) you can force a transaction to flush to disk before delivering the complete event by creating a transaction using the experimental (non-standard) readwriteflush mode (see idbdatabase.transaction.) this is currently experimental, and can only be used if the dom.
indexeddb.experimental pref is set to true in about:config.
...for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.
indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
...And 2 more matches
IDBVersionChangeEvent - Web APIs
the idbversionchangeevent interface of the
indexeddb api indicates that the version of the database has changed, as the result of an idbopendbrequest.onupgradeneeded event handler function.
...window.
indexeddb = window.
indexeddb || window.moz
indexeddb || window.webkit
indexeddb || window.ms
indexeddb; // don't use "var
indexeddb = ..." if you're not in a function.
... you may need references to some window.idb* objects: window.idbtransaction = window.idbtransaction || window.webkitidbtransaction || window.msidbtransaction; window.idbkeyrange = window.idbkeyrange || window.webkitidbkeyrange || window.msidbkeyrange; // (mozilla has never prefixed these objects, so we don't need window.mozidb*) // let us open version 4 of our database var dbopenrequest = window.
indexeddb.open("todolist", 4); // these two event handlers act on the database being opened successfully, or not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
...And 2 more matches
Using Pointer Events - Web APIs
function handlemove(evt) { var el = document.getelementsbytagname("canvas")[0]; var ctx = el.getcontext("2d"); var color = colorfortouch(evt); var idx = ongoingtouch
indexbyid(evt.pointerid); log("continuing touch: idx = " + idx); if (idx >= 0) { ctx.beginpath(); log("ctx.moveto(" + ongoingtouches[idx].pagex + ", " + ongoingtouches[idx].pagey + ");"); ctx.moveto(ongoingtouches[idx].pagex, ongoingtouches[idx].pagey); log("ctx.lineto(" + evt.clientx + ", " + evt.clienty + ");"); ctx.lineto(evt.clientx, evt.clienty); ctx.linewidth = 4; ...
... function handleend(evt) { log("pointerup"); var el = document.getelementsbytagname("canvas")[0]; var ctx = el.getcontext("2d"); var color = colorfortouch(evt); var idx = ongoingtouch
indexbyid(evt.pointerid); if (idx >= 0) { ctx.linewidth = 4; ctx.fillstyle = color; ctx.beginpath(); ctx.moveto(ongoingtouches[idx].pagex, ongoingtouches[idx].pagey); ctx.lineto(evt.clientx, evt.clienty); ctx.fillrect(evt.clientx - 4, evt.clienty - 4, 8, 8); // and a square at the end ongoingtouches.splice(idx, 1); // remove it; we're done } else { log("can't figu...
... function handlecancel(evt) { log("pointercancel: id = " + evt.pointerid); var idx = ongoingtouch
indexbyid(evt.pointerid); ongoingtouches.splice(idx, 1); // remove it; we're done } since the idea is to immediately abort the touch, we simply remove it from the ongoing touch list without drawing a final line segment.
...And 2 more matches
Touch events - Web APIs
function handlemove(evt) { evt.preventdefault(); var el = document.getelementbyid("canvas"); var ctx = el.getcontext("2d"); var touches = evt.changedtouches; for (var i = 0; i < touches.length; i++) { var color = colorfortouch(touches[i]); var idx = ongoingtouch
indexbyid(touches[i].identifier); if (idx >= 0) { console.log("continuing touch "+idx); ctx.beginpath(); console.log("ctx.moveto(" + ongoingtouches[idx].pagex + ", " + ongoingtouches[idx].pagey + ");"); ctx.moveto(ongoingtouches[idx].pagex, ongoingtouches[idx].pagey); console.log("ctx.lineto(" + touches[i].pagex + ", " + touches[i].pagey + ");"); ctx.lineto(touc...
... function handleend(evt) { evt.preventdefault(); log("touchend"); var el = document.getelementbyid("canvas"); var ctx = el.getcontext("2d"); var touches = evt.changedtouches; for (var i = 0; i < touches.length; i++) { var color = colorfortouch(touches[i]); var idx = ongoingtouch
indexbyid(touches[i].identifier); if (idx >= 0) { ctx.linewidth = 4; ctx.fillstyle = color; ctx.beginpath(); ctx.moveto(ongoingtouches[idx].pagex, ongoingtouches[idx].pagey); ctx.lineto(touches[i].pagex, touches[i].pagey); ctx.fillrect(touches[i].pagex - 4, touches[i].pagey - 4, 8, 8); // and a square at the end ongoingtouches.splice(idx, 1); // remove i...
... function handlecancel(evt) { evt.preventdefault(); console.log("touchcancel."); var touches = evt.changedtouches; for (var i = 0; i < touches.length; i++) { var idx = ongoingtouch
indexbyid(touches[i].identifier); ongoingtouches.splice(idx, 1); // remove it; we're done } } since the idea is to immediately abort the touch, we simply remove it from the ongoing touch list without drawing a final line segment.
...And 2 more matches
WebGL2RenderingContext - Web APIs
state information webgl2renderingcontext.get
indexedparameter() returns the
indexed value for the given target.
... uniform buffer objects webgl2renderingcontext.bindbufferbase() binds a given webglbuffer to a given binding point (target) at a given
index.
... webgl2renderingcontext.bindbufferrange() binds a range of a given webglbuffer to a given binding point (target) at a given
index.
...And 2 more matches
WebGLRenderingContext.getVertexAttrib() - Web APIs
syntax any gl.getvertexattrib(
index, pname); parameters
index a gluint specifying the
index of the vertex attribute.
... gl.vertex_attrib_array_enabled: returns a glboolean that is true if the vertex attribute is enabled at this
index.
... gl.vertex_attrib_array_normalized: returns a glboolean that is true if fixed-point data types are normalized for the vertex attribute array at the given
index.
...And 2 more matches
Web APIs
ent light eventsbbackground tasksbattery api beaconbluetooth apibroadcast channel apiccss counter stylescss font loading api cssomcanvas apichannel messaging apiconsole apicredential management apiddomeencoding apiencrypted media extensionsffetch apifile system api frame timing apifullscreen apiggamepad api geolocation apihhtml drag and drop apihigh resolution timehistory apiiimage capture api
indexeddbintersection observer apillong tasks api mmedia capabilities api media capture and streamsmedia session apimedia source extensions mediastream recordingnnavigation timingnetwork information api ppage visibility apipayment request apiperformance apiperformance timeline apipermissions apipointer eventspointer lock apiproximity events push api rresize observer apiresource timing apisserver ...
...e cache cachestorage canvascapturemediastreamtrack canvasgradient canvasimagesource canvaspattern canvasrenderingcontext2d caretposition channelmergernode channelsplitternode characterdata childnode client clients clipboard clipboardevent clipboarditem closeevent comment compositionevent constantsourcenode constrainboolean constraindomstring constraindouble constrainulong content
index content
indexevent convolvernode countqueuingstrategy crashreportbody credential credentialscontainer crypto cryptokey cryptokeypair customelementregistry customevent d domconfiguration domerror domexception domhighrestimestamp domimplementation domimplementationlist domlocator dommatrix dommatrixreadonly domobject domparser dompoint dompointinit dompointreadonly domquad d...
...ldlistelement htmldataelement htmldatalistelement htmldetailselement htmldialogelement htmldivelement htmldocument htmlelement htmlembedelement htmlfieldsetelement htmlfontelement htmlformcontrolscollection htmlformelement htmlframesetelement htmlhrelement htmlheadelement htmlheadingelement htmlhtmlelement htmlhyperlinkelementutils htmliframeelement htmlimageelement htmlinputelement htmlis
indexelement htmlkeygenelement htmllielement htmllabelelement htmllegendelement htmllinkelement htmlmapelement htmlmarqueeelement htmlmediaelement htmlmenuelement htmlmenuitemelement htmlmetaelement htmlmeterelement htmlmodelement htmlolistelement htmlobjectelement htmloptgroupelement htmloptionelement htmloptionscollection htmlorforeignelement htmloutputelement htmlparagraphelement htmlparamel...
...And 2 more matches
ARIA: document role - Accessibility
<div id="infotext" role="document" tab
index="0"> <p>some informational text goes here.</p> </div> ...
...adding role="document" and tab
index="0" to the element containing the text within a widget enables the screen reader user to press the tab key to place focus on the document element and read the text with the screen reader's reading cursor.
... tab
index="0" used to make it focusable so the assistive technology user can tab to it and start reading right away.
...And 2 more matches
ARIA: gridcell role - Accessibility
use aria-col
index to describe a gridcell's order in the list of columns, and aria-row
index to describe a gridcell's order in the list of rows.
...aria-col
index is being used to describe the rows' position and allows a person using assistive technology to infer that certain rows have been removed: <div role="grid" aria-colcount="6"> <div role="rowgroup"> <div role="row"> <div role="columnheader" aria-col
index="1">first name</div> <div role="columnheader" aria-col
index="2">last name</div> <div role="columnheader" aria-col
index="5">city</div> <div role="columnheader" aria-col
index="6">zip</div> </div> </div> <div role="rowgroup"> <div role="row">...
... <div role="gridcell" aria-col
index="1">debra</div> <div role="gridcell" aria-col
index="2">burks</div> <div role="gridcell" aria-col
index="5">new york</div> <div role="gridcell" aria-col
index="6">14127</div> </div> </div> … </div> describing the position of gridcells when the overall structure is unknown in situations where the table-style grouping of content does not provide information about the columns and rows, gridcells must have their positions programatically described by using aria-describedby.
...And 2 more matches
ARIA: button role - Accessibility
<div id="savechanges" tab
index="0" role="button" aria-pressed="false">save</div> the above example creates a simple button which is first in the focus order, though <button> or <input> with type="button" should be used for buttons: <button id="savechanges">save</button> note: if using role="button" instead of the semantic <button> or <input type="button"> elements, you will need to make the element focusable and have to define event handlers for click and keydown events, including the enter and space key...
...because a <span> element is used, the tab
index attribute is required to make the button focusable and part of the page's tab order.
... html <h1>aria button example</h1> <ul id="namelist"></ul> <label for="newname">enter your name: </label> <input type="text" id="newname"> <span role="button" tab
index="0" onclick="handlecommand()" onkeydown="handlecommand()">add name</span> css [role="button"] { padding: 2px; background-color: navy; color: white; cursor: default; } [role="button"]:hover, [role="button"]:focus, [role="button"]:active { background-color: white; color: navy; } ul { list-style: none; } javascript function handlecommand(event) { // handles both mouse cl...
...And 2 more matches
Basic Concepts of grid layout - CSS: Cascading Style Sheets
this layering may then be controlled with the z-
index property.
... .box1 { grid-column-start: 1; grid-column-end: 4; grid-row-start: 1; grid-row-end: 3; display: grid; grid-template-columns: subgrid; } layering items with z-
index grid items can occupy the same cell.
... controlling the order we can control the order in which items stack up by using the z-
index property - just like positioned items.
...And 2 more matches
Setting up adaptive streaming media sources - Developer guides
ge requests efficiently your server cannot prefetch range requests efficiently the sidx* is large and having to load it first slows down startup a little you want to use the original files for both dash and other forms of delivery (such as microsoft smooth streaming) as a transition strategy you can use the same media files for both live transmission and vod at a later stage *sidx or segment
indexbox is a structure describing a segment by giving its earliest presentation time and other meta-data and can often make up a large portion of the mpd file.
... the stream segmenter — provided by apple for mac platforms — takes a media stream from a local network and splits media into equally sized media files together with an
index file.
... apple also provides a file segmenter for mac — which takes a suitably encoded file, splits it up and produces a
index file, in a similar fashion to the stream segmenter.
...And 2 more matches
Global attributes - HTML: Hypertext Markup Language
tab
index an integer attribute indicating if the element can take input focus (is focusable), if it should participate to sequential keyboard navigation, and if so, at what position.
...t be reachable via sequential keyboard navigation; 0 means that the element should be focusable and reachable via sequential keyboard 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 tab
index.
... if several elements share the same tab
index, their relative order follows their relative positions in the document.
...And 2 more matches
Array.prototype.copyWithin() - JavaScript
syntax arr.copywithin(target[, start[, end]]) parameters target zero-based
index at which to copy the sequence to.
... start optional zero-based
index at which to start copying elements from.
... if start is omitted, copywithin will copy from
index 0.
...And 2 more matches
Array.prototype.splice() - JavaScript
syntax let arrdeleteditems = array.splice(start[, deletecount[, item1[, item2[, ...]]]]) parameters start the
index at which to start changing the array.
...(in this case, the origin -1, meaning -n is the
index of the nth last element, and is therefore equivalent to the
index of array.length - n.) if array.length + start is less than 0, it will begin from
index 0.
... examples remove 0 (zero) elements before
index 2, and insert "drum" let myfish = ['angel', 'clown', 'mandarin', 'sturgeon'] let removed = myfish.splice(2, 0, 'drum') // myfish is ["angel", "clown", "drum", "mandarin", "sturgeon"] // removed is [], no elements removed remove 0 (zero) elements before
index 2, and insert "drum" and "guitar" let myfish = ['angel', 'clown', 'mandarin', 'sturgeon'] let removed = myfish.splice(2, 0, 'drum', 'gui...
...And 2 more matches
RegExp - JavaScript
regexp.last
index the
index at which to start the next match.
... regexp.prototype[@@search]() searches the match in given string and returns the
index the pattern found in the string.
... using regular expression on multiple lines let s = 'please yes\nmake my day!' s.match(/yes.*day/); // returns null s.match(/yes[^]*day/); // returns ["yes\nmake my day"] using a regular expression with the sticky flag the sticky flag indicates that the regular expression performs sticky matching in the target string by attempting to match starting at regexp.prototype.last
index.
...And 2 more matches
String.prototype.matchAll() - JavaScript
examples regexp.exec() and matchall() prior to the addition of matchall to javascript, it was possible to use calls to regexp.exec (and regexes with the /g flag) in a loop to obtain all the matches: const regexp = regexp('foo[a-z]*','g'); const str = 'table football, foosball'; let match; while ((match = regexp.exec(str)) !== null) { console.log(`found ${match[0]} start=${match.
index} end=${regexp.last
index}.`); // expected output: "found football start=6 end=14." // expected output: "found foosball start=16 end=24." } with matchall available, you can avoid the while loop and exec with g.
... instead, by using matchall, you get an iterator to use with the more convenient for...of, array spread, or array.from() constructs: const regexp = regexp('foo[a-z]*','g'); const str = 'table football, foosball'; const matches = str.matchall(regexp); for (const match of matches) { console.log(`found ${match[0]} start=${match.
index} end=${match.
index + match[0].length}.`); } // expected output: "found football start=6 end=14." // expected output: "found foosball start=16 end=24." // matches iterator is exhausted after the for..of iteration // call matchall again to create a new iterator array.from(str.matchall(regexp), m => m[0]); // array [ "football", "foosball" ] matchall will throw an exception if the g flag is missing.
... const regexp = regexp('[a-c]',''); const str = 'abc'; str.matchall(regexp); // typeerror matchall internally makes a clone of the regexp—so, unlike regexp.exec(), last
index does not change as the string is scanned.
...And 2 more matches
Iteration protocols - JavaScript
using one is likely to result in runtime errors or buggy behavior: let nonwellformediterable = {}; nonwellformediterable[symbol.iterator] = () => 1; [...nonwellformediterable]; // typeerror: [] is not a function iterator examples simple iterator function makeiterator(array) { let next
index = 0 return { next: function() { return next
index < array.length ?
... { value: array[next
index++], done: false } : { done: true }; } }; } let it = makeiterator(['yo', 'ya']); console.log(it.next().value); // 'yo' console.log(it.next().value); // 'ya' console.log(it.next().done); // true infinite iterator function idmaker() { let
index = 0; return { next: function() { return { value:
index++, done: false }; } }; } let it = idmaker(); console.log(it.next().value); // '0' console.log(it.next().value); // '1' console.log(it.next().value); // '2' // ...
... with a generator function* makesimplegenerator(array) { let next
index = 0; while (next
index < array.length) { yield array[next
index++]; } } let gen = makesimplegenerator(['yo', 'ya']); console.log(gen.next().value); // 'yo' console.log(gen.next().value); // 'ya' console.log(gen.next().done); // true function* idmaker() { let
index = 0; while (true) { yield
index++; } } let gen = idmaker() console.log(gen.next().value); // '0' console.log(gen.next().value); // '1' console.log(gen.next().value); // '2' // ...
...And 2 more matches
for...in - JavaScript
objects created from built–in constructors like array and object have inherited non–enumerable properties from object.prototype and string.prototype, such as string's
indexof() method or object's tostring() method.
... array iteration and for...in note: for...in should not be used to iterate over an array where the
index order is important.
... array
indexes are just enumerable properties with integer names and are otherwise identical to general object properties.
...And 2 more matches
Add to Home screen - Progressive web apps (PWAs)
note that this has to be a relative url pointing to the site
index, relative to the url of the manifest.
...hey, at least it isn't cats.", "display": "fullscreen", "icons": [ { "src": "icon/fox-icon.png", "sizes": "192x192", "type": "image/png" } ], "name": "awesome fox pictures", "short_name": "foxes", "start_url": "/pwa-examples/a2hs/
index.html" } appropriate icon as shown in the above manifest listing, we are including a 192 x 192 px icon for use in our app.
...to make your app work offline, you have to use the service worker api to handle storing the assets offline, and if required, web storage or
indexeddb to store its data.
...And 2 more matches
SDK API Lifecycle - Archive of obsolete content
it has two main components: a stability
index that defines how stable each module is a deprecation process that defines when and how stable sdk apis can be changed or removed from future versions of the sdk while giving developers enough time to update their code.
... stability
index the stability
index is adopted from node.js.
... the stability
index for each module is written into that module’s metadata structure, and is displayed at the top of each module's documentation page.
... deprecation process deprecation in the chosen release, the sdk team will communicate the module's deprecation: update the module's stability
index to be "deprecated" include a deprecation notice in the release notes, the add-ons blog, and the jetpack google group.
Unit Testing - Archive of obsolete content
to show the module in use, edit the "
index.js" file as follows: var base64 = require("./base64"); var button = require("sdk/ui/button/action").actionbutton({ id: "base64", label: "base64", icon: "./icon-16.png", onclick: function() { encoded = base64.btoa("hello"); console.log(encoded); decoded = base64.atob(encoded); console.log(decoded); } }); to run this example you'll also have to have an icon file named "...
... now "
index.js" imports the base64 module and calls its two exported functions.
... if we run the add-on and click the button, we should see the following logging output: info: agvsbg8= info: hello testing the base64 module navigate to the add-on's test directory and delete the test-
index.js file.
... at this point your add-on ought to look like this: /base64 /data icon-16.png package.json readme.md
index.js base64.js /test test-base64.js now execute jpm --verbose test from the add-on's root directory.
Forms related code snippets - Archive of obsolete content
dchild(odecrmonth); ocapt.appendchild(oincryear); ocapt.appendchild(oincrmonth); ocapt.appendchild(this.display); this.container.appendchild(ocapt); this.container.appendchild(othead); this.current.setdate(1); this.writedays(); otarget.onclick = function () { if (otable.parentnode) { otable.parentnode.removechild(otable); return; } otable.style.z
index = nz
index++; otable.style.position = "absolute"; otable.style.left = otarget.offsetleft + "px"; otable.style.top = (otarget.offsettop + otarget.offsetheight) + "px"; otarget.parentnode.insertbefore(otable, otarget); }; ainstances.push(this); } datepicker.prototype.writedays = function () { const nendblanks = (this.current.getday() + bzeroismonday...
...st oevt = opssevt || /* ie */ window.event; var boutside = true; for (var onode = oevt.target || /* ie */ oevt.srcelement; onode; onode = onode.parentnode) { if (onode.classname === sprefs + "-calendar" || onode.classname === sdpclass) { boutside = false; break; } } if (boutside) { return; } ainstances[onode.id.replace(rbgnnan, "")].container.style.z
index = nz
index++; } function onheadclick () { const bismonth = rmonth.test(this.id), ndelta = rdecrease.test(this.id) ?
... "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"], sdays = ["m", "t", "w", "t", "f", "s", "s"], bzeroismonday = true, /* internal usage */ ainstances = [], amonthlengths = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], rbgnnan = /^\d+/, rbgnandend = /^\d+|\d+\d+$/g, rmonth = /\-month\-/, rdecrease = /\-decr\-/; var /* customizable by user */ nz
index = 1000; window.addeventlistener ?
... this date-picker code snippet will automatically create an html code like the following: <table id="zdp-cal-1" class="zdp-calendar" style="z-
index: 1026; position: absolute; left: 294px; top: 47px;"> <caption><span id="zdp-decr-year-1" class="zdp-decrease-year">«</span><span id="zdp-decr-month-1" class="zdp-decrease-month"><</span><span id="zdp-incr-year-1" class="zdp-increase-year">»</span><span id="zdp-incr-month-1" class="zdp-increase-month">></span> <span class="zdp-current-month">aug 1998</span> </caption> <...
CSS3 - Archive of obsolete content
allow the styling of forms according their content using the css :indeterminate, :default, :valid, :invalid, :in-range, :out-of-range, :required, :optional, :read-only, and :read-write pseudo-classes and the ::value, ::choices, ::repeat-item, and ::repeat-
index pseudo-elements.
... at risk: due to insufficient browser support, standardization of the pseudo-elements ::value, ::choices, ::repeat-item, and ::repeat-
index may be postponed to the next iteration of this module .
... the ability to specify the sequential navigation order (that is the tabbing order ) using the css nav-
index, nav-up, nav-right, nav-left, nav-down properties.
... filter effects module level 1 working draft css generated content for paged media module working draft adds the ability to tailor printed version of a document by allowing to control header, footer but also references tables like
indexes or tables of content.
enumKeys - Archive of obsolete content
method of winreg object syntax string enumkeys ( string key, int subkey
index ); parameters the enumkeys method has the following parameters: key the key path to the appropriate location in the key hierarchy, such as "software\\netscape\\navigator\\mail".
... subkey
index an integer representing the 0-based
index of the subkey being sought.
...var winreg = getwinregistry(); winreg.setrootkey(winreg.hkey_local_machine); var
index = 0; var basekey = "software\\mozilla"; while ( (mozillaversion = winreg.enumkeys(basekey,
index)) != null ) { logcomment("mozillaversion = " + mozillaversion); subkey = basekey + "\\" + mozillaversion + "\\extensions"; pluginsdir = winreg.getvaluestring ( subkey, "plugins" ); if ( pluginsdir ) logcomment("pluginsdir = " + pluginsdir); else logcomment("no plugins dir for " + basekey + "\\" +...
... mozillaversion);
index++; } ...
Focus and Selection - Archive of obsolete content
rearranging the tab order you can change the order in which elements are focused when the user presses the tab key by adding a tab
index attribute to an element.
...when the user presses tab, the focus will shift to the element with the next highest tab
index.
...usually, however, you would not set the tab
index attribute.
...here is an example: example 1 : source view <button label="button 1" tab
index="2"/> <button label="button 2" tab
index="1"/> <button label="button 3" tab
index="3"/> the focus event the focus event is used to respond when the focus is given to an element.
Stacks and Decks - Archive of obsolete content
the displayed page of the deck can be changed by setting an selected
index attribute on the deck element.
... the
index is a number that identifies which page to display.
... example 3 : source view <deck selected
index="2"> <description value="this is the first page"/> <button label="this is the second page"/> <box> <description value="this is the third page"/> <button label="this is also the third page"/> </box> </deck> three pages exist here, the default being the third one.
... you can switch pages by using a script to modify the selected
index attribute.
button - Archive of obsolete content
attributes accesskey, autocheck, checkstate, checked, command, crop, dir, disabled, dlgtype, group, icon, image, label, open, orient, tab
index, type properties accesskey, accessibletype, autocheck, checkstate, checked, command, crop, dir, disabled, dlgtype, group, image, label, open, orient, tab
index, type examples <button label="press me" oncommand="alert('you pressed me!');"/> attributes accesskey type: character this should be set to a character that is used as a shortcut key.
... tab
index type: integer the tab order of the element.
...elements with a higher tab
index are later in the tab sequence.
... tab
index type: integer gets and sets the value of the tab
index attribute.
caption - Archive of obsolete content
attributes accesskey, crop, image, label, tab
index properties accesskey, crop, image, label, tab
index examples <groupbox> <caption label="my groupbox"/> </groupbox> <groupbox flex="1"> <caption> <checkbox label="a checked groupbox"/> </caption> </groupbox> attributes accesskey type: character this should be set to a character that is used as a shortcut key.
... tab
index type: integer the tab order of the element.
...elements with a higher tab
index are later in the tab sequence.
... tab
index type: integer gets and sets the value of the tab
index attribute.
checkbox - Archive of obsolete content
attributes accesskey, checked, command, crop, disabled, src, label, preference, tab
index properties accesskey, accessibletype, checked, command, crop, disabled, src, label, tab
index examples <checkbox label="enable javascript" checked="true"/> <checkbox label="enable java" checked="false"/> attributes accesskey type: character this should be set to a character that is used as a shortcut key.
... tab
index type: integer the tab order of the element.
...elements with a higher tab
index are later in the tab sequence.
... tab
index type: integer gets and sets the value of the tab
index attribute.
colorpicker - Archive of obsolete content
attributes disabled, color, onchange, preference, tab
index, type properties accessibletype, color, disabled, open, tab
index, value examples <colorpicker/> attributes disabled type: boolean indicates whether the element is disabled or not.
... tab
index type: integer the tab order of the element.
...elements with a higher tab
index are later in the tab sequence.
... tab
index type: integer gets and sets the value of the tab
index attribute.
datepicker - Archive of obsolete content
attributes disabled, firstdayofweek, readonly, type, tab
index, value properties date, dateleadingzero, datevalue, disabled, month, monthleadingzero, open, readonly, tab
index, value, year, yearleadingzero examples <datepicker type="grid" value="2007-03-26"/> attributes disabled type: boolean indicates whether the element is disabled or not.
... tab
index type: integer the tab order of the element.
...elements with a higher tab
index are later in the tab sequence.
... tab
index type: integer gets and sets the value of the tab
index attribute.
description - Archive of obsolete content
attributes crop, disabled, tab
index value properties accessibletype, crop, disabled, tab
index, value style classes header, indent, monospace, plain, small-margin examples this is a long section of text that will word wrap when displayed <description> this is a long section of text that will word wrap when displayed.
... tab
index type: integer the tab order of the element.
...elements with a higher tab
index are later in the tab sequence.
... tab
index type: integer gets and sets the value of the tab
index attribute.
preference - Archive of obsolete content
attributes disabled, instantapply, inverted, name, onchange, readonly, tab
index, type properties defaultvalue, disabled, hasuservalue, inverted, locked, name, preferences, readonly, tab
index, type, value, valuefrompreferences methods reset examples <preferences> <preference id="pref_id" name="preference.name" type="int"/> </preferences> see preferences system for a complete example.
... tab
index type: integer the tab order of the element.
...elements with a higher tab
index are later in the tab sequence.
... tab
index type: integer gets and sets the value of the tab
index attribute.
scale - Archive of obsolete content
attributes dir, disabled, increment, max, min, movetoclick, pageincrement, tab
index, value properties disabled, max, min, increment, pageincrement, tab
index, value, methods decrease, decreasepage, increase, increasepage, examples horizontal scale: <scale min="1" max="10"/> vertical scale: <scale min="1" max="10" orient="vertical"/> attributes dir type: one of the values below the direction in which the child elements of the element are placed.
... tab
index type: integer the tab order of the element.
...elements with a higher tab
index are later in the tab sequence.
... tab
index type: integer gets and sets the value of the tab
index attribute.
tabpanels - Archive of obsolete content
attributes selected
index properties selected
index, selectedpanel examples (example needed) attributes selected
index type: integer gets and sets the
index of the currently selected panel.
... the first item is at
index 0.
... selected
index type: integer returns the
index of the currently selected item.
... you may select an item by assigning its
index to this property.
timepicker - Archive of obsolete content
attributes disabled, hideseconds, increment, readonly, tab
index, value properties amindicator, datevalue, disabled, hideseconds, hour, hourleadingzero, increment, is24hourclock, ispm, minute, minuteleadingzero, pmindicator, readonly, second, secondleadingzero, tab
index, value examples <timepicker value="12:05"/> attributes disabled type: boolean indicates whether the element is disabled or not.
... tab
index type: integer the tab order of the element.
...elements with a higher tab
index are later in the tab sequence.
... tab
index type: integer gets and sets the value of the tab
index attribute.
toolbarbutton - Archive of obsolete content
attributes accesskey, autocheck, checkstate, checked, command, crop, dir, disabled, dlgtype, group, image, label, oncommand, open, orient, tab
index, title, type, validate properties accesskey, accessibletype, autocheck, checkstate, checked, command, crop, dir, disabled, dlgtype, group, image, label, open, orient, tab
index, type examples <toolbar id="test-toolbar"> <toolbarbutton accesskey="p" label="plain"/> <toolbarbutton accesskey="c" label="checkbox" type="checkbox"/> <toolbarbutton accesskey="b" label="menu-button" ty...
... tab
index type: integer the tab order of the element.
...elements with a higher tab
index are later in the tab sequence.
... tab
index type: integer gets and sets the value of the tab
index attribute.
Array.observe() - Archive of obsolete content
index: only for the "splice" type.
... the
index at which the change occurred.
...
index assignment changes which do not change the length of the array may be reported as "update" changes.
... examples logging different change types var arr = ['a', 'b', 'c']; array.observe(arr, function(changes) { console.log(changes); }); arr[1] = 'b'; // [{type: 'update', object: <arr>, name: '1', oldvalue: 'b'}] arr[3] = 'd'; // [{type: 'splice', object: <arr>,
index: 3, removed: [], addedcount: 1}] arr.splice(1, 2, 'beta', 'gamma', 'delta'); // [{type: 'splice', object: <arr>,
index: 1, removed: ['b', 'c'], addedcount: 3}] specifications strawman proposal specification.
JSObject - Archive of obsolete content
equivalent to "this[
index]" in javascript.
... declaration public object getslot(int
index) getwindow static method.
...equivalent to "this[
index] = value" in javascript.
... declaration public void setslot(int
index, object value) tostring method.
Square tilemaps implementation: Static maps - Game development
gettile(): a helper method that gets the tile
index in a certain position.
...0 for the left-most tile.) however, we must account for empty tiles, since they are crucial for implementing layers — empty tiles are usually assigned a negative
index value, 0, or a null value.
... in these examples, empty tiles will be represented by
index 0, so we will shift the indices of the atlases by one (and thus the first tile of the atlas will be assigned
index 1, the second
index 2, etc.) the gettile() helper method returns the tile contained at the specified column and row.
...in this case, we need to map the column and row to an array
index: var
index = row * map.cols + column; wrapping up, an example of a tilemap object could look like the following.
HTML: A good basis for accessibility - Learn web development
here we've given our fake <div> buttons the ability to be focused (including via tab) by giving each one the attribute tab
index="0": <div data-message="this is from the first button" tab
index="0">click me!</div> <div data-message="this is from the second button" tab
index="0">click me too!</div> <div data-message="this is from the third button" tab
index="0">and me!</div> basically, the tab
index attribute is primarily intended to allow tabbable elements to have a custom tab order (specified in positive numerical order), i...
...there are two other options for tab
index: tab
index="0" — as indicated above, this value allows elements that are not normally tabbable to become tabbable.
... this is the most useful value of tab
index.
... tab
index="-1" — this allows not normally tabbable elements to receive focus programmatically, e.g., via javascript, or as the target of links.
HTML: A good basis for accessibility - Learn web development
here we've given our fake <div> buttons the ability to be focused (including via tab) by giving each one the attribute tab
index="0": <div data-message="this is from the first button" tab
index="0">click me!</div> <div data-message="this is from the second button" tab
index="0">click me too!</div> <div data-message="this is from the third button" tab
index="0">and me!</div> basically, the tab
index attribute is primarily intended to allow tabbable elements to have a custom tab order (specified in positive numerical order), i...
...there are two other options for tab
index: tab
index="0" — as indicated above, this value allows elements that are not normally tabbable to become tabbable.
... this is the most useful value of tab
index.
... tab
index="-1" — this allows not normally tabbable elements to receive focus programmatically, e.g., via javascript, or as the target of links.
JavaScript basics - Learn web development
in your
index.html file, enter this code on a new line, just before the closing </body> tag: <script src="scripts/main.js"></script> this is doing the same job as the <link> element for css.
...then load
index.html in your browser.
...javascript from the earlier exercise.) let myimage = document.queryselector('img'); myimage.onclick = function() { let mysrc = myimage.getattribute('src'); if(mysrc === 'images/firefox-icon.png') { myimage.setattribute('src','images/firefox2.png'); } else { myimage.setattribute('src','images/firefox-icon.png'); } } save all files and load
index.html in the browser.
... in
index.html, add the following line just before the <script> element: <button>change user</button> in main.js, place the following code at the bottom of the file, exactly as it is written.
Video and Audio APIs - Learn web development
exploring the html open the html
index file.
... last but not least, let's look at the css for the timer: .timer { line-height: 38px; font-size: 10px; font-family: monospace; text-shadow: 1px 1px 0px black; color: white; flex: 5; position: relative; } .timer div { position: absolute; background-color: rgba(255,255,255,0.2); left: 0; top: 0; width: 0; height: 38px; z-
index: 2; } .timer span { position: absolute; z-
index: 3; left: 19px; } we set the outer .timer <div> to have flex: 5, so it takes up most of the width of the controls bar.
... we also give our inner <div> and <span> the right amount of z-
index so that the timer will be displayed on top, and the inner <div> below that.
... create a new javascript file in the same directory level as your
index.html file.
Server-side web frameworks - Learn web development
# django view function from django.http import httpresponse def
index(request): # get an httprequest (request) # perform operations using information from the request.
... urlpatterns = [ url(r'^$', views.
index), # example: /best/myteamname/5/ url(r'^best/(?p<team_name>\w.+?)/(?p<team_number>[0-9]+)/$', views.best), ] make it easy to access data in the request data can be encoded in an http request in a number of ways.
... #best/views.py from django.shortcuts import render from .models import team def youngest(request): list_teams = team.objects.filter(team_level__exact="u09") context = {'youngest_teams': list_teams} return render(request, 'best/
index.html', context) rendering data web frameworks often provide templating systems.
... #best/templates/best/
index.html <!doctype html> <html lang="en"> <body> {% if youngest_teams %} <ul> {% for team in youngest_teams %} <li>{{ team.team_name }}</li> {% endfor %} </ul> {% else %} <p>no teams are available.</p> {% endif %} </body> </html> how to select a web framework numerous web frameworks exist for almost every programming language you might want to use (we list a few of ...
Getting started with Svelte - Learn web development
your browser will display something like this: application structure the starter template comes with the following structure: moz-todo-svelte ├── readme.md ├── package.json ├── package-lock.json ├── rollup.config.js ├── .gitignore ├── node_modules ├── public │ ├── favicon.ico │ ├──
index.html │ ├── global.css │ └── build │ ├── bundle.css │ ├── bundle.css.map │ ├── bundle.js │ └── bundle.js.map └── src ├── app.svelte └── main.js the contents are as follows: package.json and package-lock.json: contains information about the project that node.js/npm uses to keep it organized.
...
index.html: this is the main page of your app.
... finally the file public/
index.html includes the generated bundle.css and bundle.js files: <!doctype html> <html lang="en"> <head> <meta charset='utf-8'> <meta name='viewport' content='width=device-width,initial-scale=1'> <title>svelte app</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...
...as you can see, bundle.js is the only javascript file referenced by
index.html.
Introduction to automated testing - Learn web development
you can customize it later, but for now it'll look something like this: { "name": "node-test", "version": "1.0.0", "description": "test for npm projects", "main": "
index.js", "scripts": { "test": "test" }, "author": "chris mills", "license": "mit" } with this, you are ready to move on.
... next, you'll need some sample html, css and javascript content to test your system on — make copies of our sample
index.html, main.js, and style.css files in a subfolder with the name src inside your project folder.
... add the following dependency to gulpfile.js: const htmltidy = require('gulp-htmltidy'); add the following test to the bottom of gulpfile.js: function html(cb) { return gulp.src('src/
index.html') .pipe(htmltidy()) .pipe(gulp.dest('build')); cb(); } here we are grabbing our development
index.html file with gulp.src(), which allows us to grab a source file to do something with.
...xports.build = build; /* * define default task that can be called by just running `gulp` from cli */ exports.default = build; further ideas once this is all set up, you can run the gulp command inside your project directory, and you should get an output like this: you can then try out the files output by your automated tasks by looking at them inside the build directory, and loading build/
index.html in your web browser.
Gecko info for Windows accessibility vendors
how to track where the event happened, within your own offscreen model ordinary zero-
indexed child ids are not practical for representing events.
... hresult get_parentnode (/* [in] */ isimpledomnode *newnodeptr); hresult get_firstchild (/* [in] */ isimpledomnode *newnodeptr); hresult get_lastchild (/* [in] */ isimpledomnode *newnodeptr); hresult get_previoussibling(/* [in] */ isimpledomnode *newnodeptr); hresult get_nextsibling (/* [in] */ isimpledomnode *newnodeptr); hresult get_childat (/* [in] */ unsigned child
index, /* [out] */ isimpledomnode **newnodeptr); next we provide a convenience method for getting the actual html within a dom subtree.
... here are the methods for isimpledomtext: // includes all dom whitespace; iaccessible::get_accname does not hresult get_domtext(bstr *domtext); // bounding rect clipped to window hresult get_clippedsubstringbounds( [in] unsigned int start
index, [in] unsigned int end
index, [out] int *x, [out] int *y, [out] int *width, [out] int *height); // bounding rect unclipped hresult get_unclippedsubstringbounds( [in] unsigned int start
index, [in] unsigned int end
index, [out] int *x, [out] int *y, [out] int *width, [out] int *height); // scroll to this part of the subsstring hre...
...sult scrolltosubstring( [in] unsigned int start
index, [in] unsigned int end
index); // get the current font being used -- this is better than using // the isimpledomnode css property methods, because it provides // a single font name, rather than a comma delineated list of possibilities hresult fontfamily([out] bstr *fontfamily); isimpledomdocument there is one isimpledomdocument interface for each xml or html document in gecko, which you can use to get important information global to the document.
JNI.jsm
working with arrays creating/preallocating a typed array methods cdata .get(number a
index); cdata .getelements(number astart, number alength); void .set(number a
index, cdata avalue); void .setelements(number astart, [array, size_is(arr.length > number anynumber > 0)] in cdata avalsarray); .get() gets the value of the element in the array at given a
index.
... cdata get(number a
index); parameters a
index the position in the array to obtain.
... .set() sets an element in the array at given a
index to the given aval.
... void set(number a
index, cdata aval); parameters a
index the position in the array to change.
Threads
after a thread has been created, you can get and set its priority with these functions: pr_getthreadpriority pr_setthreadpriority controlling per-thread private data you can use these functions to associate private data with each of the threads in a process: pr_newthreadprivate
index allocates a unique
index.
... if the call is successful, every thread in the same process is capable of associating private data with the new
index.
... pr_setthreadprivate associates private thread data with an
index.
... pr_getthreadprivate retrieves data associated with an
index.
JIT Optimization Outcomes
proto
indexedprops the object being accessed has
indexed properties that are exotic (for example, defined as a property on a prototype object and left as a hole in the underlying object).
...for example, if the array has sparse
indexes, or has
indexes that overflow the array's length, the optimization strategy may fail.
... arrayseennegative
index arrays at this element access location have seen negative
indexes.
... accessnottypedarray accessnotstring statictypedarrayuint32 statictypedarraycantcomputemask outofbounds getelemstringnotcached nonnativereceiver
indextype setelemnondensenontanotcached nosimdjitsupport optimization failed because simd jit support was not enabled.
JS_DefineElement
syntax /* added in spidermonkey 38 (jsapi 32) */ bool js_defineelement(jscontext *cx, js::handleobject obj, uint32_t
index, js::handlevalue value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineelement(jscontext *cx, js::handleobject obj, uint32_t
index, js::handleobject value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineelement(jscontext *cx, js::handleobject obj, uint32_t
index, js::handlestring value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineelement(jscon...
...text *cx, js::handleobject obj, uint32_t
index, int32_t value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineelement(jscontext *cx, js::handleobject obj, uint32_t
index, uint32_t value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineelement(jscontext *cx, js::handleobject obj, uint32_t
index, double value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); /* obsolete since jsapi 32 */ js_defineelement(jscontext *cx, jsobject *obj, uint32_t
index, jsval value, jspropertyop getter, jsstrictpropertyop setter, unsigned attrs); ...
...
index uint32_t the
index of the property to define.
...
index is the
index of the element being defined.
JS_ExecuteRegExp
syntax bool js_executeregexp(jscontext *cx, js::handleobject obj, js::handleobject reobj, char16_t *chars, size_t length, size_t *
indexp, bool test, js::mutablehandlevalue rval); bool js_executeregexpnostatics(jscontext *cx, js::handleobject reobj, char16_t *chars, size_t length, size_t *
indexp, bool test, js::mutablehandlevalue rval); name type description cx jscontext * the context.
...
indexp size_t * in/out parameter.
... a pointer to the last
index for the execution, and received the updated last
index.
... description js_executeregexp and js_newregexpobjectnostatics execute the regexp object, reobj, to the specified input string, chars, from *
indexp
index.
JS_HasElement
determine whether a javascript array has an element in the specified
index.
... syntax bool js_haselement(jscontext *cx, js::handleobject obj, uint32_t
index, bool *foundp); name type description cx jscontext * the context in which to perform the property lookup.
...
index uint32_t
index of the element to look up.
... description js_haselement examines a specified js object, obj, and its prototype chain, for an element or numeric property numbered
index.
JS_SET_TRACING_DETAILS
syntax js_set_tracing_details(trc, printer, arg,
index) name type description trc jstracer * the tracer whose debugging hooks are to be set.
...
index size_t see the description.
...when printer is null, arg must be const char * or char * c string naming the reference and
index must be either (size_t)-1 indicating that the name alone describes the reference or it must be an
index into some array vector that stores the reference.
... when printer is not null, the arg and
index arguments are available to the callback as the debugprinterarg and debugprint
index fields of trc.
JS_SetElement
syntax /* added in spidermonkey 31 */ bool js_setelement(jscontext *cx, js::handleobject obj, uint32_t
index, js::handlevalue v); bool js_setelement(jscontext *cx, js::handleobject obj, uint32_t
index, js::handleobject v); bool js_setelement(jscontext *cx, js::handleobject obj, uint32_t
index, js::handlestring v); bool js_setelement(jscontext *cx, js::handleobject obj, uint32_t
index, int32_t v); bool js_setelement(jscontext *cx, js::handleobject obj, uint32_t
index, uint32_t v); bool js_setelement(jscontext *cx, js::handleobject obj, uint32_t
index, double v); /* obsolete since jsapi 29 */ bool js_setelement(jscontext *cx, js::handleobject ...
...obj, uint32_t
index, js::mutablehandlevalue vp); name type description cx jscontext * the context in which to set the element.
...
index uint32_t
index number of the element to set.
...it behaves like the javascript expression obj[
index] = v.
JS_ValueToId
syntax bool js_valuetoid(jscontext *cx, js::handlevalue v, js::mutablehandleid idp); bool js_stringtoid(jscontext *cx, js::handlestring s, js::mutablehandleid idp); // added in spidermonkey 38 bool js_
indextoid(jscontext *cx, uint32_t
index, js::mutablehandleid idp); // added in spidermonkey 17 bool js_charstoid(jscontext* cx, js::twobytechars chars, js::mutablehandleid idp); // added in spidermonkey 24 void js::protokeytoid(jscontext *cx, jsprotokey key, js::mutablehandleid idp); // added in spidermonkey 38 name type description cx jscontext * a context.
...
index uint32_t an unsigned integer
index of array to convert.
... js_
indextoid converts a specified integer
index to an integer jsid.
... mxr id search for js_valuetoid see also mxr id search for js_idtovalue mxr id search for js_stringtoid mxr id search for js_
indextoid mxr id search for js_charstoid mxr id search for js::protokeytoid js_valuetoid bug 698495 - added js_
indextoid bug 830500 - added js_charstoid bug 959787 - added js_stringtoid bug 987669 - added js::protokeytoid ...
History Service Design
long term objectives include the ability to
index more informations from the visited pages, through fulltext
indexes, and the possibility to generalize the frecency algorithm to allow for its use in user's queries.
...in case the database has been created for the first time history service will create all tables,
indexes and triggers, calling related inittables static methods of other dependant services.
... finally temporary tables,
indexes and triggers are created, this happens at every run since those entities are removed when closing the connection.
...database
indexes are quite important, and a good query can make the difference between minutes or seconds.
Places utilities for JavaScript
nodeiscontainer(nsinavhistoryresultnode anode); boolean nodeisdynamiccontainer(nsinavhistoryresultnode anode); boolean nodeislivemarkcontainer(nsinavhistoryresultnode anode); obsolete since gecko 21 boolean nodeislivemarkitem(nsinavhistoryresultnode anode); obsolete since gecko 21 boolean isreadonlyfolder(nsinavhistoryresultnode anode); int get
indexofnode(nsinavhistoryresultnode anode); string wrapnode(nsinavhistoryresultnode 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, bo...
... get
indexofnode() gets the
index of a node within its parent container int get
indexofnode(anode) parameters anode the node to look up return type returns the
index of the node within its parent container, or -1 if the node was not found or the node specified has no parent.
... maketransaction(data, type, container,
index, copy) parameters data the unwrapped data blob of dropped or pasted data.
... type the content type of the data container the container the data was dropped or pasted into
index the
index within the container the item was dropped or pasted at copy the drag action was copy, so don't move folders or links.
imgIContainer
gfxiimageframe getframeat(in unsigned long
index); obsolete since gecko 1.9.2 void getframecolormap(in unsigned long framenumber, [array, size_is(palettelength)] out pruint32 palettedata, out unsigned long palettelength); obsolete since gecko 2.0 unsigned long getframeimagedatalength(in unsigned long framenumber); obsolete since gecko 2.0 imagecontainer getimagecontainer(); native code only!
...obsolete since gecko 2.0 currentframe
index unsigned long the
index of the current frame that would be drawn if the image was to be drawn now.
...create or reuse a frame at
index aframenum.
... return value missing description exceptions thrown missing exception missing description getframeat() obsolete since gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) gfxiimageframe getframeat( in unsigned long
index ); parameters
index missing description return value missing description exceptions thrown missing exception missing description getframecolormap() obsolete since gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1)this feature is obsolete.
inIDOMUtils
ing apseudo); nsidomnode getparentfornode(in nsidomnode anode, in boolean ashowinganonymouscontent); unsigned long getruleline(in nsidomcssstylerule arule); unsigned long getrulecolumn(in nsidomcssstylerule arule); unsigned long getselectorcount(in nsidomcssstylerule arule); astring getselectortext(in nsidomcssstylerule arule, in unsigned long aselector
index); unsigned long long getspecificity(in nsidomcssstylerule arule, in unsigned long aselector
index); nsidomfontfacelist getusedfontfaces(in nsidomrange arange); bool haspseudoclasslock(in nsidomelement aelement, in domstring apseudoclass); boolean isignorablewhitespace(in nsidomcharacterdata adatanode); bool isinheritedproperty(in astring apropertyname)...
...; void parsestylesheet(in nsidomcssstylesheet asheet, in domstring ainput); void removepseudoclasslock(in nsidomelement aelement, in domstring apseudoclass); astring rgbtocolorname(in octet ar, in octet ag, in octet ab); bool selectormatcheselement(in nsidomelement aelement, in nsidomcssstylerule arule, in unsigned long aselector
index, [optional] in domstring apseudo); void setcontentstate(in nsidomelement aelement, in unsigned long long astate); constants constant value description exclude_shorthands (1<<0) include_aliases (1<<1) content state flags the content state flags are used in a bitmask.
... bool selectormatcheselement ( in nsidomelement aelement, in nsidomcssstylerule arule, in unsigned long aselector
index, in domstring apseudo optional ) parameters aelement the element to check the selector against.
... aselector
index the
index of the selector.
mozIStorageConnection
nt(in autf8string asqlstatement); void createtable(in string atablename, in string atableschema); mozistoragependingstatement executeasync([array, size_is(anumstatements)] in mozistoragebasestatement astatements, in unsigned long anumstatements, [optional] in mozistoragestatementcallback acallback ); void executesimplesql(in autf8string asqlstatement); boolean
indexexists(in autf8string a
indexname); void preload(); obsolete since gecko 1.9 void removefunction(in autf8string afunctionname); mozistorageprogresshandler removeprogresshandler(); void rollbacktransaction(); void setgrowthincrement(in print32 aincrement, in autf8string adatabasename); mozistorageprogresshandler setprogresshandler(in print32 a...
...
indexexists() this method determines whether or not the given
index exists.
... boolean
indexexists( in autf8string a
indexname ); parameters a
indexname the
index to check.
... return value true if the
index exists, false otherwise.
GetRelation
« nsiaccessible page summary this method returns accessible relation for this accessible object by
index.
... nsiaccessiblerelation getrelation( in unsigned long a
index ); parameters a
index[in] the
index for which relation is to be retrieved.
...exception thrown ns_error_invalid_arg indicates that the given
index is invalid.
... remark currently we do not support multiple relations so the zero
index may be valid only.
nsIAccessibleRelation
method overview nsiaccessible gettarget(in unsigned long
index); nsiarray gettargets(); attributes attribute type description relationtype unsigned long returns the type of the relation.
... methods gettarget() returns accessible relation target at the given
index.
... nsiaccessible gettarget( in unsigned long
index ); parameters
index zero-based
index of relation target.
... exceptions thrown ns_error_invalid_arg indicates the given
index is out of range.
nsIBrowserSearchService
] out unsigned long enginecount, [retval, array, size_is(enginecount)] out nsisearchengine engines); void getvisibleengines([optional] out unsigned long enginecount, [retval, array, size_is(enginecount)] out nsisearchengine engines); void init([optional] in nsibrowsersearchinitobserver observer); void moveengine(in nsisearchengine engine, in long new
index); void removeengine(in nsisearchengine engine); void restoredefaultengines(); attributes attribute type description currentengine nsisearchengine the currently active search engine.
...void moveengine( in nsisearchengine engine, in long new
index ); parameters engine the engine to move.
... new
index the engine's new
index in the set of visible engines.
... exceptions thrown ns_error_failure if new
index is out of bounds, or if engine is hidden.
nsIDOMStorage
method overview void clear(); domstring getitem(in domstring key); domstring key(in unsigned long
index); void removeitem(in domstring key); void setitem(in domstring key, in domstring data); attributes attribute type description length unsigned long the number of keys stored in the session store.
...key() returns the key for the item stored at the specified
index in the data store.
... domstring key( in unsigned long
index ); parameters
index the
index for which the corresponding key should be returned.
...exceptions thrown
index_size_err there is no key at the specified
index.
nsIDOMStorage2
last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: nsisupports method overview void clear(); domstring getitem(in domstring key); domstring key(in unsigned long
index); void removeitem(in domstring key); void setitem(in domstring key, in domstring data); attributes attribute type description length unsigned long the number of keys stored in local storage.
...key() returns the key for the item stored at the specified
index in the data store.
... domstring key( in unsigned long
index ); parameters
index the
index for which the corresponding key should be returned.
...exceptions thrown
index_size_errthere is no key at the specified
index.
nsIHttpServer
unction callback optional callback */ listen: function(port, opt, callback) { if (arguments.length == 2 && "function" == typeof opt) { callback = opt; } if (callback) { this.registerprefixhandler("/", callback); } let host = "localhost"; if (typeof port === "string" && port.
indexof(':') != -1){ [host, port] = port.split(':'); port = parseint(port); server.identity.add('http', host, port); } server.wrappedjsobject._start(port, host); return true; }, registerfile: function(path, filepath) { var file = components.classes['@mozilla.org/file/local;1'] ...
... */ void registercontenttype(in string extension, in string type); /** * sets the handler used to display the contents of a directory if * the directory contains no
index page.
... * * @param handler * an object which will handle any requests for directories which * do not contain
index pages, or null to reset to the default *
index handler; if while the server is running the handler * throws an exception while responding to a request, an http 500 * response will be returned.
... */ void set
indexhandler(in nsihttprequesthandler handler); /** represents the locations at which this server is reachable.
nsIUpdateManager
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview nsiupdate getupdateat(in long
index); void saveupdates(); attributes attribute type description activeupdate nsiupdate an nsiupdate object describing the currently in use update.
... methods getupdateat() returns the update at the specified
index into the history list.
... nsiupdate getupdateat( in long
index ); parameters
index an
index into the history list for the nsiupdate to retrieve.
... return value the nsiupdate at the specified
index into the history list.
Warnings
this happens when you have an order by clause that does not use an
index.
... when you do not use an
index, all the results from the query have to first be fetched, and then those results are sorted.
... however, when the
index is used, the data can be obtained row by row from the database, which will be much faster.
... if, for some reason you cannot use an
index in your order by clause, you can suppress this warning by including a sql comment in your query that contains this text: /* do not warn (bug [everything in these brackets does not matter] */ the bug mentioned should explain why the query cannot use an
index.
Xptcall Porting Guide
the invoke functionality requires the implementation of the following on each platform (from xptcall/public/xptcall.h): xptc_public_api(nsresult) ns_invokeby
index(nsisupports* that, pruint32 method
index, pruint32 paramcount, nsxptcvariant* params); calling code is expected to supply an array of nsxptcvariant structs.
...the platform specific code then builds a call frame and invokes the method indicated by the
index method
index on the xpcom interface that.
... ns_imethod getinterfaceinfo(nsiinterfaceinfo** info) = 0; // call this method and return result ns_imethod callmethod(pruint16 method
index, const nsxptmethodinfo* info, nsxptcminivariant* params) = 0; }; code that wishes to make use of this stubs functionality (such as xpconnect) implement a class which inherits from nsxptcstubbase and implements the getinterfaceinfo and callmethod to let the platform specific code know how to get interface information and how to dispatch methods ...
...xptcall/tests has an api level test for ns_invokeby
index, but no tests for the stubs functionality.
CSSValueList.item() - Web APIs
the item() method of the cssvaluelist interface is used to retrieve a cssvalue by ordinal
index.
...if the
index is greater than or equal to the number of values in the list, this method returns null.
... syntax var cssvalue = cssvaluelist.item(
index); parameters
index an unsigned long representing the
index of the css value within the collection.
... return value a cssvalue object at the
index position in the cssvaluelist, or null if that is not a valid
index.
Pixel manipulation with canvas - Web APIs
each component is assigned a consecutive
index within the array, with the top left pixel's red component being at
index 0 within the array.
... the uint8clampedarray contains height × width × 4 bytes of data, with
index values ranging from 0 to (height×width×4)-1.
... (imagedata.width * 4)) + (200 * 4)) + 2]; if given a set of coordinates (x and y), you may end up doing something like this: var xcoord = 50; var ycoord = 100; var canvaswidth = 1024; function getcolorindicesforcoord(x, y, width) { var red = y * (width * 4) + x * 4; return [red, red + 1, red + 2, red + 3]; } var colorindices = getcolorindicesforcoord(xcoord, ycoord, canvaswidth); var red
index = colorindices[0]; var green
index = colorindices[1]; var blue
index = colorindices[2]; var alpha
index = colorindices[3]; var redforcoord = imagedata.data[red
index]; var greenforcoord = imagedata.data[green
index]; var blueforcoord = imagedata.data[blue
index]; var alphaforcoord = imagedata.data[alpha
index]; or, if es2015 is appropriate: const xcoord = 50; const ycoord = 100; const canvaswidth = ...
...1024; const getcolorindicesforcoord = (x, y, width) => { const red = y * (width * 4) + x * 4; return [red, red + 1, red + 2, red + 3]; }; const colorindices = getcolorindicesforcoord(xcoord, ycoord, canvaswidth); const [red
index, green
index, blue
index, alpha
index] = colorindices; you may also access the size of the pixel array in bytes by reading the uint8clampedarray.length attribute: var numbytes = imagedata.data.length; creating an imagedata object to create a new, blank imagedata object, you should use the createimagedata() method.
DataTransfer.mozGetDataAt() - Web APIs
the datatransfer.mozgetdataat() method is used to retrieve an item in the drag event's data transfer object, based on a given format and
index.
... this method returns null if the specified item does not exist or if the
index is not in the range from zero to the number of items minus one.
... syntax nsivariant datatransfer.mozgetdataat([type],
index); arguments type a string representing the type of the drag data to retrieve from the drag data object.
...
index a unsigned long representing the
index of the data to retrieve.
DataTransfer.mozTypesAt() - Web APIs
the datatransfer.moztypesat() method returns a list of the format types that are stored for an item at the specified
index.
... if the
index is not in the range from 0 to the number of items minus one, an empty string list is returned.
... syntax nsivariant datatransfer.moztypesat(
index); arguments
index a unsigned long that is the
index of the data for which to retrieve the types.
...if the
index is not in the range from 0 to the number of items minus one, an empty string list is returned.
DataTransferItemList.DataTransferItem() - Web APIs
the datatransferitem() getter method implements support for accessing items in the datatransferitemlist using array-style syntax (that is datatransferitem[
index]).
... syntax dataitem = datatransferitem[
index]; parameters
index the zero-based
index of the item in the drag data list to return.
... return value the datatransferitem object at the specified
index in the item list.
... if the
index is less than zero or greater than or equal to the number of items in the list (as indicated by the list's length property, undefined is returned.
DataTransferItemList.remove() - Web APIs
the datatransferitemlist.remove() method removes the datatransferitem at the specified
index from the list.
... if the
index is less than zero or greater than one less than the length of the list, the list will not be changed.
... syntax datatransferitemlist.remove(
index); parameters
index the zero-based
index number of the item in the drag data list to remove.
... if the
index doesn't correspond to an existing item in the list, the list is left unchanged.
Introduction to the DOM - Web APIs
items in a nodelist are accessed by
index in either of two ways: list.item(1) list[1] these two are equivalent.
... namednodemap a namednodemap is like an array, but the items are accessed by name or
index, though this latter case is merely a convenience for enumeration, as they are in no particular order in the list.
... <html> <head> <title>dom tests</title> <script> function setbodyattr(attr, value) { if (document.body) document.body[attr] = value; else throw new error("no support"); } </script> </head> <body> <div style="margin: .5in; height: 400px;"> <p><b><tt>text</tt></b></p> <form> <select onchange="setbodyattr('text', this.options[this.selected
index].value);"> <option value="black">black</option> <option value="red">red</option> </select> <p><b><tt>bgcolor</tt></b></p> <select onchange="setbodyattr('bgcolor', this.options[this.selected
index].value);"> <option value="white">white</option> <option value="lightgrey">gray</option> </select> <p><b><tt>link</tt></b></p> <s...
...elect onchange="setbodyattr('link', this.options[this.selected
index].value);"> <option value="blue">blue</option> <option value="green">green</option> </select> <small> <a href="http://some.website.tld/page.html" id="sample"> (sample link) </a> </small><br /> <input type="button" value="version" onclick="ver()" /> </form> </div> </body> </html> to test a lot of interfaces in a single page—for example, a "suite" of properties that affect the colors of a web page—you can create a similar test page with a whole console of buttons, textfields, and other html elements.
FileHandle API - Web APIs
basic operations create a filehandle because the intent is to allow the storage of files through
indexeddb, creating a filehandle instance requires an
indexeddb database.
... var idbreq =
indexeddb.open("myfilestoragedatabase"); idbreq.onsuccess = function(){ var db = this.result; var buildhandle = db.mozcreatefilehandle("test.txt", "plain/text"); buildhandle.onsuccess = function(){ var myfilehandle = this.result; console.log('handle', myfilehandle); }; }; mozcreatefilehandle() takes two arguments: a name and an optional type.
... // get a lockedfile object from the handle var myfile = myfilehandle.open('readwrite'); // retrieve the size of the file var getmeta = myfile.getmetadata(); getmeta.onsuccess = function () { var size = this.result.size; // the reading operation will start with the byte at
index 0 in the file myfile.location = 0; // start a reading operation for the whole file content var reading = myfile.readastext(size); reading.onsuccess = function () { console.log('the content of the file is:'); console.log(this.result); } reading.onerror = function () { console.log('something goes wrong in the reading process: ' + this.error); } } file snapshot in man...
... var idbreq = window.
indexeddb.open('myfilestoragedatabase'); // if necessary, let's create a datastore for the files idbreq.onupgradeneeded = function () { this.result.createobjectstore('files'); } idbreq.onsuccess = function () { var db = this.result; // let's create a new file var handlereq = db.mozcreatefilehandle("test.txt", "plain/text"); handlereq.onsuccess = function () { var myfilehandle = this.r...
HTMLCollection.item - Web APIs
note: because the contents of an htmlcollection are live, changes to the underlying dom can and will cause the position of individual nodes in the collection to change, so the
index value will not necessarily remain constant for a given node.
... syntax var element = htmlcollection.item(
index) parameters
index the position of the node to be returned.
... return value the node at the specified
index, or null if
index is less than zero or greater than or equal to the length property.
...in javascript, it is easier to treat the htmlcollection as an array and to
index it using array notation.
HTMLInputElement.setSelectionRange() - Web APIs
selectionstart the 0-based
index of the first selected character.
... an
index greater than the length of the element's value is treated as pointing to the end of the value.
... selectionend the 0-based
index of the character after the last selected character.
... an
index greater than the length of the element's value is treated as pointing to the end of the value.
IDBDatabase.deleteObjectStore() - Web APIs
the deleteobjectstore() method of the idbdatabase interface destroys the object store with the given name in the connected database, along with any
indexes that reference it.
... example var dbname = "sampledb"; var dbversion = 2; var request =
indexeddb.open(dbname, dbversion); request.onupgradeneeded = function(e) { var db = request.result; if (e.oldversion < 1) { db.createobjectstore("store1"); } if (e.oldversion < 2) { db.deleteobjectstore("store1"); db.createobjectstore("store2"); } // etc.
...}; specification specification status comment
indexed database api 2.0the definition of 'deleteobjectstore()' in that specification.
... recommendation
indexed database api draftthe definition of 'deleteobjectstore()' in that specification.
IDBEnvironmentSync - Web APIs
important: the synchronous version of the
indexeddb api was originally intended for use only with web workers, and was eventually removed from the spec because its need was questionable.
... the unimplemented idbenvironmentsync interface of the
indexeddb api will be implemented by worker objects.
... attributes attribute type description
indexeddbsync readonly idbfactorysync provides a synchronous means of accessing the capabilities of
indexed databases.
... note: until the
indexed database api specification is finalized, this attribute should be accessed as moz_
indexeddbsync.
IDBFactory.deleteDatabase() - Web APIs
syntax for the current standard: var request =
indexeddb.deletedatabase(name); for the experimental version with options (see below): var request =
indexeddb.deletedatabase(name, options); parameters name the name of the database you want to delete.
... optionsnon-standard in gecko, since version 26, you can include a non-standard optional storage parameter that specifies whether you want to delete a permanent (the default value)
indexeddb, or an
indexeddb in temporary storage (aka shared pool.) return value a idbopendbrequest on which subsequent events related to this request are fired.
... example var dbdeleterequest = window.
indexeddb.deletedatabase("todolist"); dbdeleterequest.onerror = function(event) { console.log("error deleting database."); }; dbdeleterequest.onsuccess = function(event) { console.log("database deleted successfully"); console.log(event.result); // should be undefined }; specifications specification status comment
indexed database api draftthe definition of 'deletedatabase()' in that specification.
... recommendation
indexed database api 2.0the definition of 'deletedatabase()' in that specification.
IDBKeyRange - Web APIs
the idbkeyrange interface of the
indexeddb api represents a continuous interval over some data type that is used for keys.
... records can be retrieved from idbobjectstore and idb
index objects using keys or a range of keys.
... cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = '<strong>' + cursor.value.fthing + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; } specifications specification status comment
indexed database api 2.0the definition of 'idbkeyrange' in that specification.
...
indexed database api draftthe definition of 'idbkeyrange' in that specification.
IDBLocaleAwareKeyRange - Web APIs
the idblocaleawarekeyrange interface of the
indexeddb api is a firefox-specific version of idbkeyrange — it functions in exactly the same fashion, and has the same properties and methods, but it is intended for use with idb
index objects when the original
index had a locale value specified upon its creation (see create
index()'s optionalparameters) — that is, it has locale aware sorting enabled.
...with locale-aware
indexes, the meaning of < depends on the locale, so for example in lithuanian y is sorted between i and k.
... developers should always use idblocaleawarekeyrange when dealing with locale-aware
indexes.
... examples function displaydata() { var keyrangevalue = idblocaleawarekeyrange.bound("a", "f"); var transaction = db.transaction(['fthings'], 'readonly'); var objectstore = transaction.objectstore('fthings'); var my
index = objectstore.
index('lname'); my
index.opencursor(keyrangevalue).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.jtitle + '</td>' + '<td>' + cursor.value.
IDBObjectStore.clear() - Web APIs
clearing an object store consists of removing all records from the object store and removing all records in
indexes that reference the object store.
...for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.
indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
...ion var objectstore = transaction.objectstore("todolist"); // make a request to clear all the data out of the object store var objectstorerequest = objectstore.clear(); objectstorerequest.onsuccess = function(event) { // report the success of our request note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status comment
indexed database api 2.0the definition of 'clear()' in that specification.
... recommendation
indexed database api draftthe definition of 'clear()' in that specification.
IDBObjectStore.name - Web APIs
invalidstateerror either the object store has been deleted or the current transaction is not an upgrade transaction; you can only rename
indexes during upgrade transactions; that is, when the mode is "versionchange".
...for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.
indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
...tstore("todolist"); console.log(objectstore.name); // make a request to add our newitem object to the object store var objectstorerequest = objectstore.add(newitem[0]); objectstorerequest.onsuccess = function(event) { // report the success of our request note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status comment
indexed database api 2.0the definition of 'name' in that specification.
... recommendation
indexed database api draftthe definition of 'name' in that specification.
IDBOpenDBRequest.onblocked - Web APIs
}; example var db; // let us open our database var request =
indexeddb.open("todolist", 4); // these two event handlers act on the database being opened // successfully, or not request.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; request.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
...either one has not been created // before, or a new version number has been submitted via the // window.
indexeddb.open line above //it is only implemented in recent browsers request.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: "tasktitle" }); ...
... }; request.onblocked = function() { console.log("your database version can't be upgraded because the app is open somewhere else."); } specifications specification status comment
indexed database api 2.0the definition of 'onblocked' in that specification.
... recommendation
indexed database api draftthe definition of 'onblocked' in that specification.
IDBRequest: error event - Web APIs
bubbles yes cancelable no interface event event handler property onerror examples this example opens a database and tries to add a record, listening for the error event for the add() operation (this will occur if, for example, a record with the given tasktitle 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: 'tasktitle' }); // define what data items the objectstore will contain objectstore.createind...
...ex('hours', 'hours', { unique: false }); objectstore.create
index('minutes', 'minutes', { unique: false }); objectstore.create
index('day', 'day', { unique: false }); objectstore.create
index('month', 'month', { unique: false }); objectstore.create
index('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 = { tasktitle: 'my task', hours: 10, minutes: 10, day: 10, month: 'january', year: 2020 }; const objectstorerequest = objectstore.add(newitem); objectstorerequest.addeventlistener('error', () => { conso...
...le.log(`error adding new item: ${newitem.tasktitle}`); }); }); the same example, using the onerror property instead of 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: 'tasktitle' }); // define what data items the objectstore will contain objectstore.create
index('hours', 'hours', { unique: false }); objectstore.create
index('minutes', 'minutes', { unique: false }); objectstore.create
index('day', 'day', { unique: false }); objectstore.create
index('month', 'month', { unique:...
... false }); objectstore.create
index('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'); const objectstore = transaction.objectstore('todolist'); const newitem = { tasktitle: 'my task', hours: 10, minutes: 10, day: 10, month: 'january', year: 2020 }; const objectstorerequest = objectstore.add(newitem); objectstorerequest.onerror = () => { console.log(`error adding new item: ${newitem.tasktitle}`); }; }; ...
IDBTransaction.mode - Web APIs
versionchange allows any operation to be performed, including ones that delete and create object stores and
indexes.
...for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.
indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
.../ report the success of the request (this does not mean the item // has been stored successfully in the db - for that you need transaction.onsuccess) note.innerhtml += '<li>request successful.</li>'; }; // return the mode this transaction has been opened in (should be "readwrite" in this case) transaction.mode; }; specification specification status comment
indexed database api 2.0the definition of 'mode' in that specification.
... recommendation
indexed database api draftthe definition of 'mode' in that specification.
IDBVersionChangeEvent.newVersion - Web APIs
window.
indexeddb = window.
indexeddb || window.moz
indexeddb || window.webkit
indexeddb || window.ms
indexeddb; // don't use "var
indexeddb = ..." if you're not in a function.
... may need references to some window.idb* objects: window.idbtransaction = window.idbtransaction || window.webkitidbtransaction || window.msidbtransaction; window.idbkeyrange = window.idbkeyrange || window.webkitidbkeyrange || window.msidbkeyrange; // (mozilla has never prefixed these objects, // so we don't need window.mozidb*) // let us open version 4 of our database var dbopenrequest = window.
indexeddb.open("todolist", 4); // these two event handlers act on the database being opened dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
... db = dbopenrequest.result; }; specifications specification status comment
indexed database api 2.0the definition of 'newversion' in that specification.
... recommendation
indexed database api draftthe definition of 'newversion' in that specification.
Microdata DOM API - Web APIs
it can also be
indexed by name, which will return an object with a list of the elements that add properties with that name.
... var user = document.getitems('http://example.net/user')[0]; alert('hello ' + user.properties['name'][0].itemvalue + '!'); the htmlpropertiescollection object, when
indexed by name in this way, actually returns a propertynodelist object with all the matching properties.
...item(
index) collection[
index] returns the element with
index index from the collection.
...the name
index has to be one of the values listed in the names list.
TouchList.item() - Web APIs
the item() method returns the touch object at the specified
index in the touchlist.
... syntax var touchpoint = touchlist.item(
index); parameters
index the
index of the touch object to retrieve.
... the
index is a number in the range of 0 to one less than the length of the touchlist.
...returns null if the
index is not less than the length of the list.
WebGLRenderingContext.bindAttribLocation() - Web APIs
the webglrenderingcontext.bindattriblocation() method of the webgl api binds a generic vertex
index to an attribute variable.
... syntax void gl.bindattriblocation(program,
index, name); parameters program a webglprogram object to bind.
...
index a gluint specifying the
index of the generic vertex to bind.
... name a domstring specifying the name of the variable to bind to the generic vertex
index.
WebGLRenderingContext.getActiveUniform() - Web APIs
syntax webglactiveinfo webglrenderingcontext.getactiveuniform(program,
index); parameters program a webglprogram specifying the webgl shader program from which to obtain the uniform variable's information.
...
index a gluint specifying the
index of the uniform attribute to get.
... this value is an
index 0 to n - 1 as returned by gl.getprogramparameter(program, gl.active_uniforms).
... gl.invalid_value is generated if
index is not in the range [0, gl.getprogramparameter(program, gl.active_uniforms) - 1].
WebGL constants - Web APIs
t 0x8df3 medium_int 0x8df4 high_int 0x8df5 framebuffers and renderbuffers constant name value description framebuffer 0x8d40 renderbuffer 0x8d41 rgba4 0x8056 rgb5_a1 0x8057 rgb565 0x8d62 depth_component16 0x81a5 stencil_
index8 0x8d48 depth_stencil 0x84f9 renderbuffer_width 0x8d42 renderbuffer_height 0x8d43 renderbuffer_internal_format 0x8d44 renderbuffer_red_size 0x8d50 renderbuffer_green_size 0x8d51 renderbuffer_blue_size 0x8d52 renderbuffer_alpha_size 0x8d53 renderb...
...gram_texel_offset 0x8905 max_varying_components 0x8b4b fragment_shader_derivative_hint 0x8b8b rasterizer_discard 0x8c89 vertex_array_binding 0x85b5 max_vertex_output_components 0x9122 max_fragment_input_components 0x9125 max_server_wait_timeout 0x9111 max_element_
index 0x8d6b textures constants passed to webglrenderingcontext.texparameteri(), webglrenderingcontext.texparameterf(), webglrenderingcontext.bindtexture(), webglrenderingcontext.teximage2d(), and others.
..._bindings 0x8a2f max_uniform_block_size 0x8a30 max_combined_vertex_uniform_components 0x8a31 max_combined_fragment_uniform_components 0x8a33 uniform_buffer_offset_alignment 0x8a34 active_uniform_blocks 0x8a36 uniform_type 0x8a37 uniform_size 0x8a38 uniform_block_
index 0x8a3a uniform_offset 0x8a3b uniform_array_stride 0x8a3c uniform_matrix_stride 0x8a3d uniform_is_row_major 0x8a3e uniform_block_binding 0x8a3f uniform_block_data_size 0x8a40 uniform_block_active_uniforms 0x8a42 uniform_block_active_uniform_indices 0x8a43 ...
...8007 max 0x8008 depth_component24 0x81a6 stream_read 0x88e1 stream_copy 0x88e2 static_read 0x88e5 static_copy 0x88e6 dynamic_read 0x88e9 dynamic_copy 0x88ea depth_component32f 0x8cac depth32f_stencil8 0x8cad invalid_
index 0xffffffff timeout_ignored -1 max_client_wait_timeout_webgl 0x9247 constants defined in webgl extensions angle_instanced_arrays constant name value description vertex_attrib_array_divisor_angle 0x88fe describes the frequency divisor used for instanced rendering.
Creating 3D objects using WebGL - Web APIs
we can pass a lot fewer data around by building an array of all 24 vertices, then referring to each vertex by its
index into that array instead of moving entire sets of coordinates around.
... const
indexbuffer = gl.createbuffer(); gl.bindbuffer(gl.element_array_buffer,
indexbuffer); // this array defines each face as two triangles, using the // indices into the vertex array to specify each triangle's // position.
... 7, // back 8, 9, 10, 8, 10, 11, // top 12, 13, 14, 12, 14, 15, // bottom 16, 17, 18, 16, 18, 19, // right 20, 21, 22, 20, 22, 23, // left ]; // now send the element array to gl gl.bufferdata(gl.element_array_buffer, new uint16array(indices), gl.static_draw); return { position: positionbuffer, color: colorbuffer, indices:
indexbuffer, }; } the indices array defines each face like a pair of triangles, specifying each triangle's vertices as an
index into the cube's vertex arrays.
... drawing the cube next we need to add code to our drawscene() function to draw using the cube's
index buffer, adding new gl.bindbuffer() and gl.drawelements() calls: // tell webgl which indices to use to
index the vertices gl.bindbuffer(gl.element_array_buffer, buffers.indices); ...
ARIA: table role - Accessibility
mantic_elements_table_desc" aria-rowcount="81"> <div id="semantic_elements_table_desc">semantic elements to use instead of aria's roles</div> <div role="rowgroup"> <div role="row"> <span role="columnheader" aria-sort="none">aria role</span> <span role="columnheader" aria-sort="none">semantic element</span> </div> </div> <div role="rowgroup"> <div role="row" aria-row
index="11"> <span role="cell">header</span> <span role="cell">h1</span> </div> <div role="row" aria-row
index="16"> <span role="cell">header</span> <span role="cell">h6</span> </div> <div role="row" aria-row
index="18"> <span role="cell">rowgroup</span> <span role="cell">thead</span> </div> <div role="row" aria-row
index="24"> <span role="c...
...if any rows or columns are hidden, the aria-colcount or aria-rowcount should be included indicating the total number of columns or rows, respectively, along with the aria-col
index or aria-row
index on each cell.
... the aria-col
index or aria-row
index is set to the position of a cell within the row or column, respectively.
..._elements_table_desc" aria-rowcount="81"> <div id="semantic_elements_table_desc">semantic elements to use instead of aria's roles</div> <div role="rowgroup"> <div role="row"> <span role="columnheader" aria-sort="none">aria role</span> <span role="columnheader" aria-sort="none">semantic element</span> </div> </div> <div role="rowgroup"> <div role="row" aria-row
index="11"> <span role="cell">header</span> <span role="cell">h1</span> </div> <div role="row" aria-row
index="16"> <span role="cell">header</span> <span role="cell">h6</span> </div> <div role="row" aria-row
index="18"> <span role="cell">rowgroup</span> <span role="cell">thead</span> </div> <div role="row" aria-row
index="24"> <span ro...
ARIA: checkbox role - Accessibility
<span role="checkbox" aria-checked="false" tab
index="0" aria-labelledby="chk1-label"> </span> <label id="chk1-label">remember my preferences</label> the first rule of aria is if a native html element or attribute has the semantics and behavior you require, use it instead of re-purposing an element and adding aria.
...if the role is applied to a non-focusable element, use the tab
index attribute to change this.
...this attribute has one of three possible values: true the checkbox is checked false the checkbox is not checked mixed the checkbox is partially checked, or indeterminate tab
index="0" used to make it focusable so the assistive technology user can tab to it and start reading right away.
... html <span role="checkbox" id="chkpref" aria-checked="false" onclick="changecheckbox()" onkeypress="changecheckbox()" tab
index="0" aria-labelledby="chk1-label"></span> <label id="chk1-label" onclick="changecheckbox()" onkeypress="changecheckbox()">remember my preferences</label> css [role="checkbox"] { padding:5px; } [aria-checked="true"]::before { content: "[x]"; } [aria-checked="false"]::before { content: "[ ]"; } javascript function changecheckbox(event) { let item = document.getelementbyid('chkp...
CSS reference - CSS: Cascading Style Sheets
use this css reference to browse an alphabetical
index of all of the standard css properties, pseudo-classes, pseudo-elements, data types, and at-rules.
...where : selectors-list ::= selector[:pseudo-class] [::pseudo-element] [, selectors-list] properties-list ::= [property : value] [; properties-list] see the
index of selectors, pseudo-classes, and pseudo-elements below.
... keyword
index note: the property names in this
index do not include the javascript names where they differ from the css standard names.
...transition-durationtransition-propertytransition-timing-functiontranslatetranslate()translate3d()translatex()translatey()translatez()turnuunicode-bidiunicode-range (@font-face)unset<url>url()user-zoom (@viewport)v:validvar()vertical-alignvh@viewportviewport-fit (@viewport)visibility:visitedvmaxvminvwwwhite-spacewidowswidthwidth (@viewport)will-changeword-breakword-spacingword-wrapwriting-modexxzz-
indexzoom (@viewport)others--* selectors the following are the various selectors, which allow styles to be conditional based on various features of elements within the dom.
A re-introduction to JavaScript (JS tutorial) - JavaScript
this is always one more than the highest
index in the array.
...consider the following: var a = ['dog', 'cat', 'hen']; a[100] = 'fox'; a.length; // 101 remember — the length of the array is one more than the highest
index.
... if you query a non-existent array
index, you'll get a value of undefined in return: typeof a[90]; // undefined if you take the above about [] and length into account, you can iterate over an array using the following for loop: for (var i = 0; i < a.length; i++) { // do something with a[i] } es2015 introduced the more concise for...of loop for iterable objects such as arrays: for (const currentvalue of a) { // do something with currentvalue } you could also iterate over an array using a for...in loop, however this does not iterate over the array elements, but the array indices.
... another way of iterating over an array that was added with ecmascript 5 is foreach(): ['dog', 'cat', 'hen'].foreach(function(currentvalue,
index, array) { // do something with currentvalue or array[
index] }); if you want to append an item to an array simply do it like this: a.push(item); arrays come with a number of methods.
Keyed collections - JavaScript
« previousnext » this chapter introduces collections of data which are
indexed by a key; map and set objects contain elements which are iterable in the order of insertion.
...the new set object, however, has some advantages: deleting array elements by value (arr.splice(arr.
indexof(val), 1)) is very slow.
...with an array, you would have to splice based on an element's
index.
... the value nan cannot be found with
indexof in an array.
The arguments object - JavaScript
note: “array-like” means that arguments has a length property and properties
indexed from zero, but it doesn't have array's built-in methods like foreach() or map().
...it has entries for each argument the function was called with, with the first entry's
index at 0.
... using typeof with arguments the typeof operator returns 'object' when used with arguments console.log(typeof arguments); // 'object' the type of individual arguments can be determined by
indexing arguments: console.log(typeof arguments[0]); // returns the type of the first argument properties arguments.callee reference to the currently executing function that the arguments belong to.
... arguments[@@iterator] returns a new array iterator object that contains the values for each
index in arguments.
ArrayBuffer.prototype.slice() - JavaScript
syntax arraybuffer.slice(begin[, end]) parameters begin zero-based byte
index at which to begin slicing.
... end optional byte
index before which to end slicing.
...if either begin or end is negative, it refers to an
index from the end of the array, as opposed to from the beginning.
... the range specified by the begin and end parameters is clamped to the valid
index range for the current array.
Atomics.add() - JavaScript
syntax atomics.add(typedarray,
index, value) parameters typedarray an integer typed array.
...
index the position in the typedarray to add a value to.
... return value the old value at the given position (typedarray[
index]).
... throws a rangeerror, if
index is out of bounds in the typedarray.
Atomics.and() - JavaScript
syntax atomics.and(typedarray,
index, value) parameters typedarray an integer typed array.
...
index the position in the typedarray to compute the bitwise and.
... return value the old value at the given position (typedarray[
index]).
... throws a rangeerror, if
index is out of bounds in the typedarray.
Atomics.compareExchange() - JavaScript
syntax atomics.compareexchange(typedarray,
index, expectedvalue, replacementvalue) parameters typedarray an integer typed array.
...
index the position in the typedarray to exchange a value.
... return value the old value at the given position (typedarray[
index]).
... throws a rangeerror, if
index is out of bounds in the typedarray.
Atomics.exchange() - JavaScript
syntax atomics.exchange(typedarray,
index, value) parameters typedarray an integer typed array.
...
index the position in the typedarray to exchange a value.
... return value the old value at the given position (typedarray[
index]).
... throws a rangeerror, if
index is out of bounds in the typedarray.
Atomics.load() - JavaScript
syntax atomics.load(typedarray,
index) parameters typedarray an integer typed array.
...
index the position in the typedarray to load from.
... return value the value at the given position (typedarray[
index]).
... throws a rangeerror, if
index is out of bounds in the typedarray.
Atomics.or() - JavaScript
syntax atomics.or(typedarray,
index, value) parameters typedarray an integer typed array.
...
index the position in the typedarray to compute the bitwise or.
... return value the old value at the given position (typedarray[
index]).
... throws a rangeerror, if
index is out of bounds in the typedarray.
Atomics.sub() - JavaScript
syntax atomics.sub(typedarray,
index, value) parameters typedarray an integer typed array.
...
index the position in the typedarray to subtract a value from.
... return value the old value at the given position (typedarray[
index]).
... throws a rangeerror, if
index is out of bounds in the typedarray.
Atomics.xor() - JavaScript
syntax atomics.xor(typedarray,
index, value) parameters typedarray an integer typed array.
...
index the position in the typedarray to compute the bitwise xor.
... return value the old value at the given position (typedarray[
index]).
... throws a rangeerror, if
index is out of bounds in the typedarray.
RegExp() constructor - JavaScript
alternatively, if an object is supplied for the pattern, the flags string will replace any of that object's flags (and last
index will be reset to 0) (as of es2015).
... if flags is not specified and a regular expressions object is supplied, that object's flags (and last
index value) will be copied over.
... y (sticky) matches only from the
index indicated by the last
index property of this regular expression in the target string.
... does not attempt to match from any later
indexes.
RegExp.prototype.sticky - JavaScript
the sticky property reflects whether or not the search is sticky (searches in strings only from the
index indicated by the last
index property of this regular expression).
...the "y" flag indicates that it matches only from the
index indicated by the last
index property of this regular expression in the target string (and does not attempt to match from any later
indexes).
... examples using a regular expression with the sticky flag var str = '#foo#'; var regex = /foo/y; regex.last
index = 1; regex.test(str); // true regex.last
index = 5; regex.test(str); // false (last
index is taken into account with sticky flag) regex.last
index; // 0 (reset after match failure) anchored sticky flag for several versions, firefox's spidermonkey engine had a bug with regard to the ^ assertion and the sticky flag which allowed expressions starting with the ^ assertion and using the sticky flag to match when they shouldn't.
... examples of correct behavior: var regex = /^foo/y; regex.last
index = 2; regex.test('..foo'); // false -
index 2 is not the beginning of the string var regex2 = /^foo/my; regex2.last
index = 2; regex2.test('..foo'); // false -
index 2 is not the beginning of the string or line regex2.last
index = 2; regex2.test('.\nfoo'); // true -
index 2 is the beginning of a line specifications specification ecmascript (ecma-262)the definition of 'regexp...
TypedArray.prototype.copyWithin() - JavaScript
the copy is taken from the
index positions of the second and third arguments start and end.
... syntax typedarray.copywithin(target, start[, end = this.length]) parameters target target start
index position where to copy the elements to.
... start source start
index position where to start copying elements from.
...source end
index position where to end copying elements from.
TypedArray.prototype.filter() - JavaScript
invoked with arguments (element,
index, typedarray).
...callback is invoked only for
indexes of the typed array which have assigned values; it is not invoked for
indexes which have been deleted or which have never been assigned values.
... callback is invoked with three arguments: the value of the element the
index of the element the typed array object being traversed if a thisarg parameter is provided to filter, it will be passed to callback when invoked, for use as its this value.
... function isbigenough(element,
index, array) { return element >= 10; } new uint8array([12, 5, 8, 130, 44]).filter(isbigenough); // uint8array [ 12, 130, 44 ] filtering typed array elements using arrow functions arrow functions provide a shorter syntax for the same test.
TypedArray.prototype.forEach() - JavaScript
index the
index of the current element being processed in the array.
...it is not invoked for
indexes that have been deleted or elided.
... callback is invoked with three arguments: the element value the element
index the typed array being traversed if a thisarg parameter is provided to foreach(), it will be passed to callback when invoked, for use as its this value.
... examples logging the contents of a typed array the following code logs a line for each element in a typed array: function logarrayelements(element,
index, array) { console.log('a[' +
index + '] = ' + element); } new uint8array([0, 1, 2, 3]).foreach(logarrayelements); // logs: // a[0] = 0 // a[1] = 1 // a[2] = 2 // a[3] = 3 specifications specification ecmascript (ecma-262)the definition of '%typedarray%.prototype.foreach' in that specification.
WebAssembly.Table.prototype.set() - JavaScript
the set() prototype method of the webassembly.table object mutates a reference stored at a given
index to a different value.
... syntax table.set(
index, value); parameters
index the
index of the function reference you want to mutate.
... exceptions if
index is greater than or equal to table.prototype.length, a rangeerror is thrown.
...we then print out the table length and contents of the two
indexes (retrieved via table.prototype.get()) to show that the length is two, and the
indexes currently contain no function references (they currently return null).
SVG 2 support in Mozilla - SVG: Scalable Vector Graphics
general change notes length attribute and
indexed property for list interfaces implementation status unknown <script> element in content model of all elements implementation status unknown initialize(), appenditem(), replaceitem(), and insertitembefore() on list objects making a copy of any list item being inserted that is already in another list implementation status unknown crossorigin attribute for <image> and <script> elements not implemented yet ...
...ver implemented svgelement.viewportelement and svgelement.ownersvgelement nullable implementation status unknown svgelement.getpresentationattribute() removed never implemented (prototype removed in bug 921456) svgcolor and svgicccolor removed never implemented svgelement.focus(), svgelement.blur() not implemented (bug 778654) svgelement.tab
index implemented (bug 778654) document.activeelement implementation status unknown globaleventhandlers on svgelement implementation status unknown options dictionary attribute for svggraphicselement.getbbox() implemented behind the preference svg.new-getbbox.enabled (bug 999964, bug 1019326) allow leading and trailing whitespace in <length>, <angle>, <nu...
...upported (bug 528332 (firefox 15 / thunderbird 15 / seamonkey 2.12), bug 1318208) arcs value for stroke-linejoin not implemented (bug 1239142) auto-start-reverse value for <marker>'s orient attribute implemented (bug 879659) svgpaint removed implementation status unknown fill and stroke taking multiple paints implementation status unknown z-
index not implemented (bug 360148 child(<integer>) paint value implementation status unknown display of zero-length subpaths depends on stroke-linecap attribute implementation status unknown markers on all shapes implementation status unknown <marker> element display defined in ua style sheet implementation status unknown only single paints fo...
...<hatchpath> (renamed hatchpath) not implemented (bug 1239147) display behavior of paint server elements defined by ua style sheet not implemented clipping, masking, and compositing change notes overflow respected on outermost <svg> elements inline in html implementation status unknown interactivity change notes tab
index attribute implemented (bug 778654) bounding-box on pointer-events not implemented (bug 945187) load, abort, error, and unload instead of svgload, svgabort, svgerror, and svgunload not implemented (bug 620002) only structurally external elements and outermost <svg> element fire load events implementation status unknown resize and scroll instead of sv...
panel - Archive of obsolete content
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.
... var myscript = "window.addeventlistener('click', function(event) {" + " var t = event.target;" + " if (t.nodename == 'a')" + " self.port.emit('click-link', t.tostring());" + "}, false);" var mypanel = require("sdk/panel").panel({ contenturl: "http://www.bbc.co.uk/mobile/
index.html", contentscript: myscript }); mypanel.port.on("click-link", function(url) { console.log(url); }); mypanel.show(); this example uses contentscript to supply the script as a string.
...you can use these options even if the panel content is not packaged along with the add-on: var mypanel = require("sdk/panel").panel({ contenturl: "https://en.wikipedia.org/w/
index.php?title=jetpack&useformat=mobile", contentstyle: "body { border: 3px solid blue; }" }); mypanel.show(); var self = require("sdk/self"); var mypanel = require("sdk/panel").panel({ contenturl: "https://en.wikipedia.org/w/
index.php?title=jetpack&useformat=mobile", contentstylefile: self.data.url("panel-style.css") }); mypanel.show(); private browsing if your add-on has not opted into p...
Creating Reusable Modules - Archive of obsolete content
with the sdk you don't have to keep all your add-on in a single "
index.js" file.
... } return path; } require("sdk/ui/button/action").actionbutton({ id: "show-panel", label: "show panel", icon: { "16": "./icon-16.png" }, onclick: function() { console.log(md5file(promptforfile())); } }); this works , but
index.js is now getting longer and its logic is harder to understand.
... var s = array.from(hash, (c, i) => tohexstring(hash.charcodeat(i))).join(""); return s; } exports.hashfile = md5file;
index.js finally, update
index.js to import these two new modules and use them: var filepicker = require("./filepicker.js"); var md5 = require("./md5.js"); require("sdk/ui/button/action").actionbutton({ id: "show-panel", label: "show panel", icon: { "16": "./icon-16.png" }, onclick: function() { console.log(md5.hashfile(filepicker.promptforfile())); } }); distributing modules w...
xml:base support in old browsers - Archive of obsolete content
; } else if (xmlbase.match(/\/$/) && xlink.match(/\/$/)) { xmlbase = xmlbase.substring(0, xmlbase.length-2); // strip off last slash to join with xlink path with slash } // alert(xmlbase + '::' + xlink); } var link = xmlbase + xlink; if (!link.match(scheme)) { // if there is no domain, we'll need to use the current domain var loc = window.location; if (link.
indexof('/') === 0 ) { // if link is an absolute url, it should be from the host only link = loc.protocol + '//' + loc.host + link; } else { // if link is relative, it should be from full path, minus the file var dirpath = loc.pathname.substring(0, loc.pathname.last
indexof('/')-1); if (link.last
indexof('/') !== link.length-1) { link += '/'; } link = loc.protocol + '//' + loc.host...
... !thisitem.nodename) { return xmlbase; } // check present element and higher up for xml:base // now check for the next matching local name up in the hierarchy (until the document root) while (thisitem.nodename !== '#document' && thisitem.nodename !== '#document-fragment') { att = thisitem.getattribute('xml:base'); // xml: namespaces must use 'xml' prefix if (att) { protocolpos = att.
indexof('//'); var protocolmatch = att.match(scheme); if (protocolmatch) { // if has protocol, can stop if (abs) { var skipfile = (att.
indexof('///') === protocolpos) ?
... 3 : 2; // if the file protocol has an extra slashe, prepare to also skip it in the separator search var att2 = att.
indexof('/', protocolpos+skipfile); // find first path separator ('/') after protocol if (att2 !== -1) { att = att.substring(0, att2 - 1); // don't want any trailing slash, as the absolute path to be added already has one } } else if (!att.match(/\/$/)) { // if no trailing slash, add one, since it is being attached to a relative path att += '/'; } xmlbase = att + xmlbase; // if previous path was not absolute, resolve against the full uri here' break; } else if (att.
indexof('/') === 0) { // if absolute (/), need to prepare for next time to strip out after slash xmlbase = att + xmlbase; abs = true; // once the protocol is f...
Adding sidebars - Archive of obsolete content
it only displays one of its child nodes at a time, depending on its selected
index value.
... <deck selected
index="2"> <hbox> <!-- content for the first child.
...the alternative is to use a deck with the two labels, and change the selected
index depending on the purpose of the window.
Creating a Microsummary - Archive of obsolete content
then just link to the microsummaries from within the pages themselves using a <link rel="microsummary"> element, f.e.: <head> <link rel="microsummary" href="
index.php?view=microsummary"> </head> when firefox encounters a <link rel="microsummary"> element, it loads the url in the href attribute.
...mozilla.org/microsummaries/0.1" name="firefox download count"> <template> <transform xmlns="http://www.w3.org/1999/xsl/transform" version="1.0"> <output method="text"/> <template match="/"> <value-of select="id('download-count')"/> <text> fx downloads</text> </template> </transform> </template> <pages> <include>http://(www\.)?spreadfirefox\.com/(
index\.php)?</include> </pages> </generator> if you're unfamiliar with regular expressions, see creating regular expressions for a microsummary generator for a tutorial on writing them.
... for example, if we put the generator file on the web at http://people.mozilla.com/~myk/micro...-generator.xml, and we wanted users to be able to install it from http://people.mozilla.com/~myk/micro...ial/
index.html, we might add the following code to the
index.html page: <button onclick="window.sidebar.addmicrosummarygenerator('http://people.mozilla.com/~myk/microsummaries/tutorial/sfx-generator.xml')">install the spread firefox home page microsummary!</button> clicking that button will generate a javascript error on browsers that don't support microsummaries, however, so to improve the experience f...
Attribute (XUL) - Archive of obsolete content
naccesskeyextra2 buttonaccesskeyhelp buttonalign buttondir buttondisabledaccept buttonlabelaccept buttonlabelcancel buttonlabeldisclosure buttonlabelextra1 buttonlabelextra2 buttonlabelhelp buttonorient buttonpack buttons checked checkstate clicktoscroll class closebutton closemenu coalesceduplicatearcs collapse collapsed color cols command commandupdater completedefault
index container containment contentcontextmenu contenttooltip context contextmenu control crop curpos current currentset custom
index customizable cycler datasources decimalplaces default defaultbutton defaultset description dir disableautocomplete disableautoselect disableclose disabled disablehistory disablekeynavigation disablesecurity dlgtype dragging editable editort...
...pr 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 inactivetitlebarcolor 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 negate newlines next noa...
...dnext open ordinal orient pack pageid pageincrement pagestep parent parsetype persist persistence phase pickertooltiptext placeholder popup position predicate preference preference-editable primary priority properties querytype readonly ref rel removeelement resizeafter resizebefore rows screenx screeny searchbutton searchsessions searchlabel selected selected
index seltype setfocus showcaret showcommentcolumn showpopup size sizemode sizetopopup smoothscroll sort sortactive sortdirection sortresource sortresource2 spellcheck src state statedatasource statusbar statustext style subject substate suppressonselect tab
index tabscrolling targets template timeout title toolbarname tooltip tooltiptext tooltiptextnew top type uri ...
Introduction to XUL - Archive of obsolete content
check the xptoolkit
index for the most recent list.
...see individual widget documentation referenced at the
index for a list of attributes accepting javascript values.
...each widget will define a unique xml syntax for describing itself; see the widget documentation referenced at the
index for details.
getSelectedItem - Archive of obsolete content
« xul reference home getselecteditem(
index ) return type: element when multiple items are selected, you can retrieve each selected item using this method.
... the argument
index specifies the
index in the list of the selected items, not the row number of the item.
... the item
index is zero-based, thus this example will return the first selected item: getselecteditem(0).
insertItemAt - Archive of obsolete content
« xul reference home insertitemat(
index, label, value ) return type: element this method creates a new item and inserts it at the specified position.
... note: you cannot insert an item to an
index that does not exist, eg: trying to insert an item at the end with element.getrowcount() + 1 example <!-- this example inserts at the selected item or appends, then selects the newly created item --> <script language="javascript"> function insertitemtolist(){ var mylistbox = document.getelementbyid('mylistbox'); // create a date to get some labels and values var somedate = new date(); if(mylistbox.selected
index == -1){ // no item was selected in list so append to the end mylistbox.appenditem( somedate.tolocaletimestring(), somedate.gettime() ); var new
index = mylistbox.getrowcount() -1 }else{ // item was selected so insert ...
...at the selected item var new
index = mylistbox.selected
index; mylistbox.insertitemat(new
index, somedate.tolocaletimestring(), somedate.gettime()); } // select the newly created item mylistbox.selected
index = new
index; } </script> <button label="insert item at selected" oncommand="insertitemtolist()"/> <listbox id="mylistbox"> <listitem label="foo"/> </listbox> see also appenditem() removeitemat() ...
Methods - Archive of obsolete content
ane addprogresslistener addsession addtab addtabsprogresslistener advance advanceselectedtab appendcustomtoolbar appendgroup appenditem appendnotification blur cancel canceldialog centerwindowonscreen checkadjacentelement clearresults clearselection click close collapsetoolbar contains decrease decreasepage docommand ensureelementisvisible ensure
indexisvisible ensureselectedelementisvisible expandtoolbar extra1 extra2 focus getbrowserat
index getbrowserfordocument getbrowserfortab getbrowser
indexfordocument getbutton getdefaultsession geteditor getelementsbyattribute getelementsbyattributens getformattedstring gethtmleditor get
indexoffirstvisiblerow get
indexofitem getitemat
index getnextitem getnotificat...
...ionbox getnotificationwithvalue getnumberofvisiblerows getpagebyid getpreviousitem getresultat getresultcount getresultvalueat getrowcount getsearchat getselecteditem getsession getsessionbyname getsessionresultat getsessionstatusat getsessionvalueat getstring goback gobackgroup godown goforward goforwardgroup gohome goto goto
index goup hidepopup increase increasepage insertitem insertitemat invertselection loadgroup loadonetab loadtabs loaduri loaduriwithflags makeeditable movebyoffset moveto movetoalertposition onsearchcomplete ontextentered ontextreverted openpopup openpopupatscreen opensubdialog openwindow preferenceforelement reload reloadalltabs reloadtab reloadwithflags removeallitem...
...s removeallnotifications removealltabsbut removecurrentnotification removecurrenttab removeitemat removeitemfromselection removenotification removeprogresslistener removesession removetab removetabsprogresslistener removetransientnotifications replacegroup reset rewind scrollby
index scrollbypixels scrollto
index select selectall selectitem selectitemrange selecttabat
index setselectionrange showpane showpopup sizeto startediting stop stopediting swapdocshells syncsessions timedselect toggleitemselection related dom element methods dom:element.addeventlistener dom:element.appendchild dom:element.comparedocumentposition dom:element.dispatchevent dom:element.getattribute dom:element.getattributenode dom:element.getat...
MenuModification - Archive of obsolete content
the first argument is the
index where the new item should be inserted.
... in this case, 0 is supplied as the
index, which means before the first item.
...it takes a single argument, the
index of the item to remove.
Property - Archive of obsolete content
tifications allowevents alwaysopenpopup amindicator applocale 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 completedefault
index container contentdocument contentprincipal contenttitle contentview contentvieweredit contentviewerfile contentwindow contextmenu control controller controllers crop current current
index currentitem currentnotification currentpage currentpane currentset currenturi customtoolbarcount database datasources date dateleadingzero datevalue decimal...
... locked markupdocumentviewer max maxheight maxlength maxrows maxwidth menu menuboxobject menupopup min minheight minresultsforpopup minwidth minute minuteleadingzero mode month monthleadingzero name next nomatch notificationshidden object observes onfirstpage onlastpage open ordinal orient pack pagecount pageid pageincrement page
index pagestep parentcontainer palette persist persistence placeholder pmindicator popup popupboxobject popupopen position predicate preferenceelements preferencepanes preferences priority radiogroup readonly readonly ref resource resultspopup scrollboxobject scrollincrement scrollheight scrollwidth searchbutton searchcount searchlabel sear...
...chparam searchsessions second secondleadingzero securityui selected selectedbrowser selectedcount selected
index selecteditem selecteditems selectedpanel selectedtab selectionend selectionstart selstyle seltype sessioncount sessionhistory showcommentcolumn showpopup size smoothscroll spinbuttons src state statusbar statustext stringbundle strings style subject suppressonselect tabcontainer tab
index 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 elem...
Tree Widget Changes - Archive of obsolete content
for example, nsitreeview.getcellvalue() takes a row
index and a nsitreecolumn as arguments, whereas before it took a row
index and a column id.
... to get a column in javascript: tree.columns.getcolumnfor(treecolelement); tree.columns.getnamedcolumn(treecolid); tree.columns.getcolumnat(
index); you can also just use array syntax to get a column: tree.columns["lastname"]; tree.columns[5]; once you have a column, you can get various properties of it: column.
index - the
index of the column in displayed order column.id - the id attribute of the column column.element - the treecol element column.x - the x position in the tree of the left edge of the column column.width - the width of the column in c++ code, you can also get the atom attribute of nsitreecolumn which returns an nsiatom for the column, making it fast to do comparisons.
... use tree.columns.getkeycolumn().
index instead of tree.treeboxobject.getkeycolumn
index().
tabbox - Archive of obsolete content
attributes eventnode, handlectrlpageupdown, handlectrltab properties accessibletype, eventnode, handlectrlpageupdown, handlectrltab, selected
index, selectedpanel, selectedtab, tabs, tabpanels examples <tabbox id="mytablist" selected
index="2"> <tabs> <tab label="a first tab"/> <tab label="second tab"/> <tab label="another tab"/> <tab label="last tab"/> </tabs> <tabpanels> <tabpanel><!-- tabpanel first elements go here --></tabpanel> <tabpanel><!-- tabpanel second elements go here --></tabpanel> <tabpanel>...
... selected
index type: integer returns the
index of the currently selected item.
... you may select an item by assigning its
index to this property.
Styling the Amazing Netscape Fish Cam Page - Archive of obsolete content
getting the image back on top of the heading turned out to be a matter of relatively positioning the floated image, and then giving it a z-
index value.
... div.card {float: left; width: 45%; margin: 1em 2% 0 2%;} div.card img {float: left; position: relative; z-
index: 10; margin: 4px 0 0 0; border: 1px solid #339;} div.card h3 {margin: 0 0 0 4px; padding: 0.2em 0 1px 150px; border: 1px solid #339; border-left: 5px double #339; background: #eec url(body-bg-tan.jpg) bottom left no-repeat fixed; color: #339;} note how the image is pushed downward four pixels, while the h3 is pushed rightward four pixels.
... div.card {float: left; width: 45%; margin: 1em 2% 0 2%;} div.card img {float: left; position: relative; z-
index: 10; margin: 4px 0 0 0; border: 1px solid #339;} div.card h3 {margin: 0 0 0 4px; padding: 0.2em 0 1px 150px; border: 1px solid #339; border-left: 5px double #339; background: #eec url(body-bg-tan.jpg) bottom left no-repeat fixed; color: #339;} div.card p {margin: 0.5em 0.5em 0.5em 160px;} and voila!
The Business Benefits of Web Standards - Archive of obsolete content
by using semantic markup we greatly assist the search engines in their
indexing process.
... search engine agents crawl the web to
index it, but for ranking and
indexing purposes they can only process text.
...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.
Using the Right Markup to Invoke Plugins - Archive of obsolete content
get it from <a href="http://java.sun.com/products/plugin/
index.html">here.</a></p> </object> the above code mentions a version specific mime type, and if the mozilla-based browser such as netscape 7 doesn't have jre 1.4.1_01 installed, the alternate text is displayed.
... get it from <a href="http://java.sun.com/products/plugin/
index.html">here.
... link: http://devedge-temp.mozilla.org/view.../
index_en.html references general -- specifications html 4.01 specification xhtml 1.0 specification object element html 4.01 specification on object element embed element plugin api reference on embed element on devedge-temp java html 4.01 applet definition (deprecated) java plugin homepage sun documentation on object, embed, and applet and different plugin versions sun demonstr...
Implementing controls using the Gamepad API - Game development
index: a unique indentifier for the connected device.
... the
index variable is useful if we're connecting more than one controller and want to identify them to act accordingly — for example when we have a two-player game requiring two devices to be connected.
...now the length of the array of gamepads has to be n+1 where n is the number of connected devices — when there's one device connected and it has the
index of 1, the array's length is 2 and it will look like this: [null, [object gamepad]].
2D maze game with device orientation - Game development
the folder structure is quite straightforward: the starting point is the
index.html file where we initialize the framework and set up an <canvas> to render the game on.
... you can open the
index file in your favourite browser to launch the game and try it.
...let’s set it up: our starting point is the
index.html file with the following content.
SEO - MDN Web Docs Glossary: Definitions of Web-related terms
search engines crawl the web, following links from page to page, and
index the content found.
... when you search, the search engine displays the
indexed content.
...when exploring the website, crawlers should only find the content you want
indexed.
Example 1 - Learn web development
em; /* 4px */ box-shadow : 0 0.1em 0.2em rgba(0,0,0,.45); /* 0 1px 2px */ background : #f0f0f0; background : linear-gradient(0deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); } .select .value { display : inline-block; width : 100%; overflow : hidden; white-space : nowrap; text-overflow : ellipsis; vertical-align: top; } .select:after { content : "â–¼"; position: absolute; z-
index : 1; height : 100%; width : 2em; /* 20px */ top : 0; right : 0; padding-top : .1em; -moz-box-sizing : border-box; box-sizing : border-box; text-align : center; border-left : .2em solid #000; border-radius: 0 .1em .1em 0; background-color : #000; color : #fff; } .select .optlist { z-
index : 2; list-style: none; margin : 0; padding: 0; background:...
...em; /* 4px */ box-shadow : 0 0.1em 0.2em rgba(0,0,0,.45); /* 0 1px 2px */ background : #f0f0f0; background : linear-gradient(0deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); } .select .value { display : inline-block; width : 100%; overflow : hidden; white-space : nowrap; text-overflow : ellipsis; vertical-align: top; } .select:after { content : "â–¼"; position: absolute; z-
index : 1; height : 100%; width : 2em; /* 20px */ top : 0; right : 0; padding-top : .1em; -moz-box-sizing : border-box; box-sizing : border-box; text-align : center; border-left : .2em solid #000; border-radius: 0 .1em .1em 0; background-color : #000; color : #fff; } .select .optlist { z-
index : 2; list-style: none; margin : 0; padding: 0; background:...
... /* 4px */ box-shadow : 0 0.1em 0.2em rgba(0, 0, 0, .45); /* 0 1px 2px */ background : #f0f0f0; background : linear-gradient(0deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); } .select .value { display : inline-block; width : 100%; overflow : hidden; white-space : nowrap; text-overflow : ellipsis; vertical-align: top; } .select:after { content : "â–¼"; position: absolute; z-
index : 1; height : 100%; width : 2em; /* 20px */ top : 0; right : 0; padding-top : .1em; box-sizing : border-box; text-align : center; border-left : .2em solid #000; border-radius: 0 .1em .1em 0; background-color : #000; color : #fff; } .select .optlist { z-
index : 2; list-style: none; margin : 0; padding: 0; background: #f0f0f0; border: .2em solid #...
CSS basics - Learn web development
(if you haven't been following our project, pause here to read dealing with files and html basics.) open your
index.html file.
... paste the following line in the head (between the <head> and </head> tags): <link href="styles/style.css" rel="stylesheet"> save
index.html and load it in your browser.
...add the <link> element somewhere inside your
index.html's head (anywhere between the <head> and </head> tags).
Using data attributes - Learn web development
just use data attributes for that: <article id="electric-cars" data-columns="3" data-
index-number="12314" data-parent="cars"> ...
... const article = document.queryselector('#electric-cars'); article.dataset.columns // "3" article.dataset.
indexnumber // "12314" article.dataset.parent // "cars" each property is a string and can be read and written.
...in addition, search crawlers may not
index data attributes' values.
Mozilla splash page - Learn web development
save the contents of
index.html in a file called
index.html on your local drive, in a new directory.
...save copies of all these inside the same directory as
index.html.
...save a copy of both of these inside the same directory as
index.html.
Introducing asynchronous JavaScript - Learn web development
an example is when we use array.prototype.foreach() to loop through the items in an array (see it live, and the source): const gods = ['apollo', 'artemis', 'ares', 'zeus']; gods.foreach(function (eachname,
index){ console.log(
index + '.
... ' + eachname); }); in this example we loop through an array of greek gods and print the
index numbers and values to the console.
... the expected parameter of foreach() is a callback function, which itself takes two parameters, a reference to the array name and
index values.
Client-Server Overview - Learn web development
the first pattern ensures that an http request with a resource url of /best will be passed to a function named
index() in the views module.
...import views urlpatterns = [ # example: /best/ url(r'^$', views.
index), # example: /best/junior/ url(r'^junior/$', views.junior), ] note: the first parameters in the url() functions may look a bit odd (e.g.
... #best/views.py from django.shortcuts import render from .models import team def junior(request): list_teams = team.objects.filter(team_type__exact="junior") context = {'list': list_teams} return render(request, 'best/
index.html', context) after the junior() function gets the list of junior teams, it calls the render() function, passing the original httprequest, an html template, and a "context" object defining the information to be included in the template.
Beginning our React todo list - Learn web development
<div classname="btn-group"> <button type="button" classname="btn"> edit <span classname="visually-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.
... implementing our styles paste the following css code into src/
index.css so that it replaces what's currently there: /* resets */ *, *::before, *::after { box-sizing: border-box; } *:focus { outline: 3px dashed #228bec; outline-offset: 0; } html { font: 62.5% / 1.15 sans-serif; } h1, h2 { margin-bottom: 0; } ul { list-style: none; padding: 0; } button { border: none; margin: 0; padding: 0; width: auto; overflow: visible; background: tran...
... font-size: 1.6rem; line-height: 1.25; display: block; position: relative; min-height: 44px; padding-left: 40px; clear: left; } .c-cb > label::before, .c-cb > input[type="checkbox"] { box-sizing: border-box; top: -2px; left: -2px; width: 44px; height: 44px; } .c-cb > input[type="checkbox"] { -webkit-font-smoothing: antialiased; cursor: pointer; position: absolute; z-
index: 1; margin: 0; opacity: 0; } .c-cb > label { font-size: inherit; font-family: inherit; line-height: inherit; display: inline-block; margin-bottom: 0; padding: 8px 15px 5px; cursor: pointer; touch-action: manipulation; } .c-cb > label::before { content: ""; position: absolute; border: 2px solid currentcolor; background: transparent; } .c-cb > input[type="checkbox"]:focu...
Getting started with Vue - Learn web development
public: this directory contains static assets that are published, but not processed by webpack during build (with one exception;
index.html gets some processing).
...
index.html: this is the template for your app.
...currently, this file initializes your vue application and signifies which html element in the
index.html file your app should be attached to.
Handling common JavaScript problems - Learn web development
there are also many new apis appearing in recent browsers, which don't work in older browsers, for example:
indexeddb api, web storage api, and others for storing website data on the client-side.
...in the background, it uses the best api the browser has available for storing the data, whether that is
indexeddb, web storage, or even websql (which is now deprecated, but is still supported in some older versions of safari/ie).
... the code used to look something like this (although this is a simplified example): let ua = navigator.useragent; if(ua.
indexof('firefox') !== -1) { // run firefox-specific code } else if(ua.
indexof('chrome') !== -1) { // run chrome-specific code } the idea was fairly good — detect what browser is viewing the site, and run code as appropriate to make sure the browser will be able to use your site ok.
Introducing a complete toolchain - Learn web development
if this is the case, install it using the following command: npm install prettier -g now that prettier is installed, running and tidying your code can be done on the command line on an individual file basis from anywhere on your computer, for example: prettier --write ./src/
index.html note: in the command above, i use prettier with the --write flag.
...here is an example eslint output: ./my-project/src/
index.js 2:8 error 'react' is defined but never used no-unused-vars 22:20 error 'body' is defined but never used no-unused-vars 96:19 error 'b' is defined but never used no-unused-vars ✖ 3 problems (3 errors, 0 warnings) note: we'll install eslint in the next section; don't worry about this for now.
... to start parcel off in the background, go to your terminal and run the following command: npx parcel src/
index.html you should see an output like this (once the dependencies have been installed): server running at http://localhost:1234 ✨ built in 129ms.
Accessibility/LiveRegionDevGuide
the event.any_data field holds the entire text string while event.detail1 is the start
index while event.detail2 is the text string length.
...when atomic is set to "false", the start
index and end
index/run length are used as given.
...in this case the start
index is 0 and the end
index/run length is the length of the text - 1.
Debugging on Mac OS X
# breakpoint set --name nsthread::processnextevent --thread-
index 1 --auto-continue true --one-shot true breakpoint command add -s python # this script that we run does not work if we try to use the global 'lldb' # object, since it is out of date at the time that the script runs (for # example, `lldb.target.executable.fullpath` is empty).
...getid() on the *dummy* breakpoint appears to be returning # the breakpoint
index instead of its id.
...:-( dummy_bp_list = lldb.sbbreakpointlist(target) debugger.getdummytarget().findbreakpointsbyname("nsthread::processnextevent", dummy_bp_list) dummy_bp_id = dummy_bp_list.getbreakpointat
index(0).getid() + 1 debugger.getdummytarget().breakpointdelete(dummy_bp_id) # "source" the mozilla project .lldbinit: os.chdir(target.executable.fullpath.split("/dist/")[0]) debugger.handlecommand("command source -s true " + os.path.join(os.getcwd(), ".lldbinit")) done see debugging mozilla with lldb for more information.
Message manager overview
its most important functions and attributes are: childcount : contains the number of children (typically, browser windows) getchildat() : get the child at the given
index loadframescript() : load a frame script into every tab in the browser broadcastasyncmessage() : send a message to frame scripts addmessagelistener() : start listening to a specific message from all frame scripts removemessagelistener() : stop listening to a specific message interfaces nsiframescriptloader nsimessagelistenermanager nsimessagebroad...
... its most important functions and attributes are: childcount : contains the number of children (typically, browser tabs) getchildat() : get the child at the given
index loadframescript() : load a frame script into every tab in this window broadcastasyncmessage() : send a message to all frame scripts in this window addmessagelistener() : start listening to a specific message from frame scripts removemessagelistener() : stop listening to a specific message interfaces nsiframescriptloader nsimessagelistenermanager ...
... its most important functions and attributes are: childcount : contains the number of children (child processes, plus the in-content child) getchildat() : get the child at the given
index loadprocessscript() : load a process script into every content process broadcastasyncmessage() : send a message to all process scripts addmessagelistener() : start listening to a specific message from process scripts removemessagelistener() : stop listening to a specific message interfaces nsiprocessscriptloader nsimessagelistenermanager nsimessa...
HTML parser threading
the speculation object has a queue of tree ops (into which the tree builder will now flush ops to instead of the tree op stage), an owning reference to the nshtml5owningutf16buffer that contains the starting point of the speculation, an
index into the nshtml5owningutf16buffer defining the exact starting point within the buffer, the line number of the tokenizer at that point and a snapshot of the tree op state.
...if the speculation failed, the first buffer corresponding to the starting point of the speculation gets its start
index restored to the
index stored on the speculation object.
... subsequent buffers get their start
index reset back to zero.
PRThreadPrivateDTOR
the destructor function passed to pr_newthreadprivate
index that is associated with the resulting thread private
index.
... syntax #include <prthread.h> typedef void (pr_callback *prthreadprivatedtor)(void *priv); description until the data associated with an
index is actually set with a call to pr_setthreadprivate, the value of the data is null.
... if the data associated with the
index is not null, nspr passes a reference to the data to the destructor function when the thread terminates.
JS::CallArgs
js::mutablehandlevalue operator[](unsigned i) const returns the i-th zero-
indexed argument.
... js::handlevalue get(unsigned i) const returns the i-th zero-
indexed argument, or undefined if there's no such argument.
... bool hasdefined(unsigned i) const returns true if the i-th zero-
indexed argument is present and is not undefined.
JS_DeleteElement
syntax bool js_deleteelement(jscontext *cx, js::handleobject obj, uint32_t
index); // added in spidermonkey 45 bool js_deleteelement(jscontext *cx, js::handleobject obj, uint32_t
index, js::objectopresult &result); name type description cx jscontext * pointer to a js context from which to derive runtime information.
...
index uint32_t
index number of the element to delete.
... description js_deleteelement removes a specified element or numeric property,
index, from an object, obj.
JS_DeleteElement2
renamed to js_deleteelement in jsapi 39 syntax bool js_deleteelement2(jscontext *cx, js::handleobject obj, uint32_t
index, bool *succeeded); name type description cx jscontext * pointer to a js context from which to derive runtime information.
...
index uint32_t
index number of the element to delete.
... description js_deleteelement2 removes a specified element or numeric property,
index, from an object, obj.
JS_GetElement
syntax bool js_getelement(jscontext *cx, js::handleobject obj, uint32_t
index, js::mutablehandlevalue vp); name type description cx jscontext * the context in which to perform the property lookup.
...
index uint32_t
index of the element to look up.
... description js_getelement examines a specified js object, obj, and its prototype chain, for an element or numeric property numbered
index.
JS_GetStringCharAt
syntax bool js_getstringcharat(jscontext *cx, jsstring *str, size_t
index, char16_t *res); char16_t js_getflatstringcharat(jsflatstring *str, size_t
index); name type description cx jscontext * the context in which to create the new string.
...
index size_t an integer between 0 and 1-less-than the length of the string.
...
index should not be greater than or equal to the length of str.
JS_IdArrayGet
syntax jsid js_idarrayget(jscontext *cx, jsidarray *ida, unsigned
index) name type description cx jscontext * a context.
...
index unsigned the
index of the id in the jsidarray.
... description js_idarrayget gets the item in the specified
index of the id array pointed to by ida.
Property attributes
mxr id search for jsprop_shared jsprop_
index the property's id is represented internally as an integer, not a string.
... mxr id search for jsprop_
index jsprop_define_late don't define property when initially creating the constructor.
...prop_ignore_value see also bug 575997 - for jsprop_shared bug 1088002 - added jsprop_propop_accessors bug 825199 - added jsprop_define_late bug 365851 - added jsfun_stub_gsops bug 581263 - added jsfun_constructor bug 1101123 - added jsprop_redefine_nonconfigurable bug 1037770 - added jsop_ignore_* bug 1105518 - for jsprop_redefine_nonconfigurable bug 1138489 - removed jsprop_
index bug 1140482 - added jsprop_resolving ...
JSAPI reference
ed in spidermonkey 1.8 obsolete since jsapi 31 jsval_trace_kind added in spidermonkey 1.8 obsolete since jsapi 31 js_tracer_init added in spidermonkey 1.8 obsolete since jsapi 12 js_tracerinit added in spidermonkey 12 obsolete since jsapi 31 js_calltracer added in spidermonkey 1.8 obsolete since jsapi 22 js_set_tracing_details added in spidermonkey 1.8 obsolete since jsapi 26 js_set_tracing_
index added in spidermonkey 1.8 obsolete since jsapi 26 js_set_tracing_name added in spidermonkey 1.8 obsolete since jsapi 26 js_call_tracer added in spidermonkey 1.8 obsolete since jsapi 23 js_call_value_tracer added in spidermonkey 1.8 obsolete since jsapi 23 js_call_object_tracer added in spidermonkey 1.8 obsolete since jsapi 23 js_call_string_tracer added in spidermonkey 1.8 obsolete since jsa...
... struct jspropertydescriptor added in spidermonkey 1.8 property attributes jsprop_enumerate jsprop_readonly jsprop_permanent jsprop_propop_accessors added in spidermonkey 38 jsprop_getter jsprop_setter jsprop_shared jsprop_
index jsprop_define_late added in spidermonkey 38 jsfun_stub_gsops added in spidermonkey 17 jsfun_constructor added in spidermonkey 17 jsprop_redefine_nonconfigurable added in spidermonkey 38 jsprop_resolving added in spidermonkey 45 jsprop_ignore_enumerate added in spidermonkey 38 jsprop_ignore_readonly added in spidermonkey 38 jsprop_ignore_permanent added in spidermonkey 38 ...
... struct jsid js_idtovalue js_idtoprotokey added in spidermonkey 31 js_valuetoid js_stringtoid added in spidermonkey 38 js_
indextoid added in spidermonkey 17 js_charstoid added in spidermonkey 24 js::protokeytoid added in spidermonkey 38 js_isidentifier added in spidermonkey 17 struct jsidarray class js::autoidarray added in spidermonkey 17 js_idarraylength added in spidermonkey 17 js_idarrayget added in spidermonkey 17 js_destroyidarray js_getobjectid obsolete since jsapi 31 jsid constants: jsid_void ...
Components.classesByID
components.classesbyid is a read-only object whose properties are classes
indexed by cid.
... components.classesbyid is exactly like components.classes except that the elements are
indexed by the canonical form of their cid, and does not only represent the component classes that have been registered with the component manager using a contractid, but also those registered using a plain cid.
... usage in order to retrieve the object for a given cid, you can use that cid as an
index with components.classesbyid as follows: var clazz = components.classesbyid["{ed132c20-eed1-11d2-baa4-00805f8a5dd7}"]; ...
Insert
void insert( const self_type& astring,
index_type aposition ); parameters astring [in] a nsacstring to append to this string.
... void insert( const char_type* adata,
index_type aposition, size_type adatalength = pr_uint32_max ); parameters adata [in] a raw character array to append to this string.
... void insert( char_type achar,
index_type aposition ); parameters achar [in] a character to append to this string.
Replace
void replace(
index_type acutstart,
index_type acutlength, const self_type& astring ); parameters acutstart [in] the starting
index of the section to remove, measured in storage units.
... void replace(
index_type acutstart, size_type acutlength, const char_type* adata, size_type adatalength = pr_uint32_max ); parameters acutstart [in] the starting
index of the section to remove, measured in storage units.
... void replace(
index_type acutstart,
index_type acutlength, char_type achar ); parameters acutstart [in] the starting
index of the section to remove, measured in storage units.
Insert
void insert( const self_type& astring,
index_type aposition ); parameters astring [in] a nsastring to append to this string.
... void insert( const char_type* adata,
index_type aposition, size_type adatalength = pr_uint32_max ); parameters adata [in] a raw character array to append to this string.
... void insert( char_type achar,
index_type aposition ); parameters achar [in] a character to append to this string.
Replace
void replace(
index_type acutstart,
index_type acutlength, const self_type& astring ); parameters acutstart [in] the starting
index of the section to remove, measured in storage units.
... void replace(
index_type acutstart, size_type acutlength, const char_type* adata, size_type adatalength = pr_uint32_max ); parameters acutstart [in] the starting
index of the section to remove, measured in storage units.
... void replace(
index_type acutstart,
index_type acutlength, char_type achar ); parameter acutstart [in] the starting
index of the section to remove, measured in storage units.
DoAction
« nsiaccessible page summary this method performs the accessible action at the given zero-based
index.
... void doaction( in pruint8 a
index ); parameters a
index[in] the zero-based
index.
...ns_error_invalid_arg indicates that the given
index is our of range.
GetActionDescription
« nsiaccessible page summary this method retrieves the description (localized name) of the accessible action at the given zero-based
index.
... astring getactiondescription( in pruint8 a
index ); parameters a
index[in] the zero-based
index.
...ns_error_invalid_arg indicates that the given
index is our of range.
GetActionName
« nsiaccessible page summary this method retrieves the name of the accessible action at the given zero-based
index.
... astring getactionname( in pruint8 a
index ); parameters a
index[in] the zero-based
index.
...exceptions thrown ns_error_failure indicates that the accessible is unattached from the accessible tree.ns_error_invalid_arg indicates that the given
index is our of range.
GetKeyBindings
« nsiaccessible page summary this method provides array of localized string of global keyboard accelerator for the given action
index supported by accessible.
... nsidomdomstringlist getkeybindings( in pruint8 aaction
index ); parameters aaction
index[in]
index of the given action.
... exceptions thrown ns_error_invalid_arg the given
index doesn't correspond to default action (not zero).
nsIDOMFontFaceList
1.0 66 introduced gecko 7.0 inherits from: nsisupports last changed in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) method overview nsidomfontface item(in unsigned long
index); attributes attribute type description length unsigned long the number of items in the list.
... methods item() returns the nsidomfontface object at the specified
index into the list.
... nsidomfontface item( in unsigned long
index ); parameters
index the
index into the array of the font face object to return.
nsIDragSession
inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void getdata( in nsitransferable atransferable, in unsigned long aitem
index ); boolean isdataflavorsupported( in string adataflavor ); attributes attribute type description candrop boolean set the current state of the drag, whether it can be dropped or not.
... void getdata( in nsitransferable atransferable, in unsigned long aitem
index ); parameters atransferable the transferable for the data to be put into.
... aitem
index which of multiple drag items, zero-based.
nsIDynamicContainer
method overview void oncontainermoved(in long long aitemid, in long long anewparent, in long anew
index); void oncontainernodeclosed(in nsinavhistorycontainerresultnode acontainer); void oncontainernodeopening(in nsinavhistorycontainerresultnode acontainer, in nsinavhistoryqueryoptions aoptions); void oncontainerremoving(in long long aitemid); methods oncontainermoved() this method is called when the given container has just been moved, in case the service needs to do any bookkeeping.
...void oncontainermoved( in long long aitemid, in long long anewparent, in long anew
index ); parameters aitemid the item-id of the container item.
...anew
index the
index at which the container will be inserted, or "-1" to append to the end of the list.
nsIMessageBroadcaster
methods void broadcastasyncmessage([optional] in astring messagename, [optional] in jsval obj, [optional] in jsval objects); nsimessagelistenermanager getchildat(in unsigned long a
index); broadcastasyncmessage() like sendasyncmessage(), but also broadcasts this message to all "child" message managers of this message manager.
...parameters name type description a
index number the
index of the subordinate message manager to retrieve.
... returns nsimessagelistenermanager: the message manager at the given
index.
nsINavHistoryResultNode
bookmark
index long when this item is in a bookmark folder (its parent is of type folder), this is the
index into that folder at which this node resides.
... view
index long value with undefined meaning for use by the view.
...view-implementations may use this value to track the node
index in the view, for example the tree view uses this value to indicate the row in the tree that this node is at.
nsINavHistoryResultViewObserver
inherits from: nsisupports last changed in gecko 1.9.0 method overview boolean candrop(in long
index, in long orientation); void ondrop(in long row, in long orientation); void ontoggleopenstate(in long
index); void oncycleheader(in nsitreecolumn column); void oncyclecell(in long row, in nsitreecolumn column); void onselectionchanged(); void onperformaction(in wstring action); void onperformactiononrow(in wstring action, in long row); void onperformactiononcell(in wstring acti...
... boolean candrop( in long
index, in long orientation ); parameters
index the item over which the drag is currently located.
... void ontoggleopenstate( in long
index ); parameters
index the item being toggled.
nsISHistoryListener
method overview boolean onhistorygoback(in nsiuri abackuri); boolean onhistorygoforward(in nsiuri aforwarduri); boolean onhistorygoto
index(in long a
index, in nsiuri agotouri); void onhistorynewentry(in nsiuri anewuri); boolean onhistorypurge(in long anumentries); boolean onhistoryreload(in nsiuri areloaduri, in unsigned long areloadflags); methods onhistorygoback() called when navigating to a previous session history entry, for example due to an nsiwebnavigation.goback() call.
...onhistorygoto
index() called when navigating to a session history entry by
index, for example, when nsiwebnavigation.goto
index() is called.
... boolean onhistorygoto
index( in long a
index, in nsiuri agotouri ); parameters a
index the
index in session history of the entry to be loaded.
nsISelection
nsidomrange getrangeat(in long
index); void modify(in domstring alter, in domstring direction, in domstring granularity); void removeallranges(); void removerange(in nsidomrange range); void selectallchildren(in nsidomnode parentnode); void selectionlanguagechange(in boolean langrtl); domstring tostring(); attributes attribute type description ancho...
... native code only!extendnative void extendnative( in nsinode parentnode, in long offset ); parameters parentnode offset getrangeat() returns the nsidomrange at the specified
index.
... nsidomrange getrangeat( in long
index ); parameters
index return value the nsidomrange requested modify() modifies the selection.
nsITreeColumns
last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview nsitreecolumn getcolumnat(in long
index); nsitreecolumn getcolumnfor(in nsidomelement element); nsitreecolumn getfirstcolumn(); nsitreecolumn getkeycolumn(); nsitreecolumn getlastcolumn(); nsitreecolumn getnamedcolumn(in astring id); nsitreecolumn getprimarycolumn(); nsitreecolumn getsortedcolumn(); void invalidatecolumns(); void restorenaturalorder(); attributes attribute type description count long the number of columns.
... methods getcolumnat() get the column for a given
index.
... nsitreecolumn getcolumnat( in long
index ); parameters
index index of the column return value a nsitreecolumn for this
index.
nsIWebNavigation
method overview void goback void goforward void goto
index( in long
index ) void loaduri(in wstring uri , in unsigned long loadflags , in nsiuri referrer , in nsiinputstream postdata, in nsiinputstream headers) void reload(in unsigned long reloadflags) void stop(in unsigned long stopflags) constants load flags constant value description load_flags_mask 65535 this flag defines the range of...
... void goforward( ); goto
index() tells the object to navigate to the session history item at a given
index.
... void goto
index( in long
index ); parameters
index the
index of the session history item to go to.
nsIWindowsRegKey
method overview void close(); void create(in unsigned long rootkey, in astring relpath, in unsigned long mode); nsiwindowsregkey createchild(in astring relpath, in unsigned long mode); astring getchildname(in unsigned long
index); astring getvaluename(in unsigned long
index); unsigned long getvaluetype(in astring name); boolean haschanged(); boolean haschild(in astring name); boolean hasvalue(in astring name); boolean iswatching(); void open(in unsigned long rootkey, in astring relpath, in unsigned long mode); nsiwindowsregkey openchild(in astring re...
...astring getchildname( in unsigned long
index ); parameters
index the
index of the requested child key.
...astring getvaluename( in unsigned long
index ); parameters
index the
index of the requested value.
nsPIPromptService
this interface defines the meaning of each
indexes 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.
... the
indexes for getint() and setint() are: ebuttonpressed the value is 0.
Performance
for example sqlite> explain query plan select * from moz_historyvisit v join moz_history h on v.page_id = h.id where v.visit_date > 1000000000; 0|0|table moz_historyvisit as v with
index moz_historyvisit_date
index 1|1|table moz_history as h using primary key this tells us that it will first look up in moz_historyvisit using an
index, and will then look up in moz_history using the primary key.
...sqlite> explain query plan select * from moz_historyvisit where session = 12; 0|0|table moz_historyvisit in this example, you can see that it is not using an
index, so this query would be slow.
...some features (virtual tables, full text
indexes) are not compatible with shared cache - then you need to use services.storage.openunshareddatabase(file), which doesn't share the cache.
Gloda examples
a) show all messages in a conversation regardless of the folder in which they are stored, b) search messages by subject assuming that you have a message (glodamessage) in the conversation already, this is straight forward using glodamessage.conversation.getmessagescollection() alistener = { /* called when new items are returned by the database query or freshly
indexed */ onitemsadded: function _onitemsadded(aitems, acollection) { }, /* called when items that are already in our collection get re-
indexed */ onitemsmodified: function _onitemsmodified(aitems, acollection) { }, /* called when items that are in our collection are purged from the system */ onitemsremoved: function _onitemsremoved(aitems, acollection) { }, /* call...
...{}); query.tags(...tagarray); let collection = query.getcollection(mylistener); search messages by daterange searches for all messages within a date range id_q=gloda.newquery(gloda.noun_message); // define a date range form yesterday to now id_q.daterange([new date() - 86400000, new date()]); var mylistener = { /* called when new items are returned by the database query or freshly
indexed */ onitemsadded: function _onitemsadded(aitems, acollection) { }, /* called when items that are already in our collection get re-
indexed */ onitemsmodified: function _onitemsmodified(aitems, acollection) { }, /* called when items that are in our collection are purged from the system */ onitemsremoved: function _onitemsremoved(aitems, acollection) { }, /* call...
... id = id_coll.items[0]; //now we use the identity to find all messages that person was involved with msg_q=gloda.newquery(gloda.noun_message) msg_q.involves(id) msg_q.getcollection({ /* called when new items are returned by the database query or freshly
indexed */ onitemsadded: function _onitemsadded(aitems, acollection) { }, /* called when items that are already in our collection get re-
indexed */ onitemsmodified: function _onitemsmodified(aitems, acollection) { }, /* called when items...
Standard OS Libraries
a complete list of windows apis can be found at the msdn api
index.
...a list of all the functions available through this api can be found at the msdn winapi
index.
...so i went to the msdn winapi
index page and then went to the "cursors" category and came across getcursorpos.
Working with ArrayBuffers
method 2: manually handled another strategy is to handle it manually, as illustrated by the following code example: var casted = ctypes.cast(pixelbuffer.address(), ctypes.uint8_t.array(myimgdata.data.length).ptr).contents; // myimgdat.data.length is imgwidth * imgheight *4 because per pixel there is r, g, b, a numbers /** method a **/ for (var n
index = 0; n
index < casted.length; n
index = n
index + 4) { // casted.length is same as myimgdat.data.length var r = casted[n
index]; var g = casted[n
index + 1]; var b = casted[n
index + 2]; var a = casted[n
index + 3]; myimgdat.data[n
index] = r; myimgdat.data[n
index + 1] = g; myimgdat.data[n
index + 2] = b; myimgdat.data[n
index + 3] = a; } /***** or do the below which uses...
... the .set method *****/ /** method b **/ var normalarr = []; for (var n
index = 0; n
index < cast.length; n
index = n
index + 4) { // casted.length is same as myimgdat.data.length var r = casted[n
index]; var g = casted[n
index + 1]; var b = casted[n
index + 2]; var a = casted[n
index + 3]; normalarr.push(r); normalarr.push(g); normalarr.push(b); normalarr.push(a); } myimgdat.data.set(normalarr); the preceding example, however, does not take advantage of method 1, but instead manually goes through the array and sets the imagedata array.
...o.0.1'); break; default: //assume unix try { lib = ctypes.open(ctypes.libraryname('c')); } catch (ex) { throw new error('i dont know where to memcpy is defined on your operating system, "' + os.constants.sys.name + '"'); lib.close(); } } try { var memcpy = lib.declare('memcpy', os.constants.sys.name.tolowercase().
indexof('win') == 0 ?
Using js-ctypes
cu.import('resource://gre/modules/ctypes.jsm'); var libcf = ctypes.open('/system/library/frameworks/corefoundation.framework/corefoundation'); // define types var cf
index = ctypes.long; var cfoptionflags = ctypes.unsigned_long; var cftimeinterval = ctypes.double; var cftyperef = ctypes.voidptr_t; var sint32 = ctypes.long; var void = ctypes.void_t; var __cfstring = new ctypes.structtype("__cfstring"); var cfstringref = __cfstring.ptr; var __cfurl = new ctypes.structtype("__cfurl"); var cfurlref = __cfurl.ptr; var __cfallocator = new ctypes.structtype("__cfalloca...
...tor.ptr; var unichar = ctypes.jschar; // uint16 with automatic conversion // define constants var kcfusernotificationstopalertlevel = 0; var kcfusernotificationnotealertlevel = 1; var kcfusernotificationcautionalertlevel = 2; var kcfusernotificationplainalertlevel = 3; // declare functions /* https://developer.apple.com/library/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 defaultbuttontitle * ); */ var cfusernotificationdisplaynotice = libcf.declare("cfuser...
... * void cfrelease ( * cftyperef cf * ); */ var cfrelease = libcf.declare('cfrelease', ctypes.default_abi, void, // return cftyperef // cf ); /* https://developer.apple.com/library/mac/documentation/corefoundation/reference/cfstringref/#//apple_ref/c/func/cfstringcreatewithcharacters * cfstringref cfstringcreatewithcharacters ( * cfallocatorref alloc, * const unichar *chars, * cf
index numchars * ); */ var cfstringcreatewithcharacters = libcf.declare('cfstringcreatewithcharacters', ctypes.default_abi, cfstringref, // return cfallocatorref, // alloc unichar.ptr, // *chars cf
index // numchars ); // helper functions function makecfstr(jsstr) { // js str is just a string // returns a cfstr that must be released with cfrelease when done return cfstringcreatewithchara...
AudioBuffer.getChannelData() - Web APIs
syntax var myarraybuffer = audioctx.createbuffer(2, framecount, audioctx.samplerate); var nowbuffering = myarraybuffer.getchanneldata(channel); parameters channel the channel property is an
index representing the particular channel to get data for.
... an
index value of 0 represents the first channel.
... if the channel
index value is greater than of equal to audiobuffer.numberofchannels, an
index_size_err exception will be thrown.
Blob.slice() - Web APIs
syntax var newblob = blob.slice(start, end, contenttype); parameters start optional an
index into the blob indicating the first byte to include in the new blob.
... end optional an
index into the blob indicating the first byte that will *not* be included in the new blob (i.e.
... the byte exactly at this
index is not included).
CSSStyleSheet.addRule() - Web APIs
syntax var result = cssstylesheet.addrule(selector, styleblock,
index); parameters selector a domstring specifying the selector portion of the css rule.
...
index optional an optional
index into the stylesheet's cssrulelist at which to insert the new rule.
... if
index is not specified, the next
index after the last item currently in the list is used (that is, the value of cssstylesheet.cssrules.length).
CSSValueList - Web APIs
the items in the cssvaluelist are accessible via an integral
index, starting from 0.
... methods cssvaluelist.item() this method is used to retrieve a cssvalue by ordinal
index.
...if
index is greater than or equal to the number of values in the list, this returns null.
Examples of web and XML development using the DOM - Web APIs
ocument.createelement('table'); var thead = table.createthead(); var row = thead.insertrow(-1); var lablelist = ['#', 'property', 'value']; var len = lablelist.length; for (var i=0; i<len; i++) { addcell(row, lablelist[i]); } var tbody = document.createelement('tbody'); table.appendchild(tbody); for (var p in e) { row = tbody.insertrow(-1); row.classname = (row.row
index % 2)?
... 'odd':'even'; addcell(row, row.row
index); addcell(row, p); addcell(row, e[p]); } document.body.appendchild(table); } window.onload = function(event){ showeventproperties(event); } </script> </head> <body> <h1>properties of the dom <span id="eventtype"></span> event object</h1> </body> </html> example 8: using the dom table interface the dom htmltableelement interface provides some convenience methods for creating and manipulating tables.
... to add a row and some cells to an existing table: <table id="table0"> <tr> <td>row 0 cell 0</td> <td>row 0 cell 1</td> </tr> </table> <script> var table = document.getelementbyid('table0'); var row = table.insertrow(-1); var cell, text; for (var i = 0; i < 2; i++) { cell = row.insertcell(-1); text = 'row ' + row.row
index + ' cell ' + i; cell.appendchild(document.createtextnode(text)); } </script> notes a table's innerhtml property should never be used to modify a table, although you can use it to write an entire table or the content of a cell.
FileList - Web APIs
for example, if the html includes the following file input: <input id="fileitem" type="file"> the following line of code fetches the first file in the node's file list as a file object: var file = document.getelementbyid('fileitem').files[0]; method overview file item(
index); properties attribute type description length integer a read-only value indicating the number of files in the list.
... methods item() returns a file object representing the file at the specified
index in the file list.
... file item(
index ); parameters
index the zero-based
index of the file to retrieve from the list.
Gamepad - Web APIs
gamepad.
index read only an integer that is auto-incremented to be unique for each device currently connected to the system.
... example window.addeventlistener("gamepadconnected", function(e) { console.log("gamepad connected at
index %d: %s.
... %d buttons, %d axes.", e.gamepad.
index, e.gamepad.id, e.gamepad.buttons.length, e.gamepad.axes.length); }); specifications specification status comment gamepadthe definition of 'gamepad' in that specification.
GamepadEvent - Web APIs
window.addeventlistener("gamepadconnected", function(e) { console.log("gamepad connected at
index %d: %s.
... %d buttons, %d axes.", e.gamepad.
index, e.gamepad.id, e.gamepad.buttons.length, e.gamepad.axes.length); }); and on a window.gamepaddisconnected event.
... window.addeventlistener("gamepaddisconnected", function(e) { console.log("gamepad disconnected from
index %d: %s", e.gamepad.
index, e.gamepad.id); }); specifications specification status comment gamepadthe definition of 'gamepadevent' in that specification.
HTMLCollection - Web APIs
methods htmlcollection.item() returns the specific node at the given zero-based
index into the list.
... returns null if the
index is out of range.
... usage in javascript htmlcollection also exposes its members directly as properties by both name and
index.
HTMLFormElement.elements - Web APIs
you can access a particular form control in the returned collection by using either an
index or the element's name or id.
... example quick syntax example in this example, we see how to obtain the list of form controls as well as how to access its members by
index and by name or id.
... <form id="my-form"> <input type="text" name="username"> <input type="text" name="full-name"> <input type="password" name="password"> </form> var inputs = document.getelementbyid("my-form").elements; var inputby
index = inputs[0]; var inputbyname = inputs["username"]; accessing form controls this example gets the form's element list, then iterates over the list, looking for <input> elements of type "text" so that some form of processing can be performed on them.
HTMLInputElement - Web APIs
selectionstart unsigned long: returns / sets the beginning
index of the selected text.
... selectionend unsigned long: returns / sets the end
index of the selected text.
... recommendation technically, the tab
index and accesskey properties, as well as the blur(), click(), and focus() methods, are now defined on htmlelement.
HTMLSelectElement.item() - Web APIs
the htmlselectelement.item() method returns the element corresponding to the htmloptionelement whose position in the options list corresponds to the
index given in the parameter, or null if there are none.
... in javascript, using the array bracket syntax with an unsigned long, like selectelt[
index] is equivalent to selectelt.nameditem(
index).
... syntax var item = collection.item(
index); var item = collection[
index]; parameters
index is an unsigned long.
HTMLSelectElement.remove() - Web APIs
the htmlselectelement.remove() method removes the element at the specified
index from the options collection for this select element.
... syntax collection.remove(
index); parameters
index is a long for the
index of the htmloptionelement to remove from the collection.
... if the
index is not found the method has no effect.
HTMLTableElement.deleteRow() - Web APIs
syntax htmltableelement.deleterow(
index) parameters
index index is an integer representing the row that should be deleted.
... however, the special
index -1 can be used to remove the very last row of a table.
... return value no return value errors thrown if the number of the row to delete, specified by the parameter, is greater or equal to the number of available rows, or if it is negative and not equal to the special
index -1, representing the last row of the table, the exception
index_size_err is thrown.
IDBCursor.continuePrimaryKey() - Web APIs
this method is only valid for cursors coming from an
index.
... example here’s how you can resume an iteration of all articles tagged with "javascript" since your last visit: let request = articlestore.
index("tag").opencursor(); let count = 0; let unreadlist = []; request.onsuccess = (event) => { let cursor = event.target.result; if (!cursor) { return; } let lastprimarykey = getlastiteratedarticleid(); if (lastprimarykey > cursor.primarykey) { cursor.continueprimarykey("javascript", lastprimarykey); return; } // update lastiteratedarticleid setlastiteratedartic...
...leid(cursor.primarykey); // preload 5 articles into the unread list; unreadlist.push(cursor.value); if (++count < 5) { cursor.continue(); } }; specifications specification status comment
indexed database api draftthe definition of 'continueprimarykey()' in that specification.
IDBDatabase: abort event - Web APIs
// 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: 'tasktitle' }); // define what data items the objectstore will contain objectstore.create
index('hours', 'hours', { unique: false }); objectstore.create
index('minutes', 'minute...
...s', { unique: false }); objectstore.create
index('day', 'day', { unique: false }); objectstore.create
index('month', 'month', { unique: false }); objectstore.create
index('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const db = dbopenrequest.result; db.addeventlistener('abort', () => { console.log('transaction aborted'); }); // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todolist'], 'readwrite'); // abort 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; // c...
...reate an objectstore for this database const objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.create
index('hours', 'hours', { unique: false }); objectstore.create
index('minutes', 'minutes', { unique: false }); objectstore.create
index('day', 'day', { unique: false }); objectstore.create
index('month', 'month', { unique: false }); objectstore.create
index('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const db = dbopenrequest.result; db.onabort = () => { console.log('transaction aborted'); }; // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todolist'], 'readwrite'); // abort the transaction ...
IDBDatabase.close() - Web APIs
syntax idbdatabase.close(); example // let us open our database var dbopenrequest = window.
indexeddb.open("todolist", 4); // opening a database.
... db.close(); }; specification specification status comment
indexed database api 2.0the definition of 'close()' in that specification.
... recommendation
indexed database api draftthe definition of 'close()' in that specification.
IDBDatabase: close event - Web APIs
bubbles no cancelable no interface event 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: 'tasktitle' }); // define what data items the objectstore will contain objectstore.create
index('hours', 'hours', { unique: false }); objectstore.create
index('minutes', 'minute...
...s', { unique: false }); objectstore.create
index('day', 'day', { unique: false }); objectstore.create
index('month', 'month', { unique: false }); objectstore.create
index('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const db = dbopenrequest.result; db.addeventlistener('close', () => { console.log('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: 'tasktitle' }); // define what data items the objectstore will co...
...ntain objectstore.create
index('hours', 'hours', { unique: false }); objectstore.create
index('minutes', 'minutes', { unique: false }); objectstore.create
index('day', 'day', { unique: false }); objectstore.create
index('month', 'month', { unique: false }); objectstore.create
index('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const db = dbopenrequest.result; db.onclose = () => { console.log('database connection closed'); }; }; ...
IDBDatabase: error event - Web APIs
bubbles yes cancelable no interface event event handler property onerror examples this example opens a database and tries to add a record, listening for the error event for the add() operation (this will occur if, for example, a record with the given tasktitle 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: 'tasktitle' }); // define what data items the objectstore will contain objectstore.create
index('hours', 'hours', { unique: false }); objectstore.create
index('minutes', 'minute...
...s', { unique: false }); objectstore.create
index('day', 'day', { unique: false }); objectstore.create
index('month', 'month', { unique: false }); objectstore.create
index('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const newitem = { tasktitle: '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.tasktitle}`); }); // open a read/write db transaction, ready for adding the data const transaction = db.transaction(['todolist'], 'readwrite'); const objectstore = transaction.objectstore('todolist'); const objectstorerequest = objectstore.add(newitem); }; the same example, using the onerror property inste...
...ad 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: 'tasktitle' }); // define what data items the objectstore will contain objectstore.create
index('hours', 'hours', { unique: false }); objectstore.create
index('minutes', 'minutes', { unique: false }); objectstore.create
index('day', 'day', { unique: false }); objectstore.create
index('month', 'month', { unique: false }); objectstore.create
index('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const newitem = { tasktitle: 'my task', hours: 10, minutes: 10, day:...
IDBDatabase.name - Web APIs
// let us open our database var dbopenrequest = window.
indexeddb.open("todolist", 4); // these two event handlers act on the database being // opened successfully, or not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
... this is used a lot below db = dbopenrequest.result; // this line will log the name of the database, which should be "todolist" console.log(db.name); }; specifications specification status comment
indexed database api 2.0the definition of 'name' in that specification.
... recommendation
indexed database api draftthe definition of 'name' in that specification.
IDBDatabase.objectStoreNames - Web APIs
example // let us open our database var dbopenrequest = window.
indexeddb.open("todolist", 4); // these two event handlers act on the database being opened successfully, or not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
... this is used a lot below db = dbopenrequest.result; // this line will log the version of the connected database, which should be // an object that looks like { ['my-store-name'] } console.log(db.objectstorenames); }; specifications specification status comment
indexed database api 2.0the definition of 'objectstorenames' in that specification.
... recommendation
indexed database api draftthe definition of 'objectstorenames' in that specification.
IDBDatabase.onabort - Web APIs
result; db.onerror = function() { note.innerhtml += '<li>error opening database.</li>'; }; db.onabort = function() { note.innerhtml += '<li>database opening aborted!</li>'; }; // create an objectstore for this database var objectstore = db.createobjectstore("todolist", { keypath: "tasktitle" }); // define what data items the objectstore will contain objectstore.create
index("hours", "hours", { unique: false }); objectstore.create
index("minutes", "minutes", { unique: false }); objectstore.create
index("day", "day", { unique: false }); objectstore.create
index("month", "month", { unique: false }); objectstore.create
index("year", "year", { unique: false }); objectstore.create
index("notified", "notified", { unique: false }); note.innerhtml += '<li>object sto...
...re created.</li>'; }; specifications specification status comment
indexed database api 2.0the definition of 'onabort' in that specification.
... recommendation
indexed database api draftthe definition of 'onabort' in that specification.
IDBDatabase.onerror - Web APIs
db.onerror = function(event) { note.innerhtml += '<li>error opening database.</li>'; }; db.onabort = function(event) { note.innerhtml += '<li>database opening aborted!</li>'; }; // create an objectstore for this database var objectstore = db.createobjectstore("todolist", { keypath: "tasktitle" }); // define what data items the objectstore will contain objectstore.create
index("hours", "hours", { unique: false }); objectstore.create
index("minutes", "minutes", { unique: false }); objectstore.create
index("day", "day", { unique: false }); objectstore.create
index("month", "month", { unique: false }); objectstore.create
index("year", "year", { unique: false }); objectstore.create
index("notified", "notified", { unique: false }); note.innerhtml += '<li>object sto...
...re created.</li>'; }; specifications specification status comment
indexed database api 2.0the definition of 'onerror' in that specification.
... recommendation
indexed database api draftthe definition of 'onerror' in that specification.
IDBDatabase.onversionchange - Web APIs
db.onerror = function(event) { note.innerhtml += '<li>error opening database.</li>'; }; db.onabort = function(event) { note.innerhtml += '<li>database opening aborted!</li>'; }; // create an objectstore for this database var objectstore = db.createobjectstore("todolist", { keypath: "tasktitle" }); // define what data items the objectstore will contain objectstore.create
index("hours", "hours", { unique: false }); objectstore.create
index("minutes", "minutes", { unique: false }); objectstore.create
index("day", "day", { unique: false }); objectstore.create
index("month", "month", { unique: false }); objectstore.create
index("year", "year", { unique: false }); objectstore.create
index("notified", "notified", { unique: false }); note.innerhtml += '<li>object sto...
...re created.</li>'; db.onversionchange = function(event) { note.innerhtml += '<li>a database change has occurred; you should refresh this browser window, or close it down and use the other open version of this application, wherever it exists.</li>'; }; }; specifications specification status comment
indexed database api 2.0the definition of 'onversionchange' in that specification.
... recommendation
indexed database api draftthe definition of 'onversionchange' in that specification.
IDBDatabase.version - Web APIs
example // let us open our database var dbopenrequest = window.
indexeddb.open("todolist", 4); // these two event handlers act on the database // being opened successfully, or not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
... this is used a lot below db = dbopenrequest.result; // this line will log the version of the connected database, which should be "4" console.log(db.version); }; specifications specification status comment
indexed database api 2.0the definition of 'version' in that specification.
... recommendation
indexed database api draftthe definition of 'version' in that specification.
IDBDatabase: versionchange event - Web APIs
bubbles no cancelable no interface event event handler property 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: 'tasktitle' }); // define what data items the objectstore will contain objectstore.create
index('hours', 'hours', { unique: false }); objectstore.create
index('minutes', 'minute...
...s', { unique: false }); objectstore.create
index('day', 'day', { unique: false }); objectstore.create
index('month', 'month', { unique: false }); objectstore.create
index('year', 'year', { unique: false }); }; dbopenrequest.addeventlistener('success', event => { const db = event.target.result; db.addeventlistener('versionchange', event => { console.log('the 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: 'tasktitle' }); // define what data ...
...items the objectstore will contain objectstore.create
index('hours', 'hours', { unique: false }); objectstore.create
index('minutes', 'minutes', { unique: false }); objectstore.create
index('day', 'day', { unique: false }); objectstore.create
index('month', 'month', { unique: false }); objectstore.create
index('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = event => { const db = event.target.result; db.onversionchange = event => { console.log('the version of this database has changed'); }; }; ...
IDBKeyRange.bound() - Web APIs
note: for a more complete example allowing you to experiment with key range, have a look at the idbkeyrange directory in the
indexeddb-examples repo (view the example live too.) function displaydata() { var keyrangevalue = idbkeyrange.bound("a", "f"); var transaction = db.transaction(['fthings'], 'readonly'); var objectstore = transaction.objectstore('fthings'); objectstore.opencursor(keyrangevalue).onsuccess = function(event) { var cursor = event.target.result; if(cursor) { var listitem = docum...
...ent.createelement('li'); listitem.innerhtml = '<strong>' + cursor.value.fthing + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status comment
indexed database api 2.0the definition of 'bound()' in that specification.
... recommendation
indexed database api draftthe definition of 'bound()' in that specification.
IDBKeyRange.includes() - Web APIs
example var keyrangevalue = idbkeyrange.bound('a', 'k', false, false); var myresult = keyrangevalue.includes('f'); // returns true var myresult = keyrangevalue.includes('w'); // returns false polyfill the includes() method was added in the second edition of the
indexed db specification.
... idbkeyrange.prototype.includes = idbkeyrange.prototype.includes || function(key) { var r = this, c; if (r.lower !== undefined) { c =
indexeddb.cmp(key, r.lower); if (r.loweropen && c <= 0) return false; if (!r.loweropen && c < 0) return false; } if (r.upper !== undefined) { c =
indexeddb.cmp(key, r.upper); if (r.upperopen && c >= 0) return false; if (!r.upperopen && c > 0) return false; } return true; }; specification specification status comment
indexed database api draftthe definition of 'includes()' in that specification.
... recommendation
indexed database api draftthe definition of 'includes()' in that specification.
IDBObjectStore.add() - Web APIs
for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.
indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
...bjectstore = transaction.objectstore("todolist"); // make a request to add our newitem object to the object store var objectstorerequest = objectstore.add(newitem[0]); objectstorerequest.onsuccess = function(event) { // report the success of our request note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status comment
indexed database api 2.0the definition of 'add()' in that specification.
... recommendation
indexed database api draftthe definition of 'add()' in that specification.
IDBObjectStore.autoIncrement - Web APIs
for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.
indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
...odolist"); console.log(objectstore.autoincrement); // make a request to add our newitem object to the object store var objectstorerequest = objectstore.add(newitem[0]); objectstorerequest.onsuccess = function(event) { // report the success of our request note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status comment
indexed database api 2.0the definition of 'autoincrement' in that specification.
... recommendation
indexed database api draftthe definition of 'autoincrement' in that specification.
IDBObjectStore.delete() - Web APIs
for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.
indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
...e = transaction.objectstore("todolist"); // make a request to delete the specified record out of the object store var objectstorerequest = objectstore.delete("walk dog"); objectstorerequest.onsuccess = function(event) { // report the success of our request note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status comment
indexed database api 2.0the definition of 'delete()' in that specification.
... recommendation
indexed database api draftthe definition of 'delete()' in that specification.
IDBObjectStore.get() - Web APIs
for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.
indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
...t"); // make a request to get a record by key from the object store var objectstorerequest = objectstore.get("walk dog"); objectstorerequest.onsuccess = function(event) { // report the success of our request note.innerhtml += '<li>request successful.</li>'; var myrecord = objectstorerequest.result; }; }; specifications specification status comment
indexed database api 2.0the definition of 'get()' in that specification.
... recommendation
indexed database api draftthe definition of 'get()' in that specification.
IDBObjectStore.keyPath - Web APIs
for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.
indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
...ore("todolist"); console.log(objectstore.keypath); // make a request to add our newitem object to the object store var objectstorerequest = objectstore.add(newitem[0]); objectstorerequest.onsuccess = function(event) { // report the success of our request note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status comment
indexed database api 2.0the definition of 'keypath' in that specification.
... recommendation
indexed database api draftthe definition of 'keypath' in that specification.
IDBObjectStore.openCursor() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror this idbobjectstore or idb
index has been deleted.
...ame"); var request = objectstore.opencursor(); request.onsuccess = function(event) { var cursor = event.target.result; if(cursor) { // cursor.value contains the current record being iterated through // this is where you'd do something with the result cursor.continue(); } else { // no more results } }; specification specification status comment
indexed database api 2.0the definition of 'opencursor()' in that specification.
... recommendation
indexed database api draftthe definition of 'opencursor()' in that specification.
IDBObjectStore.openKeyCursor() - Web APIs
exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror this idbobjectstore or idb
index has been deleted.
...tion(event) { var cursor = event.target.result; if(cursor) { // cursor.key contains the key of the current record being iterated through // note that there is no cursor.value, unlike for opencursor // this is where you'd do something with the result cursor.continue(); } else { // no more results } }; specifications specification status comment
indexed database api 2.0the definition of 'openkeycursor()' in that specification.
... recommendation
indexed database api draftthe definition of 'openkeycursor()' in that specification.
IDBObjectStore.transaction - Web APIs
for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.
indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
..."todolist"); console.log(objectstore.transaction); // make a request to add our newitem object to the object store var objectstorerequest = objectstore.add(newitem[0]); objectstorerequest.onsuccess = function(event) { // report the success of our request note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status comment
indexed database api 2.0the definition of 'transaction' in that specification.
... recommendation
indexed database api draftthe definition of 'transaction' in that specification.
IDBOpenDBRequest: blocked event - Web APIs
bubbles no cancelable no interface idbversionchangeevent event handler property onblocked 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: 'tasktitle' }); // define what data items the objectstore will contain objectstore.create
index('hours', 'hours', { unique: false }); objec...
...tstore.create
index('minutes', 'minutes', { unique: false }); objectstore.create
index('day', 'day', { unique: false }); objectstore.create
index('month', 'month', { unique: false }); objectstore.create
index('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { // let's try to open the same database with a higher revision version const req2 =
indexeddb.open('todolist', 5); // in this case the onblocked handler will be executed req2.addeventlistener('blocked', () => { console.log('request was blocked'); }); }; 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 creati...
...ng database'); }; // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.create
index('hours', 'hours', { unique: false }); objectstore.create
index('minutes', 'minutes', { unique: false }); objectstore.create
index('day', 'day', { unique: false }); objectstore.create
index('month', 'month', { unique: false }); objectstore.create
index('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { // let's try to open the same database with a higher revision version const req2 =
indexeddb.open('todolist', 5); // in this case the onblocked handler will be executed req2.onblocked = () => { console.log('request was blocked'...
IDBOpenDBRequest: upgradeneeded event - Web APIs
// open the database const dbopenrequest = window.
indexeddb.open('todolist', 4); dbopenrequest.addeventlistener('upgradeneeded', event => { const db = event.target.result; console.log(`upgrading to version ${db.version}`); // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.create
index('hours', 'hours',...
... { unique: false }); objectstore.create
index('minutes', 'minutes', { unique: false }); objectstore.create
index('day', 'day', { unique: false }); objectstore.create
index('month', 'month', { unique: false }); objectstore.create
index('year', 'year', { unique: false }); }); this is the same example, but uses the onupgradeneeded event handler property.
... // open the database const dbopenrequest = window.
indexeddb.open('todolist', 4); dbopenrequest.onupgradeneeded = event => { const db = event.target.result; console.log(`upgrading to version ${db.version}`); // create an objectstore for this database var objectstore = db.createobjectstore('todolist', { keypath: 'tasktitle' }); // define what data items the objectstore will contain objectstore.create
index('hours', 'hours', { unique: false }); objectstore.create
index('minutes', 'minutes', { unique: false }); objectstore.create
index('day', 'day', { unique: false }); objectstore.create
index('month', 'month', { unique: false }); objectstore.create
index('year', 'year', { unique: false }); }; ...
IDBRequest.error - Web APIs
it's an exception type for creating stores and
indexes.
...ta() // function again to update the display updatetitlerequest.onsuccess = function() { displaydata(); }; }; objectstoretitlerequest.onerror = function() { // if an error occurs with the request, log what it is console.log("there has been an error with retrieving your data: " + objectstoretitlerequest.error); }; specifications specification status comment
indexed database api 2.0the definition of 'error' in that specification.
... recommendation
indexed database api draftthe definition of 'error' in that specification.
IDBRequest: success event - Web APIs
bubbles no cancelable no interface event event handler property onsuccess examples this example tries to open a database and listens 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: 'tasktitle' }); // define what data items the objectstore will contain objectstore.create
index('hours', 'hours', { unique: false }); objectstore.create
index('minu...
...tes', 'minutes', { unique: false }); objectstore.create
index('day', 'day', { unique: false }); objectstore.create
index('month', 'month', { unique: false }); objectstore.create
index('year', 'year', { unique: false }); }; openrequest.addeventlistener('success', (event) => { console.log('database opened successfully!'); }); the same example, 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: 'tasktitle' }); // define what data items the objectstore wi...
...ll contain objectstore.create
index('hours', 'hours', { unique: false }); objectstore.create
index('minutes', 'minutes', { unique: false }); objectstore.create
index('day', 'day', { unique: false }); objectstore.create
index('month', 'month', { unique: false }); objectstore.create
index('year', 'year', { unique: false }); }; openrequest.onsuccess = (event) => { console.log('database opened successfully!'); }; ...
IDBTransaction.abort() - Web APIs
for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.
indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
...objectstorerequest.onsuccess = function(event) { // report the success of the request (this does not mean the item // has been stored successfully in the db - for that you need transaction.onsuccess) note.innerhtml += '<li>request successful.</li>'; }; // abort the transaction we just did transaction.abort(); }; specification specification status comment
indexed database api 2.0the definition of 'abort()' in that specification.
... recommendation
indexed database api draftthe definition of 'abort()' in that specification.
IDBTransaction: complete event - Web APIs
bubbles no cancelable no interface event event handler property oncomplete 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: 'tasktitle' }); // define what data items the objectstore will contain objectstore.create
index('hours', 'hours', { unique: false }); objectstore.create
index('minutes', 'minutes', { unique: false }); objectstor...
...e.create
index('day', 'day', { unique: false }); objectstore.create
index('month', 'month', { unique: false }); objectstore.create
index('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'); // add a listener for `complete` transaction.addeventlistener('complete', event => { console.log('transaction was competed'); }); const objectstore = transaction.objectstore('todolist'); const newitem = { tasktitle: 'my task', hours: 10, minutes: 10, day: 10, month: 'january', year: 2019 }; const objectstorerequest = objectstore.add(newitem); }; using the oncomplete property: // open the database co...
...nst 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: 'tasktitle' }); // define what data items the objectstore will contain objectstore.create
index('hours', 'hours', { unique: false }); objectstore.create
index('minutes', 'minutes', { unique: false }); objectstore.create
index('day', 'day', { unique: false }); objectstore.create
index('month', 'month', { unique: false }); objectstore.create
index('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = event => { const db = dbopenrequest.result; // open a read/...
IDBTransaction.db - Web APIs
for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.
indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
... // report the success of the request (this does not mean the item // has been stored successfully in the db - for that you need transaction.onsuccess) note.innerhtml += '<li>request successful.</li>'; }; // return the database (idbdatabase) connection with which this transaction is associated transaction.db; }; specification specification status comment
indexed database api 2.0the definition of 'db' in that specification.
... recommendation
indexed database api draftthe definition of 'db' in that specification.
IDBTransaction.error - Web APIs
for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.
indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
...e var objectstorerequest = objectstore.add(newitem[0]); objectstorerequest.onsuccess = function(event) { // report the success of the request (this does not mean the item // has been stored successfully in the db - for that you need transaction.onsuccess) note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status comment
indexed database api 2.0the definition of 'error' in that specification.
... recommendation
indexed database api draftthe definition of 'error' in that specification.
IDBTransaction: error event - Web APIs
bubbles yes cancelable no interface event event handler property onerror examples this example opens a database and tries to add a record, listening for the error event for the add() operation (this will occur if, for example, a record with the given tasktitle 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: 'tasktitle' }); // define what data items the objectstore will contain objectstore.create
index('hours', 'hours', { unique: false }); objectstore.create
index('minutes', 'minute...
...s', { unique: false }); objectstore.create
index('day', 'day', { unique: false }); objectstore.create
index('month', 'month', { unique: false }); objectstore.create
index('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.tasktitle}`); }); const objectstore = transaction.objectstore('todolist'); const newitem = { tasktitle: 'my task', hours: 10, minutes: 10, day: 10, month: 'january', year: 2020 }; const objectstorerequest = objectstore.add(newitem); }; the same example, using the onerror pro...
...perty 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: 'tasktitle' }); // define what data items the objectstore will contain objectstore.create
index('hours', 'hours', { unique: false }); objectstore.create
index('minutes', 'minutes', { unique: false }); objectstore.create
index('day', 'day', { unique: false }); objectstore.create
index('month', 'month', { unique: false }); objectstore.create
index('year', 'year', { unique: false }); }; dbopenrequest.onsuccess = (event) => { const db = dbopenrequest.result; // open a read/write ...
IDBTransaction.objectStore() - Web APIs
for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.
indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
... var objectstorerequest = objectstore.add(newitem[0]); objectstorerequest.onsuccess = function(event) { // report the success of the request (this does not mean the item // has been stored successfully in the db - for that you need transaction.onsuccess) note.innerhtml += '<li>request successful.</li>'; }; specification specification status comment
indexed database api 2.0the definition of 'objectstore()' in that specification.
... recommendation
indexed database api draftthe definition of 'objectstore()' in that specification.
IDBTransaction.onabort - Web APIs
for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.
indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
...essfully in the db - for that you need transaction.onsuccess) note.innerhtml += '<li>request successful.</li>'; }; transaction.onabort = function() { // report when the transaction was successfully aborted console.log("transaction aborted!"); }; // abort the transaction we just did transaction.abort(); }; specification specification status comment
indexed database api 2.0the definition of 'onabort' in that specification.
... recommendation
indexed database api draftthe definition of 'onabort' in that specification.
IDBTransaction.onerror - Web APIs
for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.
indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database initialised.</li>'; // store the result of opening the database in the db variable.
...e var objectstorerequest = objectstore.add(newitem[0]); objectstorerequest.onsuccess = function(event) { // report the success of the request (this does not mean the item // has been stored successfully in the db - for that you need transaction.onsuccess) note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status comment
indexed database api 2.0the definition of 'onerror' in that specification.
... recommendation
indexed database api draftthe definition of 'onerror' in that specification.
IDBVersionChangeEvent.oldVersion - Web APIs
example var dbname = "sampledb"; var dbversion = 2; var request =
indexeddb.open(dbname, dbversion); request.onupgradeneeded = function(e) { var db = request.result; if (e.oldversion < 1) { db.createobjectstore("store1"); } if (e.oldversion < 2) { db.deleteobjectstore("store1"); db.createobjectstore("store2"); } // etc.
...}; specifications specification status comment
indexed database api 2.0the definition of 'oldversion' in that specification.
... recommendation
indexed database api draftthe definition of 'oldversion' in that specification.
Browser storage limits and eviction criteria - Web APIs
we term them "quota clients" in this context:
indexeddb asm.js caching cache api cookies note: in firefox, web storage will soon start to use the same storage management tools too, as described in this document.
... in chrome/opera, the quota management api handles quota management for appcache,
indexeddb, websql, and file system api.
...p-level directory for storages maintained by the quota manager (see below) <profile>/storage/permanent — persistent data storage repository <profile>/storage/temporary — temporary data storage repository <profile>/storage/default — default data storage repository note: after introducing storage api, the "permanent" folder can be considered obsolete; the "permanent" folder only stores
indexeddb persistent-type databases.
LockedFile.truncate() - Web APIs
if the method is called with no argument, the operation removes all the bytes starting at the
index set in lockedfile.location.
... if the method is called with an argument, the operation removes all the bytes starting at the
index corresponding to the parameter and regardless of the value of lockedfile.location.
... syntax var request = instanceoflockedfile.truncate(start); parameters start optional a number representing the
index where to start the operation.
Navigator.getGamepads() - Web APIs
elements in the array may be null if a gamepad disconnects during a session, so that the remaining gamepads retain the same
index.
... syntax var gamepads = navigator.getgamepads(); example window.addeventlistener("gamepadconnected", function(e) { var gp = navigator.getgamepads()[e.gamepad.
index]; console.log( "gamepad connected at
index %d: %s.
... %d buttons, %d axes.", gp.
index, gp.id, gp.buttons.length, gp.axes.length ); }); specifications specification status comment gamepadthe definition of 'the gamepad api specification' in that specification.
ServiceWorkerContainer.register() - Web APIs
the service worker code in this case, if included in example.com/
index.html, will control example.com/
index.html, as well as pages underneath it, like example.com/product/description.html.
... navigator.serviceworker.register('/sw.js').then(function(registration) { console.log('service worker registration succeeded:', registration); }, /*catch*/ function(error) { console.log('service worker registration failed:', error); }); } else { console.log('service workers are not supported.'); } the following code, if included in example.com/
index.html, at the root of a site, would apply to exactly the same pages as the example above.
... the following code, if included in example.com/
index.html, at the root of a site, would only apply to resources under example.com/product.
Storage.key() - Web APIs
syntax var akeyname = storage.key(
index); parameters
index an integer representing the number of the key you want to get the name of.
... this is a zero-based
index.
...if the
index does not exist, null is returned.
WebGL2RenderingContext.bindBufferBase() - Web APIs
the webgl2renderingcontext.bindbufferbase() method of the webgl 2 api binds a given webglbuffer to a given binding point (target) at a given
index.
... syntax void gl.bindbufferbase(target,
index, buffer); parameters target a glenum specifying the target for the bind operation.
... possible values: gl.transform_feedback_buffer gl.uniform_buffer
index a gluint specifying the
index of the target.
WebGL2RenderingContext.bindBufferRange() - Web APIs
the webgl2renderingcontext.bindbufferrange() method of the webgl 2 api binds a range of a given webglbuffer to a given binding point (target) at a given
index.
... syntax void gl.bindbufferrange(target,
index, buffer, offset, size); parameters target a glenum specifying the target for the bind operation.
... possible values: gl.transform_feedback_buffer gl.uniform_buffer
index a gluint specifying the
index of the target.
WebGL2RenderingContext.getActiveUniformBlockName() - Web APIs
the webgl2renderingcontext.getactiveuniformblockname() method of the webgl 2 api retrieves the name of the active uniform block at a given
index within a webglprogram.
... syntax domstring gl.getactiveuniformblockname(program, uniformblock
index); parameters program a webglprogram containing the uniform block.
... uniformblock
index a gluint specifying the
index of the uniform block to whose name to retrieve.
WebGL2RenderingContext.getActiveUniformBlockParameter() - Web APIs
syntax any gl.getactiveuniformblockparameter(program, uniformblock
index, pname); parameters program a webglprogram containing the active uniform block.
... uniformblock
index a gluint specifying the
index of the active uniform block within the program.
... examples var blocksize = gl.getactiveuniformblockparameter(program, block
index, gl.uniform_block_data_size); specifications specification status comment webgl 2.0the definition of 'getactiveuniformblockparameter' in that specification.
WebGLActiveInfo - Web APIs
program, gluint
index); webglactiveinfo?
...program, gluint
index); webglactiveinfo?
...program, gluint
index) specifications specification status comment webgl 1.0the definition of 'webglactiveinfo' in that specification.
WebGLRenderingContext.getActiveAttrib() - Web APIs
syntax webglactiveinfo gl.getactiveattrib(program,
index); parameters program a webglprogram containing the vertex attribute.
...
index a gluint specifying the
index of the vertex attribute to get.
... this value is an
index 0 to n - 1 as returned by gl.getprogramparameter(program, gl.active_attributes).
Using the Web Speech API - Web APIs
to run the demo, you can clone (or directly download) the github repo it is part of, open the html
index file in a supporting desktop browser, or navigate to the live demo url in a supporting mobile browser like chrome.
... to run the demo, you can clone (or directly download) the github repo it is part of, open the html
index file in a supporting desktop browser, or navigate to the live demo url in a supporting mobile browser like chrome, or firefox os.
... utterthis.onpause = function(event) { var char = event.utterance.text.charat(event.char
index); console.log('speech paused at character ' + event.char
index + ' of "' + event.utterance.text + '", which is "' + char + '".'); } finally, we call blur() on the text input.
The structured clone algorithm - Web APIs
it is used internally to transfer data between workers via postmessage(), storing objects with
indexeddb, or copying objects for other apis.
... certain object properties are not preserved: the last
index property of regexp objects is not preserved.
... boolean objects string objects date regexp last
index is not preserved.
Window.navigator - Web APIs
if (susrag.
indexof("firefox") > -1) { sbrowser = "mozilla firefox"; // "mozilla/5.0 (x11; ubuntu; linux x86_64; rv:61.0) gecko/20100101 firefox/61.0" } else if (susrag.
indexof("samsungbrowser") > -1) { sbrowser = "samsung internet"; // "mozilla/5.0 (linux; android 9; samsung sm-g955f build/ppr1.180610.011) applewebkit/537.36 (khtml, like gecko) samsungbrowser/9.4 chrome/67.0.3396.87 mobile safari/537.36 }...
... else if (susrag.
indexof("opera") > -1 || susrag.
indexof("opr") > -1) { sbrowser = "opera"; // "mozilla/5.0 (macintosh; intel mac os x 10_14_0) applewebkit/537.36 (khtml, like gecko) chrome/70.0.3538.102 safari/537.36 opr/57.0.3098.106" } else if (susrag.
indexof("trident") > -1) { sbrowser = "microsoft internet explorer"; // "mozilla/5.0 (windows nt 10.0; wow64; trident/7.0; .net4.0c; .net4.0e; zoom 3.6.0; wbx 1.0.0; rv:11.0) like gecko" } else if (susrag.
indexof("edge") > -1) { sbrowser = "microsoft edge"; // "mozilla/5.0 (windows nt 10.0; win64; x64) applewebkit/537.36 (khtml, like gecko) chrome/58.0.3029.110 safari/537.36 edge/16.16299" } else if (susrag.
indexof("chrome") > -1) { sbrowser = "google chrome or chromium"; // "mozilla/5.0 (x11; linux x86_64) applewebkit/537.36 (k...
...html, like gecko) ubuntu chromium/66.0.3359.181 chrome/66.0.3359.181 safari/537.36" } else if (susrag.
indexof("safari") > -1) { sbrowser = "apple safari"; // "mozilla/5.0 (iphone; cpu iphone os 11_4 like mac os x) applewebkit/605.1.15 (khtml, like gecko) version/11.0 mobile/15e148 safari/604.1 980x1306" } else { sbrowser = "unknown"; } alert("you are using: " + sbrowser); specifications specification status comment html living standardthe definition of 'window: navigator' in that specification.
XRInputSourceArray.forEach() - Web APIs
the xrinputsourcearray method foreach() executes the specified callback once for each input source in the array, starting at
index 0 and progressing until the end of the list.
... current
index optional an integer value providing the
index into the array at which the element given by currentvalue is located.
... if you don't need to know the
index number, you can omit this.
XRInputSourceArray.keys() - Web APIs
the values returned by the iterator are the
indexes of each entry in the list; that is, the numbers 0, 1, 2, and so forth through the
index of the last item in the list.
... for (const inputidx of xrsession.inputsources.keys()) { /* the keys are the
indexes into the list of inputs */ checkinput(xrsession.inputsources[inputidx]); } here, for...of is used to iterate over each of the keys.
... for each key, the input is retrieved using the
index with array notation: xrsession.inputsources[inputidx].
XRInputSourceArray - Web APIs
in addition to being able to access the input sources in the list using standard array notation (that is, with
index numbers insize square brackets), methods are available to allow the use of iterators and the foreach() method is also available.
...each item returned is an array whose first value is the
index and whose second value is the xrinputsource at that
index.
... in addition to these methods, you may use array notation to access items in the list by
index for example, the snippet of code below calls a function handleinput(), passing into it the first item in the input source list, if the list isn't empty.
Using the link role - Accessibility
the tab
index attribute may optionally be used with this role to directly specify the position of the element in the tab order.
...this includes javascript to grab the location and handle navigating to the new location using window.open() via clicking, and using keyboard, css to give the desired visuals of a link, the tab
index="0" attribute to make it keyboard-focussable, and role="link" to make it recognised as a link by assistive technology.
... html <h1>role="link" example</h1> <span data-href="https://mozilla.org" tab
index="0" id="link1" role="link" class="link"> fake accessible link created using a span </span> <p><a href="https://mozilla.org" target="_blank">actual real link</a></p> css span[role="link"] { color: blue; text-decoration: underline; cursor: pointer; } span[role="link"]:focus { outline: 1px dotted black; } javascript const spanelem = document.queryselector('span'); //handles clicks ...
ARIA: rowgroup role - Accessibility
_elements_table_desc" aria-rowcount="81"> <div id="semantic_elements_table_desc">semantic elements to use instead of aria's roles</div> <div role="rowgroup"> <div role="row"> <span role="columnheader" aria-sort="none">aria role</span> <span role="columnheader" aria-sort="none">semantic element</span> </div> </div> <div role="rowgroup"> <div role="row" aria-row
index="11"> <span role="cell">header</span> <span role="cell">h1</span> </div> <div role="row" aria-row
index="16"> <span role="cell">header</span> <span role="cell">h6</span> </div> <div role="row" aria-row
index="18"> <span role="cell">rowgroup</span> <span role="cell">thead</span> </div> <div role="row" aria-row
index="24"> <span ro...
...because not all the rows are in the dom, we've included the aria-row
index property on every row.
...count="81"> <caption id="semantic_elements_table_desc">semantic elements to use instead of aria's roles</caption> <thead role="rowgroup"> <tr role="row"> <th role="columnheader" aria-sort="none">aria role</th> <th role="columnheader" aria-sort="none">semantic element</th> </tr> </thead> <tbody role="rowgroup"> <tr role="row" aria-row
index="11"> <td role="cell">header</td> <td role="cell">h1</td> </tr> <tr role="row" aria-row
index="16"> <td role="cell">header</td> <td role="cell">h6</td> </tr> </tbody> </table> above is the semantic way of writing a table.
Alerts - Accessibility
{ removeoldalert(); var newalert = document.createelement("div"); newalert.setattribute("role", "alert"); newalert.setattribute("id", "alert"); var msg = document.createtextnode(amsg); newalert.appendchild(msg); document.body.appendchild(newalert); } function checkvalidity(aid, asearchterm, amsg) { var elem = document.getelementbyid(aid); var invalid = (elem.value.
indexof(asearchterm) < 0); if (invalid) { elem.setattribute("aria-invalid", "true"); addalert(amsg); } else { elem.setattribute("aria-invalid", "false"); removeoldalert(); } } </script> the checkvalidity function the primary method in javascript used for form validation is the checkvalidity function.
... to see if it is valid, the function checks whether the
indexof the input’s value is anything greater than -1.
... a value of -1 or less is returned if the
index of the search term could not be found within the value.
::after (:after) - CSS: Cascading Style Sheets
we can also support keyboard users with this technique, by adding a tab
index of 0 to make each span keyboard focusable, and using a css :focus selector.
... html <p>here we have some <span tab
index="0" data-descr="collection of words and punctuation">text</span> with a few <span tab
index="0" data-descr="small popups that appear when hovering">tooltips</span>.
...an[data-descr] { position: relative; text-decoration: underline; color: #00f; cursor: help; } span[data-descr]:hover::after, span[data-descr]:focus::after { content: attr(data-descr); position: absolute; left: 0; top: 24px; min-width: 200px; border: 1px #aaaaaa solid; border-radius: 10px; background-color: #ffffcc; padding: 12px; color: #000000; font-size: 14px; z-
index: 1; } result specifications specification status comment css pseudo-elements level 4the definition of '::after' in that specification.
position - CSS: Cascading Style Sheets
the top, right, bottom, left, and z-
index properties have no effect.
... this value creates a new stacking context when the value of z-
index is not auto.
... this value creates a new stacking context when the value of z-
index is not auto.
Rich-Text Editing in Mozilla - Developer guides
; margin: 0; min-width: 498px; min-height: 200px; } #editmode label { cursor: pointer; } </style> </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.selected
index].value);this.selected
index=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">subtitle <h6></option> <option value="p">paragraph <p></opti...
...on> <option value="pre">preformatted <pre></option> </select> <select onchange="formatdoc('fontname',this[this.selected
index].value);this.selected
index=0;"> <option class="heading" selected>- font -</option> <option>arial</option> <option>arial black</option> <option>courier new</option> <option>times new roman</option> </select> <select onchange="formatdoc('fontsize',this[this.selected
index].value);this.selected
index=0;"> <option class="heading" selected>- size -</option> <option value="1">very small</option> <option value="2">a bit small</option> <option value="3">normal</option> <option value="4">medium-large</option> <option value="5">big</option> <option value="6">very big</option> <option value="7">maximum</option> </select> <select onchange="formatdoc('forecolor',this[this.selected...
...
index].value);this.selected
index=0;"> <option class="heading" selected>- color -</option> <option value="red">red</option> <option value="blue">blue</option> <option value="green">green</option> <option value="black">black</option> </select> <select onchange="formatdoc('backcolor',this[this.selected
index].value);this.selected
index=0;"> <option class="heading" selected>- background -</option> <option value="red">red</option> <option value="green">green</option> <option value="black">black</option> </select> </div> <div id="toolbar2"> <img class="intlink" title="clean" onclick="if(validatemode()&&confirm('are you sure?')){odoc.innerhtml=sdeftxt};" src="data:image/gif;base64,r0lgodlhfgawaiqbad04ktrlyzfrjlldzl9vj1dusy14wyodhpwibbsvfy6o7ioxw5qbms+wubcztca0ccs4kddqjdtltmrl1o3yitha7opcsd/f4pfvrvdv8pv5...
Making content editable - Developer guides
; margin: 0; min-width: 498px; min-height: 200px; } #editmode label { cursor: pointer; } </style> </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.selected
index].value);this.selected
index=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">subtitle <h6></option> <option value="p">paragraph <p></opti...
...on> <option value="pre">preformatted <pre></option> </select> <select onchange="formatdoc('fontname',this[this.selected
index].value);this.selected
index=0;"> <option class="heading" selected>- font -</option> <option>arial</option> <option>arial black</option> <option>courier new</option> <option>times new roman</option> </select> <select onchange="formatdoc('fontsize',this[this.selected
index].value);this.selected
index=0;"> <option class="heading" selected>- size -</option> <option value="1">very small</option> <option value="2">a bit small</option> <option value="3">normal</option> <option value="4">medium-large</option> <option value="5">big</option> <option value="6">very big</option> <option value="7">maximum</option> </select> <select onchange="formatdoc('forecolor',this[this.selected...
...
index].value);this.selected
index=0;"> <option class="heading" selected>- color -</option> <option value="red">red</option> <option value="blue">blue</option> <option value="green">green</option> <option value="black">black</option> </select> <select onchange="formatdoc('backcolor',this[this.selected
index].value);this.selected
index=0;"> <option class="heading" selected>- background -</option> <option value="red">red</option> <option value="green">green</option> <option value="black">black</option> </select> </div> <div id="toolbar2"> <img class="intlink" title="clean" onclick="if(validatemode()&&confirm('are you sure?')){odoc.innerhtml=sdeftxt};" src="data:image/gif;base64,r0lgodlhfgawaiqbad04ktrlyzfrjlldzl9vj1dusy14wyodhpwibbsvfy6o7ioxw5qbms+wubcztca0ccs4kddqjdtltmrl1o3yitha7opcsd/f4pfvrvdv8pv5...
Link types - HTML: Hypertext Markup Language
for example, a blog entry could link to a monthly
index page this way.
... <link> <a>, <area>, <form> import html imports <link> <a>, <area>, <form>
index obsolete since html5 indicates that the page is part of a hierarchical structure and that the hyperlink leads to the top level resource of that structure.
... obsolete added top, contents,
index, glossary, copyright, next, previous, help, and search.
Using the application cache - HTML: Hypertext Markup Language
http://www.example.com/
index.html http://www.example.com/header.png http://www.example.com/blah/blah a cache manifest file can include three sections (cache, network, and fallback, discussed below).
...resources can be specified using either absolute or relative urls (e.g.,
index.html).
... example 2: a more complete cache manifest file the following is a more complete cache manifest file for the imaginary web site at www.example.com: cache manifest # v1 2011-08-14 # this is another comment
index.html cache.html style.css image1.png # use from network if available network: network.html # fallback content fallback: .
JavaScript data types and data structures - JavaScript
the first element is at
index 0, the next at
index 1, and so on.
...
indexed collections: arrays and typed arrays arrays are regular objects for which there is a particular relationship between integer-key-ed properties and the length property.
...for example,
indexof (searching a value in the array) or push (adding an element to the array), and so on.
Expressions and operators - JavaScript
when you delete an array property, the array length is not affected and other elements are no re-
indexed.
...the syntax is: propnameornumber in objectname where propnameornumber is a string, numeric, or symbol expression representing a property name or array
index, and objectname is the name of an object.
... // arrays var trees = ['redwood', 'bay', 'cedar', 'oak', 'maple']; 0 in trees; // returns true 3 in trees; // returns true 6 in trees; // returns false 'bay' in trees; // returns false (you must specify the
index number, // not the value at that
index) 'length' in trees; // returns true (length is an array property) // built-in objects 'pi' in math; // returns true var mystring = new string('coral'); 'length' in mystring; // returns true // custom objects var mycar = { make: 'honda', model: 'accord', year: 1998 }; 'make' in mycar; // returns true 'model' in mycar; // returns true instanceof the instanceof operator returns true if the specified object is of the specified object...
Loops and iteration - JavaScript
example 1 the following example iterates through the elements in an array until it finds the
index of an element whose value is thevalue: for (let i = 0; i < a.length; i++) { if (a[i] === thevalue) { break; } } example 2: breaking to a label let x = 0; let z = 0; labelcancelloops: while (true) { console.log('outer loops: ' + x); x += 1; z = 1; while (true) { console.log('inner loops: ' + z); z += 1; if (z === 10 && x === 10) { break labelcancelloops; } ...
... result += obj_name + '.' + i + ' = ' + obj[i] + '<br>'; } result += '<hr>'; return result; } for an object car with properties make and model, result would be: car.make = ford car.model = mustang arrays although it may be tempting to use this as a way to iterate over array elements, the for...in statement will return the name of your user-defined properties in addition to the numeric
indexes.
... therefore, it is better to use a traditional for loop with a numeric
index when iterating over arrays, because the for...in statement iterates over user-defined properties in addition to the array elements, if you modify the array object (such as adding custom properties or methods).
Text formatting - JavaScript
the first element is at
index 0, the next at
index 1, and so on.
...
indexof, last
indexof return the position of specified substring in the string or last position of specified substring, respectively.
... substring, substr return the specified subset of the string, either by specifying the start and end
indexes or the start
index and a length.
Working with objects - JavaScript
indexing object properties you can refer to a property of an object either by its property name or by its ordinal
index.
... if you initially define a property by its name, you must always refer to it by its name, and if you initially define a property by an
index, you must always refer to it by its
index.
...if you initially define an object property with an
index, such as mycar[5] = "25 mpg", you subsequently refer to the property only as mycar[5].
TypeError: cannot use 'in' operator to search for 'x' in 'y' - JavaScript
"hello" in "hello world"; // typeerror: cannot use 'in' operator to search for 'hello' in 'hello world' instead you will need to use string.prototype.
indexof(), for example.
... "hello world".
indexof("hello") !== -1; // true the operand can't be null or undefined make sure the object you are inspecting isn't actually null or undefined.
...the in operator checks the
index number, not the value at that
index.
Array.prototype.fill() - JavaScript
the fill() method changes all elements in an array to a static value, from a start
index (default 0) to an end
index (default array.length).
...(note all elements in the array will be this exact value.) start optional start
index, default 0.
... end optional end
index, default arr.length.
Array.prototype.sort() - JavaScript
if a and b are two elements being compared, then: if comparefunction(a, b) returns less than 0, sort a to an
index lower than b (i.e.
... if comparefunction(a, b) returns greater than 0, sort b to an
index lower than a (i.e.
... // the array to be sorted var list = ['delta', 'alpha', 'charlie', 'bravo']; // temporary array holds objects with position and sort-value var mapped = list.map(function(el, i) { return {
index: i, value: el.tolowercase() }; }) // sorting the mapped array containing the reduced values mapped.sort(function(a, b) { if (a.value > b.value) { return 1; } if (a.value < b.value) { return -1; } return 0; }); // container for the resulting order var result = mapped.map(function(el){ return list[el.
index]; }); there is an open source library available called mapsort which ...
Atomics.notify() - JavaScript
syntax atomics.notify(typedarray,
index, count) parameters typedarray a shared int32array.
...
index the position in the typedarray to wake up on.
... throws a rangeerror, if
index is out of bounds in the typedarray.
Atomics.store() - JavaScript
syntax atomics.store(typedarray,
index, value) parameters typedarray an integer typed array.
...
index the position in the typedarray to store a value in.
... throws a rangeerror, if
index is out of bounds in the typedarray.
Atomics.wait() - JavaScript
syntax atomics.wait(typedarray,
index, value[, timeout]) parameters typedarray a shared int32array.
...
index the position in the typedarray to wait on.
... throws a rangeerror, if
index is out of bounds in the typedarray.
Date() constructor - JavaScript
syntax new date() new date(value) new date(datestring) new date(year, month
index [, day [, hours [, minutes [, seconds [, milliseconds]]]]]) note: the only correct way to instantiate a new date object is by using the new operator.
... month
index integer value representing the month, beginning with 0 for january to 11 for december.
... let today = new date() let birthday = new date('december 17, 1995 03:24:00') let birthday = new date('1995-12-17t03:24:00') let birthday = new date(1995, 11, 17) // the month is 0-
indexed let birthday = new date(1995, 11, 17, 3, 24, 0) specifications specification ecmascript (ecma-262)the definition of 'date' in that specification.
String.prototype.match() - JavaScript
index the
index of the search at which the result was found.
... const str = 'for more information, see chapter 3.4.5.1'; const re = /see (chapter \d+(\.\d)*)/i; const found = str.match(re); console.log(found); // logs [ 'see chapter 3.4.5.1', // 'chapter 3.4.5.1', // '.1', //
index: 22, // input: 'for more information, see chapter 3.4.5.1' ] // 'see chapter 3.4.5.1' is the whole match.
...// the '
index' property (22) is the zero-based
index of the whole match.
String.prototype.search() - JavaScript
return value the
index of the first match between the regular expression and the given string, or -1 if no match was found.
... description when you want to know whether a pattern is found, and also know its
index within a string, use search().
...an unsuccessful search (-1) let str = "hey jude" let re = /[a-z]/g let redot = /[.]/g console.log(str.search(re)) // returns 4, which is the
index of the first capital letter "j" console.log(str.search(redot)) // returns -1 cannot find '.' dot punctuation specifications specification ecmascript (ecma-262)the definition of 'string.prototype.search' in that specification.
TypedArray.prototype.every() - JavaScript
index the
index of the current element being processed in the typed array.
... callback is invoked with three arguments: the value of the element, the
index of the element, and the array object being traversed.
... function isbigenough(element,
index, array) { return element >= 10; } new uint8array([12, 5, 8, 130, 44]).every(isbigenough); // false new uint8array([12, 54, 18, 130, 44]).every(isbigenough); // true testing typed array elements using arrow functions arrow functions provide a shorter syntax for the same test.
TypedArray.prototype.map() - JavaScript
index optional the
index of the current element being processed in the typed array.
... mapfn is invoked only for
indexes of the typed array which have assigned values; it is not invoked for
indexes that are undefined, those which have been deleted, or which have never been assigned values.
... mapfn is invoked with three arguments: the value of the element, the
index of the element, and the typed array object being traversed.
TypedArray.prototype.reduceRight() - JavaScript
index the
index of the current element being processed in the typed array.
... description the reduceright method executes the callback function once for each element present in the typed array, excluding holes in the typed array, receiving four arguments: the initial value (or value from the previous callback call), the value of the current element, the current
index, and the typed array over which iteration is occurring.
... the call to the reduceright callback would look something like this: typedarray.reduceright(function(previousvalue, currentvalue,
index, typedarray) { // ...
TypedArray.prototype.some() - JavaScript
index the
index of the current element being processed in the typed array.
... callback is invoked with three arguments: the value of the element, the
index of the element, and the array object being traversed.
... function isbiggerthan10(element,
index, array) { return element > 10; } new uint8array([2, 5, 8, 1, 4]).some(isbiggerthan10); // false new uint8array([12, 5, 8, 1, 4]).some(isbiggerthan10); // true testing typed array elements using arrow functions arrow functions provide a shorter syntax for the same test.
WebAssembly.Table.prototype.get() - JavaScript
the get() prototype method of the webassembly.table() object retrieves a function reference stored at a given
index.
... syntax table.get(
index); parameters
index the
index of the function reference you want to retrieve.
... exceptions if
index is greater than or equal to table.prototype.length, a rangeerror is thrown.
WebAssembly.Table - JavaScript
instance methods table.prototype.get() accessor function — gets the element stored at a given
index.
... table.prototype.set() sets an element stored at a given
index to a given value.
...we then print out the table length and contents of the two
indexes (retrieved via table.prototype.get() to show that the length is two and both elements are null.
WebAssembly.instantiate() - JavaScript
this module can be instantiated again, shared via postmessage() or cached in
indexeddb.
... var importobject = { imports: { imported_func: function(arg) { console.log(arg); } } }; fetch('simple.wasm').then(response => response.arraybuffer() ).then(bytes => webassembly.instantiate(bytes, importobject) ).then(result => result.instance.exports.exported_func() ); note: you can also find this example at
index.html on github (view it live also).
... second overload example the following example (see our
index-compile.html demo on github, and view it live also) compiles the loaded simple.wasm byte code using the webassembly.compilestreaming() method and then sends it to a worker using postmessage().
in operator - JavaScript
syntax prop in object parameters prop a string or symbol representing a property name or array
index (non-symbols will be coerced to strings).
... // arrays let trees = ['redwood', 'bay', 'cedar', 'oak', 'maple'] 0 in trees // returns true 3 in trees // returns true 6 in trees // returns false 'bay' in trees // returns false (you must specify the
index number, not the value at that
index) 'length' in trees // returns true (length is an array property) symbol.iterator in trees // returns true (arrays are iterable, works only in es2015+) // predefined objects 'pi' in math // returns true // custom objects let mycar = {make: 'honda', model: 'accord', year: 1998} 'make' in mycar // returns true 'model' in mycar // returns true you mus...
... let empties = new array(3) empties[2] // returns undefined 2 in empties // returns false to avoid this, make sure a new array is always filled with non-empty values or not write to
indexes past the end of array.
How to make PWAs installable - Progressive web apps (PWAs)
the js13kpwa.webmanifest file of the js13kpwa web app is included in the <head> block of the
index.html file using the following line of code: <link rel="manifest" href="js13kpwa.webmanifest"> there are a few common kinds of manifest file that have been used in the past: manifest.webapp was popular in firefox os app manifests, and many use manifest.json for web manifests as the contents are organized in a json structure.
... { "src": "icons/icon-512.png", "sizes": "512x512", "type": "image/png" } ], "start_url": "/pwa-examples/js13kpwa/
index.html", "display": "fullscreen", "theme_color": "#b12a34", "background_color": "#b12a34" } most of the fields are self-explanatory, but to be certain we're on the same page: name: the full name of your web app.
... start_url: the
index document to launch when starting the app.
How to make PWAs re-engageable using Notifications and Push - Progressive web apps (PWAs)
this demo consists of three files:
index.js, which contains the source code of our app server.js, which contains the server part (written in node.js) service-worker.js, which contains the service worker-specific code.
... let's explore all of these
index.js the
index.js file starts by registering the service worker: navigator.serviceworker.register('service-worker.js') .then(function(registration) { return registration.pushmanager.getsubscription() .then(async function(subscription) { // registration part }); }) .then(function(subscription) { // subscription part }); it is a little bit more complicated than the service worker we saw in the js13kpwa demo.
...you can see the variables from the
index.js file being used: payload, delay and ttl.
The building blocks of responsive design - Progressive web apps (PWAs)
the markup is very simple: <x-deck selected-
index="0"> <x-card> … </x-card> <x-card> … </x-card> <x-card> … </x-card> </x-deck> note: these weird x- elements may be unfamiliar; they are part of brick, mozilla's ui element library for mobile web apps.
... nav { width: 100%; position: absolute; z-
index: 1000; display: -webkit-flex; display: -moz-flex; display: -ms-flexbox; display: flex; } nav button { font-size: 6.8vw; -webkit-flex: 1; -moz-flex: 1; -ms-flex: 1; flex: 1; border-left: 1px solid rgba(100,100,100,0.4); } nav button:first-child { border-left: 0; } } in this last set of rules, we change the display value of ...
...the <nav> to flex to make it show (it was set to none in the default css at the top of the stylesheet, as it wasn't needed for the other views.) we then use absolute positioning and z-
index to make it take up no space in the document flow, and sit on top of the x-cards (this is why we gave the x-cards that top-margin earlier).
Structural overview of progressive web apps - Progressive web apps (PWAs)
it consists of a single html file (
index.html), with basic css styling provided in style.css.
...the file and folder hierarchy looks like this: app.js data/ games.js img/ 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.
...this list includes both app shell and content files: var cachename = 'js13kpwa-v1'; var appshellfiles = [ '/pwa-examples/js13kpwa/', '/pwa-examples/js13kpwa/
index.html', '/pwa-examples/js13kpwa/app.js', '/pwa-examples/js13kpwa/style.css', '/pwa-examples/js13kpwa/fonts/graduate.eot', '/pwa-examples/js13kpwa/fonts/graduate.ttf', '/pwa-examples/js13kpwa/fonts/graduate.woff', '/pwa-examples/js13kpwa/favicon.ico', '/pwa-examples/js13kpwa/img/js13kgames.png', '/pwa-examples/js13kpwa/img/bg.png', '/pwa-examples/js13kpwa/icons/icon-32.png', '/p...
Progressive web apps (PWAs)
introduction to progressive web apps progressive web app structure making pwas work offline with service workers how to make pwas installable how to make pwas re-engageable using notifications and push progressive loading technology guides client-side storage — a lengthy guide showing how and when to use web storage,
indexeddb, and service workers.
... using
indexeddb — the fundamentals of
indexeddb, explained in detail.
... tools localforage — a nice simple javascript library for making client-side data storage really simple; it uses
indexeddb by default and falls back to web sql/web storage if necessary.
Web API reference - Web technology reference
each individual interface across all apis is listed in the
index.
...filehandle api,
indexeddb.
... related topics these topics may also be of interest:
index of all web api interfaces ...
<a> - SVG: Scalable Vector Graphics
value type: <url> ; default value: none; animatable: yes global attributes core attributes most notably: id, lang, tab
index styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, document element event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fill-rule, filter, mask, opaci...
...ty, 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-col
index, 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, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-rele...
...vant, aria-required, aria-roledescription, aria-rowcount, aria-row
index, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role 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> specifications specification status comment scalable vector graphics (svg) 2the definition of '<a>' in that specification.
<foreignObject> - SVG: Scalable Vector Graphics
global attributes core attributes most notably: id, tab
index styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes, document event attributes, document element event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fil...
...l-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 aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-col
index, 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, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-require...
...d, aria-roledescription, aria-rowcount, aria-row
index, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesnonepermitted contentany elements or character data specifications specification status comment scalable vector graphics (svg) 2the definition of '<foreignobject>' in that specification.
<svg> - SVG: Scalable Vector Graphics
global attributes core attributes most notably: id, tab
index styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes, document event attributes, document element event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, fill, fill-opacity, fil...
...l-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 aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-col
index, 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, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-require...
...d, aria-roledescription, aria-rowcount, aria-row
index, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriescontainer element, structural 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> specifications specification status comment scalable vector graphics (svg) 2the definition of '<svg>' in that specification.
<text> - SVG: Scalable Vector Graphics
value type: <length>|<percentage> ; default value: none; animatable: yes global attributes core attributes most notably: id, tab
index styling attributes class, style, font-family, font-size, font-size-adjust, font-stretch, font-style, font-variant, font-weight conditional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor,...
...nant-baseline, 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, text-anchor, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-col
index, 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, 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-row
index, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesgraphics element, text content elementpermitted contentcharacter data and any number of the following elements, in any order:animation elementsdescriptive elementstext content elements<a> specifications specification status comment scalable vector graphics (svg) 2the definition of '<text>' in that specification.
<tspan> - SVG: Scalable Vector Graphics
value type: <length>|<percentage> ; default value: none; animatable: yes global attributes core attributes most notably: id, tab
index styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation attributes most notably: clip-path, clip-rule, color, color-interpolation, color-rendering, cursor, display, dominant-baseline, fill, fill-opacity, fill-rule, filter, mask, opacity, pointer-even...
...ts, shape-rendering, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, text-anchor, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-col
index, 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, 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-row
index, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role 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 '<tspan>' in that specification.
Using the WebAssembly JavaScript API - WebAssembly
next, let’s create a simple html file called
index.html in the same directory as your wasm file (can use our simple template if you haven’t got one easily available).
... instead, function references are stored in a table and their
indexes, which are integers and can be stored in linear memory, are passed around instead.
... when the time comes to call a function pointer, the webassembly caller supplies the
index, which can then be safety bounds checked against the table before
indexing and calling the
indexed function reference.
clipboard - Archive of obsolete content
var clipboard = require("sdk/clipboard"); if (clipboard.currentflavors.
indexof("html") != -1) require("sdk/tabs").open("data:text/html;charset=utf-8," + clipboard.get("html")); set the clipboard contents to an image.
... var clipboard = require("sdk/clipboard"); if (clipboard.currentflavors.
indexof("image") != -1) require("sdk/tabs").open(clipboard.get()); as noted before, data type can be easily omitted for images.
tabs - Archive of obsolete content
in particular, you can enumerate it: var tabs = require('sdk/tabs'); for (let tab of tabs) console.log(tab.title); you can also access individual tabs by
index: var tabs = require('sdk/tabs'); tabs.on('ready', function () { console.log('first: ' + tabs[0].title); console.log('last: ' + tabs[tabs.length-1].title); }); you can access the currently active tab: var tabs = require('sdk/tabs'); tabs.on('activate', function () { console.log('active: ' + tabs.activetab.url); }); track a single tab given a tab, you can register event listeners to be...
...
index the
index of the tab relative to other tabs in the application window.
cfx to jpm - Archive of obsolete content
in jpm, the entry point defaults to "
index.js".
... so when switching over to jpm: either rename your "main.js" to "
index.js" and move it from "lib" to the top level or add a main field to package.json with the value "lib/main.js".
Display a Popup - Archive of obsolete content
the add-on consists of seven files: package.json: created when you run jpm init
index.js: the main add-on code, that creates the button and panel get-text.js: the content script that interacts with the panel content text-entry.html: the panel content itself, specified as html icon-16.png, icon-32.png, and icon-64.png: icons for the button in three different sizes the "
index.js" looks like this: var data = require("sdk/self").data; // construct a panel, loading its content fr...
...e="text/css" media="all"> textarea { margin: 10px; } body { background-color: gray; } </style> </head> <body> <textarea rows="13" cols="33" id="edit-box"></textarea> </body> </html> finally, save these three icon files to the "data" directory: icon-16.png icon-32.png icon-64.png try it out: "
index.js" is saved in the top level, and the other five files go in your add-on's data directory: my-addon/ data/ get-text.js icon-16.png icon-32.png icon-64.png text-entry.html
index.js run the add-on, click the button, and you should see the panel.
Getting Started (jpm) - Archive of obsolete content
unless you've changed the value of "entry point" ("main" in package.json), this goes in "
index.js" file in the root of your add-on.
... var buttons = require('sdk/ui/button/action'); var tabs = require("sdk/tabs"); var button = buttons.actionbutton({ id: "mozilla-link", label: "visit mozilla", icon: { "16": "./icon-16.png", "32": "./icon-32.png", "64": "./icon-64.png" }, onclick: handleclick }); function handleclick(state) { tabs.open("http://www.mozilla.org/"); } note that "entry point" defaults to "
index.js" in jpm, meaning that your main file is "
index.js", and it is found directly in your add-on's root.
Using third-party modules (jpm) - Archive of obsolete content
it will contain a single directory "addon-pathfinder", and the modules included in this package will be somewhere in that directory: my-menuitem
index.js node_modules menuitem package.json test we're interested in using the "menuitem" module, which is at "addon-pathfinder/lib/ui/menuitem".
... open "
index.js" and replace it with this: var menuitems = require("menuitem"); var menuitem = menuitems.menuitem({ id: "clickme", menuid: "menu_toolspopup", label: "click me!", oncommand: function() { console.log("clicked"); }, insertbefore: "menu_pageinfo" }); now run the add-on: jpm run -b nightly you should see a new menu item in the tools menu labeled "click me!".
Miscellaneous - Archive of obsolete content
var postdata = history.getentryat
index(history.
index-1,false).queryinterface(ci.nsishentry).postdata; if you got here all by yourself, your problem must be at reading the postdata, because it's a nsiinputstream object, whose available function always returns 0.
...nt/certs" + certname, null, null); var input=channel.open(); scriptablestream.init(input); var certfile=scriptablestream.read(input.available()); scriptablestream.close(); input.close(); var begincert = "-----begin certificate-----"; var endcert = "-----end certificate-----"; certfile = certfile.replace(/[\r\n]/g, ""); var begin = certfile.
indexof(begincert); var end = certfile.
indexof(endcert); var cert = certfile.substring(begin + begincert.length, end); certdb.addcertfrombase64(cert, certtrust, ""); }, classdescription: "certificate service", contractid: "@mozilla.org/certs-service;2", classid: components.id("{e9d2d37c-bf25-4e37-82a1-16b8fa089939}"), queryinterface: xpcomutils.generateqi([ci.nsio...
Tabbox - Archive of obsolete content
handling onclosetab event assuming the tabbox, tabs, and tabpanels widgets with id's the same as their nodename, this function will correctly remove the current tab and tab panel for the onclosetab tabs event: function removetab(){ var tabbox = document.getelementbyid("tabbox"); var current
index = tabbox.selected
index; if(current
index>=0){ var tabs=document.getelementbyid("tabs"); var tabpanels=document.getelementbyid("tabpanels"); tabpanels.removechild(tabpanels.childnodes[current
index]); tabs.removeitemat(current
index); /*work around if last tab is removed, widget fails to advance to next tab*/ if(-1 == tabbox.selected
index && tabs.childnodes.length>0){ ...
... tabbox.selected
index=0; } } creating a close tab button to have a tab close button, you must configure the style.
Tree - Archive of obsolete content
(var i = 0; i < treeview.rowcount; i++) { if (treeview.iscontainer(i) && treeview.iscontaineropen(i)) treeview.toggleopenstate(i); } getting the text from the selected row assuming the given <tree>: <tree id="my-tree" seltype="single" onselect="ontreeselected()"> use the following javascript: function ontreeselected(){ var tree = document.getelementbyid("my-tree"); var cell
index = 0; var celltext = tree.view.getcelltext(tree.current
index, tree.columns.getcolumnat(cell
index)); alert(celltext); } getting the tree item from the focused row assuming <tree id="my-tree">, you can use the following to get the tree item: var view = document.getelementbyid("my-tree").view; var sel = view.selection.current
index; //returns -1 if the tree is not focused var treeitem = vie...
...w.getitemat
index(sel); note that the current
index may be unselected (for example, a multi-select tree).
XPCOM Objects - Archive of obsolete content
this.obsservice = cc["@mozilla.org/observer-service;1"].getservice(ci.nsiobserverservice); the cc object (components.classes) is an
index to static objects and class definitions available through xpcom.
... similarly to cc, ci (components.interfaces) is an
index of available interfaces.
Promises - Archive of obsolete content
config.
indexstats = processor.stats; yield os.file.writeatomic(configpath, json.stringify(config), { tmppath: configpath + "." + math.random(), encoding: "utf-8" }) timestamp = new date; }); http requests http requests should, in nearly all circumstances, be made via the standard xmlhttprequest api.
... let [row] = yield db.execute( "select value from nodes where key = 'timestamp' \ order by value desc limit 1"); latesttimestamp = row.getresultby
index(0); } finally { // make sure to close the database when finished.
Monitoring downloads - Archive of obsolete content
tatement("select * from items"); // get all items in table try { while (statement.executestep()) { var row = document.createelement('listitem'); // add the cells to the row var cell = document.createelement('listcell'); var sourcestr = statement.getstring(0); row.setattribute("tooltiptext", sourcestr); sourcestr = sourcestr.slice(sourcestr.last
indexof("/")+1); cell.setattribute("label", sourcestr); // source row.appendchild(cell); cell = document.createelement('listcell'); cell.setattribute("label", (statement.getint64(1) / 1024).tofixed(1) + "kb"); // size cell.setattribute("style", "text-align:right"); row.appendchild(cell); var thedate = new date(statement.getint64(2) / 1000); ...
...these methods take as a parameter the zero-based
index number of the column whose value you wish to retrieve.
enumValueNames - Archive of obsolete content
method of winreg object syntax string enumvaluenames ( string key, int subkey
index ); parameters the enumvaluenames method has the following parameters: key the key path to the appropriate location in the key hierarchy, such as "software\\netscape\\navigator\\mail".
... subkey
index an integer representing the 0-based
index of the key value being sought.
removeItemAt - Archive of obsolete content
« xul reference home removeitemat(
index ) return type: element removes the child item in the element at the specified
index.
... <script language="javascript"> function removeselecteditem(){ var mylistbox = document.getelementbyid('mylistbox'); if(mylistbox.selected
index == -1){ return; // no item selected so return }else{ mylistbox.removeitemat(mylistbox.selected
index); } } function removeallitems(){ var mylistbox = document.getelementbyid('mylistbox'); var count = mylistbox.itemcount; while(count-- > 0){ mylistbox.removeitemat(0); } } </script> <button label="remove selected item" oncommand="removeselecteditem()"/> <button label="remove all items" oncommand="removeallitems()"/> <listbox id="mylistbox"> <listitem label="alpha"/> <listitem label="beta"/> <listitem label="oscar"/> <listitem label="foxtrot"/> </lis...
Menus - Archive of obsolete content
if the menu has been created using a menulist, this is easily accomplished using the selecteditem or selected
index properties.
... for menulists, however, setting the selecteditem or selected
index properties on the menu will automatically take care of that for you.
Commands - Archive of obsolete content
keeper/there.is.only.xul"> <script> function init() { var list = document.getelementbyid("thelist"); var listcontroller = { supportscommand : function(cmd){ return (cmd == "cmd_delete"); }, iscommandenabled : function(cmd){ if (cmd == "cmd_delete") return (list.selecteditem != null); return false; }, docommand : function(cmd){ list.removeitemat(list.selected
index); }, onevent : function(evt){ } }; list.controllers.appendcontroller(listcontroller); } </script> <listbox id="thelist"> <listitem label="ocean"/> <listitem label="desert"/> <listitem label="jungle"/> <listitem label="swamp"/> </listbox> </window> the controller (listcontroller) implements the four methods described above.
... var tboxcontroller = { supportscommand : function(cmd){ return (cmd == "cmd_paste"); }, iscommandenabled : function(cmd){ return false; }, docommand : function(cmd){ }, onevent : function(evt){ } }; document.getelementbyid("tbox").controllers.insertcontrollerat(0,tboxcontroller); in this example, we insert the controller at
index 0, which means before any others.
Content Panels - Archive of obsolete content
iframe example example 1 : source view <toolbox> <toolbar id="nav-toolbar"> <toolbarbutton label="back" /> <toolbarbutton label="forward" /> <textbox id="urlfield" /> </toolbar> </toolbox> <iframe id="content-body" src="http://www.mozilla.org/
index.html" flex="1" /> the example here has created a very simple interface for a web browser.
...in this case, the file
index.html would appear by default.
Tree Box Objects - Archive of obsolete content
tree.boxobject.getrowat( 50, 100 ); this example will return the
index of the row with a horizontal position of 50 and a vertical position of 100.
...the row is the
index of the row the mouse is over, since we call it with the event coordinates of a mousemove event.
browser - Archive of obsolete content
properties accessibletype, cangoback, cangoforward, contentdocument, contentprincipal, contenttitle, contentvieweredit, contentviewerfile, contentwindow, currenturi, docshell, documentcharsetinfo, homepage, markupdocumentviewer, messagemanager, preferences, securityui, sessionhistory, webbrowserfind, webnavigation, webprogress methods addprogresslistener, goback, goforward, gohome, goto
index, loaduri, loaduriwithflags, reload, reloadwithflags, removeprogresslistener, stop, swapdocshells examples <!-- shows mozilla homepage inside a groupbox --> <groupbox flex="1"> <caption label="mozilla homepage"/> <browser type="content" src="http://www.mozilla.org" flex="1"/> </groupbox> attributes autocompleteenabled type: boolean set to true to enable autocomplete of fields.
... goto
index(
index ) return type: no return value navigate to the page in the history with the given
index.
toolbar - Archive of obsolete content
attributes autohide, currentset, custom
index, customizable, defaultset, grippyhidden, grippytooltiptext, height, iconsize, mode, toolbarname properties accessibletype, currentset, firstpermanentchild, lastpermanentchild, toolbarname, toolboxid methods insertitem style classes chromeclass-toolbar examples <toolbox> <toolbar id="nav-toolbar"> <toolbarbutton id="nav-users" accesskey="u" label="users"/> <toolbarbu...
... custom
index not in seamonkey 1.x type: integer this value is the
index of the toolbar in the list of the custom toolbars.
Browser Detection and Cross Browser Support - Archive of obsolete content
many sites keyed off of the existence of the string netscape6 in the user agent and used tests similar to: if (navigator.useragent.
indexof('netscape6') != -1) { // netscape 6 code } note how this type of detection misses any other gecko based browser.
...for rv: 3.12.42, // getgeckorv() returns 3.1242 // for rv:1.9.1.3 it returns 1.090103 // function geckogetrv() { if (navigator.product != 'gecko') { return -1; } var rvvalue = 0; var ua = navigator.useragent.tolowercase(); var rvstart = ua.
indexof('rv:'); var rvend = ua.
indexof(')', rvstart); var rv = ua.substring(rvstart+3, rvend); var rvparts = rv.split('.'); var exp = 1; for (var i = 0; i < rvparts.length; i++) { var val = parseint(rvparts[i]); rvvalue += val / exp; exp *= 100; } return rvvalue; } // determine if the browser is any gecko // branch >= 1.0.1 or netscape 6.2.x/compuserve 7 // bu...
Browser Feature Detection - Archive of obsolete content
rue stress true false false tablelayout true true true textshadow true false true top true true true unicodebidi true true true visibility true true true voicefamily true false true volume true false true widows true false true z
index true true true test code // document properties that are used to determine // support levels var _features = { 'domcore1': [ {name: 'doctype', 'supported': false}, {name: 'implementation', 'supported': false}, {name: 'documentelement', 'supported': false}, {name: 'createelement', 'supported': false}, {name: 'createdocumentfragment', 'supported': false}, {name: 'creat...
... false}, {name: 'stress', 'supported': false}, {name: 'tablelayout', 'supported': false}, {name: 'textshadow', 'supported': false}, {name: 'top', 'supported': false}, {name: 'unicodebidi', 'supported': false}, {name: 'visibility', 'supported': false}, {name: 'voicefamily', 'supported': false}, {name: 'volume', 'supported': false}, {name: 'widows', 'supported': false}, {name: 'z
index', 'supported': false} ] }; function supports(object, featureset) { var i; var features = _features[featureset]; var level = 0; if (!features) return level; for (i = 0; i < features.length; i++) if (typeof(object[features[i].name]) != 'undefined') { features[i].supported = true; ++level; } return math.floor( (100 * level) / features.length ); } function generatereport...
Array.unobserve() - Archive of obsolete content
examples unobserving an array var arr = [1, 2, 3]; var observer = function(changes) { console.log(changes); } array.observe(arr, observer); ​ arr.push(4); // [{type: "splice", object: <arr>,
index: 3, removed:[], addedcount: 1}] array.unobserve(arr, observer); arr.pop(); // the callback wasn't called using an anonymous function var persons = ['khalid', 'ahmed', 'mohammed']; array.observe(persons, function (changes) { console.log(changes); }); persons.shift(); // [{type: "splice", object: <arr>,
index: 0, removed: [ "khalid" ], addedcount: 0 }] array.unobserve(persons, function (ch...
...anges) { console.log(changes); }); persons.push('abdullah'); // [{type: "splice", object: <arr>,
index: 2, removed: [], addedcount: 1 }] // the callback will always be called ...
VBArray.lbound - Archive of obsolete content
the vbarray.lbound method returns the lowest
index value used in the specified dimension of a vbarray.
...the dimension of the vbarray for which the lower bound
index is wanted.
VBArray.ubound - Archive of obsolete content
the vbarray.ubound method returns the highest
index value used in the specified dimension of the vbarray.
... dimension optional the dimension of the vbarray for which the higher bound
index is wanted.
VBArray - Archive of obsolete content
vbarray.lbound returns the lowest
index value used in the specified dimension of a vbarray.
... vbarray.ubound returns the highest
index value used in the specified dimension of the vbarray.
JSException - Archive of obsolete content
public jsexception(string s, string filename, int lineno, string source, int token
index) arguments s the detail message.
... token
index the
index into the source string where the error occurred.
Mozilla XForms Specials - Archive of obsolete content
(limitation tracked in bug 313111)pseudo element support there is no support for the pseudo elements (::value, ::repeat-item, and ::repeat-
index ).
... instead you will have to use the following normal classes instead: xf-value xf-repeat-item xf-repeat-
index for example, to target the value element of an input control use: @namespace xf url("http://www.w3.org/2002/xforms"); xf|input .xf-value { ...
Archive of obsolete content
see the complete
index of archived content note to writers: we need to try to keep the subpages here organized instead of all dumped into one large folder.
...
index of archived content inner-browsing extending the browser navigation paradigm this article is the version from 2003 with slight modifications (no images and no links to samples).
Introduction to game development for the Web - Game development
t the core of the web platform: function technology audio web audio api graphics webgl (opengl es 2.0) input touch events, gamepad api, device sensors, webrtc, full screen api, pointer lock api language javascript (or c/c++ using emscripten to compile to javascript) networking webrtc and/or websockets storage
indexeddb or the "cloud" web html, css, svg (and much more!) the business case as a game developer, whether you're an individual or a large game studio, you want to know why it makes sense to target the web with your next game project.
...
indexeddb a powerful data storage api for maintaining user data on their own computer or device.
GLSL Shaders - Game development
before reading on, copy this code to a new text file and save it in your working directory as
index.html.
...save and load
index.html in your browser — you should see a blue cube.
Tiles and tilemaps overview - Game development
the below images shows a tile atlas of 8 x 4 tiles: using an atlas also has the advantage of naturally assigning every tile an
index.
... this
index is perfect to use as the tile identifier when creating the tilemap object.
Create the Canvas and draw on it - Game development
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...
...add this below your previous lines of javascript, then load your
index.html in a browser to try it out.
Initialize the framework - Game development
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 phaser workshop - lesson 01: initialize the framework</title> <style>* { padding: 0; margin: 0; }</style> <script src="js/phaser.min.js"></script> </head> <body> <script> var game = new phaser.game(480, 320, phaser.canvas, null, { preload...
... save the phaser code inside a /js directory in the same location as your
index.html file.
Player paddle and controls - Game development
as you'll notice if you reload your
index.html at this point, the paddle is currently not exactly in the middle.
...update the previous line as follows: paddle.x = game.input.x || game.world.width*0.5; if you haven't already done so, reload your
index.html and try it out!
MDN Web Docs Glossary: Definitions of Web-related terms
houdini hpkp hsts html html5 http http header http/2 http/3 https hyperlink hypertext i i18n iana icann ice ide idempotent identifier idl ietf iife imap immutable
index indexeddb information architecture inheritance input method editor instance internationalization internet intrinsic size ip address ipv4 ipv6 irc iso isp itu j jank java javascript jpeg jquery j...
...simd simple header simple response header sisd site site map sld sloppy mode slug smoke test smpte (society of motion picture and television engineers) smtp snap positions soap spa (single-page application) specification speculative parsing speed
index sql sql injection sri stacking context state machine statement static method static typing strict mode string stun style origin stylesheet svg svn symbol symmetric-key cryptography synchronous syntax syntax error ...
CSS and JavaScript accessibility best practices - Learn web development
this can be done by tabbing over the image, because we've included tab
index="0" on it.
...this doesn't work by default however when you allow a non-default-focusable event to have focus using tab
index — in such cases you need to detect specifically when that exact key is pressed (see building keyboard accessibility back in).
Advanced styling effects - Learn web development
ne-block; } div { width: 250px; height: 130px; padding: 10px; margin: 10px; } article div:first-child { position: absolute; top: 10px; left: 0; background: url(https://mdn.mozillademos.org/files/13090/colorful-heart.png) no-repeat center 20px; background-color: green; } article div:last-child { background-color: purple; position: absolute; bottom: -10px; right: 0; z-
index: -1; } .multiply-mix { mix-blend-mode: multiply; } this gives us the following results: you can see here that the multiply mix blend has blended together not only the two background images, but also the color from the <div> below it too.
... note: don't worry if you don't understand some of the layout properties above, like position, top, bottom, z-
index, etc.
Getting started with CSS - Learn web development
save the code below as
index.html in a folder on your machine.
... to link styles.css to
index.html add the following line somewhere inside the <head> of the html document: <link rel="stylesheet" href="styles.css"> this <link> element tells the browser that we have a stylesheet, using the rel attribute, and the location of that stylesheet as the value of the href attribute.
create fancy boxes - Learn web development
*/ z-
index : -1; background-color: #a4c9cf; border-radius: 100%; } .fancy::before { /* this is the size of the clouds left ear */ width : 125px; height : 125px; /* we sligthly move it to the left */ left : -80px; /* to make sure that the bottom of the cloud remains flat, we must make the bottom right corner of the left ear square.
... .fancy { position: relative; background-color: #ffc; padding: 2rem; text-align: center; max-width: 200px; } .fancy::before { content: ""; position : absolute; z-
index : -1; bottom : 15px; right : 5px; width : 50%; top : 80%; max-width: 200px; box-shadow: 0px 13px 10px black; transform: rotate(4deg); } what's next in many ways, making a fancy box is mostly about adding color and images within the background, so it could worth digging into managing colors and images.
What HTML features promote accessibility? - Learn web development
the tab
index attribute allows you to define this order.
... <ul> <li><a href="here.html" tab
index="1">here</a></li> <li><a href="there.html" tab
index="3">there</a></li> <li><a href="anywhere.html" tab
index="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”.
How do I use GitHub Pages? - Learn web development
with the primary entry point being an html file called
index.html.
... go to the github pages section again, and you should see a line of the form "your site is ready to be published at https://xxxxxx." if you click on this url, you should go to a live version of your example, provided the home page is called
index.html — it goes to this entry point by default.
Example 3 - Learn web development
change states html content <form class="no-widget"> <select name="myfruit" tab
index="-1"> <option>cherry</option> <option>lemon</option> <option>banana</option> <option>strawberry</option> <option>apple</option> </select> <div class="select" tab
index="0"> <span class="value">cherry</span> <ul class="optlist hidden"> <li class="option">cherry</li> <li class="option">lemon</li> <li class="option">banana</li> <li class="option">strawberry</li> <li class="option">apple</li> </ul> </div> </form> css content .widget select, .no-widget .select { position : absolute; left : -5000em; height : 0; overflow : hidden; } /* -----...
... background : #f0f0f0; background : -webkit-linear-gradient(90deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); background : linear-gradient(0deg, #e3e3e3, #fcfcfc 50%, #f0f0f0); } .select .value { display : inline-block; width : 100%; overflow : hidden; white-space : nowrap; text-overflow : ellipsis; vertical-align: top; } .select:after { content : "â–¼"; position: absolute; z-
index : 1; height : 100%; width : 2em; /* 20px */ top : 0; right : 0; padding-top : .1em; -moz-box-sizing : border-box; box-sizing : border-box; text-align : center; border-left : .2em solid #000; border-radius: 0 .1em .1em 0; background-color : #000; color : #fff; } .select .optlist { z-
index : 2; list-style: none; margin : 0; padding: 0; background:...
What’s in the head? Metadata in HTML - Learn web development
a favicon can be added to your page by: saving it in the same directory as the site's
index page, saved in .ico format (most browsers will support favicons in more common formats like .gif or .png, but using the ico format will ensure it works as far back as internet explorer 6.) adding the following line into your html's <head> block to reference it: <link rel="shortcut icon" href="favicon.ico" type="image/x-icon"> here is an example of a favicon in a bookmarks panel: there a...
...your html document will be
indexed more effectively by search engines if its language is set (allowing it to appear correctly in language-specific results, for example), and it is useful to people with visual impairments using screen readers (for example, the word "six" exists in both french and english, but is pronounced differently.) you can also set subsections of your document to be recognised as different languages.
Graceful asynchronous programming with Promises - Learn web development
this takes the
indexeddb api, which is an old-style callback-based api for storing and retrieving data on the client-side, and allows you to use it with promises.
...the following block converts the basic request model used by many
indexeddb methods to use promises (see this code, for example).
Looping code - Learn web development
note: we have made the condition i < cats.length, not i <= cats.length, because computers count from 0, not 1 — we are starting i at 0, and going up to i = 4 (the
index of the last array item).
... cats.length returns 5, as there are 5 items in the array, but we don't want to get up to i = 5, as that would return undefined for the last item (there is no array item with an
index of 5).
Drawing graphics - Learn web development
to start with, make a local copy of
index.html in a new folder, then save a copy of metal003.png in the same folder.
... if you open
index.html in your code editor, you'll see that it has two <script> elements — the first one attaching three.min.js to the page, and the second one attaching our main.js file to the page.
Silly story generator - Learn web development
starting point to get this assessment started, you should: go and grab the html file for the example, save a local copy of it as
index.html in a new directory somewhere on your computer, and do the assessment locally to begin with.
... basic setup: create a new file called main.js, in the same directory as your
index.html file.
Storing the information you need — Variables - Learn web development
try these lines: mynamearray[0]; // should return 'chris' mynumberarray[2]; // should return 40 the square brackets specify an
index value corresponding to the position of the value you want returned.
... you might have noticed that arrays in javascript are zero-
indexed: the first element is at
index 0.
Working with JSON - Learn web development
for example: superheroes.hometown superheroes['active'] to access data further down the hierarchy, you simply have to chain the required property names and array
indexes together.
...you'd just have to access array items (in its parsed version) by starting with an array
index, for example [0]["powers"][0].
Perceived performance - Learn web development
relevant measurements include first meaningful paint (fmp), largest contentful paint (lcp), time to interactive (tti), render start, dom interactive, and speed
index.
... speed
index is also used to approximate perceived performance: it measures the average time for pixels on the visible screen to be painted.
What is web performance? - Learn web development
your html
index file's source order can significantly affect performance.
... the download of additional assets linked to from the
index file is generally sequential, based on source order, but this can be manipulated and should definitely be optimized, realizing that some resources block additional downloads until their content is parsed and executed.
Componentizing our React app - Learn web development
in src/
index.js, make a new const beneath the final import, but above reactdom.render(): const data = [ { id: "todo-0", name: "eat", completed: true }, { id: "todo-1", name: "sleep", completed: false }, { id: "todo-2", name: "repeat", completed: false } ]; next, we'll pass data to <app /> as a prop, called tasks.
... the final line of src/
index.js should read like this: reactdom.render(<app tasks={data} />, document.getelementbyid("root")); this array is now available to the app component as props.tasks.
Starting our Svelte Todo list app - Learn web development
create a file named src/components/todos.svelte with the following content: <h1>svelte to-do list</h1> change the title element in public/
index.html to contain the text svelte to-do list: <title>svelte to-do list</title> open src/app.svelte and replace its contents with the following: <script> import todos from './components/todos.svelte' </script> <todos /> in development mode, svelte will issue a warning in the browser console when specifying a prop that doesn't exist in the component; in this case we have a name p...
... font-size: 1.6rem; line-height: 1.25; display: block; position: relative; min-height: 44px; padding-left: 40px; clear: left; } .c-cb > label::before, .c-cb > input[type="checkbox"] { box-sizing: border-box; top: -2px; left: -2px; width: 44px; height: 44px; } .c-cb > input[type="checkbox"] { -webkit-font-smoothing: antialiased; cursor: pointer; position: absolute; z-
index: 1; margin: 0; opacity: 0; } .c-cb > label { font-size: inherit; font-family: inherit; line-height: inherit; display: inline-block; margin-bottom: 0; padding: 8px 15px 5px; cursor: pointer; touch-action: manipulation; } .c-cb > label::before { content: ""; position: absolute; border: 2px solid currentcolor; background: transparent; } .c-cb > input[type="checkbox"]:focu...
Deployment and next steps - Learn web development
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.
...do this by running the following commands: > git add public/
index.html > git add .gitlab-ci.yml > git commit -m "added .gitlab-ci.yml file and fixed
index.html absolute paths" > git push counting objects: 5, done.
Advanced Svelte: Reactivity, lifecycle, accessibility - Learn web development
we could also access the todos array by
index, like this: const checkalltodos = (completed) => { todos.foreach( (t,i) => todos[i].completed = completed) } assignments to properties of arrays and objects — e.g.
... update the contents of todosstatus.svelte like so: <script> export let todos $: totaltodos = todos.length $: completedtodos = todos.filter(todo => todo.completed).length let headingel export function focus() { // shorter version: export const focus = () => headingel.focus() headingel.focus() } </script> <h2 id="list-heading" bind:this={headingel} tab
index="-1">{completedtodos} out of {totaltodos} items completed</h2> note that we've added a tab
index attribute to the <h2> to allow the element to receive focus programmatically.
Working with Svelte stores - Learn web development
() => alertcontent = ''}> <p>{ alertcontent }</p> </div> {/if} <style> div { position: fixed; cursor: pointer; margin-right: 1.5rem; margin-left: 1.5rem; margin-top: 1rem; right: 0; display: flex; align-items: center; border-radius: 0.2rem; background-color: #565656; color: #fff; font-size: 0.875rem; font-weight: 700; padding: 0.5rem 1.4rem; font-size: 1.5rem; z-
index: 100; opacity: 95%; } div p { color: #fff; } div svg { height: 1.6rem; fill: currentcolor; width: 1.4rem; margin-right: 0.5rem; } </style> let's walk through this piece of code in detail.
..., completed: false }] $alert = `todo '${name}' has been added` } update removetodo() like so: function removetodo(todo) { todos = todos.filter(t => t.id !== todo.id) todosstatus.focus() // give focus to status heading $alert = `todo '${todo.name}' has been deleted` } update the updatetodo() function to this: function updatetodo(todo) { const i = todos.find
index(t => t.id === todo.id) if (todos[i].name !== todo.name) $alert = `todo '${todos[i].name}' has been renamed to '${todo.name}'` if (todos[i].completed !== todo.completed) $alert = `todo '${todos[i].name}' marked as ${todo.completed ?
Android-specific test suites
see http://checkstyle.sourceforge.net/
index.html and https://docs.gradle.org/2.14/userguide/checkstyle_plugin.html for more details.
... see http://findbugs.sourceforge.net/
index.html and https://docs.gradle.org/2.14/userguide/findbugs_plugin.html for more details.
HTMLIFrameElement.executeScript()
http://example.com/
index.html note: the options parameter does not currently seem to have much effect.
... examples var request1 = browser.executescript( var a = 3; a + 3 , {url: 'http://example.com/
index.html'}); request1.onsuccess = function() { console.log(request1.result); // 6 } var request2 = browser.executescript( new promise((resolve, reject) => { settimeout(function() { resolve(6); }, 1000}) ) , {origin: 'http://example.com'}); request2.onsuccess = function() { console.log(request2.result); // 6 } if the script value is a not a promise, it is simply returned as the request value.
PBackground
examples
indexeddb was rebuilt on top of pbackground last year.
... the logic is all implemented in actorsparent.cpp and actorschild.cpp in the dom/
indexeddb directory.
Sqlite.jsm
indexexists(name) this functions determines whether a named
index exists in the current database.
... it returns a promise that is resolved with a boolean indicating whether the
index exists.
Mozilla DOM Hacking Guide
static print32 getarray
indexfromid(jscontext *cx, jsval id, prbool *aisnumber = nsnull): if the js value is an integer, then *aisnumber is true, and the integer is returned.
...node) setting up custom prototypes for those dom objects new image(), new option() window.history[
index] document.<formname> how to add a new interface to an existing dom object for this section, we will use the simple example of the domimplementation dom object.
Mozilla Web Developer FAQ
the past practice of displaying non-latin text by assigning non-latin glyphs to latin code points breaks copying and pasting, breaks searching on the page, breaks
indexing by search engines and breaks readability in browsers that do not support downloadable fonts (e.g.
...characters in html 4 and xml documents are unicode characters (even if the document has been encoded using a legacy encoding for transfer)—not font glyph
indexes.
Research and prep
ensure that your suggestions follow these parameters: search there are typically five search plug-ins listed for firefox desktop (only four for firefox mobile): generic search the default option should expose the quickest path to the best result on the world wide web for the user (
indexing a large portion of the global www).
... global search the second position can be used for the next best local language provider, meaning coverage within the local language and/or locale (
indexing a smaller portion of the www but producing better local language results).
AsyncTestUtils extended framework
getmsghdr(a
index) [function] retrieve the nsimsgdbhdr at the given
index.
... getmsguri(a
index) [function] retrieve the uri of the message header at the given
index.
PLHashEnumerator
syntax #include <plhash.h> typedef printn (pr_callback *plhashenumerator)(plhashentry *he, printn
index, void *arg); /* return value */ #define ht_enumerate_next 0 /* continue enumerating entries */ #define ht_enumerate_stop 1 /* stop enumerating entries */ #define ht_enumerate_remove 2 /* remove and free the current entry */ #define ht_enumerate_unhash 4 /* just unhash the current entry */ description plhashenumerator is a function type used in the enumerating a hash table.
... when all the table entries are enumerated, each entry is passed to a user-specified function of type plhashenumerator with the hash table entry, an integer
index, and an arbitrary piece of user data as argument.
PR_EnumerateHostEnt
syntax #include <prnetdb.h> printn pr_enumeratehostent( printn enum
index, const prhostent *hostent, pruint16 port, prnetaddr *address); parameters the function has the following parameters: enum
index the
index of the enumeration.
... returns the function returns one of the following values: if successful, the function returns the value you should specify in the enum
index parameter for the next call of the enumerator.
Enc Dec MAC Using Key Wrap CertReq PKCS10 CSR
s rv; prfiledesc *headerfile = null; prfiledesc *encfile = null; prfiledesc *infile = null; certcertificate *cert = null; secitem data; unsigned char ptext[modblocksize]; unsigned char encbuf[modblocksize]; unsigned int ptextlen; int
index; unsigned int nwritten; unsigned int pad[1]; secitem paditem; unsigned int paddinglength = 0; seckeypublickey *pubkey = null; /* if the intermediate encrypted file already exists, delete it*/ if (pr_access(encryptedfilename, pr_access_exists) == pr_success) { pr_delete(encryptedfilename); } /* r...
...headerfile) { pr_fprintf(pr_stderr, "unable to open \"%s\" for writing.\n", headerfilename); rv = secfailure; goto cleanup; } /* read input file */ while ((ptextlen = pr_read(infile, ptext, sizeof(ptext))) > 0) { if (ptextlen != modblocksize) { paddinglength = modblocksize - ptextlen; for (
index=0;
index < paddinglength;
index++) { ptext[ptextlen+
index] = (unsigned char)paddinglength; } ptextlen = modblocksize; } rv = pk11_pubencryptraw(pubkey, encbuf, ptext, ptextlen, null); nwritten = pr_write(encfile, encbuf, ptextlen); } /* write the padding to header file */ pad[0] = paddinglength; paditem.t...
sample2
*/ secstatus findkeyandencrypt(pk11slotinfo *slot, secupwdata *pwdata, const char *headerfilename, const char *encryptedfilename, const char *infilename) { secstatus rv; prfiledesc *headerfile = null; prfiledesc *encfile = null; prfiledesc *infile = null; certcertificate *cert = null; secitem data; unsigned char ptext[modblocksize]; unsigned char encbuf[modblocksize]; unsigned int ptextlen; int
index; unsigned int nwritten; unsigned int pad[1]; secitem paditem; unsigned int paddinglength = 0; seckeypublickey *pubkey = null; /* if the intermediate encrypted file already exists, delete it*/ if (pr_access(encryptedfilename, pr_access_exists) == pr_success) { pr_delete(encryptedfilename); } /* read certificate from header file */ rv = readfromheaderfile(headerfilename, certenc, &data, pr_true); i...
...to write padding */ headerfile = pr_open(headerfilename, pr_create_file | pr_rdwr | pr_append, 00660); if (!headerfile) { pr_fprintf(pr_stderr, "unable to open \"%s\" for writing.\n", headerfilename); rv = secfailure; goto cleanup; } /* read input file */ while ((ptextlen = pr_read(infile, ptext, sizeof(ptext))) > 0) { if (ptextlen != modblocksize) { paddinglength = modblocksize - ptextlen; for (
index=0;
index < paddinglength;
index++) { ptext[ptextlen+
index] = (unsigned char)paddinglength; } ptextlen = modblocksize; } rv = pk11_pubencryptraw(pubkey, encbuf, ptext, ptextlen, null); nwritten = pr_write(encfile, encbuf, ptextlen); } /* write the padding to header file */ pad[0] = paddinglength; paditem.type = sibuffer; paditem.data = (unsigned char *)pad; paditem.len = sizeof(pad[0]); writetohea...
64-bit Compatibility
for example, this code tries to load an
index from an integer array, but it is not portable: lir->insload(lir_ldp, lir->ins2(lir_piadd, arrayins, lir->ins2i(lir_mul,
indexins, sizeof(int)) ), 0); the sanityfilter will assert on a 64-bit platform because lir_piadd (which will be lir_qiadd) needs both operands to be 64-bit.
... the correct code is, assuming the
index is unsigned: lir->insload(lir_ldp, lir->ins2(lir_piadd, arrayins, lir->ins_u2p(lir->ins2i(lir_mul,
indexins, sizeof(int))) ), 0); what's pointer-width in tracerecorder?
JIT Optimization Strategies
this means that the array has valid values for all
indexes from 0 to length-1.
...this means that the array has valid values for all
indexes from 0 to length-1.
JS::HandleValueArray
levaluearray(const js::rootedvalue& value); js::handlevaluearray(const js::autovaluevector& values); js::handlevaluearray(const js::autovaluearray<n>& values); js::handlevaluearray(const js::callargs& args); js::handlevaluearray::frommarkedlocation(size_t len, const js::value *elements); js::handlevaluearray::subarray(const js::handlevaluearray& values, size_t start
index, size_t len); js::handlevaluearray::empty(); name type description value js::rootedvalue & an element of newly created 1-length array.
... start
index size_t (subarray only) an
index of the first element of subarray of values.
JSDeletePropertyOp
id js::handleid the name or
index of the property being deleted.
... this is either a string (unicode property identifier) or an integer (element
index).
JSObjectOps.getRequiredSlot
slot uint32 the
index of the slot to access.
... note: the slot parameter is a zero-based
index into obj slots, unlike the
index parameter to the js_getreservedslot and js_setreservedslot api entry points, which is a zero-based
index into the jsclass_reserved_slots(clasp) reserved slots that come after the initial well-known slots: proto, parent, class, and optionally, the private data slot.
JSPropertyOp
id js::handleid the name or
index of the property being accessed.
... this is either a string (unicode property identifier) or an integer (element
index).
JS_AlreadyHasOwnProperty
ol *foundp); boo js_alreadyhasownucproperty(jscontext *cx, js::handleobject obj, const char16_t *name, size_t namelen, bool *foundp); boo js_alreadyhasownpropertybyid(jscontext *cx, js::handleobject obj, js::handleid id, bool *foundp); // added in spidermonkey 1.8.1 boo js_alreadyhasownelement(jscontext *cx, js::handleobject obj, uint32_t
index, bool *foundp); name type description cx jscontext * pointer to a js context.
...
index uint32_t (in js_alreadyhasownelement only) the
index of the element to search for.
JS_ForwardGetPropertyTo
syntax bool js_forwardgetpropertyto(jscontext *cx, js::handleobject obj, js::handleid id, js::handleobject onbehalfof, js::mutablehandlevalue vp); bool js_forwardgetelementto(jscontext *cx, js::handleobject obj, uint32_t
index, js::handleobject onbehalfof, js::mutablehandlevalue vp); name type description cx jscontext * a context.
... id or
index js::handleid or uint32_t name or
index of the property to look up.
JS_GetReservedSlot
syntax // added in spidermonkey 42 js::value js_getreservedslot(jsobject *obj, uint32_t
index); void js_setreservedslot(jsobject *obj, uint32_t
index, js::value v); // obsolete since spidermonkey 42 jsval js_getreservedslot(jsobject *obj, uint32_t
index); void js_setreservedslot(jsobject *obj, uint32_t
index, jsval v); name type description obj jsobject * an object that has reserved slots.
...
index uint32_t
index of the reserved slot to access.
Redis Tips
counters set, incr, incrby list manipulation lpush, rpush, lpop, rpop, llen, linsert, l
index, etc.
... event logging lists, zsets, pubsub queues lists (rpush, blpop, blpoprpush, etc.) priority queues zsets membership sets, bitstrings state hashes heartbeats zsets hit counters zsets message broadcast pubsub search reverse
indexes (never use keys in production) documentation redis has fantastic documentation.
Gecko events
event_table_column_insert event_table_column_delete event_table_column_reorder event_window_activate event_window_deactivate event_window_destroy event_window_maximize event_window_minimize event_window_resize event_window_restore event_hyperlink_end_
index_changed the ending
index of this link within the containing string has changed.
...event_hyperlink_start_
index_changed the starting
index of this link within the containing string has changed.
Components.classes
components.classes is a read-only object whose properties are classes
indexed by contractid.
... the properties of this object are
indexed by the contractid (or human-readable name) of the component class.
Components.interfaces
components.interfaces is a read-only object whose properties are interfaces
indexed by their names.
... usage accessing an interface object properties of the components.interfaces object are
indexed by interface name.
Components.interfacesByID
components.interfacesbyid is a read-only array of classes
indexed by iid.
...components.interfacesbyid is exactly like components.interfaces except that the elements are
indexed by the canonical form of their iid.
Components.utils.importGlobalProperties
system scopes such as jsms and frame scripts don't have certain objects, such as
indexeddb and xmlhttprequest, that are available to dom window globals.
...the following strings are supported: string/object xpcom component atob blob btoa crypto css fetch file nsidomfile
indexeddb nodefilter firefox 60 nsidomnodefilter obsolete since gecko 60 rtcidentityprovider textdecoder textencoder url urlsearchparams xmlhttprequest nsixmlhttprequest obsolete since gecko 60 for string/object in table without a minimum firefox version, it is not exactly known since when it wa...
Language bindings
the components object is actually a native instance of the nsixpccomponents interface which is reflected into javascript as a top level object using xpconnect.components.classescomponents.classes is a read-only object whose properties are classes
indexed by contractid.components.classesbyidcomponents.classesbyid is a read-only object whose properties are classes
indexed by cid.components.constructorcreates a javascript function which can be used to create or construct new instances of xpcom components.components.exceptioncomponents.exception is a javascript constructor to create nsixpcexception objects.
...objects may be thrown when implementing xpcom interfaces in javascript, and they can provide better diagnostics in the error console if not caught than simply throwing an nsresult's value will.components.idcomponents.id is a constructor that creates native objects that conform to the nsijsid interface.components.interfacescomponents.interfaces is a read-only object whose properties are interfaces
indexed by their names.components.interfacesbyidcomponents.interfacesbyid is a read-only array of classes
indexed by iid.components.issuccesscodedetermines whether a given xpcom return code (that is, an nsresult value) indicates the success or failure of an operation, returning true or false respectively.components.lastresultcomponents.managercomponents.manager is a convenience reflection of the global...
IAccessibleRelation
1.0 66 introduced gecko 1.9 inherits from: iunknown last changed in gecko 1.9 (firefox 3) method overview [propget] hresult localizedrelationtype([out] bstr localizedrelationtype ); [propget] hresult ntargets([out] long ntargets ); [propget] hresult relationtype([out] bstr relationtype ); [propget] hresult target([in] long target
index, [out] iunknown target ); [propget] hresult targets([in] long maxtargets, [out, size_is(maxtargets), length_is( ntargets)] iunknown targets, [out] long ntargets ); methods localizedrelationtype() returns a localized version of the relation type.
...[propget] hresult target( [in] long target
index, [out] iunknown target ); parameters target
index 0 based
index.
mozIStorageRow
last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: mozistoragevaluearray method overview nsivariant getresultby
index(in unsigned long a
index); nsivariant getresultbyname(in autf8string aname); methods getresultby
index() returns the value from a specific column in the row, using a zero-based
index to identify the column.
... nsivariant getresultby
index( in unsigned long a
index ); parameters a
index the zero-based
index of the column number whose value is to be returned.
mozIStorageService
if your database contains virtual tables (for example, for full-text
indexes), you must use mozistorageservice.openunshareddatabase() to open it, since those tables are not compatible with a shared cache.
...each connection uses its own sqlite cache, which is inefficient, so you should use opendatabase() instead of this method unless you need a feature of sqlite that is incompatible with a shared cache, like virtual table and full text
indexing support.
nsIAccessibleEditableText
void setattributes( in long startpos, in long endpos, in nsisupports attributes ); parameters startpos the start
index of the text whose attributes are modified.
... endpos the end
index of the text whose attributes are modified.
nsIAccessibleEvent
event_table_column_reorder 0x0048 0x0044 event_window_activate 0x0049 0x0045 event_window_create 0x004a 0x0046 event_window_deactivate 0x004b 0x0047 event_window_destroy 0x004c 0x0048 event_window_maximize 0x004d 0x0049 event_window_minimize 0x004e 0x004a event_window_resize 0x004f 0x004b event_window_restore 0x0050 0x004c event_hyperlink_end_
index_changed 0x0051 0x004d the ending
index of this link within the containing string has changed.
... event_hyperlink_start_
index_changed 0x0056 0x0052 the starting
index of this link within the containing string has changed.
nsIAccessibleTableCell
column
index long return column
index of this cell.
... row
index long return row
index of this cell.
nsICRLManager
inherits from: nsisupports last changed in gecko 1.7 method overview wstring computenextautoupdatetime(in nsicrlinfo info, in unsigned long autoupdatetype, in double noofdays); void deletecrl(in unsigned long crl
index); nsiarray getcrls(); void importcrl([array, size_is(length)] in octet data, in unsigned long length, in nsiuri uri, in unsigned long type, in boolean dosilentdownload, in wstring crlkey); void reschedulecrlautoupdate(); boolean updatecrlfromurl(in wstring url, in wstring key); constants constant value description type_autoupdate_time_based 1 type_autoupdate_freq_based 2 methods computenextautoupdatetime() wstring computenextautoupdatetime( ...
...void deletecrl( in unsigned long crl
index ); parameters crl
index getcrls() get a list of crl entries in the db.
nsIDOMOfflineResourceList
last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) inherits from: nsisupports method overview void mozadd(in domstring uri); boolean mozhasitem(in domstring uri); domstring mozitem(in unsigned long
index); void mozremove(in domstring uri); void swapcache(); void update(); attributes attribute type description mozitems nsidomofflineresourcelist the list of dynamically-managed entries in the offline resource list.
... domstring mozitem( in unsigned long
index ); parameters
index the
index of the cached item whose uri should be returned.
nsIDOMXPathResult
dom/interfaces/xpath/nsidomxpathresult.idlscriptable this interface describes an xpath result returned by nsidomxpathevaluator or document.evaluate inherits from: nsisupports last changed in gecko 1.7 method overview nsidomnode iteratenext(); nsidomnode snapshotitem(in unsigned long
index); attributes attribute type description booleanvalue boolean if resulttype is boolean_type, the boolean value.
...nsidomnode snapshotitem( in unsigned long
index ); parameters
index the
index of the dom node to return.
nsIDOMXULSelectControlElement
inherits from: nsidomxulcontrolelement last changed in gecko 1.9 (firefox 3) method overview nsidomxulselectcontrolitemelement appenditem(in domstring label, in domstring value); long get
indexofitem(in nsidomxulselectcontrolitemelement item); nsidomxulselectcontrolitemelement getitemat
index(in long
index); nsidomxulselectcontrolitemelement insertitemat(in long
index, in domstring label, in domstring value); nsidomxulselectcontrolitemelement removeitemat(in long
index); attributes attribute type description itemcount unsigned long read only.
... selected
index long selecteditem nsidomxulselectcontrolitemelement value domstring methods appenditem() nsidomxulselectcontrolitemelement appenditem( in domstring label, in domstring value ); parameters label value return value get
indexofitem() long get
indexofitem( in nsidomxulselectcontrolitemelement item ); parameters item return value getitemat
index() nsidomxulselectcontrolitemelement getitemat
index( in long
index ); parameters
index return value insertitemat() nsidomxulselectcontrolitemelement insertitemat( in long
index, in domstring label, in domstring value ); parameters
index label value return value removeitemat() nsidomxulselectcontrolitemelement removeitemat( in long
index ); parameters
index return value ...
nsIDocShell
layouthistorystate nsilayouthistorystate loadedtrans
index long keeps track of the previous shtransaction
index and the current shtransaction
index at the time that the doc shell begins to load.
... previoustrans
index long keeps track of the previous shtransaction
index and the current shtransaction
index at the time that the doc shell begins to load.
nsIMsgDBHdr
thunderbird stored uint32 properties (not a complete list):
indexed used for spotlight integration on osx.
... acstring getstringreference(in long refnum); parameters refnum the
index of the reference to return.
nsIMsgFilter
eadonly attribute nsimsgfiltercustomaction customaction; methods addterm() void nsimsgfilter::addterm ( in nsmsgsearchattribvalue attrib, in nsmsgsearchopvalue op, in nsimsgsearchvalue value, in boolean booleanand, in acstring arbitraryheader ) getterm() void nsimsgfilter::getterm ( in long term
index, in nsmsgsearchattribvalue attrib, in nsmsgsearchopvalue op, in nsimsgsearchvalue value, out boolean booleanand, out acstring arbitraryheader ) appendterm() void nsimsgfilter::appendterm (in nsimsgsearchterm term) createterm() nsimsgsearchterm nsimsgfilter::createterm ( ) matchhdr() void nsimsgfilter::matchhdr ( in nsi...
...lder folder, in nsimsgdatabase db, in string headers, in unsigned long headersize, out boolean result ) logrulehit() void nsimsgfilter::logrulehit ( in nsimsgruleaction afilteraction, in nsimsgdbhdr aheader ) createaction() nsimsgruleaction nsimsgfilter::createaction ( ) getactionat() nsimsgruleaction nsimsgfilter::getactionat (in long a
index) appendaction() void nsimsgfilter::appendaction (in nsimsgruleaction action ) clearactionlist() void nsimsgfilter::clearactionlist() getsortedactionlist() void nsimsgfilter::getsortedactionlist (in nsisupportsarray actionlist) ...
nsIMsgFilterList
ribute unsigned long nsimsgfilterlist::filtercount loggingenabled attribute boolean nsimsgfilterlist::loggingenabled defaultfile attribute nsilocalfile nsimsgfilterlist::defaultfile logstream attribute nsioutputstream nsimsgfilterlist::logstream logurl readonly attribute acstring nsimsgfilterlist::logurl methods getfilterat() nsimsgfilter nsimsgfilterlist::getfilterat (in unsigned long filter
index ) getfilternamed() nsimsgfilter nsimsgfilterlist::getfilternamed (in astring filtername) setfilterat() nsimsgfilter nsimsgfilterlist::setfilterat ( in unsigned long filter
index, in nsimsgfilter filter ) removefilter() void nsimsgfilterlist::removefilter (in nsimsgfilter filter) removefilterat() void nsimsgfilterlist::removefilterat (in unsigned long filter
index)...
... movefilterat() void nsimsgfilterlist::movefilterat ( in unsigned long filter
index, in nsmsgfiltermotionvalue motion ) insertfilterat() void nsimsgfilterlist::insertfilterat ( in unsigned long filter
index, in nsimsgfilter filter ) movefilter() void nsimsgfilterlist::movefilter ( in nsimsgfilter filter, in nsmsgfiltermotionvalue motion ) createfilter() nsimsgfilter nsimsgfilterlist::createfilter ( in astring name ) savetofile() void nsimsgfilterlist::savetofile ( in nsioutputstream stream ) parsecondition() void nsimsgfilterlist::parsecondition ( in nsimsgfilter afilter, in string condition ) savetodefaultfile() void nsimsgfilterlist::savetodefaultfile ( ) applyfilterstohdr() void nsimsgfilte...
nsISHEntry
to create an instance, use: var shentry = components.classes["@mozilla.org/browser/session-history-entry;1"] .createinstance(components.interfaces.nsishentry); method overview void addchildshell(in nsidocshelltreeitem shell); nsidocshelltreeitem childshellat(in long
index); void clearchildshells(); nsishentry clone(); void create(in nsiuri uri, in astring title, in nsiinputstream inputstream, in nsilayouthistorystate layouthistorystate, in nsisupports cachekey, in acstring contenttype, in nsisupports owner, in unsigned long long docshellid, in boolean dynamiccreation); native code only!
...void addchildshell( in nsidocshelltreeitem shell ); parameters shell childshellat() nsidocshelltreeitem childshellat( in long
index ); parameters
index the child shell at
index; null if
index is out of bounds.
nsITaskbarWindowPreview
method overview nsitaskbarpreviewbutton getbutton(in unsigned long
index); attributes attribute type description enablecustomdrawing boolean if true, the nsitaskbarpreviewcontroller object's nsitaskbarpreviewcontroller.drawpreview() and nsitaskbarpreviewcontroller.drawthumbnail() methods will be called to draw the preview.
...nsitaskbarpreviewbutton getbutton( in unsigned long
index ); parameters
index the
index into the button array for the nsitaskbarpreviewbutton to retrieve.
nsITransactionManager
note that the transaction at the top of the redo stack will actually be at the
index n-1 in the list, where n is the number of items in the list.
...note that the transaction at the top of the undo stack will actually be at the
index n-1 in the list, where n is the number of items in the list.
nsIUpdate
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview nsiupdatepatch getpatchat(in unsigned long
index); nsidomelement serialize(in nsidomdocument updates); attributes attribute type description appversion astring the application version of this update.
...nsiupdatepatch getpatchat( in unsigned long
index ); parameters
index the
index of the patch to retrieve.
xptcall FAQ
the core invoke function has the declaration: xptc_public_api(nsresult) xptc_invokeby
index(nsisupports* that, pruint32 method
index, pruint32 paramcount, nsxptcvariant* params); nsxptcvariant is a discriminated union of the types that can be passed as parameters to the target function (including void* to represent arbitrary pointer types).
...xpconnect uses information from typelib files to reflect arbitrary xpcom interfaces into javascript and to make calls from javascript to xpcom using xptc_invokeby
index.
Creating a gloda message query
you may also see new messages show up if new messages are
indexed that meet the constraints.
... let mylistener = { /* called when new items are returned by the database query or freshly
indexed */ onitemsadded: function mylistener_onitemsadded(aitems, acollection) { }, /* called when items that are already in our collection get re-
indexed */ onitemsmodified: function mylistener_onitemsmodified(aitems, acollection) { }, /* called when items that are in our collection are purged from the system */ onitemsremoved: function mylistener_onitemsremoved(aitems, acollection) { }, /* called when our database query completes */ onquerycompleted: function mylistener_onquerycompleted(acollection) { } }; let collection = query.getcollection(mylistener); message attributes look at the pretty messages!
ArrayType
in addition, each element in the array can be referenced by
index using standard bracket notation, such as myarray[
index].
...if this value isn't a valid javascript number that's also a valid
index into the array, a typeerror exception is thrown.
Plug-in Basics - Plugins
<object data="foo_movie.swf" type="application/x-shockwave-flash" class="myplugin"/> <param name="quality" value="high"/> <param name="salign" value="tl"/> <param name="menu" value="0"/> <object type="*" class="myplugin"> <param name="pluginspage" value="http://www.macromedia.com/shockwave/download/
index.cgi?p1_prod_version=shockwaveflash"/> </object> </object> </object> </p></body> </html> the outermost object element defines the classid; the first nested object uses the type value application/x-shockwave-flash to load the adobe flash plug-in, and the innermost object exposes a download page for users that do not already have the necessary plug-in.
...base="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,30,0" width="749" height="68"> <param name="movie" value="foo.swf"> <param name="quality" value="high"> <param name="bgcolor" value="#eeeeee"> <param name="salign" value="tl"> <param name="menu" value="0"> <embed src="foo.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/
index.cgi?p1_prod_version=shockwaveflash" type="application/x-shockwave-flash" width="749" height="68" bgcolor="#eeeeee" salign="tl" menu="0"> </embed> </object> using custom embed attributes in addition to these standard attributes, you can create private, plug-in-specific attributes and use them in the embed attribute to pass extra information between the html page and the plu...
Debugger.Script - Firefox Developer Tools
if this is a function’s script, this is the
index of the start of the function token in the source code.
... getalloffsets() if the instance refers to a jsscript, return an arrayl describing the relationship between bytecode instruction offsets and source code positions in this script.l is sparse, and
indexed by source line number.
Intensive JavaScript - Firefox Developer Tools
it's pretty simple to split up calculateprimes(): we will just calculate primality for each number in a separate function: function dopointlesscomputationswithrequestanimationframe() { function testcandidate(
index) { // finishing condition if (
index == iterations) { console.log(primes); pointlesscomputationsbutton.disabled = false; return; } // test this number var candidate =
index * (multiplier * math.random()); var isprime = true; for (var c = 2; c <= math.sqrt(candidate); ++c) { if (candidate % c === 0) { // not prime isprime = fal...
...se; break; } } if (isprime) { primes.push(candidate); } // schedule the next var testfunction = testcandidate.bind(this,
index + 1); window.requestanimationframe(testfunction); } var primes = []; var testfunction = testcandidate.bind(this, 0); window.requestanimationframe(testfunction); } let's test this version out: select the radio button labeled "use requestanimationframe" and capture another profile.
AudioBuffer.copyToChannel() - Web APIs
if channelnumber is greater than or equal to audiobuffer.numberofchannels, an
index_size_err will be thrown.
...if startinchannel is greater than audiobuffer.length, an
index_size_err will be thrown.
AudioNode.channelInterpretation - Web APIs
fill each output channel with its input counterpart, that is the input channel with the same
index.
... fill each output channel with its input counterpart, that is the input channel with the same
index.
CSSKeyframesRule - Web APIs
the parameter is the
index of the keyframe to be deleted, expressed as a domstring resolving as a number between 0% and 100%.
...the key is a domstring containing an
index of the keyframe to be returned, resolving to a percentage between 0% and 100%.
CSSStyleSheet - Web APIs
deleterule() deletes the rule at the specified
index into the stylesheet's rule list.
... removerule() functionally identical to deleterule(); removes the rule at the specified
index from the stylesheet's rule list.
CSSUnparsedValue.forEach() - Web APIs
syntax cssunparsedvalue.foreach(function callback(currentvalue[,
index[, array]]) { // your iterator }[, thisarg]); parameters callback the function to execute for each element, taking three arguments: currentvalue the value of the current element being processed.
...
indexoptional the
index of the current element being processed.
CSSUnparsedValue - Web APIs
cssunparsedvalue.keys() returns a new array iterator object that contains the keys for each
index in the cssunparsedvalue object.
... cssunparsedvalue.values() returns a new array iterator object that contains the values for each
index in the cssunparsedvalue object.
Basic animations - Web APIs
} function anim() { requestanimationframe(anim); c.fillstyle = "rgba(0,0,0,0.05)"; c.fillrect(0, 0, cn.width, cn.height); a.foreach(function(e, i) { e.dr(); }); } </script> <style> #cw { position: fixed; z-
index: -1; } body { margin: 0; padding: 0; 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" cont...
...i.y = 0 : i.y < 0 && (i.y = h), e = fa.find
index(t => coll({ ...this.sn[0], h: this.h, w: this.w }, t)), this.sn.unshift(i), -1 != e) return console.log(e), fa[e].renew(), void (document.getelementbyid("score").innertext = number(document.getelementbyid("score").innertext) + 1); this.sn.pop(), console.log(6) } this.sn.foreach((t, ...
Console.table() - Web APIs
the first column in the table will be labeled (
index).
...note that (in firefox) console.table is limited to displaying 1000 rows (first row is the labeled
index).
CustomElementRegistry.define() - Web APIs
htmlelement { constructor() { // always call super first in constructor super(); // create a shadow root var shadow = this.attachshadow({mode: 'open'}); // create spans var wrapper = document.createelement('span'); wrapper.setattribute('class','wrapper'); var icon = document.createelement('span'); icon.setattribute('class','icon'); icon.setattribute('tab
index', 0); var info = document.createelement('span'); info.setattribute('class','info'); // take attribute content and put it inside the info span var text = this.getattribute('text'); info.textcontent = text; // insert icon var imgurl; if(this.hasattribute('img')) { imgurl = this.getattribute('img'); } else { imgurl = 'img/default.png'; } var ...
... 'padding: 10px;' + 'background: white;' + 'border-radius: 10px;' + 'opacity: 0;' + 'transition: 0.6s all;' + 'position: absolute;' + 'bottom: 20px;' + 'left: 10px;' + 'z-
index: 3;' + '}' + 'img {' + 'width: 1.2rem' + '}' + '.icon:hover + .info, .icon:focus + .info {' + 'opacity: 1;' + '}'; // attach the created elements to the shadow dom shadow.appendchild(style); shadow...
DOMException - Web APIs
indexsizeerror the
index is not in the allowed range.
...(legacy code value: 1 and legacy constant name:
index_size_err) hierarchyrequesterror the node tree hierarchy is not correct.
DOMTokenList.item() - Web APIs
the item() method of the domtokenlist interface returns an item in the list by its
index.
... syntax tokenlist.item(
index) parameters
index a domstring representing the
index of the item you want to return.
DOMTokenList - Web APIs
it is
indexed beginning with 0 as with javascript array objects.
... methods domtokenlist.item(
index) returns the item in the list by its
index, or undefined if
index is greater than or equal to the list's length.
DataTransferItemList - Web APIs
datatransferitemlist.remove() removes the drag item from the list at the given
index.
... datatransferitemlist.datatransferitem() getter that returns a datatransferitem at the given
index.
EffectTiming.iterationStart - Web APIs
iterationstart represents the iteration
index at which the animation effect begins as well as its progress through that iteration.
...since all animations' iteration
indexes start at 0, a value of 0.5 would start the animation halfway through its first iteration or loop.
Element.attributes - Web APIs
it is a namednodemap, not an array, so it has no array methods and the attr nodes'
indexes may differ among browsers.
... syntax var attr = element.attributes; example basic examples // get the first <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.
Element.tabStop - Web APIs
while with the existing tab
index property, it is required to specify an order for the element to become tabbable.
... the tabstop property would decouple the tabbable property from the tab
index.
Using Fetch - Web APIs
utf8decoder.decode(chunk) : ''; const re = /\n|\r|\r\n/gm; let start
index = 0; let result; for (;;) { let result = re.exec(chunk); if (!result) { if (readerdone) { break; } let remainder = chunk.substr(start
index); ({ value: chunk, done: readerdone } = await reader.read()); chunk = remainder + (chunk ?
... utf8decoder.decode(chunk) : ''); start
index = re.last
index = 0; continue; } yield chunk.substring(start
index, result.
index); start
index = re.last
index; } if (start
index < chunk.length) { // last line didn't end in a newline char yield chunk.substr(start
index); } } async function run() { for await (let line of maketextfilelineiterator(urloffile)) { processline(line); } } run(); checking that the fetch was successful a fetch() promise will reject with a typeerror when a network error is encountered or cors is misconfigured on the server-side, although this usually means permission issues or similar — a 404 does not constitute a network error, for example.
Introduction to the File and Directory Entries API - Web APIs
the file and directory entries api and other storage apis the file and directory entries api is an alternative to other storage apis like
indexeddb, websql (which has been deprecated since november18, 2010), and appcache.
... while firefox supports blob storage for
indexeddb, chrome currently does not (chrome is still implementing support for blob storage in
indexeddb).
GamepadEvent.gamepad - Web APIs
window.addeventlistener("gamepadconnected", function(e) { console.log("gamepad connected at
index %d: %s.
... %d buttons, %d axes.", e.gamepad.
index, e.gamepad.id, e.gamepad.buttons.length, e.gamepad.axes.length); }); value a gamepad object.
HTMLAnchorElement - Web APIs
htmlelement.tab
index is a long containing the position of the element in the tabbing navigation order for the current document.
... recommendation the methods blur() and focus(), as well as the properties tab
index and accesskey, are now defined on htmlelement.
HTMLAreaElement - Web APIs
htmlelement.tab
index is a long containing the element's position in the tabbing order.
... recommendation technically, the properties tab
index and accesskey are now defined on htmlelement.
HTMLButtonElement - Web APIs
htmlbuttonelement.tab
index is a long that represents this element's position in the tabbing order.
... recommendation the attributes tab
index and accesskey, are now defined on htmlelement.
HTMLElement - Web APIs
htmlorforeignelement.tab
index is a long representing the position of the element in the tabbing order.
... recommendation added the following properties: dataset, hidden, tab
index, accesskey, accesskeylabel, draggable, dropzone, contenteditable, iscontenteditable, contextmenu, spellcheck, commandtype, commandlabel, commandicon, commandhidden, commanddisabled, commandchecked, style, and all the onxyz properties.
HTMLObjectElement - Web APIs
htmlobjectelement.tab
index is a long representing the position of the element in the tabbing navigation order for the current document.
... recommendation the w3c specification is a latest of a previous version of html living standard technically, the property tab
index is now defined on htmlelement.
HTMLSelectElement.add() - Web APIs
syntax collection.add(item[, before]); parameters item is an htmloptionelement or htmloptgroupelement before is optional and an element of the collection, or an
index of type long, representing the item item should be inserted before.
... if this parameter is null (or the
index does not exist), the new element is appended to the end of the collection.
HTMLTableCellElement - Web APIs
htmltablecellelement.cell
index read only a long integer representing the cell's position in the cells collection of the <tr> the cell is contained within.
... obsolete the cell
index property is now read-only.
HTMLTableSectionElement - Web APIs
if the given position is greater (or equal as it starts at zero) than the amount of rows in the section, or is smaller than 0, it raises a domexception with the
indexsizeerror value.
...if the given position is greater (or equal as it starts at zero) than the amount of rows in the section, or is smaller than -1, it raises a domexception with the
indexsizeerror value.
IDBCursor.advance() - Web APIs
= event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = '<strong>' + cursor.value.albumtitle + '</strong>, ' + cursor.value.year; list.appendchild(listitem); cursor.advance(2); } else { console.log('every other entry displayed.'); } }; }; specifications specification status comment
indexed database api 2.0the definition of 'advance()' in that specification.
... recommendation
indexed database api draftthe definition of 'advance()' in that specification.
IDBCursor.continue() - Web APIs
event) { var cursor = event.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = cursor.value.albumtitle + ', ' + cursor.value.year; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specifications specification status comment
indexed database api 2.0the definition of 'continue()' in that specification.
... recommendation
indexed database api draftthe definition of 'continue()' in that specification.
IDBCursor.direction - Web APIs
istitem = document.createelement('li'); listitem.innerhtml = '<strong>' + cursor.value.albumtitle + '</strong>, ' + cursor.value.year; list.appendchild(listitem); console.log(cursor.direction); cursor.continue(); } else { console.log('entries displayed backwards.'); } }; }; specifications specification status comment
indexed database api 2.0the definition of 'direction' in that specification.
... recommendation
indexed database api draftthe definition of 'direction' in that specification.
IDBCursor.key - Web APIs
vent.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = cursor.value.albumtitle + ', ' + cursor.value.year; list.appendchild(listitem); console.log(cursor.key); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specifications specification status comment
indexed database api 2.0the definition of 'key' in that specification.
... recommendation
indexed database api draftthe definition of 'key' in that specification.
IDBCursor.primaryKey - Web APIs
rget.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = cursor.value.albumtitle + ', ' + cursor.value.year; list.appendchild(listitem); console.log(cursor.primarykey); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specifications specification status comment
indexed database api 2.0the definition of 'primarykey' in that specification.
... recommendation
indexed database api draftthe definition of 'primarykey' in that specification.
IDBCursorWithValue.value - Web APIs
nt.target.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = cursor.value.albumtitle + ', ' + cursor.value.year; list.appendchild(listitem); console.log(cursor.value); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specifications specification status comment
indexed database api 2.0the definition of 'source' in that specification.
... recommendation
indexed database api draftthe definition of 'idbdatabase' in that specification.
IDBDatabaseException - Web APIs
in the
indexeddb api, an idbdatabaseexception object represents exception conditions that can be encountered while performing database operations.
...for example, an object, such as an object store or
index, already exists and a request attempted to create a new one.
databases - Web APIs
syntax const promise =
indexeddb.databases() parameters the method does not take in any parameters.
... example const promise =
indexeddb.databases() promise.then(databases => { console.log(databases) }) specifications specification status comment
indexed database api draftthe definition of 'databases()' in that specification.
IDBFactorySync - Web APIs
important: the synchronous version of the
indexeddb api was originally intended for use only with web workers, and was eventually removed from the spec because its need was questionable.
... the idbfactorysync interface of the
indexeddb api provide a synchronous means of accessing the capabilities of
indexed databases.
IDBKeyRange.lower - Web APIs
result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = '<strong>' + cursor.value.fthing + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status comment
indexed database api 2.0the definition of 'lower' in that specification.
... recommendation
indexed database api draftthe definition of 'lower' in that specification.
IDBKeyRange.lowerBound() - Web APIs
result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = '<strong>' + cursor.value.fthing + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status comment
indexed database api 2.0the definition of 'lowerbound()' in that specification.
... recommendation
indexed database api draftthe definition of 'lowerbound()' in that specification.
IDBKeyRange.lowerOpen - Web APIs
et.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = '<strong>' + cursor.value.fthing + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status comment
indexed database api 2.0the definition of 'loweropen' in that specification.
... recommendation
indexed database api draftthe definition of 'loweropen' in that specification.
IDBKeyRange.only() - Web APIs
et.result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = '<strong>' + cursor.value.fthing + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status comment
indexed database api 2.0the definition of 'only' in that specification.
... recommendation
indexed database api draftthe definition of 'only' in that specification.
IDBKeyRange.upper - Web APIs
result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = '<strong>' + cursor.value.fthing + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status comment
indexed database api 2.0the definition of 'upper' in that specification.
... recommendation
indexed database api draftthe definition of 'upper' in that specification.
IDBKeyRange.upperBound() - Web APIs
ult; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = '<strong>' + cursor.value.fthing + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status comment
indexed database api 2.0the definition of 'upperbound()' in that specification.
... recommendation
indexed database api draftthe definition of 'upperbound()' in that specification.
IDBKeyRange.upperOpen - Web APIs
result; if(cursor) { var listitem = document.createelement('li'); listitem.innerhtml = '<strong>' + cursor.value.fthing + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status comment
indexed database api 2.0the definition of 'upperopen' in that specification.
... recommendation
indexed database api draftthe definition of 'upperopen' in that specification.
IDBObjectStore.count() - Web APIs
var transaction = db.transaction(['fthings'], 'readonly'); var objectstore = transaction.objectstore('fthings'); var countrequest = objectstore.count(); countrequest.onsuccess = function() { console.log(countrequest.result); } specification specification status comment
indexed database api 2.0the definition of 'count()' in that specification.
... recommendation
indexed database api draftthe definition of 'count()' in that specification.
IDBObjectStore.getKey() - Web APIs
example let openrequest =
indexeddb.open("telemetry"); openrequest.onsuccess = (event) => { let db = event.target.result; let store = db.transaction("netlogs").objectstore("netlogs"); let today = new date(); let yesterday = new date(today); yesterday.setdate(today.getdate() - 1); let request = store.getkey(idbkeyrange(yesterday, today)); request.onsuccess = (event) => { let when = event.target.result; ale...
...rt("the 1st activity in last 24 hours was occurred at " + when); }; }; specifications specification status comment
indexed database api draftthe definition of 'getkey()' in that specification.
IDBObjectStore.put() - Web APIs
put(data); // log the transaction that originated this request console.log("the transaction that originated this request is " + updatetitlerequest.transaction); // when this new request succeeds, run the displaydata() function again to update the display updatetitlerequest.onsuccess = () => { displaydata(); }; }; specification specification status comment
indexed database api 2.0the definition of 'put()' in that specification.
... recommendation
indexed database api draftthe definition of 'put()' in that specification.
IDBRequest.onerror - Web APIs
}; specifications specification status comment
indexed database api 2.0the definition of 'onerror' in that specification.
... recommendation
indexed database api draftthe definition of 'onerror' in that specification.
IDBRequest.onsuccess - Web APIs
data.notified = "yes"; // create another request that inserts the item back // into the database var updatetitlerequest = objectstore.put(data); // when this new request succeeds, run the displaydata() // function again to update the display updatetitlerequest.onsuccess = function() { displaydata(); }; }; specifications specification status comment
indexed database api 2.0the definition of 'onsuccess' in that specification.
... recommendation
indexed database api draftthe definition of 'onsuccess' in that specification.
IDBRequest.readyState - Web APIs
request = objectstore.put(data); // log the source of this request console.log("the readystate of this request is " + updatetitlerequest.readystate); // when this new request succeeds, run the displaydata() // function again to update the display updatetitlerequest.onsuccess = function() { displaydata(); }; }; specifications specification status comment
indexed database api 2.0the definition of 'readystate' in that specification.
... recommendation
indexed database api draftthe definition of 'readystate' in that specification.
IDBRequest.result - Web APIs
data.notified = "yes"; // create another request that inserts the item // back into the database var updatetitlerequest = objectstore.put(data); // when this new request succeeds, run the displaydata() // function again to update the display updatetitlerequest.onsuccess = function() { displaydata(); }; }; specifications specification status comment
indexed database api 2.0the definition of 'result' in that specification.
... recommendation
indexed database api draftthe definition of 'result' in that specification.
IDBTransaction.objectStoreNames - Web APIs
specification specification status comment
indexed database api 2.0the definition of 'objectstorenames' in that specification.
... recommendation
indexed database api draftthe definition of 'objectstorenames' in that specification.
IDBTransactionSync - Web APIs
important: the synchronous version of the
indexeddb api was originally intended for use only with web workers, and was eventually removed from the spec because its need was questionable.
... the idbtransactionsync interface of the
indexeddb api provides a synchronous transaction on a database.
KeyboardLayoutMap.forEach() - Web APIs
syntax keyboardlayoutmap.foreach(function callback(currentvalue[,
index[, array]]) { //your iterator }[, thisarg]); parameters callback the function to execute for each element, taking three arguments: currentvalue the value of the current element being processed.
...
index optional the
index of the current element being processed.
KeyboardLayoutMap - Web APIs
keyboardlayoutmap.keys read only returns a new array iterator object that contains the keys for each
index in the array.
... keyboardlayoutmap.values read only returns a new array iterator object that contains the values for each
index in the keyboardlayoutmap object.
NamedNodeMap - Web APIs
objects inside a namednodemap are not in any particular order, unlike nodelist, although they may be accessed by an
index as in an array.
... namednodemap.item() returns the attr at the given
index, or null if the
index is higher or equal to the number of nodes.
Node.childNodes - Web APIs
the node.childnodes read-only property returns a live nodelist of child nodes of the given element where the first child node is assigned
index 0.
...adding or removing children will change the list's `length` } } remove all children from a node // this is one way to remove all children from a node // box is an object reference to an element while (box.firstchild) { //the list is live so it will re-
index each call box.removechild(box.firstchild); } notes the items in the collection of nodes are objects, not strings.
NodeList.prototype.forEach() - Web APIs
current
index optional the
index of the currentvalue being processed in somenodelist.
... example let node = document.createelement("div"); let kid1 = document.createelement("p"); let kid2 = document.createtextnode("hey"); let kid3 = document.createelement("span"); node.appendchild(kid1); node.appendchild(kid2); node.appendchild(kid3); let list = node.childnodes; list.foreach( function(currentvalue, current
index, listobj) { console.log(currentvalue + ', ' + current
index + ', ' + this); }, 'mythisarg' ); the above code results in the following: [object htmlparagraphelement], 0, mythisarg [object text], 1, mythisarg [object htmlspanelement], 2, mythisarg polyfill this polyfill adds compatibility to all browsers supporting es5: if (window.nodelist && !nodelist.prototype.foreach) { nodelist.
OVR_multiview2.framebufferTextureMultiviewOVR() - Web APIs
syntax void ext.framebuffertexturemultiviewovr(target, attachment, texture, level, baseview
index, numviews); parameters target a glenum specifying the binding point (target).
... baseview
index a glint specifying the base view
index of the framebuffer object attachment.
OVR_multiview2 - Web APIs
framebuffer_attachment_texture_base_view_
index_ovr base view
index of the framebuffer object attachment.
... framebuffer_incomplete_view_targets_ovr if baseview
index is not the same for all framebuffer attachment points where the value of framebuffer_attachment_object_type is not none, the framebuffer is considered incomplete.
PluginArray - Web APIs
the pluginarray is not a javascript array, but has the length property and supports accessing individual items using bracket notation (plugins[2]), as well as via item(
index) and nameditem("name") methods.
... methods pluginarray.item returns the plugin at the specified
index into the array.
RTCIceCandidate.RTCIceCandidate() - Web APIs
this includes the candidate, sdpmid, sdpmline
index, and usernamefragment properties.
... exceptions typeerror the specified rtcicecandidateinit has values of null in both the sdpmid and sdpmline
index properties.
RTCPeerConnection.addIceCandidate() - Web APIs
typeerror the specified candidate's sdpmid and sdpmline
index are both null.
... the specified value of sdpmline
index is greater than or equal to the number of media descriptions included in the remote description.
ReadableStreamDefaultReader.read() - Web APIs
utf8decoder.decode(chunk) : ""; let re = /\r\n|\n|\r/gm; let start
index = 0; let result; for (;;) { let result = re.exec(chunk); if (!result) { if (readerdone) { break; } let remainder = chunk.substr(start
index); ({value: chunk, done: readerdone} = await reader.read()); chunk = remainder + (chunk ?
... utf8decoder.decode(chunk) : ""); start
index = re.last
index = 0; continue; } yield chunk.substring(start
index, result.
index); start
index = re.last
index; } if (start
index < chunk.length) { // last line didn't end in a newline char yield chunk.substr(start
index); } } for await (let line of maketextfilelineiterator(urloffile)) { processline(line); } specifications specification status comment streamsthe definition of 'read()' in that specification.
ServiceWorkerGlobalScope: contentdelete event - Web APIs
the contentdelete event of the serviceworkerglobalscope interface is fired when an item is removed from the
indexed content via the user agent.
... bubbles no cancelable no interface content
indexevent event handler property oncontentdelete examples the following example uses a contentdelete event handler to remove cached content related to the deleted
index item.
ServiceWorkerGlobalScope.oncontentdelete - Web APIs
the oncontentdelete property of the serviceworkerglobalscope interface is an event handler fired when an item is removed from the
indexed content via the user agent.
...}; examples the following example uses a contentdelete event handler to remove cached content related to the deleted
index item.
SpeechSynthesisEvent - Web APIs
speechsynthesisevent.char
index read only returns the
index position of the character in the speechsynthesisutterance.text that was being spoken when the event was triggered.
... examples utterthis.onpause = function(event) { var char = event.utterance.text.charat(event.char
index); console.log('speech paused at character ' + event.char
index + ' of "' + event.utterance.text + '", which is "' + char + '".'); } utterthis.onboundary = function(event) { console.log(event.name + ' boundary reached after ' + event.elapsedtime + ' milliseconds.'); } specifications specification status comment web speech apithe definition of 'speechsynthesisevent' ...
Storage API - Web APIs
site storage—the data stored for a web site which is managed by the storage standard—includes:
indexeddb databases cache api data service worker registrations web storage api data managed using window.localstorage history state information saved using history.pushstate() application caches notification data other kinds of site-accessible, site-specific data that may be maintained site storage units the site storage system described by the storage standard and interacted with using the ...
... origin 1 has some web storage data as well as some
indexeddb data, but also has some free space left; its current usage hasn't yet reached its quota.
StylePropertyMapReadOnly.forEach() - Web APIs
syntax stylepropertymapreadonly.foreach(function callback(currentvalue[,
index[, array]]) { //your code }[, thisarg]); parameters callback the function to execute for each element, taking three arguments: currentvalue the value of the current element being processed.
...
indexoptional the
index of the current element being processed.
StyleSheet.media - Web APIs
example <!doctype html> <html> <head> <link rel="stylesheet" href="document.css" type="text/css" media="screen" /> <style rel="stylesheet" type="text/css" media="screen, print"> body { background-color: snow; } </style> </head> <body> <script> for (var isheet
index = 0; isheet
index < document.stylesheets.length; isheet
index++) { console.log('document.stylesheets[' + string(isheet
index) + '].media: ' + json.stringify(document.stylesheets[isheet
index].media)); if (isheet
index === 0) document.stylesheets[isheet
index].media.appendmedium('handheld'); if (isheet
index === 1) document.stylesheets[isheet
index].media.deletemedium('print'); console...
....log('document.stylesheets[' + string(isheet
index) + '].media: ' + json.stringify(document.stylesheets[isheet
index].media)); } /* will log: document.stylesheets[0].media: {"0":"screen"} document.stylesheets[0].media: {"0":"screen","1":"handheld"} document.stylesheets[1].media: {"0":"screen","1":"print"} document.stylesheets[1].media: {"0":"screen"} */ </script> </body> </html> specifications specification status comment css object model (cssom)the definition of 'stylesheet: media' in that specification.
Text.splitText() - Web APIs
syntax newnode = textnode.splittext(offset) parameters offset the
index immediately before which to break the text node.
... exceptions thrown a domexception with a value of
index_size_err is thrown if the specified offset is negative or is greater than the number of 16-bit units in the node's text; a domexception with a value of no_modification_allowed_err is thrown if the node is read-only.
TextEncoder.prototype.encodeInto() - Web APIs
however, it is sometimes useful to make the output start at a particular
index.
...if not, reallocate the target buffer to written + (s.length - read) * 3 and then convert the rest by taking a substring of s starting from
index read and a subbuffer of the target buffer starting from
index written.
TimeRanges.end() - Web APIs
syntax endtime = timeranges.end(
index) parameters
index is the range number to return the ending time for.
... exceptions
index_size_err a domexception thrown if the specified
index doesn't correspond to an existing range.
TimeRanges.start() - Web APIs
syntax starttime = timeranges.start(
index) parameters
index is the range number to return the starting time for.
... exceptions
index_size_err a domexception thrown if the specified
index doesn't correspond to an existing range.
TimeRanges - Web APIs
you reference each time range by using the start() and end() methods, passing the
index number of the time range you want to retrieve.
... methods timeranges.start() returns the time for the start of the range with the specified
index.
TrackDefaultList.TrackDefault() - Web APIs
[].) syntax var mytrackdefault = trackdefaultlist[
index]; parameters
index the
index position of the trackdefault object you want to return.
... errors no specific errors are returned, but if the supplied
index is great than or equal to trackdefaultlist.length, the operation will return undefined.
WebGL2RenderingContext.bindSampler() - Web APIs
the webgl2renderingcontext.bindsampler() method of the webgl 2 api binds a passed webglsampler object to the texture unit at the passed
index.
... syntax void gl.bindsampler(unit, sampler); parameters unit a gluint specifying the
index of the texture unit to which to bind the sampler to.
WebGL2RenderingContext.uniformBlockBinding() - Web APIs
syntax void gl.uniformblockbinding(program, uniformblock
index, uniformblockbinding); parameters program a webglprogram containing the active uniform block whose binding to assign.
... uniformblock
index a gluint specifying the
index of the active uniform block within the program.
WebGLRenderingContext.disableVertexAttribArray() - Web APIs
the webglrenderingcontext.disablevertexattribarray() method of the webgl api turns the generic vertex attribute array off at a given
index position.
... syntax void gl.disablevertexattribarray(
index); parameters
index a gluint specifying the
index of the vertex attribute to disable.
WebGLRenderingContext.vertexAttrib[1234]f[v]() - Web APIs
syntax void gl.vertexattrib1f(
index, v0); void gl.vertexattrib2f(
index, v0, v1); void gl.vertexattrib3f(
index, v0, v1, v2); void gl.vertexattrib4f(
index, v0, v1, v2, v3); void gl.vertexattrib1fv(
index, value); void gl.vertexattrib2fv(
index, value); void gl.vertexattrib3fv(
index, value); void gl.vertexattrib4fv(
index, value); parameters
index a gluint specifying the position of the vertex attribute to be modified.
...they aren't part of the shader state (like generix vertex attribute
indexes to shader variable bindings) and aren't part of the vertex array object state (like enabled vertex attribute arrays).
A basic 2D WebGL animation example - Web APIs
then the vertex position attribute's
index is obtained from the shader program by calling getattriblocation().
... with the
index of the vertex position attribute now available in avertexposition, we call enablevertexattribarray() to enable the position attribute so it can be used by the shader program (in particular, by the vertex shader).
WebGL best practices - Web APIs
take advantage of universally supported webgl 1 extensions these webgl 1 extensions are universally supported: angle_instanced_arrays ext_blend_minmax oes_element_
index_uint oes_standard_derivatives oes_vertex_array_object webgl_debug_renderer_info webgl_lose_context (see also: https://jdashg.github.io/misc/webgl/webgl-feature-levels.html) consider polyfilling these into webglrenderingcontext, like: https://github.com/jdashg/misc/blob/master/webgl/webgl-v1.1.js universally supported limits the minimum requirements for webgl are quite low.
...you may ask for depth_component24 or stencil_
index8, but you're often getting d24x8 and x24s8 32bpp formats behind the scenes.
Basic concepts behind Web Audio API - Web APIs
fill each output channel with its input counterpart, that is the input channel with the same
index.
... fill each output channel with its input counterpart, that is the input channel with the same
index.
Using Web Workers - Web APIs
but you can use a large number of items available under window, including websockets, and data storage mechanisms like
indexeddb.
... spawning a shared worker spawning a new shared worker is pretty much the same as with a dedicated worker, but with a different constructor name (see
index.html and
index2.html) — each one has to spin up the worker using code like the following: var myworker = new sharedworker('worker.js'); one big difference is that with a shared worker you have to communicate via a port object — an explicit port is opened that the scripts can use to communicate with the worker (this is done implicitly in the case of dedicated workers).
Window.getComputedStyle() - Web APIs
individual css property values are accessed through apis provided by the object, or by
indexing with css property names.
... css property values may be accessed using the getpropertyvalue(propname) api or by
indexing directly into the object such as obj['z-
index'] or obj.z
index.
XPathResult.snapshotItem() - Web APIs
the snapshotitem() method of the xpathresult interface returns an item of the snapshot collection or null in case the
index is not within the range of nodes.
... syntax var node = result.snapshotitem(i); return value the node at the given
index within the node set of the xpathresult.
Using the group role - Accessibility
<div id="tree1" role="tree" tab
index="-1"> <div id="animals" class="groupheader" role="presentation" aria-owns="animalgroup" aria-expanded="true"> <img role="presentation" tab
index="-1" src="images/treeexpanded.gif" /> <span role="treeitem" tab
index="0">animals</span> </div> <div id="animalgroup" role="group"> <div id="birds" role="treeitem"> <span tab
index="-1">birds</span> </div> <div id="cats" clas...
...s="groupheader" role="presentation" aria-owns="catgroup" aria-expanded="false"> <img role="presentation" tab
index="-1" src="images/treecontracted.gif" /> <span role="treeitem" tab
index="0">cats</span> </div> <div id="catgroup" role="group"> <div id="siamese" role="treeitem"> <span tab
index="-1">siamese</span> </div> <div id="tabby" role="treeitem"> <span tab
index="-1">tabby</span> </div> </div> </div> </div> example 2: using the group role with a html drop-down menu the snippet below shows how the group role is added directly into the html source code.
:target - CSS: Cascading Style Sheets
/* selects an element with an id matching the current url's fragment */ :target { border: 2px solid black; } for example, the following url has a fragment (denoted by the # sign) that points to an element called section2: http://www.example.com/
index.html#section2 the following element would be selected by a :target selector when the current url is equal to the above: <section id="section2">example</section> syntax :target examples a table of contents the :target pseudo-class can be used to highlight the portion of a page that has been linked to from a table of contents.
... align-items: center; justify-content: center; } /* lightbox content */ .lightbox figcaption { width: 25rem; position: relative; padding: 1.5em; background-color: lightpink; } /* close button */ .lightbox .close { position: relative; display: block; } .lightbox .close::after { right: -1rem; top: -1rem; width: 2rem; height: 2rem; position: absolute; display: flex; z-
index: 1; align-items: center; justify-content: center; background-color: black; border-radius: 50%; color: white; content: "×"; cursor: pointer; } /* lightbox overlay */ .lightbox .close::before { left: 0; top: 0; width: 100%; height: 100%; position: fixed; background-color: rgba(0,0,0,.7); content: ""; cursor: default; } result specifications specificatio...
CSS Tutorials - CSS: Cascading Style Sheets
understanding z-
index controlling superposition of boxes is a basic feature that is very quickly needed by web developers.
...though multi-column text is not that common on devices like screens, this is particularly useful on printed pages, or for
indexes.
<button>: The Button element - HTML: Hypertext Markup Language
desktop browsers windows 8.1 os x 10.x firefox yes - firefox 30.0 no (even with a tab
index) firefox 63 chrome yes - chrome 35 yes - chrome 65 safari n/a no (even with a tab
index) safari 12 (bug 22261) internet explorer yes - internet explorer 11 n/a presto yes - opera 12 yes - opera 12 does tapping on a <button> give it focus?
... mobile browsers ios 7.1.2 android 4.4.4 safari mobile no (even with a tab
index) n/a chrome 35 no (even with a tab
index) yes specifications specification status comment html living standardthe definition of '<button>' in that specification.
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
is
index: for historical reasons, the name is
index is not allowed.
... tab
index global attribute valid for all elements, including all the input types, an integer attribute indicating if the element can take input focus (is focusable), if it should participate to sequential keyboard navigation.
Using HTTP cookies - HTTP
modern apis for client storage are the web storage api (localstorage and sessionstorage) and
indexeddb.
...more structured and larger amounts of data can be stored using the
indexeddb api, or a library built on it.
SameSite cookies - HTTP
set-cookie: flavor=choco; samesite=lax example: rewriteengine on rewritebase "/" rewritecond "%{http_host}" "^example\.org$" [nc] rewriterule "^(.*)" "https://www.example.org/
index.html" [r=301,l,qsa] rewriterule "^(.*)\.ht$" "
index.php?nav=$1 [nc,l,qsa,co=rewriterule;01;https://www.example.org;30/;samesite=none;secure] rewriterule "^(.*)\.htm$" "
index.php?nav=$1 [nc,l,qsa,co=rewriterule;02;https://www.example.org;30/;samesite=none;secure] rewriterule "^(.*)\.html$" "
index.php?nav=$1 [nc,l,qsa,co=rewriterule;03;https://www.example.org;30/;samesite=none;...
...secure] [...] rewriterule "^admin/(.*)\.html$" "admin/
index.php?nav=$1 [nc,l,qsa,co=rewriterule;09;https://www.example.org:30/;samesite=strict;secure] specifications specification title rfc 6265, section 4.1: set-cookie http state management mechanism draft-ietf-httpbis-rfc6265bis-05 cookie prefixes, same-site cookies, and strict secure cookies ...
Enumerability and ownership of properties - JavaScript
detection can occur by simplepropertyretriever.thegetmethodyouwant(obj).
indexof(prop) > -1 iteration can occur by simplepropertyretriever.thegetmethodyouwant(obj).foreach(function (value, prop) {}); (or use filter(), map(), etc.) var simplepropertyretriever = { getownenumerables: function(obj) { return this._getpropertynames(obj, true, false, this._enumerable); // or could use for..in filtered with hasownproperty or just this: return object.keys(obj...
...function(obj, prop) { return true; }, // inspired by http://stackoverflow.com/a/8024294/271577 _getpropertynames: function getallpropertynames(obj, iterateselfbool, iterateprototypebool, includepropcb) { var props = []; do { if (iterateselfbool) { object.getownpropertynames(obj).foreach(function(prop) { if (props.
indexof(prop) === -1 && includepropcb(obj, prop)) { props.push(prop); } }); } if (!iterateprototypebool) { break; } iterateselfbool = true; } while (obj = object.getprototypeof(obj)); return props; } }; detection table in for..in obj.haso...
JavaScript modules - JavaScript
basic example structure in our first example (see basic-modules) we have a file structure as follows:
index.html main.js modules/ canvas.js square.js note: all of the examples in this guide have basically the same structure; the above should start getting pretty familiar.
... in this example we've only made changes to our
index.html and main.js files — the module exports remain the same as before.
Warning: String.x is deprecated; use String.prototype.x instead - JavaScript
warning: string.concat is deprecated; use string.prototype.concat instead warning: string.contains is deprecated; use string.prototype.contains instead warning: string.endswith is deprecated; use string.prototype.endswith instead warning: string.includes is deprecated; use string.prototype.includes instead warning: string.
indexof is deprecated; use string.prototype.
indexof instead warning: string.last
indexof is deprecated; use string.prototype.last
indexof instead warning: string.localecompare is deprecated; use string.prototype.localecompare instead warning: string.match is deprecated; use string.prototype.match instead warning: string.normalize is ...
... strict'; var i, // we could also build the array of methods with the following, but the // getownpropertynames() method is non-shimable: // object.getownpropertynames(string).filter(function(methodname) { // return typeof string[methodname] === 'function'; // }); methods = [ 'contains', 'substring', 'tolowercase', 'touppercase', 'charat', 'charcodeat', '
indexof', 'last
indexof', 'startswith', 'endswith', 'trim', 'trimleft', 'trimright', 'tolocalelowercase', 'normalize', 'tolocaleuppercase', 'localecompare', 'match', 'search', 'slice', 'replace', 'split', 'substr', 'concat', 'localecompare' ], methodcount = methods.length, assignstringgeneric = function(methodname) { var method = string.prototype[methodname]; st...
Array.prototype[@@unscopables] - JavaScript
description the default array properties that are excluded from with bindings are: copywithin() entries() fill() find() find
index() includes() keys() values() see symbol.unscopables for how to set unscopables for your own objects.
... var keys = []; with (array.prototype) { keys.push('something'); } object.keys(array.prototype[symbol.unscopables]); // ["copywithin", "entries", "fill", "find", "find
index", // "includes", "keys", "values"] specifications specification ecmascript (ecma-262)the definition of 'array.prototype[@@unscopables]' in that specification.
Array.prototype.entries() - JavaScript
the entries() method returns a new array iterator object that contains the key/value pairs for each
index in the array.
... examples iterating with
index and element const a = ['a', 'b', 'c']; for (const [
index, element] of a.entries()) console.log(
index, element); // 0 'a' // 1 'b' // 2 'c' using a for…of loop var a = ['a', 'b', 'c']; var iterator = a.entries(); for (let e of iterator) { console.log(e); } // [0, 'a'] // [1, 'b'] // [2, 'c'] specifications specification ecmascript (ecma-262)the definition of 'array.prototype.entries' in that specification.
Array.prototype.flatMap() - JavaScript
syntax var new_array = arr.flatmap(function callback(currentvalue[,
index[, array]]) { // return element for new_array }[, thisarg]) parameters callback function that produces an element of the new array, taking three arguments: currentvalue the current element being processed in the array.
...
indexoptional the
index of the current element being processed in the array.
Array.prototype.values() - JavaScript
the values() method returns a new array iterator object that contains the values for each
index in the array.
...ined, done: true } iteraror.next().value; // undefined one-use: the array iterator object is one use or temporary object example: var arr = ['a', 'b', 'c', 'd', 'e']; var iterator = arr.values(); for (let letter of iterator) { console.log(letter); } //"a" "b" "c" "d" "e" for (let letter of iterator) { console.log(letter); } // undefined reason: when next().done=true or current
index>length the for..of loop ends.
RegExp.prototype[@@search]() - JavaScript
return value integer if successful, [@@search]() returns the
index of the first match of the regular expression inside the string.
... class myregexp extends regexp { constructor(str) { super(str) this.pattern = str; } [symbol.search](str) { return str.
indexof(this.pattern); } } var re = new myregexp('a+b'); var str = 'ab a+b'; var result = str.search(re); // string.prototype.search calls re[@@search].
String.prototype.codePointAt() - JavaScript
ject = {}; var $defineproperty = object.defineproperty; var result = $defineproperty(object, object, object) && $defineproperty; } catch(error) {} return result; }()); var codepointat = function(position) { if (this == null) { throw typeerror(); } var string = string(this); var size = string.length; // `tointeger` var
index = position ?
... number(position) : 0; if (
index !=
index) { // better `isnan`
index = 0; } // account for out-of-bounds indices: if (
index < 0 ||
index >= size) { return undefined; } // get the first code unit var first = string.charcodeat(
index); var second; if ( // check if it’s the start of a surrogate pair first >= 0xd800 && first <= 0xdbff && // high surrogate size >
index + 1 // there is a next code unit ) { second = string.charcodeat(
index + 1); if (second >= 0xdc00 && second <= 0xdfff) { // low surrogate // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae return (first - 0xd800) * 0x400 + second - 0xdc00 + 0x10000; } } return first; ...
Symbol.search - JavaScript
the symbol.search well-known symbol specifies the method that returns the
index within a string that matches the regular expression.
... property attributes of symbol.search writable no enumerable no configurable no examples custom string search class caseinsensitivesearch { constructor(value) { this.value = value.tolowercase(); } [symbol.search](string) { return string.tolowercase().
indexof(this.value); } } console.log('foobar'.search(new caseinsensitivesearch('bar'))); // expected output: 3 specifications specification ecmascript (ecma-262)the definition of 'symbol.search' in that specification.
TypedArray.prototype.reduce() - JavaScript
index the
index of the current element being processed in the typed array.
... description the reduce method executes the callback function once for each element present in the typed array, excluding holes in the typed array, receiving four arguments: the initial value (or value from the previous callback call), the value of the current element, the current
index, and the typed array over which iteration is occurring.
TypedArray.prototype.subarray() - JavaScript
description the range specified by begin and end is clamped to the valid
index range for the current array; if the computed length of the new array would be negative, it's clamped to zero.
... if either begin or end is negative, it refers to an
index from the end of the array instead of from the beginning.
import.meta - JavaScript
for example, with the following html: <script type="module"> import './
index.mjs?someurlinfo=5'; </script> ..the following javascript file will log the `someurlinfo parameter: //
index.mjs new url(import.meta.url).searchparams.get('someurlinfo'); // 5 the same applies when a file imports another: //
index.mjs import './
index2.mjs?someurlinfo=5'; //
index2.mjs new url(import.meta.url).searchparams.get('someurlinfo'); // 5 note that while node.js will pass on query pa...
...rameters (or the hash) as in the latter example, as of node 14.1.0, a url with query parameters will err when loading in the form node --experimental-modules
index.mjs?someurlinfo=5 (it is treated as a file rather than a url in this context).
<mroot> - MathML
the mathml <mroot> element is used to display roots with an explicit
index.
... two arguments are accepted, which leads to the syntax: <mroot> base
index </mroot>.
Progressive web app structure - Progressive web apps (PWAs)
structure of 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.
...cation, 30000); } the service worker the last file we will quickly look at is the service worker: sw.js — it first imports data from the games.js file: self.importscripts('data/games.js'); next, it creates a list of all the files to be cached, both from the app shell and the content: var cachename = 'js13kpwa-v1'; var appshellfiles = [ '/pwa-examples/js13kpwa/', '/pwa-examples/js13kpwa/
index.html', '/pwa-examples/js13kpwa/app.js', '/pwa-examples/js13kpwa/style.css', '/pwa-examples/js13kpwa/fonts/graduate.eot', '/pwa-examples/js13kpwa/fonts/graduate.ttf', '/pwa-examples/js13kpwa/fonts/graduate.woff', '/pwa-examples/js13kpwa/favicon.ico', '/pwa-examples/js13kpwa/img/js13kgames.png', '/pwa-examples/js13kpwa/img/bg.png', '/pwa-examples/js13kpwa/icons/icon-32.png', '/p...
SVG Core Attributes - SVG: Scalable Vector Graphics
id lang tab
index xml:base xml:lang xml:space attributes id defines a unique identifier (id) which must be unique in the whole document.
... value: any valid language id; animatable: no tab
index the tab
index svg attribute allows you to control whether an element is focusable and to define the relative order of the element for the purposes of sequential focus navigation.
SVG Attribute reference - SVG: Scalable Vector Graphics
shape-rendering slope spacing specularconstant specularexponent speed spreadmethod startoffset stddeviation stemh stemv stitchtiles stop-color stop-opacity strikethrough-position strikethrough-thickness string stroke stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width style surfacescale systemlanguage t tab
index tablevalues target targetx targety text-anchor text-decoration text-rendering textlength to transform transform-origin type u u1 u2 underline-position underline-thickness unicode unicode-bidi unicode-range units-per-em v v-alphabetic v-hanging v-ideographic v-mathematical values vector-effect version vert-adv-y vert-origin-x vert-origin-y viewbox viewtarget...
... visibility w width widths word-spacing writing-mode x x x-height x1 x2 xchannelselector xlink:actuate xlink:arcrole xlink:href xlink:role xlink:show xlink:title xlink:type xml:base xml:lang xml:space y y y1 y2 ychannelselector z z zoomandpan svg attributes by category generic attributes core attributes id, lang, tab
index, xml:base, xml:lang, xml:space style attributes class, style conditional processing attributes externalresourcesrequired, requiredextensions, requiredfeatures, systemlanguage.
<circle> - SVG: Scalable Vector Graphics
global attributes core attributes most notably: id, tab
index styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation 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 aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-col
index, 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, 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-row
index, aria-ro...
<ellipse> - SVG: Scalable Vector Graphics
global attributes core attributes most notably: id, tab
index styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation 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 aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-col
index, 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, 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-row
index, aria-ro...
<g> - SVG: Scalable Vector Graphics
vg { height:100% } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <!-- using g to inherit presentation attributes --> <g fill="white" stroke="green" stroke-width="5"> <circle cx="40" cy="40" r="25" /> <circle cx="60" cy="60" r="25" /> </g> </svg> attributes this element only includes global attributes global attributes core attributes most notably: id, tab
index styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation 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 aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-col
index, 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, 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-row
index, aria-ro...
<line> - SVG: Scalable Vector Graphics
value type: <number> ; default value: none; animatable: yes global attributes core attributes most notably: id, tab
index styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation 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 aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-col
index, 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, 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-row
index, aria-ro...
<marker> - SVG: Scalable Vector Graphics
value type: <list-of-numbers> ; default value: none; animatable: yes global attributes core attributes most notably: id, tab
index styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage presentation 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-l...
...inejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-col
index, 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, 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-row
index, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valu...
<path> - SVG: Scalable Vector Graphics
value type: <number> ; default value: none; animatable: yes global attributes core attributes most notably: id, tab
index styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation 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 aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-col
index, 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, 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-row
index, aria-ro...
<polygon> - SVG: Scalable Vector Graphics
value type: <number> ; default value: none; animatable: yes global attributes core attributes most notably: id, tab
index styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation 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 aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-col
index, 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, 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-row
index, aria-ro...
<polyline> - SVG: Scalable Vector Graphics
value type: <number> ; default value: none; animatable: yes global attributes core attributes most notably: id, tab
index styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation 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 aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-col
index, 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, 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-row
index, aria-ro...
<rect> - SVG: Scalable Vector Graphics
global attributes core attributes most notably: id, tab
index styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation 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 aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-col
index, 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, 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-row
index, aria-ro...
<symbol> - SVG: Scalable Vector Graphics
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 aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-col
index, 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, 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-row
index, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriescontainer element, structural 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> note: a <symbol> element itself is not meant to be rendered.
<textPath> - SVG: Scalable Vector Graphics
value type: <length>|<percentage>|<number> ; default value: auto; animatable: yes global attributes core attributes most notably: id, tab
index styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation 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 aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-col
index, 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, 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-row
index, aria-ro...
<use> - SVG: Scalable Vector Graphics
global attributes core attributes most notably: id, tab
index styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage event attributes global event attributes, graphical event attributes presentation 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 aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-col
index, 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, 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-row
index, aria-ro...
SVG In HTML Introduction - SVG: Scalable Vector Graphics
<title>xtech svg demo</title> <style> stop.begin { stop-color:yellow; } stop.end { stop-color:green; } body.invalid stop.end { stop-color:red; } #err { display:none; } body.invalid #err { display:inline; } </style> <script> function signalerror() { document.getelementbyid('body').setattribute("class", "invalid"); } </script> </head> <body id="body" style="position:absolute; z-
index:0; border:1px solid black; left:5%; top:5%; width:90%; height:90%;"> <form> <fieldset> <legend>html form</legend> <p><label>enter something:</label> <input type="text"> <span id="err">incorrect value!</span></p> <p><input type="button" value="activate!" onclick="signalerror();"></p> </fieldset> </form> <svg viewbox="0 0 100 100" preserveaspectratio="xmidymid slice" st...
...yle="width:100%; height:100%; position:absolute; top:0; left:0; z-
index:-1;"> <lineargradient id="gradient"> <stop class="begin" offset="0%"/> <stop class="end" offset="100%"/> </lineargradient> <rect x="0" y="0" width="100" height="100" style="fill:url(#gradient)" /> <circle cx="50" cy="50" r="30" style="fill:url(#gradient)" /> </svg> </body> </html> discussion the page is mainly regular html, css and javascript.
Same-origin policy - Web security
therefore, https://company.com:81/
index.html and https://company.com/
index.html are considered the same origin and no restrictions are applied.
... cross-origin data storage access access to data stored in the browser such as web storage and
indexeddb are separated by origin.
Using shadow DOM - Web Components
reate a shadow root let shadow = this.attachshadow({mode: 'open'}); creating the shadow dom structure next, we use some dom manipulation to create the element's internal shadow dom structure: // create spans let wrapper = document.createelement('span'); wrapper.setattribute('class', 'wrapper'); let icon = document.createelement('span'); icon.setattribute('class', 'icon'); icon.setattribute('tab
index', 0); let info = document.createelement('span'); info.setattribute('class', 'info'); // take attribute content and put it inside the info span let text = this.getattribute('data-text'); info.textcontent = text; // insert icon let imgurl; if(this.hasattribute('img')) { imgurl = this.getattribute('img'); } else { imgurl = 'img/default.png'; } let img = document.createelement('img'); img.src =...
... create some css to apply to the shadow dom let style = document.createelement('style'); style.textcontent = ` .wrapper { position: relative; } .info { font-size: 0.8rem; width: 200px; display: inline-block; border: 1px solid black; padding: 10px; background: white; border-radius: 10px; opacity: 0; transition: 0.6s all; position: absolute; bottom: 20px; left: 10px; z-
index: 3; } img { width: 1.2rem; } .icon:hover + .info, .icon:focus + .info { opacity: 1; }`; attaching the shadow dom to the shadow root the final step is to attach all the created elements to the shadow root: // attach the created elements to the shadow dom shadow.appendchild(style); shadow.appendchild(wrapper); wrapper.appendchild(icon); wrapper.appendchild(info); using our custom elemen...
Porting the Library Detector - Archive of obsolete content
ary names to that tab's libraries property: pagemod.pagemod({ include: "*", contentscriptwhen: 'end', contentscriptfile: (data.url('library-detector.js')), onattach: function(worker) { worker.on('message', function(librarylist) { if (!worker.tab.libraries) { worker.tab.libraries = []; } librarylist.foreach(function(library) { if (worker.tab.libraries.
indexof(library) == -1) { worker.tab.libraries.push(library); } }); if (worker.tab == tabs.activetab) { updatewidgetview(worker.tab); } }); } }); the content script is executed once for every window.onload event, so it will run multiple times when a single page containing multiple iframes is loaded.
addon-page - Archive of obsolete content
after this, the page loaded from "data/
index.html" will not contain navigational elements: var addontab = require("sdk/addon-page"); var data = require("sdk/self").data; require("sdk/tabs").open(data.url("
index.html")); this only affects the page at "data/
index.html": all other pages are displayed normally.
page-mod - Archive of obsolete content
attached to a page-mod: var workers = []; var pagemod = require("sdk/page-mod").pagemod({ include: ['*'], contentscriptwhen: 'ready', contentscriptfile: data.url('pagemod.js'), onattach: function(worker) { workers.push(worker); } }); you can remove workers when they are no longer valid by listening to detach: var workers = []; function detachworker(worker, workerarray) { var
index = workerarray.
indexof(worker); if(
index != -1) { workerarray.splice(
index, 1); } } var pagemod = require("sdk/page-mod").pagemod({ include: ['*'], contentscriptwhen: 'ready', contentscriptfile: data.url('pagemod.js'), onattach: function(worker) { workers.push(worker); worker.on('detach', function () { detachworker(this, workers); }); } }); cleaning up on add-...
self - Archive of obsolete content
while not generally of use to add-on code directly, it can be used by internal api code to
index local storage and other resources that are associated with a particular add-on.
ui/sidebar - Archive of obsolete content
here's an add-on that adds each worker to an array in the attach handler, and makes sure that its references are cleaned up by listening to detach and removing workers as they are detached: var workerarray = []; function attachworker(worker) { workerarray.push(worker); } function detachworker(worker) { var
index = workerarray.
indexof(worker); if(
index != -1) { workerarray.splice(
index, 1); } } var sidebar = require("sdk/ui/sidebar").sidebar({ id: 'my-sidebar', title: 'my sidebar', url: require("sdk/self").data.url("sidebar.html"), onattach: attachworker, ondetach: detachworker }); show this event is emitted when the sidebar is shown, as a result of any of the following: calling th...
jpm - Archive of obsolete content
then jpm creates a skeleton add-on, as a starting point for your add-on development, with the following file structure: my-addon
index.js package.json test test-
index.js jpm run this command runs a new instance of firefox with the add-on installed: jpm run jpm run accepts the following options: -b --binary binary use the version of firefox specified in binary.
Adding a Button to the Toolbar - Archive of obsolete content
create a directory called "data", mkdir data and save these three icon files to the "data" directory: icon-16.png icon-32.png icon-64.png then open the file called "
index.js" in the root of your addon directory and add the following code to it: var buttons = require('sdk/ui/button/action'); var tabs = require("sdk/tabs"); var button = buttons.actionbutton({ id: "mozilla-link", label: "visit mozilla", icon: { "16": "./icon-16.png", "32": "./icon-32.png", "64": "./icon-64.png" }, onclick: handleclick }); function handleclick(state) { tabs.
Creating annotations - Archive of obsolete content
at the top of the file import the page-mod module and declare an array for the workers: var pagemod = require('sdk/page-mod'); var selectors = []; add detachworker(): function detachworker(worker, workerarray) { var
index = workerarray.
indexof(worker); if(
index != -1) { workerarray.splice(
index, 1); } } edit toggleactivation() to notify the workers of a change in activation state: function activateselectors() { selectors.foreach( function (selector) { selector.postmessage(annotatorison); }); } function toggleactivation() { annotatorison = !annotatorison; activateselectors(); return a...
Logging - Archive of obsolete content
the console.log() method prints an informational message: console.log("hello world"); try it out: create a new directory, and navigate to it execute jpm init, accepting all the defaults open "
index.js" and add the line above execute jpm run firefox will start, and the following line will appear in the command window you used to execute jpm run: info: hello world!
Developing for Firefox Mobile - Archive of obsolete content
high-level apis addon-page not supported base64 supported clipboard not supported context-menu not supported hotkeys supported
indexed-db supported l10n supported notifications supported page-mod supported page-worker supported panel not supported passwords supported private-browsing not supported querystring supported request supported selection not supported self supported simple-pre...
Modifying the Page Hosted by a Tab - Archive of obsolete content
//
index.js var self = require("sdk/self"); var tabs = require("sdk/tabs"); require("sdk/ui/button/action").actionbutton({ id: "load-several", label: "load several scripts", icon: "./icon-16.png", onclick: function () { tabs.activetab.attach({ contentscriptfile: [self.data.url('first.js'), self.data.url('second.js')] }); } }); communicating with the co...
Finding window handles - Archive of obsolete content
; let sel = ctypes.voidptr_t; // constants let nil = ctypes.voidptr_t(0); //common functions let sel_registername = objc.declare('sel_registername', ctypes.default_abi, sel, ctypes.char.ptr); let objc_msgsend = objc.declare('objc_msgsend', ctypes.default_abi, id, id, sel, '...'); /* https://developer.apple.com/library/mac/documentation/cocoa/reference/applicationkit/classes/nsapplication_class/
index.html#//apple_ref/occ/instp/nsapplication/orderfront: * [nswindowptr orderfront:nil] */ var orderfront = sel_registername('orderfront:'); var nswindowptr = ctypes.voidptr_t(ctypes.uint64(nswindowstring)); var rez_orderfront = objc_msgsend(nswindowptr, orderfront, nil); console.log('rez_orderfront:', rez_orderfront, rez_orderfront.tostring()); objc.close(); unix under unix systems, the nat...
LookupPrefix - Archive of obsolete content
ceuri && originalelement.namespaceuri === namespaceuri && originalelement.prefix && originalelement.lookupnamespaceuri(originalelement.prefix) === namespaceuri) { return originalelement.prefix; } if (originalelement.attributes && originalelement.attributes.length) { for (var i=0; i < originalelement.attributes.length; i++) { var att = originalelement.attributes[i]; xmlnspattern.last
index = 0; var localname = att.localname || att.name.substr(att.name.
indexof(':')+1); // latter test for ie which doesn't support localname if (localname.
indexof(':') !== -1) { // for firefox when in html mode localname = localname.substr(att.name.
indexof(':')+1); } if ( xmlnspattern.test(att.name) && att.value === namespaceuri && lookupnamespaceuri(originalelement, localnam...
Windows - Archive of obsolete content
var wenum = components.classes["@mozilla.org/embedcomp/window-watcher;1"] .getservice(components.interfaces.nsiwindowwatcher) .getwindowenumerator(); var
index = 1; var windowname = "yourwindowname"; while (wenum.hasmoreelements()) { var win = wenum.getnext(); if (win.name == windowname) { win.focus(); return; }
index++ } window.open("chrome://to/your/window.xul", windowname, "features"); uniquely identifying dom windows requires gecko 2.0(firefox 4 / thunderbird 3.3 / seamonkey 2.1) in gecko, each dom window has a unique 64-bit ...
Custom about: URLs - Archive of obsolete content
utpage_description = 'this is my custom about page'; const aboutpage_id = 'aa132730-2278-11e5-867f-0800200c9a66'; // make sure you generate a unique id from https://www.famkruithof.net/uuid/uuidgen const aboutpage_word = 'myaboutpage' const aboutpage_uri = 'data:text/html,hi this is the page that is shown when navigate to about:myaboutpage'; // const aboutpage_uri = 'chrome://myaboutaddon/content/
index.html'; class aboutpage { static get classid() { return components.id(`{${aboutpage_id}}`); } static get classdescription() { return aboutpage_description; } static get contractid() { return `@mozilla.org/network/protocol/about;1?what=${aboutpage_word}`; } static get queryinterface() { return xpcomutils.generateqi([ci.nsiaboutmodule]); } constructor() { object.freeze(this); } ...
Mozilla internal string guide
void processstring(const nsastring& str) { const nsastring& firstfive = substring(str, 0, 5); // from
index 0, length 5 // firstfive is now a string representing the first 5 characters } unicode conversion ns*cstring vs.
XPCOM Stream Guide
nsmultiplexinputstream @mozilla.org/io/multiplex-input-stream;1 nsimultiplexinputstream .appendstream(stream) .insertstream(stream,
index) buffered read ahead in the underlying stream into a buffer, so that calls to the underlying stream are minimized.
XPCOM guide
in this document the term array refers to a container for multiple objects with a numeric, zero-based
index.xpcom changes in gecko 2.0several changes that affect xpcom component compatibility are taking place in gecko 2.
Components.utils.Sandbox
the following objects are supported: -promise (removed in firefox 37) css
indexeddb (web worker only) xmlhttprequest textencoder textdecoder url urlsearchparams atob btoa blob file crypto rtcidentityprovider fetch (added in firefox 41) caches filereader for example: var sandboxscript = 'var encode...
NS_ConvertASCIItoUTF16
ource parameters nsstring& aresult pruint32 astartpos pruint32 acount left pruint32 left(nsstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount right pruint32 right(nsstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given
index @param achar is the char you want to write into this string @param an
index is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 a
index stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
NS_ConvertUTF16toUTF8
parameters nscstring& aresult pruint32 astartpos pruint32 acount left pruint32 left(nscstring&, pruint32) const - source parameters nscstring& aresult pruint32 acount right pruint32 right(nscstring&, pruint32) const - source parameters nscstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given
index @param achar is the char you want to write into this string @param an
index is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 a
index stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
NS_ConvertUTF8toUTF16
ource parameters nsstring& aresult pruint32 astartpos pruint32 acount left pruint32 left(nsstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount right pruint32 right(nsstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given
index @param achar is the char you want to write into this string @param an
index is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 a
index stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
NS_LossyConvertUTF16toASCII
parameters nscstring& aresult pruint32 astartpos pruint32 acount left pruint32 left(nscstring&, pruint32) const - source parameters nscstring& aresult pruint32 acount right pruint32 right(nscstring&, pruint32) const - source parameters nscstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given
index @param achar is the char you want to write into this string @param an
index is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 a
index stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
Cut
void cut(
index_type acutstart, size_type acutlength ); parameters acutstart [in] the starting
index of the section to remove, measured in storage units.
nsACString
index_type [pruint32] type used to represent an offset into the string.
Cut
void cut(
index_type acutstart,
index_type acutlength ); parameters acutstart [in] the starting
index of the section to remove, measured in storage units.
nsAString
index_type [pruint32] type used to represent an offset into the string.
nsAdoptingCString
parameters nscstring& aresult pruint32 astartpos pruint32 acount left pruint32 left(nscstring&, pruint32) const - source parameters nscstring& aresult pruint32 acount right pruint32 right(nscstring&, pruint32) const - source parameters nscstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given
index @param achar is the char you want to write into this string @param an
index is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 a
index stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
nsAdoptingString
ource parameters nsstring& aresult pruint32 astartpos pruint32 acount left pruint32 left(nsstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount right pruint32 right(nsstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given
index @param achar is the char you want to write into this string @param an
index is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 a
index stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
nsAutoString
ource parameters nsstring& aresult pruint32 astartpos pruint32 acount left pruint32 left(nsstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount right pruint32 right(nsstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given
index @param achar is the char you want to write into this string @param an
index is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 a
index stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
nsCAutoString
lt pruint32 astartpos pruint32 acount left pruint32 left(nscstring&, pruint32) const - source parameters nscstring& aresult pruint32 acount right pruint32 right(nscstring&, pruint32) const - source parameters nscstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given
index @param achar is the char you want to write into this string @param an
index is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 a
index stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
nsCString
parameters nscstring& aresult pruint32 astartpos pruint32 acount left pruint32 left(nscstring&, pruint32) const - source parameters nscstring& aresult pruint32 acount right pruint32 right(nscstring&, pruint32) const - source parameters nscstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given
index @param achar is the char you want to write into this string @param an
index is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 a
index stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
nsDependentCString
parameters nscstring& aresult pruint32 astartpos pruint32 acount left pruint32 left(nscstring&, pruint32) const - source parameters nscstring& aresult pruint32 acount right pruint32 right(nscstring&, pruint32) const - source parameters nscstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given
index @param achar is the char you want to write into this string @param an
index is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 a
index stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
nsDependentString
ource parameters nsstring& aresult pruint32 astartpos pruint32 acount left pruint32 left(nsstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount right pruint32 right(nsstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given
index @param achar is the char you want to write into this string @param an
index is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 a
index stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
nsFixedCString
parameters nscstring& aresult pruint32 astartpos pruint32 acount left pruint32 left(nscstring&, pruint32) const - source parameters nscstring& aresult pruint32 acount right pruint32 right(nscstring&, pruint32) const - source parameters nscstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given
index @param achar is the char you want to write into this string @param an
index is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 a
index stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
nsFixedString
ource parameters nsstring& aresult pruint32 astartpos pruint32 acount left pruint32 left(nsstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount right pruint32 right(nsstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given
index @param achar is the char you want to write into this string @param an
index is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 a
index stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
nsPromiseFlatCString
parameters nscstring& aresult pruint32 astartpos pruint32 acount left pruint32 left(nscstring&, pruint32) const - source parameters nscstring& aresult pruint32 acount right pruint32 right(nscstring&, pruint32) const - source parameters nscstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given
index @param achar is the char you want to write into this string @param an
index is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 a
index stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
nsPromiseFlatString
ource parameters nsstring& aresult pruint32 astartpos pruint32 acount left pruint32 left(nsstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount right pruint32 right(nsstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given
index @param achar is the char you want to write into this string @param an
index is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 a
index stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
nsString
ource parameters nsstring& aresult pruint32 astartpos pruint32 acount left pruint32 left(nsstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount right pruint32 right(nsstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given
index @param achar is the char you want to write into this string @param an
index is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 a
index stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
nsXPIDLCString
parameters nscstring& aresult pruint32 astartpos pruint32 acount left pruint32 left(nscstring&, pruint32) const - source parameters nscstring& aresult pruint32 acount right pruint32 right(nscstring&, pruint32) const - source parameters nscstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given
index @param achar is the char you want to write into this string @param an
index is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 a
index stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
nsXPIDLString
ource parameters nsstring& aresult pruint32 astartpos pruint32 acount left pruint32 left(nsstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount right pruint32 right(nsstring&, pruint32) const - source parameters nsstring& aresult pruint32 acount setcharat prbool setcharat(prunichar, pruint32) - source set a char inside this string at given
index @param achar is the char you want to write into this string @param an
index is the ofs where you want to write the given char @return true if successful parameters prunichar achar pruint32 a
index stripchars void stripchars(const char*) - source these methods are used to remove all occurrences of the characters found in aset from this string.
nsIAbCard
webpage2 astring used for the contact's home web page birthyear astring birthmonth astring birthday astring custom1 astring custom2 astring custom3 astring custom4 astring notes astring lastmodifieddate unsigned long popularity
index unsigned long popularity
index is bumped every time e-mail is sent to this recipient .
nsIAccessNode
nsiaccessnode getchildnodeat( in long childnum ); parameters childnum zero-based child
index.
XPCOM Interface Reference
w2nsidomwindowinternalnsidomwindowutilsnsidomxpathevaluatornsidomxpathexceptionnsidomxpathexpressionnsidomxpathresultnsidomxulcontrolelementnsidomxulelementnsidomxullabeledcontrolelementnsidomxulselectcontrolelementnsidomxulselectcontrolitemelementnsidatasignatureverifiernsidebugnsidebug2nsidevicemotionnsidevicemotiondatansidevicemotionlistenernsidialogcreatornsidialogparamblocknsidictionarynsidir
indexnsidir
indexlistenernsidir
indexparsernsidirectoryenumeratornsidirectoryiteratornsidirectoryservicensidirectoryserviceprovidernsidirectoryserviceprovider2nsidiskcachestreaminternalnsidispatchsupportnsidocshellnsidocumentloadernsidownloadnsidownloadhistorynsidownloadmanagernsidownloadmanageruinsidownloadobservernsidownloadprogresslistenernsidownloadernsidragdrophandlernsidragservicensidragsessionnsid...
XPCOM Interface Reference by grouping
ice nsicomponentregistrar internationalization nsibidikeyboard nsilocale io filesystem nsidirectoryenumerator nsidirectoryiterator nsidirectoryservice nsidirectoryserviceprovider nsidirectoryserviceprovider2 nsidir
index nsidir
indexlistener nsidir
indexparser nsifile nsilocalfile stream nsiasyncinputstream nsiasyncoutputstream nsiasyncstreamcopier nsibinaryinputstream nsibinaryoutputstream nsicontentsniffer nsiconverterinputstream nsifileinp...
NS_CStringCutData
acutstart [in] the starting
index of the section to remove, measured in storage units.
NS_CStringSetDataRange
acutstart [in] the starting
index of the section to replace, measured in storage units.
NS_StringCutData
acutstart [in] the starting
index of the section to remove, measured in storage units.
NS_StringSetDataRange
acutstart [in] the starting
index of the section to replace, measured in storage units.
nsIAbCard/Thunderbird3
faxnumber, faxnumbertype pagernumber, pagernumbertype cellularnumber, cellularnumbertype jobtitle, department, company _aimscreenname dates: anniversaryyear, anniversarymonth, anniversaryday birthyear, birthmonth, birthday webpage1 (work), webpage2 (home) custom1, custom2, custom3, custom4 notes integral properties: lastmodifieddate popularity
index prefermailformat (see nsiabprefermailformat) boolean properties: allowremotecontent inherits from: nsiabitem method overview nsivariant getproperty(in autf8string name, in nsivariant defaultvalue); [noscript] astring getpropertyasastring(in string name); [noscript] autf8string getpropertyasautf8string(in string name); [noscript] pruint32...
nsMsgNavigationType
for example to move forward a message, you would call: // assuming gdbview is a global nsimsgdbview var resultid = new object(); var result
index = new object(); var thread
index = new object(); gdbview.viewnavigate(components.interfaces.nsmsgnavigationtype.nextmessage, resultid, result
index, thread
index, true); the nsmsgnavigationtype interface is defined as a global variable in thunderbird: var nsmsgviewcommandtype = components.interfaces.nsmsgviewcommandtype; mailnews/base/public/nsimsgdbview.idlscriptable please add a summary to this article.
Mozilla technologies
these services include:viewing and searching mozilla source code onlinesource code for all mozilla projects hosted in the mercurial repositories can be searched and viewed online using searchfox, a fast
indexed search engine that runs on aws.xml extrasthe xml extras module contains several features that allow developers to treat xml as data i.e.
Demo Addon
let query = gloda.newquery(gloda.noun_message); query.subjectmatches(searchterm); let mylistener = { /* called when new items are returned by the database query or freshly
indexed */ onitemsadded: function mylistener_onitemsadded(aitems, acollection) { }, /* called when items that are already in our collection get re-
indexed */ onitemsmodified: function mylistener_onitemsmodified(aitems, acollection) { }, /* called when items that are in our collection are purged from the system */ onitemsremoved: function mylistener_onitemsremoved(aitems, aco...
Thunderbird extensions
learn more about gloda: an overview of gloda how to create your first message query and read the gloda examples gloda internals: gloda debugging, gloda
indexing more thunderbird-specific links some links may be out of date, but they still provide valuable information on the codebase.
Using the Multiple Accounts API
- boolean, should we download new messags on biff (true) or just alert user that there is new mail (false) preference: mail.server.server.directory - local platform-specific path to store messages and folder
indexes preference: mail.server.server.name - user-visible name of server the following are specific to imap: preference: mail.server.server.admin_url - administration url for server preference: mail.server.server.using_subscription - boolean, should we use subscriptions?
CSSUnparsedValue.values() - Web APIs
the cssunparsedvalue.values() method returns a new array iterator object that contains the values for each
index in the cssunparsedvalue object.
Using dynamic styling information - Web APIs
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.).
Cache.add() - Web APIs
this.addeventlistener('install', function(event) { event.waituntil( caches.open('v1').then(function(cache) { return cache.add('/sw-test/
index.html'); }) ); }); specifications specification status comment service workersthe definition of 'cache: add' in that specification.
Cache.addAll() - Web APIs
this.addeventlistener('install', function(event) { event.waituntil( caches.open('v1').then(function(cache) { return cache.addall([ '/sw-test/', '/sw-test/
index.html', '/sw-test/style.css', '/sw-test/app.js', '/sw-test/image-list.js', '/sw-test/star-wars-logo.jpg', '/sw-test/gallery/', '/sw-test/gallery/bountyhunters.jpg', '/sw-test/gallery/mylittlevader.jpg', '/sw-test/gallery/snowtroopers.jpg' ]); }) ); }); specifications specification status comment ...
Cache.keys() - Web APIs
examples caches.open('v1').then(function(cache) { cache.keys().then(function(keys) { keys.foreach(function(request,
index, array) { cache.delete(request); }); }); }) specifications specification status comment service workersthe definition of 'cache: keys' in that specification.
Cache.match() - Web APIs
if (event.request.method === 'get' && event.request.headers.get('accept').
indexof('text/html') !== -1) { console.log('handling fetch event for', event.request.url); event.respondwith( fetch(event.request).catch(function(e) { console.error('fetch failed; returning offline page instead.', e); return caches.open(offline_cache).then(function(cache) { return cache.match(offline_url); }); }) ); } }); specifications ...
Cache.matchAll() - Web APIs
examples caches.open('v1').then(function(cache) { cache.matchall('/images/').then(function(response) { response.foreach(function(element,
index, array) { cache.delete(element); }); }); }) specifications specification status comment service workersthe definition of 'cache: matchall' in that specification.
CacheStorage.delete() - Web APIs
this.addeventlistener('activate', function(event) { var cachestokeep = ['v2']; event.waituntil( caches.keys().then(function(keylist) { return promise.all(keylist.map(function(key) { if (cachestokeep.
indexof(key) === -1) { return caches.delete(key); } })); }) ); }); specifications specification status comment service workersthe definition of 'cachestorage: delete' in that specification.
CacheStorage.keys() - Web APIs
then.addeventlistener('activate', function(event) { var cachewhitelist = ['v2']; event.waituntil( caches.keys().then(function(keylist) { return promise.all(keylist.map(function(key) { if (cachewhitelist.
indexof(key) === -1) { return caches.delete(key); } }); }) ); }); specifications specification status comment service workersthe definition of 'cachestorage: keys' in that specification.
CacheStorage.open() - Web APIs
self.addeventlistener('install', function(event) { event.waituntil( caches.open('v1').then(function(cache) { return cache.addall([ '/sw-test/', '/sw-test/
index.html', '/sw-test/style.css', '/sw-test/app.js', '/sw-test/image-list.js', '/sw-test/star-wars-logo.jpg', '/sw-test/gallery/bountyhunters.jpg', '/sw-test/gallery/mylittlevader.jpg', '/sw-test/gallery/snowtroopers.jpg' ]); }) ); specifications specification status comment service workersthe definition of ...
CacheStorage - Web APIs
self.addeventlistener('install', function(event) { event.waituntil( caches.open('v1').then(function(cache) { return cache.addall([ '/sw-test/', '/sw-test/
index.html', '/sw-test/style.css', '/sw-test/app.js', '/sw-test/image-list.js', '/sw-test/star-wars-logo.jpg', '/sw-test/gallery/bountyhunters.jpg', '/sw-test/gallery/mylittlevader.jpg', '/sw-test/gallery/snowtroopers.jpg' ]); }) ); }); self.addeventlistener('fetch', function(event) { event.respondwith(caches.match(event.request).th...
Document.cookie - Web APIs
} <button onclick="doonce()">only do something once</button> example #4: reset the previous cookie function resetonce() { document.cookie = "dosomethingonlyonce=; expires=thu, 01 jan 1970 00:00:00 gmt"; } <button onclick="resetonce()">reset only once cookie</button> example #5: check a cookie existence //es5 if (document.cookie.split(';').some(function(item) { return item.trim().
indexof('reader=') == 0 })) { console.log('the cookie "reader" exists (es5)') } //es2016 if (document.cookie.split(';').some((item) => item.trim().startswith('reader='))) { console.log('the cookie "reader" exists (es6)') } example #6: check that a cookie has a specific value //es5 if (document.cookie.split(';').some(function(item) { return item.
indexof('reader=1') >= 0 })) { conso...
Document.forms - Web APIs
ut type="button" onclick="alert(document.forms[0].id);" value="robby's form" /> </form> <form id="dave"> <input type="button" onclick="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...
DocumentOrShadowRoot.msElementsFromRect() - Web APIs
var nodelist = document.mselementsfromrect(x,y,width,height) var nodelist = document.mselementsfrompoint(x,y) the returned nodelist is sorted by z-
index so that you can tell the relative stacking order of the elements.
EffectTiming.delay - Web APIs
syntax var timingproperties = { delay: delayinmilliseconds }; timingproperties.delay = delayinmilliseconds; value a number specifying the delay, in milliseconds, from the start of the animation's play cycle to the beginning of its active interval (the time
index at which actual animation begins).
EventSource - Web APIs
for example, eventsource is a useful approach for handling things like social media status updates, news feeds, or delivering data into a client-side storage mechanism like
indexeddb or web storage.
Using files from web applications - Web APIs
$_files['myfile']['name']); exit; } ?><!doctype html> <html> <head> <title>dnd binary upload</title> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <script type="application/javascript"> function sendfile(file) { const uri = "/
index.php"; const xhr = new xmlhttprequest(); const fd = new formdata(); xhr.open("post", uri, true); xhr.onreadystatechange = function() { if (xhr.readystate == 4 && xhr.status == 200) { alert(xhr.responsetext); // handle response.
File.getAsBinary() - Web APIs
// files is a filelist object (similar to nodelist) var files = fileinput.files; // object for allowed media types var accept = { binary : ["image/png", "image/jpeg"], text : ["text/plain", "text/css", "application/xml", "text/html"] }; var file; for (var i = 0; i < files.length; i++) { file = files[i]; // if file type could be detected if (file !== null) { if (accept.binary.
indexof(file.type) > -1) { // file is a binary, which we accept var data = file.getasbinary(); } else if (accept.text.
indexof(file.type) > -1) { // file is of type text, which we accept var data = file.getastext(); // modify data with string methods } } } specification not part of any specification.
File.getAsDataURL() - Web APIs
nt: <input type="file" id="myfileinput" multiple> var fileinput = document.getelementbyid("myfileinput"); // files is a filelist object (similar to nodelist) var files = fileinput.files; // array with acceptable file types var accept = ["image/png"]; // img is a htmlimgelement: <img id="myimg"> var img = document.getelementbyid("myimg"); // if we accept the first selected file type if (accept.
indexof(files[0].mediatype) > -1) { // display the image // same as <img src="data:image/png,<imagedata>"> img.src = files[0].getasdataurl(); } specification not part of any specification.
File.getAsText() - Web APIs
); // files is a filelist object (similar to nodelist) var files = fileinput.files; // object for allowed media types var accept = { binary : ["image/png", "image/jpeg"], text : ["text/plain", "text/css", "application/xml", "text/html"] }; var file; for (var i = 0; i < files.length; i++) { file = files[i]; // if file type could be detected if (file !== null) { if (accept.text.
indexof(file.mediatype) > -1) { // file is of type text, which we accept // make sure it's encoded as utf-8 var data = file.getastext("utf-8"); // modify data with string methods } else if (accept.binary.
indexof(file.mediatype) > -1) { // binary } } } specification not part of any specification.
Gamepad.id - Web APIs
syntax readonly attribute domstring id; example window.addeventlistener("gamepadconnected", function() { var gp = navigator.getgamepads()[0]; gamepadinfo.innerhtml = "gamepad connected at
index " + gp.
index + ": " + gp.id + "."; }); value a string.
GlobalEventHandlers.onerror - Web APIs
window.onerror = function (msg, url, lineno, columnno, error) { var string = msg.tolowercase(); var substring = "script error"; if (string.
indexof(substring) > -1){ alert('script error: see browser console for detail'); } else { var message = [ 'message: ' + msg, 'url: ' + url, 'line: ' + lineno, 'column: ' + columnno, 'error object: ' + json.stringify(error) ].join(' - '); alert(message); } return false; }; when using the inline html markup (<body onerror="alert('an error occurred')"...
GlobalEventHandlers.onmousemove - Web APIs
html <p><a href="#" data-tooltip="first link">see a tooltip here …</a></p> <p><a href="#" data-tooltip="second link">… or here!</a></p> css .tooltip { position: absolute; z-
index: 9999; padding: 6px; background: #ffd; border: 1px #886 solid; border-radius: 5px; } javascript const tooltip = new (function() { const node = document.createelement('div'); node.classname = 'tooltip'; node.setattribute('hidden', ''); document.body.appendchild(node); this.follow = function(event) { node.style.left = event.clientx + 20 + 'px'; node.style.top = event.cl...
GlobalEventHandlers.onmouseup - Web APIs
html <div class="container"> <div class="toaster"></div> <div class="toast">hello world!</div> </div> css .container { position: absolute; left: 50%; bottom: 20px; transform: translate(-50%); } .toaster { width: 160px; height: 110px; background: #bbb; border-radius: 10px 10px 0 0; } .toast { position: absolute; left: 50%; top: 50%; z-
index: -1; width: 100px; height: 50px; padding: 10px; background: #ed9; border-radius: 10px 10px 0 0; transform: translate(-50%, -90px); transition: transform .3s; } .depressed { transform: translate(-50%, -50%); } javascript function depress() { toast.classlist.add('depressed'); } function release() { toast.classlist.remove('depressed'); } const toaster = document.queryselecto...
HTMLElement: animationstart event - Web APIs
a negative delay will cause the event to fire with an elapsedtime equal to the absolute value of the delay (and, correspondingly, the animation will begin playing at that time
index into the sequence).
HTMLElement.offsetLeft - Web APIs
</span> <span id="longspan">long span that wraps within this div.</span> </div> <div id="box" style="position: absolute; border-color: red; border-width: 1; border-style: solid; z-
index: 10"> </div> <script type="text/javascript"> var box = document.getelementbyid("box"); var longspan = document.getelementbyid("longspan"); box.style.left = longspan.offsetleft + document.body.scrollleft + "px"; box.style.top = longspan.offsettop + document.body.scrolltop + "px"; box.style.width = longspan.offsetwidth + "px"; box.style.height = longspan.offsetheight + "px"; </script> ...
HTMLFormElement - Web APIs
you can then use any of the following syntaxes to get an individual form: document.forms[
index] returns the form at the specified
index into the array of forms.
HTMLImageElement.useMap - Web APIs
consider a <map> that looks like this: <map name="mainmenu-map"> <area shape="circle" coords="25, 25, 75, 75" href="/
index.html" alt="return to home page"> <area shape="rect" coords="25, 25, 100, 150" href="/
index.html" alt="shop"> </map> given the image map named mainmenu-map, the image which uses it should look something like the following: <img src="menubox.png" usemap="#mainmenu-map"> for additional examples (including interactive ones), see the articles about the <map> and <area> elements, as well as the g...
HTMLImageElement.x - Web APIs
ctor("pre"); let tbl = document.getelementbyid("userinfo") let log = msg => { logbox.innerhtml += `${msg}<br>`; } let cell = tbl.rows[1].cells[2]; let image = cell.queryselector("img"); log(`image's global x: ${image.x}`); log(`image's global y: ${image.y}`); this uses the <table>'s rows property to get a list of the rows in the table, from which it looks up row 1 (which, being a zero-based
index, means the second row from the top).
HTMLImageElement.y - Web APIs
ctor("pre"); let tbl = document.getelementbyid("userinfo") let log = msg => { logbox.innerhtml += `${msg}<br>`; } let cell = tbl.rows[1].cells[2]; let image = cell.queryselector("img"); log(`image's global x: ${image.x}`); log(`image's global y: ${image.y}`); this uses the <table>'s rows property to get a list of the rows in the table, from which it looks up row 1 (which, being a zero-based
index, means the second row from the top).
HTMLOptionElement - Web APIs
htmloptionelement.
index read only is a long representing the position of the option within the list of options it belongs to, in tree-order.
HTMLElement.focus() - Web APIs
obsolete notes if you call htmlelement.focus() from a mousedown event handler, you must call event.preventdefault() to keep the focus from leaving the htmlelement behaviour of the focus in relation to different html features like tab
index or shadow dom, which previously remained under-specified, were recently updated (as october of 2019).
HTMLOrForeignElement - Web APIs
propertiesdataset read only the dataset read-only property of the htmlorforeignelement interface provides read/write access to all the custom data attributes (data-*) set on the element.nonce the nonce property of the htmlorforeignelement interface returns the cryptographic number used once that is used by content security policy to determine whether a given fetch will be allowed to proceed.tab
indexthe tab
index property of the htmlorforeignelement interface represents the tab order of the current element.methodsblur()the htmlelement.blur() method removes keyboard focus from the current element.focus()the htmlelement.focus() method sets focus on the specified element, if it can be focused.
The HTML DOM API - Web APIs
eelement htmltablerowelement htmltablesectionelement htmltemplateelement htmltextareaelement htmltimeelement htmltitleelement htmltrackelement htmlulistelement htmlunknownelement htmlvideoelement deprecated html element interfaces htmlmarqueeelement obsolete html element interfaces htmlbasefontelement htmlfontelement htmlframeelement htmlframesetelement htmlis
indexelement htmlmenuitemelement web app and browser integration interfaces these interfaces offer access to the browser window and document that contain the html, as well as to the browser's state, available plugins (if any), and various configuration options.
IDBCursor.request - Web APIs
var listitem = document.createelement('li'); listitem.innerhtml = '<strong>' + cursor.value.albumtitle + '</strong>, ' + cursor.value.year; list.appendchild(listitem); console.log(cursor.request); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status comment
indexed database api draftthe definition of 'request' in that specification.
IDBDatabase.onclose - Web APIs
example db.onclose = function(event) { myappshowalert('the database "' + db.name + '" has unexpectedly closed.'); }; specifications specification status comment
indexed database api draftthe definition of 'onclose' in that specification.
IDBMutableFile - Web APIs
note: this interface used to be called filehandle , but it was changed to this (bug 1006485.) as idbmutablefile objects are bound to a fake file system built on top of
indexeddb, such an object is created using the idbdatabase.createmutablefile method.
SVGPathElement - Web APIs
svgpathelement.getpathsegatlength() returns an unsigned long representing the
index within the pathseglist utilizing the user agent's distance-along-a-path algorithm.
Selection.setBaseAndExtent() - Web APIs
exceptions if anchoroffset is larger than the number of child nodes inside anchornode, or if focusoffset is larger than the number of child nodes inside focusnode, an
indexsizeerror exception is thrown.
ServiceWorkerGlobalScope: activate event - Web APIs
globalscope.addeventlistener('activate', function(event) { var cachewhitelist = ['v2']; event.waituntil( caches.foreach(function(cache, cachename) { if (cachewhitelist.
indexof(cachename) == -1) { return caches.delete(cachename); } }) ); }); you can also set up the event handler using the serviceworkerglobalscope.onactivate property: globalscope.onactivate = function(event) { ...
ServiceWorkerGlobalScope: install event - Web APIs
globalscope.oninstall examples the following snippet shows how an install event handler can be used to populate a cache with a number of responses, which the service worker can then use to serve assets offline: this.addeventlistener('install', function(event) { event.waituntil( caches.open('v1').then(function(cache) { return cache.add( '/sw-test/', '/sw-test/
index.html', '/sw-test/style.css', '/sw-test/app.js', '/sw-test/image-list.js', '/sw-test/star-wars-logo.jpg', '/sw-test/gallery/', '/sw-test/gallery/bountyhunters.jpg', '/sw-test/gallery/mylittlevader.jpg', '/sw-test/gallery/snowtroopers.jpg' ); }) ); }); you can also set up the event handler using the serviceworkerglobalscope...
ServiceWorkerGlobalScope.onactivate - Web APIs
then.addeventlistener('activate', function(event) { var cachewhitelist = ['v2']; event.waituntil( caches.foreach(function(cache, cachename) { if (cachewhitelist.
indexof(cachename) == -1) { return caches.delete(cachename); } }) ); }); specifications specification status comment service workersthe definition of 'event handlers' in that specification.
ServiceWorkerGlobalScope.oninstall - Web APIs
}; examples the following snippet shows how an install event handler can be used to populate a cache with a number of responses, which the service worker can then use to serve assets offline: this.addeventlistener('install', function(event) { event.waituntil( caches.open('v1').then(function(cache) { return cache.add( '/sw-test/', '/sw-test/
index.html', '/sw-test/style.css', '/sw-test/app.js', '/sw-test/image-list.js', '/sw-test/star-wars-logo.jpg', '/sw-test/gallery/', '/sw-test/gallery/bountyhunters.jpg', '/sw-test/gallery/mylittlevader.jpg', '/sw-test/gallery/snowtroopers.jpg' ); }) ); }); specifications specification status comment ser...
SourceBufferList - Web APIs
sourcebufferlist:
indexed property getter this getter allows the sourcebuffer objects in the list to be accessed with an array operator (i.e.
SpeechRecognitionEvent - Web APIs
speechrecognitionevent.result
index read only returns the lowest
index value result in the speechrecognitionresultlist "array" that has actually changed.
SpeechSynthesisEvent.utterance - Web APIs
examples utterthis.onpause = function(event) { var char = event.utterance.text.charat(event.char
index); console.log('speech paused at character ' + event.char
index + ' of "' + event.utterance.text + '", which is "' + char + '".'); } specifications specification status comment web speech apithe definition of 'utterance' in that specification.
SpeechSynthesisVoice - Web APIs
lue); var selectedoption = voiceselect.selectedoptions[0].getattribute('data-name'); for(i = 0; i < voices.length ; i++) { if(voices[i].name === selectedoption) { utterthis.voice = voices[i]; } } utterthis.pitch = pitch.value; utterthis.rate = rate.value; synth.speak(utterthis); utterthis.onpause = function(event) { var char = event.utterance.text.charat(event.char
index); console.log('speech paused at character ' + event.char
index + ' of "' + event.utterance.text + '", which is "' + char + '".'); } inputtxt.blur(); } specifications specification status comment web speech apithe definition of 'speechsynthesisvoice' in that specification.
WorkerGlobalScope - Web APIs
windoworworkerglobalscope.
indexeddb read only provides a mechanism for applications to asynchronously access capabilities of
indexed databases; returns an idbfactory object.
HTML in XMLHttpRequest - Web APIs
(new regexp("(?:(?:.(?!<\\s*" + aexec[1] + "[^>]*[>]))*.?<\\s*" + aexec[1] + "[^>]*[>](?:.(?!<\\s*\/\\s*" + aexec[1] + "\\s*>))*.?<\\s*\/\\s*" + aexec[1] + "\\s*>)*(?:.(?!<\\s*\/\\s*" + aexec[1] + "\\s*>))*.?", "i")).exec(ssrc.slice(ssrc.
indexof(aexec[0]) + aexec[0].length)) || "" : ""; } var oreq = new xmlhttprequest(); oreq.open("get", "yourpage.html", true); oreq.onload = function () { console.log(gethtml(this, "intro")); }; oreq.send(null); note: this solution is very expensive for the interpreter.
Using XMLHttpRequest - Web APIs
for example: http://foo.com/bar.html -> http://foo.com/bar.html?12345 http://foo.com/bar.html?foobar=baz -> http://foo.com/bar.html?foobar=baz&12345 as the local cache is
indexed by url, this causes every request to be unique, thereby bypassing the cache.
XPathResult - Web APIs
xpathresult.snapshotitem() returns an item of the snapshot collection or null in case the
index is not within the range of nodes.
XRInputSource.targetRayMode - Web APIs
the direction is determined using platform-specific rules, though if no such rules exist, the direction is chosen by assuming the user is pointing their
index finger straight out from their hand.
XRInputSourceArray.values() - Web APIs
return value a javascript iterator that can be used to walk through the list of xrinputsource objects in the array, starting with the first entry (at
index 0) and proceeding straight through the list.
XRTargetRayMode - Web APIs
the direction is determined using platform-specific rules, though if no such rules exist, the direction is chosen by assuming the user is pointing their
index finger straight out from their hand.
ARIA guides - Accessibility
error handling in forms labeling widgets labeling composite widgets and regions managing focus in composite widgets (aria-activedescendant vs roving tab
index) using landmark roles handling dynamic updates & live regions virtual vs.
ARIA live regions - Accessibility
textcontent = 'no planet selected'; planetdescription.textcontent = 'select a planet to view its description'; } } const renderplanetinfobutton = document.queryselector('#renderplanetinfobutton'); renderplanetinfobutton.addeventlistener('click', event => { const planetsselect = document.queryselector('#planetsselect'); const selectedplanet = planetsselect.options[planetsselect.selected
index].value; renderplanetinfo(selectedplanet); }); as the user selects a new planet, the information in the live region will be announced.
Using the alertdialog role - Accessibility
<div role="alertdialog" aria-labelledby="dialog1title" aria-describedby="dialog1desc"> <div role="document" tab
index="0"> <h2 id="dialog1title">your login session is about to expire</h2> <p id="dialog1desc">to extend your session, click the ok button</p> <button>ok</button> </div> </div> working examples: tbd notes aria attributes used alertdialog aria-labelledby aria-describedby related aria techniques using the dialog role using the alert role compatibility tbd: add support...
Using the aria-invalid attribute - Accessibility
the snippet below shows a very simple validation function, which only checks for the presence of a particular character (in the real world, validation will likely be more sophisticated): function checkvalidity(aid, asearchterm, amsg){ var elem = document.getelementbyid(aid); var invalid = (elem.value.
indexof(asearchterm) < 0); if (invalid) { elem.setattribute("aria-invalid", "true"); updatealert(amsg); } else { elem.setattribute("aria-invalid", "false"); updatealert(); } } the snippet below shows the alert functions, which add (or remove) the error message: function updatealert(msg) { var oldalert = document.getelementbyid("alert"); if (oldaler...
Using the radio role - Accessibility
<h3 id="rg1_label">lunch options</h3> <ul class="radiogroup" id="rg1" role="radiogroup" aria-labelledby="rg1_label"> <li id="r1" tab
index="-1" role="radio" aria-checked="false"> <img role="presentation" src="radio-unchecked.gif" /> thai </li> <li id="r2" tab
index="-1" role="radio" aria-checked="false"> <img role="presentation" src="radio-unchecked.gif" /> subway </li> <li id="r3" tab
index="0" role="radio" aria-checked="true"> <img role="presentation" src="radio-checked.gif" /> radio maria </li> </ul> working ...
x-ms-aria-flowfrom - Accessibility
example <div tab
index="0" class="foo" id="element2" role="option" aria-posinset="1" aria-setsize="15" aria-flowto="element8" x-ms-aria-flowfrom="element5"> see also aria relationship attributes microsoft api extensions ...
Using ARIA: Roles, states, and properties - Accessibility
-multiselectable aria-orientation aria-placeholder aria-pressed aria-readonly aria-required aria-selected aria-sort aria-valuemax aria-valuemin aria-valuenow aria-valuetext live region attributes aria-live aria-relevant aria-atomic aria-busy drag & drop attributes aria-dropeffect aria-dragged relationship attributes aria-activedescendant aria-colcount aria-col
index aria-colspan aria-controls aria-describedby aria-details aria-errormessage aria-flowto aria-labelledby aria-owns aria-posinset aria-rowcount aria-row
index aria-rowspan aria-setsize microsoftedge-specific properties x-ms-aria-flowfrom ...
ARIA: tabpanel role - Accessibility
<div role="tablist"> <div role="tab" aria-selected="true" aria-controls="tabpanel-id" id="tab-id" tab
index="0">tab label</div> accessibility concerns optionally, warn of any potential accessibility concerns that exist with using this property, and how to work around them.
Microdata - HTML: Hypertext Markup Language
due to the implementation of additional marking parameters of schema's vocabulary, the
indexation of information in russian-language web-pages became considerably more successful.
Choosing between www and non-www URLs - HTTP
this way, search engines don't
index the same page several times, potentially leading to it being considered as duplicate content or spam, and even removing or lowering your page from the search engine result pages.
Clear-Site-Data - HTTP
this includes storage mechanisms such as: localstorage (executes localstorage.clear), sessionstorage (executes sessionstorage.clear),
indexeddb (for each database execute idbfactory.deletedatabase), service worker registrations (for each service worker registration, execute serviceworkerregistration.unregister), appcache, websql databases, filesystem api data, plugin data (flash via npp_clearsitedata).
Location - HTTP
examples location: /
index.html specifications specification title rfc 7231, section 7.1.2: location hypertext transfer protocol (http/1.1): semantics and content ...
Retry-After - HTTP
it is useful to send it along with a 503 (service unavailable) response, so that search engines will keep
indexing your site when the downtime is over.
Upgrade - HTTP
for example, the client might send a get request as shown, listing the preferred protocols to switch to (in this case "example/1" and "foo/2"): get /
index.html http/1.1 host: www.example.com connection: upgrade upgrade: example/1, foo/2 note: connection: upgrade must be set whenever upgrade is sent.
HTTP headers - HTTP
x-robots-tag the x-robots-tag http header is used to indicate how a web page is to be
indexed within public search engine results.
GET - HTTP
request has body no successful response has body yes safe yes idempotent yes cacheable yes allowed in html forms yes syntax get /
index.html specifications specification title rfc 7231, section 4.3.1: get hypertext transfer protocol (http/1.1): semantics and content ...
HEAD - HTTP
request has body no successful response has body no safe yes idempotent yes cacheable yes allowed in html forms no syntax head /
index.html specifications specification title rfc 7231, section 4.3.2: head hypertext transfer protocol (http/1.1): semantics and content ...
OPTIONS - HTTP
request has body no successful response has body yes safe yes idempotent yes cacheable no allowed in html forms no syntax options /
index.html http/1.1 options * http/1.1 examples identifying allowed request methods to find out which request methods a server supports, one can use the curl command-line program to issue an options request: curl -x options https://example.org -i the response then contains an allow header that holds the allowed methods: http/1.1 204 no content allow: options, get, head, post cache-control: max-a...
TRACE - HTTP
request has body no successful response has body no safe no idempotent yes cacheable no allowed in html forms no syntax trace /
index.html specifications specification title rfc 7231, section 4.3.8: trace hypertext transfer protocol (http/1.1): semantics and content ...
An overview of HTTP - HTTP
most of the time the user-agent is a web browser, but it can be anything, for example a robot that crawls the web to populate and maintain a search engine
index.
Protocol upgrade mechanism - HTTP
this means that a typical request that includes upgrade would look something like: get /
index.html http/1.1 host: www.example.com connection: upgrade upgrade: example/1, foo/2 other headers may be required depending on the requested protocol; for example, websocket upgrades allow additional headers to configure details about the websocket connection as well as to offer a degree of security in opening the connection.
Proxy Auto-Configuration (PAC) file - HTTP
examples shexpmatch("http://home.netscape.com/people/ari/
index.html" , "*/ari/*"); // returns true shexpmatch("http://home.netscape.com/people/montulli/
index.html", "*/ari/*"); // returns false weekdayrange() syntax weekdayrange(wd1, wd2, [gmt]) note: (before firefox 49) wd1 must be less than wd2 if you want the function to evaluate these parameters as a range.
301 Moved Permanently - HTTP
status 301 moved permanently example client request get /
index.php http/1.1 host: www.example.org server response http/1.1 301 moved permanently location: http://www.example.org/
index.asp specifications specification title rfc 7231, section 6.4.2: 301 moved permanently hypertext transfer protocol (http/1.1): semantics and content ...
Equality comparisons and sameness - JavaScript
there are four equality algorithms in es2015: abstract equality comparison (==) strict equality comparison (===): used by array.prototype.
indexof, array.prototype.last
indexof, and case-matching samevaluezero: used by %typedarray% and arraybuffer constructors, as well as map and set operations, and also string.prototype.includes and array.prototype.includes since es2016 samevalue: used in all other places javascript provides three different value-comparison operations: === - strict equality comparison ("strict equality", "identity", "triple equals") == - abstract equality comparison ("loose equality", "double equals") object.is provides samevalue (new in es2015).
Concurrency model and the event loop - JavaScript
handling i/o is typically performed via events and callbacks, so when the application is waiting for an
indexeddb query to return or an xhr request to return, it can still process other things like user input.
Control flow and error handling - JavaScript
function getmonthname(mo) { mo = mo - 1; // adjust month number for array
index (1 = jan, 12 = dec) let months = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec']; if (months[mo]) { return months[mo]; } else { throw 'invalidmonthno'; // throw keyword is used here } } try { // statements to try monthname = getmonthname(mymonth); // function could throw exception } catch (e) { monthname = 'unknown'; logm...
Iterators and generators - JavaScript
function makerangeiterator(start = 0, end = infinity, step = 1) { let next
index = start; let iterationcount = 0; const rangeiterator = { next: function() { let result; if (next
index < end) { result = { value: next
index, done: false } next
index += step; iterationcount++; return result; } return { value: iterationcount, done: true } } }; return...
Meta programming - JavaScript
function.prototype.apply.call(math.floor, undefined, [1.75]) with reflect.apply this becomes less verbose and easier to understand: reflect.apply(math.floor, undefined, [1.75]) // 1 reflect.apply(string.fromcharcode, undefined, [104, 101, 108, 108, 111]) // "hello" reflect.apply(regexp.prototype.exec, /ab/, ['confabulation']).
index // 4 reflect.apply(''.charat, 'ponies', [3]) // "i" checking if property definition has been successful with object.defineproperty, which returns an object if successful, or throws a typeerror otherwise, you would use a try...catch block to catch any error that occurred while defining a property.
Assertions - JavaScript
console.log(/\d+(?!\.)/g.exec('3.141')); // [ '141',
index: 2, input: '3.141' ] different meaning of '?!' combination usage in assertions and ranges different meaning of ?!
Groups and ranges - JavaScript
matches are accessed using the
index of the the result's elements ([1], ..., [n]) or from the predefined regexp object's properties ($1, ..., $9).
Unicode property escapes - JavaScript
// Ù¢ is the digit 2 in arabic-indic notation // while it is predominantly written within the arabic script // it can also be written in the thaana script "Ù¢".match(/\p{script=thaana}/u); // null as thaana is not the predominant script super() "Ù¢".match(/\p{script_extensions=thaana}/u); // ["Ù¢",
index: 0, input: "Ù¢", groups: undefined] unicode property escapes vs.
JavaScript Guide - JavaScript
arguments & parameters arrow functions expressions and operators assignment & comparisons arithmetic operators bitwise & logical operators conditional (ternary) operator numbers and dates number literals number object math object date object text formatting string literals string object template literals internationalization regular expressions
indexed collections arrays typed arrays keyed collections map weakmap set weakset working with objects objects and properties creating objects defining methods getter and setter details of the object model prototype-based oop creating object hierarchies inheritance promises guarantees chaining error propagation composition timing iter...
Inheritance and the prototype chain - JavaScript
// o ---> object.prototype ---> null var b = ['yo', 'whadup', '?']; // arrays inherit from array.prototype // (which has methods
indexof, foreach, etc.) // the prototype chain looks like: // b ---> array.prototype ---> object.prototype ---> null function f() { return 2; } // functions inherit from function.prototype // (which has methods call, bind, etc.) // f ---> function.prototype ---> object.prototype ---> null with a constructor a "constructor" in javascript is "just" a function that happens to be called with the new...
Memory Management - JavaScript
v8 engine flags the max amount of available heap memory can be increased with a flag: node --max-old-space-size=6000
index.js we can also expose the garbage collector for debugging memory issues using a flag and the chrome debugger: node --expose-gc --inspect
index.js see also ibm article on "memory leak patterns in javascript" (2007) kangax article on how to register event handler and avoid memory leaks (2010) performance ...
Float32Array() constructor - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array
index syntax (that is, using bracket notation).
Float64Array() constructor - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array
index syntax (that is, using bracket notation).
Function.prototype.call() - JavaScript
the main purpose of the anonymous function here is to add a print function to every object, which is able to print the correct
index of the object in the array.
Generator.prototype.next() - JavaScript
nction* gen() { yield 1; yield 2; yield 3; } const g = gen(); // "generator { }" g.next(); // "object { value: 1, done: false }" g.next(); // "object { value: 2, done: false }" g.next(); // "object { value: 3, done: false }" g.next(); // "object { value: undefined, done: true }" using next() with a list function* getpage(pagesize = 1, list) { let output = []; let
index = 0; while (
index < list.length) { output = []; for (let i =
index; i <
index + pagesize; i++) { if (list[i]) { output.push(list[i]); } } yield output;
index += pagesize; } } list = [1, 2, 3, 4, 5, 6, 7, 8] var page = getpage(3, list); // generator { } page.next(); // object {value: (3) [1, 2, 3], done: fals...
Generator - JavaScript
examples an infinite iterator function* infinite() { let
index = 0; while (true) { yield
index++; } } const generator = infinite(); // "generator { }" console.log(generator.next().value); // 0 console.log(generator.next().value); // 1 console.log(generator.next().value); // 2 // ...
Int16Array() constructor - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array
index syntax (that is, using bracket notation).
Int32Array() constructor - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array
index syntax (that is, using bracket notation).
Int8Array() constructor - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array
index syntax (that is, using bracket notation).
Intl - JavaScript
multiple locales may be specified (and a best-supported locale determined by evaluating each of them in order and comparing against the locales supported by the implementation) by passing an array (or array-like object, with a length property and corresponding
indexed elements) whose elements are either intl.locale objects or values that convert to unicode bcp 47 locale identifier strings.
JSON.parse() - JavaScript
text = string(text); rx_dangerous.last
index = 0; if (rx_dangerous.test(text)) { text = text.replace(rx_dangerous, function(a) { return ( "\\u" + ("0000" + a.charcodeat(0).tostring(16)).slice(-4) ); }); } // in the second stage, we run the text against regular expressions that look // for non-json patterns.
JSON.stringify() - JavaScript
json.stringify() calls tojson with one parameter: if this object is a property value, the property name if it is in an array, the
index in the array, as a string an empty string if json.stringify() was directly called on this object for example: var obj = { data: 'data', tojson (key) { if (key) return `now i am a nested object under key '${key}'`; else return this; } }; json.stringify(obj); // '{"data":"data"}' json.stringify({ obj }); // shorthand property names (es2015)...
NaN - JavaScript
let arr = [2, 4, nan, 12]; arr.
indexof(nan); // -1 (false) arr.includes(nan); // true arr.find
index(n => number.isnan(n)); // 2 specifications specification ecmascript (ecma-262)the definition of 'nan' in that specification.
Object.assign() - JavaScript
nction') { // must be writable: true, enumerable: false, configurable: true object.defineproperty(object, "assign", { value: function assign(target, varargs) { // .length of function is 2 'use strict'; if (target === null || target === undefined) { throw new typeerror('cannot convert undefined or null to object'); } var to = object(target); for (var
index = 1;
index < arguments.length;
index++) { var nextsource = arguments[
index]; if (nextsource !== null && nextsource !== undefined) { for (var nextkey in nextsource) { // avoid bugs when hasownproperty is shadowed if (object.prototype.hasownproperty.call(nextsource, nextkey)) { to[nextkey] = nextsource[nextkey]; } ...
Object.getOwnPropertyNames() - JavaScript
var target = myobject; var enum_and_nonenum = object.getownpropertynames(target); var enum_only = object.keys(target); var nonenum_only = enum_and_nonenum.filter(function(key) { var
indexinenum = enum_only.
indexof(key); if (
indexinenum == -1) { // not found in enum_only keys, // meaning that the key is non-enumerable, // so return true so we keep this in the filter return true; } else { return false; } }); console.log(nonenum_only); specifications specification ecmascript (ecma-262)the definition of 'object.getownpropertynames' i...
Strict mode - JavaScript
both involve a considerable amount of magical behavior in normal code: eval to add or remove bindings and to change binding values, and arguments by its
indexed properties aliasing named arguments.
JavaScript reference - JavaScript
parseint() decodeuri() decodeuricomponent() encodeuri() encodeuricomponent() fundamental objects object function boolean symbol error objects error aggregateerror evalerror internalerror rangeerror referenceerror syntaxerror typeerror urierror numbers & dates number bigint math date text processing string regexp
indexed collections array int8array uint8array uint8clampedarray int16array uint16array int32array uint32array float32array float64array bigint64array biguint64array keyed collections map set weakmap weakset structured data arraybuffer sharedarraybuffer atomics dataview json control abstraction promise generator generatorfunction asyn...
Authoring MathML - MathML
note that ua string sniffing is not the most reliable method and might break from version to version: var ua = navigator.useragent; var isgecko = ua.
indexof("gecko") > -1 && ua.
indexof("khtml") === -1 && ua.
indexof('trident') === -1; var iswebkit = ua.
indexof('applewebkit') > -1 && ua.
indexof('chrome') === -1; mathematical fonts in order to get a good layout or to allow different style, it's important to have mathematical fonts available.
<msqrt> - MathML
the mathml <msqrt> element is used to display square roots (no
index is displayed).
MathML element reference - MathML
laying non-standard symbols) i <mi> (identifier) l <mlabeledtr> (labeled row in a table or a matrix) <mlongdiv> (long division notation) m <mmultiscripts> (prescripts and tensor indices) n <mn> (number) o <mo> (operator) <mover> (overscript) p <mpadded> (space around content) <mphantom> (invisible content with reserved space) r <mroot> (radical with specified
index) <mrow> (grouped sub-expressions) s <ms> (string literal) <mscarries> (annotations such as carries) <mscarry> (single carry, child element of <mscarries>) <msgroup> (grouped rows of <mstack> and <mlongdiv> elements) <msline> (horizontal lines inside <mstack> elements) <mspace> (space) <msqrt> (square root without an
index) <msrow> (rows in <mstack> elements) <mstack> (stacked alignm...
Media container formats (file types) - Web media technologies
index of media container formats (file types) to learn more about a specific container format, find it in this list and click through to the details, which include information about what the container is typically useful for, what codecs it supports, and which browsers support it, among other specifics.
Web Performance
st interactive first meaningful paint first paint http http/2 jank latency lazy load long task lossless compression lossy compression main thread minification network throttling packet page load time page prediction parse perceived performance prefetch prerender quic rail real user monitoring resource timing round trip time (rtt) server timing speculative parsing speed
index ssl synthetic monitoring tcp handshake tcp slow start time to first byte time to interactive tls transmission control protocol (tcp) tree shaking web performance documents yet to be written javascript performance best practices javascript, when used properly, can allow for interactive and immersive web experiences ...
Introduction to progressive web apps - Progressive web apps (PWAs)
this is achieved using a combination of technologies: service workers to control page requests (for example storing them offline), the cache api for storing responses to network requests offline (very useful for storing site assets), and client-side data storage technologies such as web storage and
indexeddb to store application data offline.
Progressive loading - Progressive web apps (PWAs)
we could go even further and move everything from style.css to the <style> tag in the <head> of
index.html — this would improve performance even more, but for the readability of the example we will skip that approach too.
Making PWAs work offline with Service workers - Progressive web apps (PWAs)
var cachename = 'js13kpwa-v1'; var appshellfiles = [ '/pwa-examples/js13kpwa/', '/pwa-examples/js13kpwa/
index.html', '/pwa-examples/js13kpwa/app.js', '/pwa-examples/js13kpwa/style.css', '/pwa-examples/js13kpwa/fonts/graduate.eot', '/pwa-examples/js13kpwa/fonts/graduate.ttf', '/pwa-examples/js13kpwa/fonts/graduate.woff', '/pwa-examples/js13kpwa/favicon.ico', '/pwa-examples/js13kpwa/img/js13kgames.png', '/pwa-examples/js13kpwa/img/bg.png', '/pwa-examples/js13kpwa/icons/icon-32.png', '/p...
visibility - SVG: Scalable Vector Graphics
it may receive pointer events depending on the pointer-events attribute, may receive focus depending on the tab
index attribute, contributes to bounding box calculations and clipping paths, and does affect text layout.
<pattern> - SVG: Scalable Vector Graphics
value type: <length>|<percentage> ; default value: 0; animatable: yes global attributes core attributes most notably: id, tab
index styling attributes class, style conditional processing attributes most notably: requiredextensions, systemlanguage presentation 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-l...