Search completed in 1.20 seconds.
2219 results for "git":
Your results are loading. Please wait...
Git and GitHub - Learn web development
All developers will use some kind of version control system (VCS), a tool to allow them to collaborate with other developers on a project without danger of them overwriting each other's work, and roll back to previous versions of the code base if a problem is discovered later on. The most popular VCS (at least among web developers) is Git, along with GitHub, a site that provides hosting for your repositories and several tools for working with them. This module aims to teach you what you need to know about both of them. Overview VCSes are essential for software development: It is rare that you will work on a project completely on your own, and as soon as you start working with other people you start to run the risk of conflicting with each other's work -- this is when both of you try to ...
...ersions if a problem is later discovered. You might have started doing this in your own work by creating different versions of the same file, e.g. myCode.js, myCode_v2.js, myCode_v3.js, myCode_final.js, myCode_really_really_final.js, etc., but this is really error-prone and unreliable. ...
... creating different versions of the same file, e.g. myCode.js, myCode_v2.js, myCode_v3.js, myCode_final.js, myCode_really_really_final.js, etc., but this is really error-prone and unreliable. Different team members will commonly want to create their own separate versions of the code (called branches in Git), work on a new feature in that version, and then get it merged in a controlled manner (in GitHub we use pull requests) with the master version when they are done with it. ...
...And 16 more matches
How do I use GitHub Pages? - Learn web development
GitHub is a "social coding" site. It allows you to upload code repositories for storage in the Git version control system. You can then collaborate on code projects, and the system is open-source by default, meaning that anyone in the world can find your GitHub code, use it, learn from it, and improve on it. You can do that with other people's code too! ...
...coding" site. It allows you to upload code repositories for storage in the Git version control system. You can then collaborate on code projects, and the system is open-source by default, meaning that anyone in the world can find your GitHub code, use it, learn from it, and improve on it. You can do that with other people's code too! This article provides a basic guide to publishing content using Github's gh-pages feature. Publishing content GitHub is a very important and useful community to get involved in, and Git/GitHub is a very popular version control system -- most tech companies now use it in their workflow. GitHub has a very useful feature called GitHub Pages, which allows you to publish website code live on the Web. Basic Github setup First of all, install Git on your machine. ...
...y important and useful community to get involved in, and Git/GitHub is a very popular version control system -- most tech companies now use it in their workflow. GitHub has a very useful feature called GitHub Pages, which allows you to publish website code live on the Web. Basic Github setup First of all, install Git on your machine. This is the underlying version control system software that GitHub works on top of. Next, sign up for a GitHub account. It's simple and easy. Once you've signed up, log in to github.com with your username and password. Preparing your code for upload You can store any code you like in a Github repository, but to use the GitHub Pages feature to full effect, your code should be structured as a typical website, e.g. with the primary entry point being an HTML...
...And 13 more matches
Mozilla projects on GitHub
This is a great place to start looking for any projects not listed below. ...
...This is a great place to start looking for any projects not listed below. ...
...This is a great place to start looking for any projects not listed below. ...
...And 4 more matches
Digital Signatures - Archive of obsolete content
d length with the following characteristics: The value of the hash is unique for the hashed data. Any change in the data, even deleting or altering a single character, results in a different value. The content of the hashed data cannot, for all practical purposes, be deduced from the hash-which is why it is called "one-way." Similarly, in public key encryption, a key pair is generated for digital signing. The key pair consists of a private signing key and a public verification key. The public key is widely distributed, while the private key is known only to its proprietor. The keys are related mathematically, but the parameters are chosen so that calculating the private key from the public key is either impossible or prohibitively expensive.The encrypted hash, along with other informati...
...ing key and a public verification key. The public key is widely distributed, while the private key is known only to its proprietor. The keys are related mathematically, but the parameters are chosen so that calculating the private key from the public key is either impossible or prohibitively expensive.The encrypted hash, along with other information, such as the hashing algorithm, is known as a digital signature. Figure 1 shows a simplified view of the way a digital signature can be used to validate the integrity of signed data. Figure 1 shows two items transferred to the recipient of some signed data: the original data and the digital signature, which is basically a one-way hash (of the original data) that has been encrypted with the signer's private key. To validate the integrity of the...
...y a one-way hash (of the original data) that has been encrypted with the signer's private key. To validate the integrity of the data, the receiving software first uses the signer's public key to decrypt the hash. It then uses the same hashing algorithm that generated the original hash to generate a new one-way hash of the same data. (Information about the hashing algorithm used is sent with the digital signature, although this isn't shown in the figure.) Finally, the receiving software compares the new hash against the original hash. If the two hashes match, the data has not changed since it was signed. If they don't match, the data may have been tampered with since it was signed, or the signature may have been created with a private key that doesn't correspond to the public key presented by ...
...And 3 more matches
GeolocationCoordinates.longitude - Web APIs
The GeolocationCoordinates interface's read-only longitude property is a double-precision floating point value which represents the longitude of a geographical position, specified in decimal degrees. Together with a DOMTimeStamp indicating a time of measurement, the GeolocationCoordinates object is part of the GeolocationPosition interface, which is the object type returned by Geolocation API functions that obtain and return a geographical position. Syntax let longitude = geolocationCoordinatesInstance.longitude Value The value in longitude is the geographical longitude of the location on Earth described by the Coordinates object, in decimal degrees. The value is defined by the World Geodetic System 1984 specification (WGS 84). Note: The zero meridian (also known as the prim...
... we fetch the user's location and display the resulting coordinates once they're returned. JavaScript The JavaScript code below creates an event listener so that when the user clicks on a button, the location information is retrieved and displayed. ...
...n, the location information is retrieved and displayed. let button = document.getElementById("get-location"); let latText = document.getElementById("latitude"); let longText = document.getElementById("longitude"); button.addEventListener("click", function() { navigator.geolocation.getCurrentPosition(function(position) { let lat = position.coords.latitude; let long = position.coords.longitude; latText.innerText = lat.toFixed(2); longText.innerText = long.toFixed(2); }); }); After setting up variables to more conveniently reference the button element and the two elements into which the latitude and logitude will be drawn, the event listener is established by calling addEventListener() on the <button> element. When the user clicks the button, we'll fetch and display the l...
...And 3 more matches
Digital audio concepts - Web media technologies
Sampling audio Audio is an inherently analog feature of the natural world. As an object vibrates, it causes the molecules surrounding it to vibrate as well. These molecules affect the ones adjacent to them, and so forth, propagating the vibration in the form of a wave outward from the source until the amplitude of the wave (its volume) fades away with distance. ...
...the higher the amplitude of the wave, and the louder the sound is. The faster the molecules vibrate, the higher the frequency of the wave. The higher the amplitude (height) of the wave, the louder the sound is at that instant. The shorter the wavelength (the closer together the crests of the wave are), the higher the frequency (or pitch) of the sound that's produced. Computers, however, are digital. In order to represent a sound wave in a way computers can manipulate and work with (let alone transmit over a network), the sound has to be converted into a digital form. This process is called analog to digital conversion (A/D for short). The first factor affecting the fidelity of the captured audio is the audio bandwidth; that is, the range of audio frequencies the A/D converter is capable ...
...ave in a way computers can manipulate and work with (let alone transmit over a network), the sound has to be converted into a digital form. This process is called analog to digital conversion (A/D for short). The first factor affecting the fidelity of the captured audio is the audio bandwidth; that is, the range of audio frequencies the A/D converter is capable of capturing and converting into digital form. The audio bandwidth is also affected by the codec, if it chooses to discard any frequency bands while encoding the sound. ...
...And 3 more matches
Git - MDN Web Docs Glossary: Definitions of Web-related terms
Git is a free, open-source, distributed Source Code Management (SCM) system. It facilitates handling code bases with distributed development teams. What sets it apart from previous SCM systems is the ability to do common operations (branching, committing, etc.) on your local development machine, without having to change the master repository or even having write access to it. ...
...e Management (SCM) system. ...
...nt (SCM) system. ...
Digital certificate - MDN Web Docs Glossary: Definitions of Web-related terms
A digital certificate is a data file that binds a publicly known cryptographic key to an organization. A digital certificate contains information about an organization, such as the common name (e.g., mozilla.org), the organization unit (e.g., Mozilla Corporation), and the location (e.g., Mountain View). Digital certificates are most commonly signed by a certificate authority, attesting to the certificate's authenticity. ...
... binds a publicly known cryptographic key to an organization. A digital certificate contains information about an organization, such as the common name (e.g., mozilla.org), the organization unit (e.g., Mozilla Corporation), and the location (e.g., Mountain View). Digital certificates are most commonly signed by a certificate authority, attesting to the certificate's authenticity. ...
Digital video concepts - Web media technologies
transparency). YUV Unlike RGB, the YUV (or Y'UV) color encoding system is based around how humans perceive a color image. Doing so allows color data to be represented using fewer total bits of space in a video stream. The name "YUV" is generally used today to describe this color system, even though the term was originally used specifically for analog coding of color, while YCbCr was used for digital color. However, today both terms are used for digital color. The prime symbol, ', indicates that gamma compression is being used. Contemplating human vision We're able to represent an image this way because the human eye sees far more detail in greyscale than in color, thanks to biology. The human eye contains two kinds of photoreceptor (light-sensing) cells. The rods are highly-sensitive lig...
KeyboardEvent: code values - Web APIs
values on Windows This table shows the Windows scan codes representing keys and the KeyboardEvent.code values which correspond to those hardware keys. Only keys which generate scan codes on Windows are listed. ...
...ndows This table shows the Windows scan codes representing keys and the KeyboardEvent.code values which correspond to those hardware keys. Only keys which generate scan codes on Windows are listed. ...
...Windows scan codes representing keys and the KeyboardEvent.code values which correspond to those hardware keys. Only keys which generate scan codes on Windows are listed. ...
...And 27 more matches
The "codecs" parameter in common media types - Web media technologies
ion 5: Codecs Parameter String. av01.P.LLT.DD[.M[.CCC[.cp[.tc[.mc[.F]]]]]] This codec parameter string's components are described in more detail in the table below. Each component is a fixed number of characters long; if the value is less than that length, it must be padded with leading zeros. AV1 codec parameter string components Component Details P The one-digit profile number: AV1 profile numbers Profile number Description 0 "Main" profile; supports YUV 4:2:0 or monochrome bitstreams with bit depth of 8 or 10 bits per component. 1 "High" profile adds support for 4:4:4 chroma subsampling. 2 "Professional" profile adds supp...
... 0 "Main" profile; supports YUV 4:2:0 or monochrome bitstreams with bit depth of 8 or 10 bits per component. 1 "High" profile adds support for 4:4:4 chroma subsampling. 2 "Professional" profile adds support for 4:2:2 chroma subsampling and 12 bit per component color. LL The two-digit level number, which is converted to the X.Y format level format, where X = 2 + (LL >> 2) and Y = LL & 3. See Appendix A, section 3 in the AV1 Specification for details. T The one-character tier indicator. For the Main tier (seq_tier equals 0), this character is the letter M. For the High tier (seq_tier is 1), this character is the letter H. The High tier is only available for level 4.
...o the X.Y format level format, where X = 2 + (LL >> 2) and Y = LL & 3. See Appendix A, section 3 in the AV1 Specification for details. T The one-character tier indicator. For the Main tier (seq_tier equals 0), this character is the letter M. For the High tier (seq_tier is 1), this character is the letter H. The High tier is only available for level 4.0 and up. ...
...And 25 more matches
Deploying our app - Learn web development
Prerequisites: Familiarity with the core HTML, CSS, and JavaScript languages. Objective: To finish working through our complete toolchain case study, focusing on deploying the app. ...
...purpose. Netlify, amongst other things, also allows you to run pre-deployment tasks, which in our case means that all the production code build processes can be performed inside of Netlify and if the build is successful, the website changes will be deployed. Although Netlify offers a drag and drop deployment service, we are intending to trigger a new deployment to Netlify each time we push to a GitHub repo. It's exactly these kinds of connected services that we would encourage you to look for when deciding on your own build toolchain. We can commit our code and push to GitHub and the updated code will automatically trigger the entire build routine. If all is well, we get a live change deployed automatically. The only action we need to perform is that initial "push". However, we do have to...
...ing on filenames. The newly-created production code is placed in a new directory called dist, which contains all the files required to run the website, ready for you to upload to a server. However, doing this step manually isn't our final aim -- what we want is for the build to happen automatically and the result of the dist directory to be deployed live on our website. This is where our code, GitHub, and Netlify need to be set up to talk to one another, so that each time we update our GitHub code repository, Netlify will automatically pick up the changes, run the build tasks, and finally release a new update. We're going to add the build command to our package.json file as an npm script, so that the command npm run build will trigger the build process. This step isn't necessary, but it i...
...And 24 more matches
Introduction to Public-Key Cryptography - Archive of obsolete content
related standards and techniques underlie the security features of many products such as signed and encrypted email, single sign-on, and Secure Sockets Layer (SSL) communications. This document introduces the basic concepts of public-key cryptography. For an overview of SSL, see "Introduction to SSL." For an overview of encryption and decryption, see "Encryption and Decryption." Information on digital signatures is available from "Digital Signatures." Public-key cryptography is a set of well-established techniques and standards for protecting communications from eavesdropping, tampering, and impersonation attacks. Encryption and decryption allow two communicating parties to disguise information they send to each other. The sender encrypts, or scrambles, information before sending it. The...
...ch other. The sender encrypts, or scrambles, information before sending it. The receiver decrypts, or unscrambles, the information after receiving it. While in transit, the encrypted information is unintelligible to an intruder. Tamper detection allows the recipient of information to verify that it has not been modified in transit. Any attempt to modify data or substitute a false message for a legitimate one will be detected. Authentication allows the recipient of information to determine its origin-that is, to confirm the sender's identity. Nonrepudiation prevents the sender of information from claiming at a later date that the information was never sent. The sections that follow introduce the concepts of public-key cryptography that underlie these capabilities. Certificates and Auth...
...public key certified by the certificate will work with the corresponding private key possessed by the entity identified by the certificate. In addition to a public key, a certificate always includes the name of the entity it identifies, an expiration date, the name of the CA that issued the certificate, a serial number, and other information. Most importantly, a certificate always includes the digital signature of the issuing CA. The CA's digital signature allows the certificate to function as a "letter of introduction" for users who know and trust the CA but don't know the entity identified by the certificate. For more information about the role of CAs, see "How CA Certificates Are Used to Establish Trust". Authentication Confirms an Identity Authentication is the process of confirming a...
...And 19 more matches
Deployment and next steps - Learn web development
pros and cons of using TypeScript. Even if you are not planning to adopt it, this article will be useful for allowing you to learn what it has to offer and help you make your own decision. If you are not interested at all in TypeScript, you can skip to the next chapter, where we will look at different options for deploying our Svelte applications, further resources, and more. Code along with us Git Clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git Then to get to the current app state, run cd mdn-svelte-tutorial/08-next-steps Or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/08-next-steps Remember to run npm install && npm run dev to start your app in development mode. Compiling our...
...y now. You might get a warning, but you can ignore this for now. Our whole app is now just 21 KB -- 8.3 KB when gzipped. There are no additional runtimes or dependencies to download, parse, execute, and keep running in memory. Svelte analyzed our components and compiled the code to vanilla JavaScript. A look behind the Svelte compilation process By default, when you create a new app with npx degit sveltejs/template my-svelte-project, Svelte will use rollup as the module bundler. Note: There is also an official template for using webpack and also many community-maintained plugins for other bundlers. In the file package.json you can see that the dev and start scripts are just calling rollup: "scripts": { "build": "rollup -c", "dev": "rollup -c -w", "start": "sirv public" }, In th...
...] [19s] Deployed to production. Run `vercel --prod` to overwrite later (https://vercel.link/2F). To change the domain or build command, go to https://zeit.co/opensas/mdn-svelte-tutorial/settings Accept all the defaults, and you'll be fine. Once it has finished deploying, go to the "Production" URL in your browser, and you'll see the app deployed! You can also import a Svelte git project into Vercel from GitHub, GitLab, or BitBucket. Note: you can globally install Vercel with npm i -g vercel so you don't have to use npx to run it. Automatic deployment to GitLab pages For hosting static files there are several online services that allow you to automatically deploy your site whenever you push changes to a git repository. Most of them involve setting up a deployment pip...
...And 18 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
ter area) is a top-level domain used for Internet infrastructure purposes, especially reverse DNS lookup (i.e., find the domain name for a given IP address). 8 ASCII Glossary, Infrastructure ASCII (American Standard Code for Information Interchange) is one of the most popular coding method used by computers for converting letters, numbers, punctuation and control codes into digital form. Since 2007, UTF-8 superseded it on the Web. 9 ATAG ATAG, Accessibility, Authoring Tool Accessibility Guidelines, Glossary ATAG (Authoring Tool Accessibility Guidelines) is a W3C recommendation for building accessible-authoring tools that produce accessible contents. 10 Abstraction Abstraction, Coding, CodingScripting, Glossary, Programming Language ...
... 17 Alignment subject Alignment subject, CSS, Glossary, alignment In CSS Box Alignment the alignment subject is the thing (or things) being aligned by the property. 18 Alpha (alpha channel) Alpha, Alpha Channel, Drawing, Glossary, Graphics, Translucency, Translucent, Transparency, Transparent, WebGL, WebXR, channel, color, pixel Colors are represented in digital form as a collection of numbers, each representing the strength or intensity level of a given component of the color. Each of these components is called a channel. In a typical image file, the color channels describe how much red, green, and blue are used to make up the final color. To represent a color through which the background can be seen to some extent, a fourth channel is added to the co...
... cards, and then arranging the cards into piles. 67 CardDAV CardDAV, Glossary, Infrastructure CardDAV (vCard Extension to WebDAV) is a protocol standardized by the IETF and used to remote-access or share contact information over a server. 68 Certificate authority Cryptography, Glossary, Security A certificate authority (CA) is an organization that signs digital certificates and their associated public keys. This certifies that an organization that requested a digital certificate (e.g., Mozilla Corporation) is authorized to request a certificate for the subject named in the certificate (e.g., mozilla.org). 69 Certified Apps, B2G, Firefox OS, Glossary, Security, Trustworthy Certified means that an application, content or data transm...
...And 14 more matches
Index
from a memory dump. NSS uses many C data structures. Often NSS has multiple implementations for the same or similar concepts. For example, there are multiple presentations of certificates, and the NSS internals (and sometimes even the application using NSS) might have to convert between them. Key responsibilites of NSS are verification of signatures and certificates. In order to verify a digital signature, we have to look at the application data (e.g., a document that was signed), the signature data block (the digital signature), and a public key (as found in a certificate that is believed to be the signer, e.g., identified by metadata received together with the signature). The signature is verified if it can be shown that the signature data block must have been produced by the owner o...
...ript and the required libraries must be bundled in a JAR file, which is specified with the -jar argument. modutil -dbdir sql:/home/mt"jar-install-filey/sharednssdb -jar install.jar -installdir sql:/home/my/sharednssdb This installation JAR file was signed by: ---------------------------------------------- **SUBJECT NAME** C=US, ST=California, L=Mountain View, CN=Cryptorific Inc., OU=Digital ID Class 3 - Netscape Object Signing, OU="www.verisign.com/repository/CPS Incorp. by Ref.,LIAB.LTD(c)9 6", OU=www.verisign.com/CPS Incorp.by Ref . LIABILITY LTD.(c)97 VeriSign, OU=VeriSign Object Signing CA - Class 3 Organization, OU="VeriSign, Inc.", O=VeriSign Trust Network **ISSUER NAME**, OU=www.verisign.com/CPS Incorp.by Ref. LIABILITY LTD.(c)97 VeriSign, OU=VeriSign Object Signing C...
... the course of the installation. Typically, this string is used for a setup program provided by a module vendor, such as a self-extracting setup executable. More than one file can be specified as executable, in which case the files are run in the order in which they are specified in the script file. FilePermissions sets permissions on any referenced files in a string of octal digits, according to the standard Unix format. This string is a bitwise OR. user read: 0400 user write: 0200 user execute: 0100 group read: 0040 group write: 0020 group execute: 0010 other read: 0004 other write: 0002 other execute: 0001 Some platforms may not understand thes...
...And 13 more matches
Index - Web APIs
Web › API › Index
n and altitude of the device on Earth, as well as the accuracy with which these properties are calculated. 668 Coordinates.accuracy API, Coordinates, Geolocation API, Property, Secure context, accuracy The Coordinates.accuracy read-only property is a strictly positive double representing the accuracy, with a 95% confidence level, of the Coordinates.latitude and Coordinates.longitude properties expressed in meters. 669 Coordinates.altitude API, Coordinates, Geolocation API, Property, Secure context, altitude The Coordinates.altitude read-only property is a double representing the altitude of the position in meters, relative to sea level. This value is null if the implementation cannot provide this data. 670 Coordinates.altitudeAccuracy A...
... 270 degrees). If Coordinates.speed is 0, heading is NaN. If the device is not able to provide heading information, this value is null. 672 Coordinates.latitude API, Coordinates, Geolocation API, Property, Secure context, latitude The Coordinates.latitude read-only property is a double representing the latitude of the position in decimal degrees. 673 Coordinates.longitude API, Coordinates, GPS, Geolocation, Geolocation API, Global Positioning System, Property, Read-only, Reference, Secure context, longitude The Coordinates interface's read-only longitude property is a double-precision floating point value which represents the longitude of a geographical position, specified in decimal degrees. Together with a DOMTimeStamp indicating a time of measureme...
... by panning, zooming, or scrolling. 999 Document: pointerdown event API, Document, Event, PointerEvent, Reference, onpointerdown, pointerdown The pointerdown event is fired when a pointer becomes active. For mouse, it is fired when the device transitions from no buttons depressed to at least one button depressed. For touch, it is fired when physical contact is made with the digitizer. For pen, it is fired when the stylus makes physical contact with the digitizer. 1000 Document: pointerenter event API, Document, Event, PointerEvent, Reference, onpointerenter, pointerenter The pointerenter event fires when a pointing device is moved into the hit test boundaries of an element or one of its descendants, including as a result of a pointerdown event from a ...
...And 13 more matches
Intl.Locale.prototype.numberingSystem - JavaScript
operty helps to represent the different numeral systems used by various countries, regions, and cultures around the world. As with most internationalization schemas, the numeral systems that can be represented in a Locale object by numberingSystem are standardized by Unicode. A table of the standard Unicode numeral systems can be seen below. ...
... different numeral systems used by various countries, regions, and cultures around the world. As with most internationalization schemas, the numeral systems that can be represented in a Locale object by numberingSystem are standardized by Unicode. A table of the standard Unicode numeral systems can be seen below. ...
...rious countries, regions, and cultures around the world. As with most internationalization schemas, the numeral systems that can be represented in a Locale object by numberingSystem are standardized by Unicode. A table of the standard Unicode numeral systems can be seen below. ...
...And 13 more matches
JSON - JavaScript
avaScript and JSON differences JSON is a syntax for serializing objects, arrays, numbers, strings, booleans, and null. It is based upon JavaScript syntax but is distinct from it: some JavaScript is not JSON. Objects and Arrays Property names must be double-quoted strings; trailing commas are forbidden. Numbers Leading zeros are prohibited. A decimal point must be followed by at least one digit. NaN and Infinity are unsupported. Any JSON text is a valid JavaScript expression... ...But only in JavaScript engines that have implemented the proposal to make all JSON text valid ECMA-262. In engines that haven't implemented the proposal, U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR are allowed in string literals and property keys in JSON; but their use in these features in JavaScrip...
...y configuration format based on JSON, there is JSON5, used by the Babel compiler, and the more commonly used YAML. Full JSON syntax The full JSON syntax is as follows: JSON = null or true or false or JSONNumber or JSONString or JSONObject or JSONArray JSONNumber = - PositiveNumber or PositiveNumber PositiveNumber = DecimalNumber or DecimalNumber . ...
...ere is JSON5, used by the Babel compiler, and the more commonly used YAML. Full JSON syntax The full JSON syntax is as follows: JSON = null or true or false or JSONNumber or JSONString or JSONObject or JSONArray JSONNumber = - PositiveNumber or PositiveNumber PositiveNumber = DecimalNumber or DecimalNumber . Digits or DecimalNumber . ...
...And 10 more matches
Introducing a complete toolchain - Learn web development
u an idea of how a non-native web language could be integrated into a toolchain. The latest built-in JavaScript features (at time of writing), such as import. Useful development tools such as Prettier for formatting and eslint for linting. PostCSS to provide CSS nesting capabilities. Parcel to build and minify our code, and to write a bunch of configuration file content automatically for us. GitHub to manage our source code control. Netlify to automate our deployment process. You may not be familiar with all the above features and tools or what they are doing, but don't panic -- we'll explain each part as we move through this article. Toolchains and their inherent complexity As with any chain, the more links you have in your toolchain, the more complex and potentially brittle it is ...
...s project has only 4 SVG images, which were manually minified using SVGO before adding them to the project. A couple of prerequisites Besides the tools we're going to install that contribute to our toolchain, we mentioned two web services in the above list of tools. Let's take this opportunity to make sure we are set up with them before we continue. You will need to create accounts with each of GitHub and Netlify if you wish to complete the tutorial. As mentioned previously, GitHub is a source code repository service that adds community features such as issue tracking, following project releases and much more. In the next chapter we will push to a GitHub code repository, which will cause a cascade effect that (should) deploy all the software to a home on the web. Netlify is a hosting se...
...all the software to a home on the web. Netlify is a hosting service for static websites (that is, websites that entirely consist of files that do not change in real time), which lets us deploy multiple times a day and freely hosts static sites of all kinds. Netlify is what provides the "home on the web" mentioned above -- free hosting for us to deploy our test app to. ...
...And 9 more matches
Getting started with Svelte - Learn web development
(the node package runner). Note that you can also use the Yarn package manager in place of npm, but we'll assume you are using npm in this set of tutorials. See Package management basics for more information on npm and yarn. If you're using Windows, you will need to install some software to give you parity with Unix/macOS terminal in order to use the terminal commands mentioned in this tutorial. Gitbash (which comes as part of the git for Windows toolset) or Windows Subsystem for Linux (WSL) are both suitable. Cmder is another very good and complete alternative. See Command line crash course for more information on these, and on terminal commands in general. Also see the following for more information: "What is npm" on nodejs.org "Introducing npx" on the npm blog "The easiest way to ge...
...and on terminal commands in general. Also see the following for more information: "What is npm" on nodejs.org "Introducing npx" on the npm blog "The easiest way to get started with Svelte" on the svelte blog Creating your first Svelte app The easiest way to create a starter app template is to just download the starter template application. You can do that by visiting sveltejs/template on GitHub or you can avoid having to download and unzip it and just use degit. To create your starter app template, run the following terminal commands: npx degit sveltejs/template moz-todo-svelte cd moz-todo-svelte npm install npm run dev Note: degit doesn't do any kind of magic -- it just lets you download and unzip the latest version of a git repo's contents. This is much quicker than using git c...
...tart a local server at localhost:5000. Svelte will watch for file updates, and automatically recompile and refresh the app for you when changes are made to the source files. 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. ...
...And 8 more matches
Date and time formats used in HTML - HTML: Hypertext Markup Language
ay allow entry of dates using other calendars, the underlying value always uses the Gregorian calendar. While the Gregorian calendar wasn't created until the year 1582 (replacing the similar Julian calendar), for HTML's purposes, the Gregorian calendar is extended back to the year 1 C.E. Make sure any older dates account for this. For the purposes of HTML dates, years are always at least four digits long; years prior to the year 1000 are padded with leading zeroes ("0"), so the year 72 is written as 0072. Years prior to the year 1 C.E. are not supported, so HTML doesn't support years 1 B.C.E. (1 B.C.) or earlier. A year is normally 365 days long, except during leap years. Leap years A leap year is any year which is divisible by 400 or the year is divisible by 4 but not by 100. Although t...
...entists occasionally add leap seconds to the calendar (seriously) to handle the remaining three ten-thousandths of a day and to compensate for the gradual, naturally occurring slowing of Earth's rotation. While month 02, February, normally has 28 days, it has 29 days in leap years. Months of the year There are 12 months in the year, numbered 1 through 12. They are always represented by a two-digit ASCII string whose value ranges from 01 through 12. See the table in the section Days of the month for the month numbers and their corresponding names (and lengths in days). Days of the month Month numbers 1, 3, 5, 7, 8, 10, and 12 are 31 days long. Months 4, 6, 9, and 11 are 30 days long. Month 2, February, is 28 days long most years, but is 29 days long in leap years. This is detailed in the ...
... July 31 o8 August 31 09 September 30 10 October 31 11 November 30 12 December 31 Week strings A week string specifies a week within a particular year. A valid week string consists of a valid year number, followed by a hyphen character ("-", or U+002D), then the capital letter "W" (U+0057), followed by a two-digit week of the year value. The week of the year is a two-digit string between 01 and 53. Each week begins on Monday and ends on Sunday. That means it's possible for the first few days of January to be considered part of the previous week-year, and for the last few days of December to be considered part of the following week-year. The first week of the year is the week that conains the first Thursda...
...And 8 more matches
Content type - SVG: Scalable Vector Graphics
No embedded white space is allowed in clock values, although leading and trailing wh...
...No embedded white space is allowed in clock values, although leading and trailing white space characters will be ignored. The followi...
...No embedded white space is allowed in clock values, although leading and trailing white space characters will be ignored. The following are examples of legal clock values: Full c...
...And 8 more matches
NSS tools : signtool
Electronic software distribution over any network involves potential security problems. ...
...pression Level] ] [[-d cert-dir] ] [[-i installer script] ] [[-m metafile] ] [[-x name] ] [[-f filename] ] [[-t|--token tokenname] ] [[-e extension] ] [[-o] ] [[-z] ] [[-X] ] [[--outfile] ] [[--verbose value] ] [[--norecurse] ] [[--leavearc] ] [[-j directory] ] [[-Z jarfile] ] [[-O] ] [[-p password] ] [directory-tree] [archive] Description The Signing Tool, signtool, creates digital signatures and uses a Java Archive (JAR) file to associate the signatures with files in a directory. Electronic software distribution over any network involves potential security problems. To help address some of these problems, you can associate digital signatures with the files in a JAR archive. Digital signatures allow SSL-enabled clients to perform two important operations: ...
...ith files in a directory. Electronic software distribution over any network involves potential security problems. To help address some of these problems, you can associate digital signatures with the files in a JAR archive. Digital signatures allow SSL-enabled clients to perform two important operations: * Confirm the identity of the individual, company, or other entity whose digital signature is associated with the files * Check whether the files have been tampered with since being signed If you have a signing certificate, you can use Netscape Signing Tool to digitally sign files and package them as a JAR file. An object-signing certificate is a special kind of certificate that allows you to associate your digital signature with one or more files. An i...
...And 7 more matches
Index - Learn web development
r, Composing, NeedsActiveLearning, needsSchema When starting with a web project, many people focus on the technical side. Of course you must be familiar with the technique of your craft, but what really matters is what you want to accomplish. Yes, it seems obvious, but too many projects fail not from a lack of technical know-how, but from lack of goals and vision. 17 How do I use GitHub Pages? Beginner, GitHub, Guide, Web, gh-pages, git, publish GitHub is a "social coding" site. It allows you to upload code repositories for storage in the Git version control system. You can then collaborate on code projects, and the system is open-source by default, meaning that anyone in the world can find your GitHub code, use it, learn from it, and improve on it. You can do that ...
...coding" site. It allows you to upload code repositories for storage in the Git version control system. You can then collaborate on code projects, and the system is open-source by default, meaning that anyone in the world can find your GitHub code, use it, learn from it, and improve on it. You can do that with other people's code too! This article provides a basic guide to publishing content using Github's gh-pages feature. 18 How do you host your website on Google App Engine? Beginner, Google App Engine, Google Cloud Platform, Guide, Host, Learn, Web, publish, website Google App Engine is a powerful platform that lets you build and run applications on Google's infrastructure -- whether you need to build a multi-tiered web application from scratch or host a static website.
...-side, servers Throughout most of the learning area, we tell you to just open your examples directly in a browser -- this can be done by double clicking the HTML file, dragging and dropping it into the browser window, or choosing File > Open... and navigating to the HTML file. There are many ways to achieve this. 21 How do you upload your files to a web server? Beginner, FTP, GitHub, Uploading, WebMechanics, hosting, rsync, sftp If you have built a simple web page (see HTML basics for an example), you will probably want to put it online, on a web server. In this article we'll discuss how to do that, using various available options such as SFTP clients, RSync and GitHub. 22 How does the Internet work? Beginner, Tutorial, WebMechanics The Internet...
...And 6 more matches
text-combine-upright - CSS: Cascading Style Sheets
than 1em, the user agent must fit the contents within 1em. The resulting composition is treated as a single upright glyph for layout and decoration. This property only has an effect in vertical writing modes. This is used to produce an effect that is known as tate-chu-yoko (???) in Japanese, or as ???? in Chinese. /* Keyword values */ text-combine-upright: none; text-combine-upright: all; /* Digits values */ text-combine-upright: digits; /* fits 2 consecutive digits horizontally inside vertical text */ text-combine-upright: digits 4; /* fits up to 4 consecutive digits horizontally inside vertical text */ /* Global values */ text-combine-upright: inherit; text-combine-upright: initial; text-combine-upright: unset; Syntax Values none There is no special processing. all Attemp...
...If the integer is omitted, it computes to 2. Integers outside the range of 2-4 are invalid. ...
...*/ text-combine-upright: inherit; text-combine-upright: initial; text-combine-upright: unset; Syntax Values none There is no special processing. all Attempts to typeset all consecutive characters within the box horizontally, such that they take up the space of a single character within the vertical line of the box. digits <integer>? Attempts to display a sequence of consecutive ASCII digits (U+0030-U+0039) that has as many or fewer characters than the specified integer, such that it takes up the space of a single character within the vertical line box. If the integer is omitted, it computes to 2. Integers outside the range of 2-4 are invalid. Formal definition Initial valuenoneApplies tonon-replaced inline elementsInheritedyesComputed valuespecified keyword, plus integer if 'dig...
...And 6 more matches
Progressive web app structure - Progressive web apps (PWAs)
</head> <body> <header> <p><a class="logo" href="http://js13kgames.com"><img src="img/js13kgames.png" alt="js13kGames"></a></p> </header> <main> <h1>js13kGames A-Frame entries</h1> <p class="description">List of games submitted to the <a href="http://js13kgames.com/aframe">A-Frame category</a> in the <a href="http://2017.js13kgames.com">js13kGames 2017</a> competition. ...
....com"><img src="img/js13kgames.png" alt="js13kGames"></a></p> </header> <main> <h1>js13kGames A-Frame entries</h1> <p class="description">List of games submitted to the <a href="http://js13kgames.com/aframe">A-Frame category</a> in the <a href="http://2017.js13kgames.com">js13kGames 2017</a> competition. ...
...erates the content based on this template: var template = "<article>\n\ <img src='data/img/SLUG.jpg' alt='NAME'>\n\ <h3>#POS. ...
...And 6 more matches
Introduction to SSL - Archive of obsolete content
nce that the identity associated with the public key is in fact the server with which the client is connected. Otherwise, the server cannot decrypt the premaster secret and cannot generate the symmetric keys required for the session, and the session will be terminated. In the case of client authentication, the client encrypts some random data with the client's private key-that is, it creates a digital signature. The public key in the client's certificate can correctly validate the digital signature only if the corresponding private key was used. Otherwise, the server cannot validate the digital signature and the session is terminated. The sections that follow provide more details on server authentication and client authentication. Server Authentication Red Hat's SSL-enabled client softwa...
...t. If the distinguished name (DN) of the issuing CA matches the DN of a CA on the client's list of trusted CAs, the answer to this question is yes, and the client goes on to Step 3. If the issuing CA is not on the list, the server will not be authenticated unless the client can verify a certificate chain ending in a CA that is on the list. Does the issuing CA's public key validate the issuer's digital signature? The client uses the public key from the CA's certificate (which it found in its list of trusted CAs in step 2) to validate the CA's digital signature on the server certificate being presented. If the information in the server certificate has changed since it was signed by the CA or if the CA certificate's public key doesn't correspond to the private key used by the CA to sign the ser...
...At this point, the client has determined that the server certificate is valid. It is the client's responsibility to take Step 4 before Step 5. ...
...And 5 more matches
Drawing graphics - Learn web development
; you can adjust the lineWidth property value to change this (it takes a number representing the number of pixels wide the stroke is). Add the following line in between the previous two lines: ctx.lineWidth = 5; Now you should see that your white outline has become much thicker! That's it for now. At this point your example should look like this: Note: The finished code is available on GitHub as 2_canvas_rectangles.html. Drawing paths If you want to draw anything more complex than a rectangle, you need to draw a path. Basically, this involves writing code to specify exactly what path the pen should move along on your canvas to trace the shape you want to draw. Canvas includes functions for drawing straight lines, circles, Bezier curves, and more. Let's start the section off by ...
...of the circle chopped off between the start and end point of the arc. This illustrates another important point of the canvas -- if you try to fill an incomplete path (i.e. one that is not closed), the browser fills in a straight line between the start and end point and then fills it in. That's it for now; your final example should look like this: Note: The finished code is available on GitHub as 3_canvas_paths.html. Note: To find out more about advanced path drawing features such as Bezier curves, check out our Drawing shapes with canvas tutorial. Text Canvas also has features for drawing text. Let's explore these briefly. Start by making another fresh copy of our canvas template (1_canvas_template.html) in which to draw the new example. Text is drawn using two methods: f...
...following block to the bottom of your JavaScript: ctx.strokeStyle = 'white'; ctx.lineWidth = 1; ctx.font = '36px arial'; ctx.strokeText('Canvas text', 50, 50); ctx.fillStyle = 'red'; ctx.font = '48px georgia'; ctx.fillText('Canvas text', 50, 150); Here we draw two lines of text, one outline and the other stroke. The final example should look like so: Note: The finished code is available on GitHub as 4_canvas_text.html. Have a play and see what you can come up with! You can find more information on the options available for canvas text at Drawing text. Drawing images onto canvas It is possible to render external images onto your canvas. These can be simple images, frames from videos, or the content of other canvases. For the moment we'll just look at the case of using some simple im...
...And 5 more matches
TypeScript support in Svelte - Learn web development
pros and cons of using TypeScript. Even if you are not planning to adopt it, this article will be useful for allowing you to learn what it has to offer and help you make your own decision. If you are not interested at all in TypeScript, you can skip to the next chapter, where we will look at different options for deploying our Svelte applications, further resources, and more. ...
...f using TypeScript. Even if you are not planning to adopt it, this article will be useful for allowing you to learn what it has to offer and help you make your own decision. If you are not interested at all in TypeScript, you can skip to the next chapter, where we will look at different options for deploying our Svelte applications, further resources, and more. Code along with us Git Clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git Then to get to the current app state, run cd mdn-svelte-tutorial/07-typescript-support Or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/07-typescript-support Remember to run npm install && npm run dev to start your app in development mode. REPL Unfort...
...TypeScript support has been Svelte's most requested feature for quite some time. Thanks to the hard work of the Svelte team, together with many contributors, we have an official solution ready to be put to the test. In this section we'll show you how to setup a Svelte project With TypeScript support to give it a try. Why TypeScript? Recently TypeScript has seen enormous growth. From last year's GitHub octoverse report we can see that TypeScript is the 7th most used and 5th fastest growing language used on GitHub. According to StackOverflow's 2019 Developer Survey it is the third most loved language, right behind Rust and Python. So TypeScript is going through a great phase of adoption. TypeScript's main advantages are: Early spotted bugs: The compiler checks types at compile time and p...
...And 5 more matches
Making cross-thread calls using runnables
-passing framework that uses the nsIRunnable interface. Each runnable represents a task which can then be dispatched to another thread for execution. Note: JavaScript code cannot use the techniques described in this article. Chrome JavaScript should instead use workers. In general, threading and message passing should be asynchronous. For example, let's say we have a function, CalculatePi(int digits), which will calculate ? to an arbitrary number of digits: void CalculatePi(int digits, nsCString& result); // This is synchronous This can take a while, so we don't want to run this on the main thread. Instead, we want to run it on a new thread and be notified when the result is available. So we declare an asynchronous version of the same function: typedef void (*PiCallback)(const nsCString& r...
...In our example, we actually need two runnables: one dispatched to the worker thread, and one to hand us back the result. ...
...estroy the thread when we're done with it, it will hang around forever... bad! // But thread->Shutdown must be called from the main thread, not from the thread itself. ...
...And 5 more matches
Character classes - JavaScript
Types The following table is also duplicated on this cheatsheet. Do not forget to edit it as well, thanks! Characters Meaning . Has one of the following meanings: Matches any single character except line terminators: \n, \r, \u2028 or \u2029. For example, /.y/ matches "my" and "ay", but not "yes", in "yes make my day". Inside a character set, the dot loses its special meaning and matches a literal dot. Note that the m multiline flag doesn't change the dot behavior. ...
...set, the dot loses its special meaning and matches a literal dot. Note that the m multiline flag doesn't change the dot behavior. So to match a pattern across multiple lines, the character set [^] can be used -- it will match any character including newlines. ES2018 added the s "dotAll" flag, which allows the dot to also match line terminators. \d Matches any digit (Arabic numeral). Equivalent to [0-9]. For example, /\d/ or /[0-9]/ matches "2" in "B2 is the suite number". \D Matches any character that is not a digit (Arabic numeral). Equivalent to [^0-9]. For example, /\D/ or /[^0-9]/ matches "B" in "B2 is the suite number". \w Matches any alphanumeric character from the basic Latin alphabet, including the underscor...
...foo" in "foo bar". \t Matches a horizontal tab. \r Matches a carriage return. \n Matches a linefeed. \v Matches a vertical tab. \f Matches a form-feed. [\b] Matches a backspace. If you're looking for the word-boundary character (\b), see Boundaries. \0 Matches a NUL character. Do not follow this with another digit. \cX Matches a control character using caret notation, where "X" is a letter from A-Z (corresponding to codepoints U+0001-U+001F). For example, /\cM/ matches "\r" in "\r\n". \xhh Matches the character with the code hh (two hexadecimal digits). \uhhhh Matches a UTF-16 code-unit with the value hhhh (four hexadecimal digits). \u{hhhh} or \u{hhhhh...
...And 5 more matches
Number.prototype.toExponential() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax numObj.toExponential([fractionDigits]) Parameters fractionDigits Optional. An integer specifying the number of digits after the decimal point. Defaults to as many digits as necessary to specify the number. ...
...The toExponential() method returns a string representing the Number object in exponential notation. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax numObj.toExponential([fractionDigits]) Parameters fractionDigits Optional. An integer specifying the number of digits after the decimal point. ...
... source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax numObj.toExponential([fractionDigits]) Parameters fractionDigits Optional. An integer specifying the number of digits after the decimal point. Defaults to as many digits as necessary to specify the number. Return value A string representing the given Number object in exponential notation with one digit before the decimal point, rounded to fractionDigits digits after the decimal point. Exceptions RangeError If fractionDigits is too small or too large. Values between 0 and 20, inclusive, will not cause a RangeError. Implementations are allowed to support l...
...And 5 more matches
Lexical grammar - JavaScript
by older ECMAScript specifications (ECMAScript 1 till 3). abstract boolean byte char double final float goto int long native short synchronized throws transient volatile Additionally, the literals null, true, and false cannot be used as identifiers in ECMAScript. Reserved word usage Reserved words actually only apply to Identifiers (vs. IdentifierNames) . As described in es5.github.com/#A.1, these are all IdentifierNames which do not exclude ReservedWords. a.import a['import'] a = { import: 'test' }. On the other hand the following is illegal because it's an Identifier, which is an IdentifierName without the reserved words. Identifiers are used for FunctionDeclaration, FunctionExpression, VariableDeclaration and so on. IdentifierNames are used for MemberExpression, Ca...
... also null for more information. null Boolean literal See also Boolean for more information. true false Numeric literals The Number and BigInt types use numeric literals. Decimal 1234567890 42 // Caution when using with a leading zero: 0888 // 888 parsed as decimal 0777 // parsed as octal, 511 in decimal Note that decimal literals can start with a zero (0) followed by another decimal digit, but If all digits after the leading 0 are smaller than 8, the number is interpreted as an octal number. This won't throw in JavaScript, see bug 957513. See also the page about parseInt() Exponential The decimal exponential literal is specified by the following format: beN; where b is a base number (integer or floating), followed by e char (which serves as separator or exponent indicator) and N...
...ch is exponent or power number - a signed integer (as per 2019 ECMA-262 specs): 0e-5 // => 0 0e+5 // => 0 5e1 // => 50 175e-2 // => 1.75 1e3 // => 1000 1e-3 // => 0.001 Binary Binary number syntax uses a leading zero followed by a lowercase or uppercase Latin letter "B" (0b or 0B). Because this syntax is new in ECMAScript 2015, see the browser compatibility table, below. If the digits after the 0b are not 0 or 1, the following SyntaxError is thrown: "Missing binary digits after 0b". var FLT_SIGNBIT = 0b10000000000000000000000000000000; // 2147483648 var FLT_EXPONENT = 0b01111111100000000000000000000000; // 2139095040 var FLT_MANTISSA = 0B00000000011111111111111111111111; // 8388607 Octal Octal number syntax uses a leading zero followed by a lowercase or uppercase Latin le...
...And 5 more matches
Structural overview of progressive web apps - Progressive web apps (PWAs)
<header> <p><a class="logo" href="http://js13kgames.com"><img src="img/js13kgames.png" alt="js13kGames"></a></p> </header> <main> <h1>js13kGames A-Frame entries</h1> <p class="description">List of games submitted to the <a href="http://js13kgames.com/aframe"> A-Frame category</a> in the <a href="http://2017.js13kgames.com">js13kGames 2017</a> competition. ...
...3kgames.png" alt="js13kGames"></a></p> </header> <main> <h1>js13kGames A-Frame entries</h1> <p class="description">List of games submitted to the <a href="http://js13kgames.com/aframe"> A-Frame category</a> in the <a href="http://2017.js13kgames.com">js13kGames 2017</a> competition. ...
...ent using the following template: var template = "<article>\n\ <img src='data/img/SLUG.jpg' alt='NAME'>\n\ <h3>#POS. ...
...And 5 more matches
Release notes - Archive of obsolete content
Firefox 35 Highlights Added access keys for context menu. Removed isPrivateBrowsing from BrowserWindow. Details GitHub commits made between Firefox 34 and Firefox 35. This will not include any uplifts made after this release entered Aurora. Bugs fixed between Firefox 34 and Firefox 35. This will not include any uplifts made after this release entered Aurora. Firefox 34 Highlights New API: dev/panel enables you to extend the Firefox Developer Tools. jpm beta released. "./my-file" introduced everywhere as an alias for require("sdk/self").data.url("my-file") Added the ability to attach stylesheets to individual tabs. Details GitHub commits made between Firefox 33 and Firefox 34. This will not include any uplifts made after this release entered Aurora. Bugs fixed between Fir...
...ixed between Firefox 33 and Firefox 34. This will not include any uplifts made after this release entered Aurora. Firefox 33 Highlights Added support for context menus in panels via a new option in the Panel constructor. Added tab.readyState. Added a BrowserWindow parameter to sidebar.show() and sidebar.hide(), to control the window for which the sidebar will be shown or hidden. Details GitHub commits made between Firefox 32 and Firefox 33. This will not include any uplifts made after this release entered Aurora. Bugs fixed between Firefox 32 and Firefox 33. This will not include any uplifts made after this release entered Aurora. Firefox 32 Highlights Added exclude option to PageMod. Added anonymous option to Request. Add-on Debugger now includes a Console and a Scratchpad.
...made between Firefox 32 and Firefox 33. This will not include any uplifts made after this release entered Aurora. Bugs fixed between Firefox 32 and Firefox 33. This will not include any uplifts made after this release entered Aurora. Firefox 32 Highlights Added exclude option to PageMod. Added anonymous option to Request. Add-on Debugger now includes a Console and a Scratchpad. Details GitHub commits made between Firefox 31 and Firefox 32. This will not include any uplifts made after this release entered Aurora. Bugs fixed between Firefox 31 and Firefox 32. This will not include any uplifts made after this release entered Aurora. Firefox 31 Highlights Add-on Debugger Added the ability to convert between high-level BrowserWindow objects and DOM windows, and between high-level...
...And 4 more matches
Client-side form validation - Learn web development
, valueMissing, or a customError. Built-in form validation examples In this section, we'll test out some of the attributes that we discussed above. Simple start file Let's start with a simple example: an input that allows you to choose whether you prefer a banana or a cherry. This example involves a simple text <input> with an associated <label> and a submit <button>. Find the source code on GitHub at fruit-start.html and a live example below. <form> <label for="choose">Would you prefer a banana or cherry?</label> <input id="choose" name="i_like"> <button>Submit</button> </form> input:invalid { border: 2px dashed red; } input:valid { border: 2px solid black; } To begin, make a copy of fruit-start.html in a new directory on your hard drive. The required attribute The sim...
... background-image: linear-gradient(to right, pink, lightgreen); } input:valid { border: 2px solid black; } This CSS causes the input to have a red dashed border when it is invalid and a more subtle solid black border when valid. We also added a background gradient when the input is required and invalid. Try out the new behavior in the example below: Note: You can find this example live on GitHub as fruit-validation.html (see also the source code.) Try submitting the form without a value. Note how the invalid input gets focus, a default error message ("Please fill out this field") appears, and the form is prevented from being sent. The presence of the required attribute on any element that supports this attribute means the element matches the :required pseudoclass whether it has a v...
...Regular expressions are case-sensitive, but we've made it support capitalized as well as lower-case versions using an extra "Aa" pattern nested inside square brackets. At this point, try changing the value inside t...
...And 4 more matches
Publishing your website - Learn web development
e limited hosting for a small website. The available feature set will be limited, but it might be perfect for your first experiments. There are also free services available like Neocities, Blogger, and WordPress. Sometimes you get what you pay for, but sometimes these resources are good enough for your initial experiments. Many companies provide hosting and domains. ...
..., but it might be perfect for your first experiments. There are also free services available like Neocities, Blogger, and WordPress. Sometimes you get what you pay for, but sometimes these resources are good enough for your initial experiments. Many companies provide hosting and domains. Using an online tool like GitHub or Google App Engine Some tools let you publish your website online: GitHub is a "social coding" site. ...
...ike Neocities, Blogger, and WordPress. Sometimes you get what you pay for, but sometimes these resources are good enough for your initial experiments. Many companies provide hosting and domains. Using an online tool like GitHub or Google App Engine Some tools let you publish your website online: GitHub is a "social coding" site. It allows you to upload code repositories for storage in the Git version control system. You can then collaborate on code projects, and the system is open-source by default, meaning that anyone in the world can find your GitHub code, use it, learn from it, and improve on it. GitHub has a very useful feature called GitHub Pages, which allows you to expose website code live on the web. Google App Engine is a powerful platform that lets you build and run applica...
...And 4 more matches
Using the Geolocation API - Web APIs
wer as fast as possible with a low accuracy result. It is useful if you need a quick answer regardless of the accuracy. Devices with a GPS, for example, can take a minute or more to get a GPS fix, so less accurate data (IP location or wifi) may be returned to getCurrentPosition(). navigator.geolocation.getCurrentPosition((position) => { doSomething(position.coords.latitude, position.coords.longitude); }); The above example will cause the doSomething() function to execute when the location is obtained. Watching the current position If the position data changes (either by device movement or if more accurate geo information arrives), you can set up a callback function that is called with that updated position information. This is done using the watchPosition() function, which has the same...
...a more accurate location as different techniques are used to geolocate you. The error callback function, which is optional just as it is for getCurrentPosition(), can be called repeatedly. Note: You can use watchPosition() without an initial getCurrentPosition() call. const watchID = navigator.geolocation.watchPosition((position) => { doSomething(position.coords.latitude, position.coords.longitude); }); The watchPosition() method returns an ID number that can be used to uniquely identify the requested position watcher; you use this value in tandem with the clearWatch() method to stop watching the user's location. navigator.geolocation.clearWatch(watchID); Fine tuning the response Both getCurrentPosition() and watchPosition() accept a success callback, an optional error callback, an...
... (up until this age it will be cached and reused if the same position is requested again; after this the browser will request fresh position data), and a timeout value that dictates how long the browser should attempt to get the position data for, before it times out. ...
...And 4 more matches
Intl.NumberFormat() constructor - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax new Intl.NumberFormat([locales[, options]]) Parameters locales Optional A string with a BCP 47 language tag, or an array of such strings. For the general form and interpretation of the locales argument, see the Intl page. ...
...it formatting style to use in unit formatting, the defaults is "short". "long" (e.g., 16 litres) "short" (e.g., 16 l) "narrow" (e.g., 16l) useGrouping Whether to use grouping separators, such as thousands separators or thousand/lakh/crore separators. Possible values are true and false; the default is true. ...
...use in unit formatting, the defaults is "short". "long" (e.g., 16 litres) "short" (e.g., 16 l) "narrow" (e.g., 16l) useGrouping Whether to use grouping separators, such as thousands separators or thousand/lakh/crore separators. Possible values are true and false; the default is true. The following properties fall into two groups: minimumIntegerDigits, minimumFractionDigits, and maximumFractionDigits in one group, minimumSignificantDigits and maximumSignificantDigits in the other. If at least one property from the second group is defined, then the first group is ignored. minimumIntegerDigits The minimum number of integer digits to use. Possible values are from 1 to 21; the default is 1. minimumFractionDigits The minimum number of fraction digits to use. ...
...And 4 more matches
Intl.PluralRules() constructor - JavaScript
it". For information about this option, see the Intl page. type The type to use. Possible values are: "cardinal" for cardinal numbers (refering to the quantity of things). This is the default value. "ordinal" for ordinal number (refering to the ordering or ranking of things, e.g. "1st", "2nd", "3rd" in English). ...
...out this option, see the Intl page. type The type to use. Possible values are: "cardinal" for cardinal numbers (refering to the quantity of things). This is the default value. "ordinal" for ordinal number (refering to the ordering or ranking of things, e.g. "1st", "2nd", "3rd" in English). ...
...tl page. type The type to use. Possible values are: "cardinal" for cardinal numbers (refering to the quantity of things). This is the default value. "ordinal" for ordinal number (refering to the ordering or ranking of things, e.g. "1st", "2nd", "3rd" in English). The following properties fall into two groups: minimumIntegerDigits, minimumFractionDigits, and maximumFractionDigits in one group, minimumSignificantDigits and maximumSignificantDigits in the other. If at least one property from the second group is defined, then the first group is ignored. minimumIntegerDigits The minimum number of integer digits to use. Possible values are from 1 to 21; the default is 1. minimumFractionDigits The minimum number of fraction digits to use. Possible values are...
...And 4 more matches
Understanding WebAssembly text format - WebAssembly
Also see WebAssembly.instantiateStreaming() for more details about the instantiate function. Exploring fundamentals Now we've covered the real basics, let's move on to look at some more advanced features. Calling functions from other functions in the same module The call instruction calls a single function, given its index or name. For example, the followin...
...e have already seen JavaScript calling WebAssembly functions, but what about WebAssembly calling JavaScript functions? WebAssembly doesn't actually have any built-in knowledge of JavaScript, but it does have a general way to import functions that can accept either JavaScript or wasm functions. Let's look at an example: (module (import "console" "log" (func $log (param i32))) (func (export "logIt") i32.const 13 call $log)) WebAssembly has a two-level namespace so the import statement here is saying that we're asking to import the log function from the console module. You can also see that the exported logIt function calls the imported function using the call instruction we introduced above. Imported functions are just like normal functions: they have a signature that WebAssembly...
...e corresponding properties. For the above, we need an object (let's call it importObject) such that importObject.console.log is a JavaScript function. This would look like the following: var importObject = { console: { log: function(arg) { console.log(arg); } } }; WebAssembly.instantiateStreaming(fetch('logger.wasm'), importObject) .then(obj => { obj.instance.exports.logIt(); }); Note: You can find this example on GitHub as logger.html (see it live also). Declaring globals in WebAssembly WebAssembly has the ability to create global variable instances, accessible from both JavaScript and importable/exportable across one or more WebAssembly.Module instances. This is very useful, as it allows dynamic linking of multiple modules. In WebAssembly text format, it ...
...And 4 more matches
Looping code - Learn web development
This shows a loop is used to iterate over the items in an array and do something with each of them -- a very common pattern in JavaScript. Here: The counter variable (sometimes known as an initializer or an iteration variable), i, starts at 0 (let i = 0). The loop has been told to run until i is no longer smaller than the length of the cats array. This is ...
...nation on the final loop iteration so that we haven't got a comma on the end of the sentence. Well, no problem -- we can quite happily insert a conditional inside our for loop to handle this special case: for (let i = 0; i < cats.length; i++) { if (i === cats.length - 1) { info += 'and ' + cats[i] + '.'; } else { info += cats[i] + ', '; } } Note: You can find this example code on GitHub too (also see it running live). Important: With for -- as with all loops -- you must make sure that the initializer is incremented or, depending on the case, decremented, so that it eventually reaches the point where the condition is not true. If not, the loop will go on forever, and either the browser will force it to stop, or it will crash. This is called an infinite loop. Exiting loops...
...searchName. If it is, we enter a string into the paragraph to report what the contact's number is, and use break to end the loop. After (contacts.length-1) iterations, if the contact name does not match the entered search the paragraph text is set to "Contact not found.", and the loop continues looping until the condition is no longer true. Note: You can view the full source code on GitHub too (also see it running live). Skipping iterations with continue The continue statement works in a similar manner to break, but instead of breaking out of the loop entirely, it skips to the next iteration of the loop. Let's look at another example that takes a number as an input, and returns only the numbers that are squares of integers (whole numbers). The HTML is basically the same as t...
...And 3 more matches
PromiseWorker.jsm
ssed from somewhere else. post callsite doesn't have to know which object should be transferred. For example: myWorker.post('func', [foo(), bar(), baz()]) foo now has the power to determine if the argument should be transferred by returning a Meta instance. So it can transfer an object without modifying the caller. Here is a simple demo showing how to transfer the second argument to a worker: Github:: PromiseWorker Transfer Data Line 23. The command outline below this shows how to do the same with Meta syntax. Sending a message from worker With all other workers, to send a message to the main thread, postMessage is typically used. However with PromiseWorker objects this is no longer the case, simply return data or throw from your function depending if you want to resolve or reject the p...
...Various error objects are supported; each one has its specific meaning; they're described below. Supported built-in JavaScript Error are following: EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError In addition to them, StopI...
...{ exn: 'CustomError', message: this.message, }; }; // A function called by message. function func() { ... // Throw a custom error. throw new CustomError('meow'); } The converted message will be posted back to the main thread, and it will be converted again to error object, with fromMsg function specified for the error in ExceptionHandlers property. ...
...And 3 more matches
Enc Dec MAC Using Key Wrap CertReq PKCS10 CSR
(rv != SECSuccess) { PR_fprintf(PR_STDERR, "problem while SGN_End\n"); goto cleanup; } cleanup: if (inFile) { PR_Close(inFile); } if (sgn) { SGN_DestroyContext(sgn, PR_TRUE); } return rv; } /* * Verify the signature using public key */ SECStatus VerifyData(const char *inFileName, SECKEYPublicKey *pk, SECItem *sigItem, secuPWData *pwdata) { unsigned int nb; unsigned char ibuf[4096]; SECStatus rv = SECFailure; VFYContext *vfy = NULL; PRFileDesc *inFile = NULL; /* Open the input file for reading */ inFile = PR_Open(inFileName, PR_RDONLY, 0); if (!inFile) { PR_fprintf(PR_STDERR, "Unable to open \"%s\" for reading.\n", inFileN...
... VFYContext *vfy = NULL; PRFileDesc *inFile = NULL; /* Open the input file for reading */ inFile = PR_Open(inFileName, PR_RDONLY, 0); if (!inFile) { PR_fprintf(PR_STDERR, "Unable to open \"%s\" for reading.\n", inFileName); rv = SECFailure; goto cleanup; } vfy = VFY_CreateContext(pk, sigItem, SEC_OID_PKCS1_MD5_WITH_RSA_ENCRYPTION, pwdata); if (!vfy) { PR_fprintf(PR_STDERR, "unable to create context for verifying signature\n"); rv = SECFailure; goto cleanup; } rv = VFY_Begin(vfy); if (rv != SECSuccess) { PR_fprintf(PR_STDERR, "problem while VFY_Begin\n"); goto cle...
... const char *headerFileName, const char *inFileName) { SECStatus rv; PRFileDesc *headerFile = NULL; PRFileDesc *inFile = NULL; CERTCertificate *cert = NULL; unsigned int signatureLen = 0; SECKEYPrivateKey *privkey = NULL; SECItem sigItem; SECOidTag hashOIDTag; /* Open the header file 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; } /* Get the certificate...
...And 3 more matches
Utilities for nss samples
* PW_EXTERNAL = 3 */ } source; char *data; /* depending on source this can be the actual * password or the file to read it from */ } secuPWData; /* * PrintAsAscii */ extern void PrintAsAscii(PRFileDesc* out, const unsigned char *data, unsigned int len); /* * PrintAsHex */ extern void PrintAsHex(PRFileDesc* out, const unsigned char *data, unsigned int len); /* * GetDigit */ extern int GetDigit(char c); /* * HexToBuf */ extern int HexToBuf(unsigned char *inString, SECItem *outbuf, PRBool isHexData); /* * FileToItem */ extern SECStatus FileToItem(SECItem *dst, PRFileDesc *src); /* * CheckPassword */ extern PRBool CheckPassword(char *cp); /* * GetPassword */ extern char * GetPassword(FILE *input, FILE *output, char *prompt,...
... PR_fprintf(out, "%02x:", data[i]); column += 3; } else { PR_fprintf(out, "%02x", data[i]); column += 2; break; } if (column > 76 || (i % 16 == limit)) { Newline(out); column = level; limit = i % 16; } } if (column != level) { Newline(out); } } /* * GetDigit */ int GetDigit(char c) { if (c == 0) { return -1; } if (c <= '9' && c >= '0') { return c - '0'; } if (c <= 'f' && c >= 'a') { return c - 'a' + 0xa; } if (c <= 'F' && c >= 'A') { return c - 'A' + 0xa; } return -1; } /* * HexToBuf */ int HexToBuf(unsigned char *inString, SECItem *outbuf, PRBool isHexData) { int len = strle...
...'9' && c >= '0') { return c - '0'; } if (c <= 'f' && c >= 'a') { return c - 'a' + 0xa; } if (c <= 'F' && c >= 'A') { return c - 'A' + 0xa; } return -1; } /* * HexToBuf */ int HexToBuf(unsigned char *inString, SECItem *outbuf, PRBool isHexData) { int len = strlen((const char *)inString); int outLen = len+1/2; int trueLen = 0; int digit1, digit2; outbuf->data = isHexData ? PORT_Alloc(outLen) : PORT_Alloc(len); if (!outbuf->data) { return -1; } if (isHexData) { while (*inString) { if ((*inString == '\n') || (*inString == ':')) { inString++; continue; } digit1 = GetDigit(*inString++); digit2 = GetD...
...And 3 more matches
nsDependentSubstring
nsAString_internal Data Members No public members. ...
...c members. ...
...const nsAString_internal&, PRUint32, PRUint32) - source Parameters nsAString_internal& str PRUint32 startPos PRUint32 length void nsDependentSubstring(const PRUnichar*, const PRUnichar*) - source Parameters PRUnichar* start PRUnichar* end void nsDependentSubstring(const nsReadingIterator<short unsigned int>&, const nsReadingIterator<short unsigned int>&) - source Parameters nsReadingIterator<short unsigned int>& start nsReadingIterator<short unsigned int>& end void nsDependentSubstring() - source Rebind void Rebind(const nsAString_internal&, PRUint32, PRUint32) - source Parameters nsAString_internal& <anonymous> PRUint32 startPos PRUint32 length void Rebind(const PRUnichar*, const PRUnichar*) - source Parameters PRUnichar* start PRUnichar* end BeginReadi...
...And 3 more matches
Using the CSS Painting API - Web APIs
and design of our paint worklet took place in the external script shown above. We need to register that worklet from our main script. CSS.paintWorklet.addModule('nameOfPaintWorkletFile.js'); This can be done using the paint worklet's addModule() method in a <script> within the main HTML or in an external JavaScript file linked to from the document. In our example, the paintworklet is stored on Github. CSS.paintWorklet.addModule('https://mdn.github.io/houdini-examples/cssPaint/intro/01partOne/header-highlight.js'); Reference the paint worklet in CSS Once we have a registered paint worklet, we can use it in CSS. Employ the CSS paint() function like we would any other <image> type, using the same string identifier we used in the paintworklet's registerPaint() function. .fancy { backgro...
...changed the dimensions and positioning of our rectangle to be relative to the size of the element box rather than absolute values. We can pass the second parameter into the paint() function to give us access to the width and the height of the element, via .width and .height properties. Our header now has a highlight that changes according to it's size. ...
... registerPain...
...And 3 more matches
SubtleCrypto.sign() - Web APIs
Web › API › SubtleCrypto › sign
It takes as its arguments a key to sign with, some algorithm-specific parameters, and the data to sign. It returns a Promise which will be fulfilled with the signature. You can use the corresponding SubtleCrypto.verify() method to verify the signature. Syntax const signature = crypto.subtle.sign(algorithm, key, data); Parameters algorithm is a string or object that specifies the signature algorithm to use and its parameters: To use RSASSA-PKCS1-v1_5, pass the string "RSASSA-PKCS1-v1_5" or an object of the form { "name": "RSASSA-PKCS1-v1_5" }. To use RSA-PSS, pass an RsaPssParams object. To use ECDSA, pass an EcdsaParams object. ...
...SS The RSA-PSS algorithm is specified in RFC 3447. It's different from RSASSA-PKCS1-v1_5 in that it incorporates a random salt in the signature operation, so the same message signed with the same key will not result in the same signature each time. An extra property, defining the salt length, is passed into the sign() and verify() functions when they are invoked. ECDSA ECDSA (Elliptic Curve Digital Signature Algorithm) is a variant of the Digital Signature Algorithm, specified in FIPS-186, that uses Elliptic Curve Cryptography (RFC 6090). HMAC The HMAC algorithm calculates and verifies hash-based message authentication codes according to the FIPS 198-1 standard. The digest algorithm to use is specified in the HmacKeyGenParams object that you pass into generateKey(), or the HmacImportP...
...es Elliptic Curve Cryptography (RFC 6090). HMAC The HMAC algorithm calculates and verifies hash-based message authentication codes according to the FIPS 198-1 standard. The digest algorithm to use is specified in the HmacKeyGenParams object that you pass into generateKey(), or the HmacImportParams object that you pass into importKey(). Examples Note: You can try the working examples out on GitHub. RSASSA-PKCS1-v1_5 This code fetches the contents of a text box, encodes it for signing, and signs it with a private key. See the complete source code on GitHub. /* Fetch the contents of the "message" textbox, and encode it in a form we can use for the sign operation. */ function getMessageEncoding() { const messageBox = document.querySelector(".rsassa-pkcs1 #message"); let message = m...
...And 3 more matches
system - CSS: Cascading Style Sheets
entation are doubled, tripled, and so on. For example, if the original symbols provided were "?" and "?", on each successive pass, they will become "??" and "??", "???" and "???" and so on. At least one symbol must be specified in the symbols descriptor or the counter style is not valid. This counter system works for positive counter values only. alphabetic Interprets the specified symbols as digits, to an alphabetic numbering system. If the characters "a" to "z" are specified as symbols in a counter style, with the alphabetic system, then the first 26 counter representations will be "a", "b" upto "z". Until this point, the behavior is the same as that of the symbolic system, described above. However, after "z", it will continue as "aa", "ab", "ac"... The symbols descriptor must contain ...
...system, described above. However, after "z", it will continue as "aa", "ab", "ac"... The symbols descriptor must contain at least two symbols or the counter style is not valid. The first counter symbol provided in the symbols descriptor is interpreted as 1, the next as 2, and so on. This system is also defined strictly over positive counter values. numeric Interprets the counter symbols as digits in a place-value numbering system. The numeric system is similar to the alphabetic system, described above. The main difference is that in the alphabetic system, the first counter symbol given in the symbols descriptor is interpreted as 1, the next as 2, and so on. However, in the numeric system, the first counter symbol is interpreted as 0, the next as 1, then 2, and so on. At least two coun...
...symbols descriptor is interpreted as 1, the next as 2, and so on. However, in the numeric system, the first counter symbol is interpreted as 0, the next as 1, then 2, and so on. At least two counter symbols must be specified in the symbols descriptor or the counter style is not valid. additive Used to represent "sign-value" numbering systems, such as Roman numerals, which rather than reuse digits in different positions to obtain different values, define additional digits for larger values. The value of a number in such a system can be found out by adding the digits in the number. An additional descriptor called additive-symbols must be specified with at least one additive tuple, or else the counter style rule will not be valid. An additive tuple is similar to a composite counter symbo...
...And 3 more matches
all - CSS: Cascading Style Sheets
Web › CSS › all
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...shorthand CSS property resets all of an element's properties except unicode-bidi, direction, and CSS Custom Properties. It can set properties to their initial or inherited values, or to the values specified in another stylesheet origin. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Global values */ all: initial; all: inherit; all: unset; /* CSS Cascading and Inheritance Level 4 */ all: revert; The all property is specified as one of the CSS global keyword values. Note that none of these values affect the unicode-bidi and direction properties. Values initial Specifies that all the element's prope...
...l elementsInheritednoComputed valueas the specified value applies to each property this is a shorthand for.Animation typeas each of the properties of the shorthand (all properties but unicode-bidi and direction) Formal syntax initial | inherit | unset | revert Examples HTML <blockquote id="quote"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. </blockquote> Phasellus eget velit sagittis. CSS body { font-size: small; background-color: #F0F0F0; color: blue; } blockquote { background-color: skyblue; color: red; } Result No all property <blockquote id="quote">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</blockquote> Phasellus eget velit sagittis. body { font-size: small; background-color: #F0F0F0; color:blue; } blockquote { background-color: skyblue...
...And 3 more matches
position - CSS: Cascading Style Sheets
Web › CSS › position
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax The position property is specified as a single keyword chosen from the list of values below. ...
... The position CSS property sets how an element is positioned in a document. The top, right, bottom, and left properties determine the final location of positioned elements. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax The position property is specified as a single keyword chosen from the list of values below. Values static The element is positioned according to the normal flow of the document. The top, right, bottom, left, and z-index properties have no effect. This is the default value. relative The element is positioned according to the normal flow of the document, and then offset relative to ...
...left. The offset does not affect the position of any other elements. This value always creates a new stacking context. Note that a sticky element "sticks" to its nearest ancestor that has a "scrolling mechanism" (created when overflow is hidden, scroll, auto, or overlay), even if that ancestor isn't the nearest actually scrolling ancestor. This effectively inhibits any "sticky" behavior (see the GitHub issue on W3C CSSWG). Description Types of positioning A positioned element is an element whose computed position value is either relative, absolute, fixed, or sticky. (In other words, it's anything except static.) A relatively positioned element is an element whose computed position value is relative. The top and bottom properties specify the vertical offset from its normal position; th...
...And 3 more matches
<input type="password"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › password
password provide a way for the user to securely enter a password. The element is presented as a one-line plain text editor control in which the text is obscured so that it cannot be read, usually by replacing each character with a symbol such as the asterisk ("*") or a dot ("o"). This character will vary depending on the user agent and OS. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Specifics of how the entry process works may vary from browser to browser; mobile devices, for example, often display the typed character for a moment before obscuring it, to allow the user to be sure they pressed the key they meant ...
...y as a tooltip to explain what the requirements are to match the pattern. You should also include other explanatory text nearby. Use of a pattern is strongly recommended for password inputs, in order to help ensure that valid passwords using a wide assortment of character classes are selected and used by your users. With a pattern, you can mandate case rules, require the use of some number of digits and/or punctuation characters, and so forth. See the section Validation for details and an example. placeholder The placeholder attribute is a string that provides a brief hint to the user as to what kind of information is expected in the field. It should be a word or short phrase that demonstrates the expected type of data, rather than an explanatory message. The text must not include carriag...
... suggest that it's not saved. <label for="pin">PIN: </label> <input id="pin" type="password" inputmode="numeric"> Setting length requirements As usual, you can use the minlength and maxlength attributes to establish minimum and maximum acceptable lengths for the password. This example expands on the previous one by specifying that the user's PIN must be at least four and no more than eight digits. The size attribute is used to ensure that the password entry control is eight characters wide. <label for="pin">PIN:</label> <input id="pin" type="password" inputmode="numeric" minlength="4" maxlength="8" size="8"> Selecting text As with other textual entry controls, you can use the select() method to select all the text in the password field. HTML <label for="userPassword">Passwo...
...And 3 more matches
Date - JavaScript
7) and returns the number of milliseconds since January 1, 1970, 00:00:00 UTC, with leap seconds ignored. Instance methods Date.prototype.getDate() Returns the day of the month (1-31) for the specified date according to local time. Date.prototype.getDay() Returns the day of the week (0-6) for the specified date according to local time. Date.prototype.getFullYear() Returns the year (4 digits for 4-digit years) of the specified date according to local time. Date.prototype.getHours() Returns the hour (0-23) in the specified date according to local time. Date.prototype.getMilliseconds() Returns the milliseconds (0-999) in the specified date according to local time. Date.prototype.getMinutes() Returns the minutes (0-59) in the specified date according to local time. Date.prototyp...
...es.) Date.prototype.getTimezoneOffset() Returns the time-zone offset in minutes for the current locale. Date.prototype.getUTCDate() Returns the day (date) of the month (1-31) in the specified date according to universal time. Date.prototype.getUTCDay() Returns the day of the week (0-6) in the specified date according to universal time. Date.prototype.getUTCFullYear() Returns the year (4 digits for 4-digit years) in the specified date according to universal time. Date.prototype.getUTCHours() Returns the hours (0-23) in the specified date according to universal time. Date.prototype.getUTCMilliseconds() Returns the milliseconds (0-999) in the specified date according to universal time. Date.prototype.getUTCMinutes() Returns the minutes (0-59) in the specified date according to univ...
...ersal time. Date.prototype.getUTCMinutes() Returns the minutes (0-59) in the specified date according to universal time. Date.prototype.getUTCMonth() Returns the month (0-11) in the specified date according to universal time. Date.prototype.getUTCSeconds() Returns the seconds (0-59) in the specified date according to universal time. Date.prototype.getYear() Returns the year (usually 2-3 digits) in the specified date according to local time. Use getFullYear() instead. Date.prototype.setDate() Sets the day of the month for a specified date according to local time. Date.prototype.setFullYear() Sets the full year (e.g. 4 digits for 4-digit years) for a specified date according to local time. Date.prototype.setHours() Sets the hours for a specified date according to local time. Date...
...And 3 more matches
Intl.DateTimeFormat() constructor - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax new Intl.DateTimeFormat([locales[, options]]) Parameters locales Optional A string with a BCP 47 language tag, or an array of such strings. To use the browser's default locale, omit this argument or pass undefined. Unicode extension are supported (for example "en-US-u-ca-buddhist"). ...
.... options Optional An object with some or all of the following properties: dateStyle The date formatting style to use when calling format(). Possible values include: "full" "long" "medium" "short" timeStyle The time formatting style to use when calling format(). Possible values include: "full" "long" "medium" "short" fractionalSecondDigits The number of fractional seconds to apply when calling format(). Valid values are 0-3. calendar Calendar. Possible values include: "buddhist", "chinese", " coptic", "ethiopia", "ethiopic", "gregory", " hebrew", "indian", "islamic", "iso8601", " japanese", "persian", "roc". dayPeriod The way day periods should be expressed. Possible values include: "narrow", "short", " long". numberin...
...ay) "short" (e.g., Thu) "narrow" (e.g., T). Two weekdays may have the same narrow style for some locales (e.g. Tuesday's narrow style is also T). era The representation of the era. Possible values are: "long" (e.g., Anno Domini) "short" (e.g., AD) "narrow" (e.g., A) year The representation of the year. Possible values are: "numeric" (e.g., 2012) "2-digit" (e.g., 12) month The representation of the month. Possible values are: "numeric" (e.g., 2) "2-digit" (e.g., 02) "long" (e.g., March) "short" (e.g., Mar) "narrow" (e.g., M). Two months may have the same narrow style for some locales (e.g. May's narrow style is also M). day The representation of the day. Possible values are: "numeric" (e.g., 1) "2-dig...
...And 3 more matches
Web audio codec guide - Web media technologies
ent. Additionally, WebRTC implementations generally use a subset of these codecs for their encoding and decoding of media, and may support additional codecs as well, for optimal cross-platform support of video and audio conferencing, and to integrate better with legacy telecommunication solutions. See Codecs used by WebRTC for details. For information about the fundamental concepts behind how digital audio works, see the article Digital audio concepts. Common codecs The list below denotes the codecs most commonly used on the web and which containers (file types) support them. If all you need to know is which codecs are even possible to use, this is for you. Of course, individual browsers may or may not choose to support all of these codecs, and their support for which container types can ...
...actors affecting the encoded audio There are two general categories of factors that affect the encoded audio which is output by an audio codec's encoder: details about the source audio's format and contents, and the codec and its configuration during the encoding process. For each factor that affects the encoded audio, there is a simple rule that is nearly always true: because the fidelity of digital audio is determined by the granularity and precision of the samples taken to convert it into a data stream, the more data used to represent the digital version of the audio, the more closely the sampled sound will match the source material. The effect of source audio format on encoded audio output Because encoded audio inherently uses fewer bits to represent each sample, the source audio form...
... make the encoded file larger; it will never make it smaller. Of course, these effects can be altered by decisions made while encoding the audio. For example, if the encoder is configured to reduce the sample rate, the sample rate's effect on the output file will be reduced in kind. For more information about these and other features of audio data, see Audio data format and structure in Digital audio concepts. The effect of codec configuration on encoded audio output Audio codecs typically employ cleverly-designed and highly-complex mathematical algorithms to take source audio data and compress it to take substantially less space in memory or network bandwidth. In addition to choosing the type of encoder to use, you may have the opportunity to adjust the encoder using parameters tha...
...And 3 more matches
2015 MDN Fellowship Program - Archive of obsolete content
ne existing tests to adapt to this cross-browser test harness. Activities and Deliverables Identify gaps between existing documentation and current development environments. The work would entail refining existing tests to adapt to this framework. Required skills and experience Experience and comfort writing Javascript test scripts. Mentor Information Josh Matthews, Mozilla Platform Group. GitHub: jdm Twitter: @lastontheboat Service Workers Brief Project Description Service workers essentially act as proxy servers that sit between web applications, the browser and (when available) the network. They enable the creation of effective offline experiences and wiill also allow access to push notifications and background sync APIs. Activities and Deliverables Write a demonstration we...
...stration web application (new or existing) to showcase Service Worker functionality. Provide detailed API descriptions. Required skills and experience Experienced Web developer with expertise in JavaScript, CSS, HTML as well as with efficient network interaction (queuing resource fetching, etc.). Self-starter and autonomous worker Mentor information Brittany Storoz, Mozilla Apps Engineering. GitHub: brittanystoroz Twitter: @brittanystoroz WebGL Brief Project Description WebGL is the latest incarnation of the OpenGL family of real time rendering immediate mode graphics APIs. WebGL is getting some cool new features in 2015 with the standardization efforts around the WebGL 2.0 spec being published. Activities and Deliverables Help us develop a curriculum on MDN for teaching develop...
... being published. Activities and Deliverables Help us develop a curriculum on MDN for teaching developers new to graphics programming the WebGL APIs. Required skills and experience Computer graphics experience with programmable shaders and the OpenGL, OpenGL ES, WebGL, or Direct3D APIs. Command of JavaScript and module systems preferred. Mentor information Nick Desaulniers, Sleeps at Desk. GitHub: nickdesaulniers Twitter: @LostOracle Web App Performance Brief Project Description Web performance is a feature that needs to be considered from serving content to rendering to interactivity. Finding and addressing performance bottlenecks depends on tooling the browser networking and rendering but also, often more important, user perception. Activities and Deliverables Help us develo...
...And 2 more matches
Index - Archive of obsolete content
NeedsHelp, XPInstall This article describes how to sign your own Firefox extensions with a code-signing certificate on a Windows platform. It was developed from the linux article So you want to sign your XPI package? by MozDev Group's Pete Collins. 300 Signing an extension Add-ons, Administration, Extensions, Themes, XPInstall, enterprise This article describes how to digitally sign your extension for Firefox and Thunderbird, with a code signing certificate for Object Signing. The following instructions also apply to a theme and other XPI files. 301 Supporting search suggestions in search plugins Add-ons, OpenSearch, Search, Search plugins Firefox supports search suggestions in OpenSearch plugins; as the user types in the search bar, Firefox que...
... lookups, package tracking, and even word definitions can all be retrieved from user-customized bookmarks. 379 Build This page was auto-generated because a user created a sub-page to this page. 380 Building TransforMiiX standalone NeedsHelp, NeedsRewrite, XSLT No summary! 381 Chromeless Update [This project may not be active -- check Github https://github.com/mozilla/chromeless] 382 Compiling The npruntime Sample Plugin in Visual Studio Add-ons, Plugins No summary! 383 Creating a Firefox sidebar extension Add-ons, Extensions, Firefox, Obsolete This article describes how to create a registered sidebar for Firefox 2 or greater. See the references section for information on creating extensio...
... 2248 background-size Should not the "Browser compatibility" table also list Google Chrome and Konqueror? Chome is not mentioned at all, but is becoming increasingly popular. Konqueror is listed below the table, which seems inconsistent. Znerd 04 August 2009 2249 forEach Ok, in the end I didn't remove the old code as it isn't hosted anywhere (I thought the github reference contained the code) but inserted a faster implementation above while retaining the rest of the document. 3239 Beginner tutorials This page includes archived beginners tutorials, from various places around MDN. 3240 Creating reusable content with CSS and XBL Advanced, CSS, CSS:Getting_Started, Example, Guide, NeedsUpdate, Web, XBL This page i...
...And 2 more matches
HTML table basics - Learn web development
Learn › HTML › Tables › Basics
Pluto 0.0146 2,370 2095 0.7 153.3 5906.4 -225 5 Declassified as a planet in 2006, but this remains controversial. When done correctly, even blind people can interpret tabular data in an HTML table -- a successful HTML table should enhance the experience of sighted and visually impaired users alike. Table styling You can also have a look at the live example on GitHub! One thing you'll notice is that the table does look a bit more readable there -- this is because the table you see above on this page has minimal styling, whereas the GitHub version has more significant CSS applied. Be under no illusion; for tables to be effective on the web, you need to provide some styling information with CSS, as well as good solid structure with HTML. In this module we a...
... or two more -- each row needs to be wrapped in an additional <tr> element, with each cell contained in a <td>. This should result in a table that looks something like the following: Hi, I'm your first cell. I'm your second cell. I'm your third cell. I'm your fourth cell. Second row, first cell. Cell 2. Cell 3. Cell 4. Note: You can also find this on GitHub as simple-table.html (see it live also). Adding headers with <th> elements Now let's turn our attention to table headers -- special cells that go at the start of a row or column and define the type of data that row or column contains (as an example, see the "Person" and "Age" cells in the first example shown in this article). To illustrate why they are useful, have a look at the following t...
...stands for 'table header'). This works in exactly the same way as a <td>, except that it denotes a header, not a normal cell. Go into your HTML, and change all the <td> elements surrounding the table headers into <th> elements. Save your HTML and load it in a browser, and you should see that the headers now look like headers. Note: You can find our finished example at dogs-table-fixed.html on GitHub (see it live also). Why are headers useful? We have already partially answered this question -- it is easier to find the data you are looking for when the headers clearly stand out, and the design just generally looks better. Note: Table headings come with some default styling -- they are bold and centered even if you don't add your own styling to the table, to help them stand out. Tabl...
...And 2 more matches
Starting our Svelte Todo list app - Learn web development
ommended that you are familiar with the core HTML, CSS, and JavaScript languages, and have knowledge of the terminal/command line. You'll need a terminal with node + npm installed to compile and build your app. Objective: To learn how to create a Svelte component, render it inside another component, pass data into it using props, and save its state. ...
...ou are familiar with the core HTML, CSS, and JavaScript languages, and have knowledge of the terminal/command line. You'll need a terminal with node + npm installed to compile and build your app. Objective: To learn how to create a Svelte component, render it inside another component, pass data into it using props, and save its state. Code along with us Git Clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git Then to get to the current app state, run cd mdn-svelte-tutorial/02-starting-our-todo-app Or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/02-starting-our-todo-app Remember to run npm install && npm run dev to start your app in development mode. REPL ...
.... It's important to be a good web citizen and make make your pages accessible to the broadest possible userbase. The accessibility rules checked by Svelte are taken from eslint-plugin-jsx-a11y, a plugin for eslint that provides static checks for many accessibility rules on JSX elements. Svelte aims to implement all of them in its compiler, and most of them have already been ported to Svelte. On GitHub you can see which accessibility checks are still missing. You can check the meaning of each rule by clicking on its link. Styling our markup Let's make the todo list look a little better. Replace the contents of the file public/global.css with the following: /* RESETS */ *, *::before, *::after { box-sizing: border-box; } *:focus { outline: 3px dashed #228bec; outline-offset: 0; } html...
...And 2 more matches
Client-side tooling overview - Learn web development
pical VCS involves having a local version of the code that you make changes to. You then "push" changes to a "master" version of the code inside a remote repository stored on a server somewhere. There is usually a way of controlling and coordinating what changes are made to the "master" copy of the code, and when, so a team of developers doesn't end up overwriting each other's work all the time. Git is the source code control system that most people use these days. It is primarily accessed via the command line but can be accessed via friendly user interfaces. With your code in a git repository, you can push it to your own server instance, or use a hosted source control website such as GitHub, GitLab, or BitBucket. We'll be using GitHub in this module. You can find more information about it ...
... the source code control system that most people use these days. It is primarily accessed via the command line but can be accessed via friendly user interfaces. With your code in a git repository, you can push it to your own server instance, or use a hosted source control website such as GitHub, GitLab, or BitBucket. We'll be using GitHub in this module. You can find more information about it at Git and GitHub. Code formatters Code formatters are somewhat related to linters, except that rather than point out errors in your code, they usually tend to make sure your code is formatted correctly, according to your style rules, ideally automatically fixing errors that they find. Prettier is a very popular example of a code formatter, which we'll make use of later on in the module. Bundlers/pa...
...ss is one that you want the least amount of active interaction with so that once it is configured, it runs mostly automatically, only popping up to say hello if something has gone wrong. Testing tools These generally take the form of a tool that will automatically run tests against your code to make sure it is correct before you go any further (for example, when you attempt to push changes to a GitHub repo). This can including linting, but also more sophisticated procedures like unit tests, where you run part of your code, making sure they behave as they should. Frameworks for writing tests include Jest, Mocha, and Jasmine. Automated test running and notification systems include Travis CI, Jenkins, Circle CI, and others. Deployment tools Deployment systems allow you to get your websi...
...And 2 more matches
HTTP Cache
e is no profile the new HTTP cache works, but everything is stored only in memory not obeying any particular limits. It is strongly encoraged to NOT USE the OLD cache API any more - nsICacheService et al. It will soon be completely obsoleted and removed (bug 913828). nsICacheStorageService The HTTP cache entry-point. Accessible as a service only, fully thread-safe, scriptable. //github.com/RealityRipple/UXP/blob/master/netwerk/cache2/nsICacheStorageService.idl "@mozilla.org/netwerk/cache-storage-service;1" Provides methods accessing "storage" objects - see nsICacheStorage below - giving further access to cache entries - see nsICacheEntry more below - per specific URL. Currently we have 3 types of storages, all the access methods return an nsICacheStorage o...
...non-blocking in any way; the actual erase happens in background purgeFromMemory - removes (schedules to remove) any intermediate cache data held in memory for faster access (more about the intermediate cache below) nsILoadContextInfo Distinguishes the scope of the storage demanded to open. Mandatory argument to *Storage methods of nsICacheStorageService. ...
...ntextInfo.jsm module methods Two storage objects created with the same set of nsILoadContextInfo arguments are identical, containing the same cache entries. Two storage objects created with in any way different nsILoadContextInfo arguments are strictly and completely distinct and cache entries in them do not overlap even when having the same URIs. nsICacheStorage //github.com/RealityRipple/UXP/blob/master/netwerk/cache2/nsICacheStorage.idl Obtained from call to one of the *Storage methods on nsICacheStorageService. Represents a distinct storage area (or scope) to put and get cache entries mapped by URLs into and from it. Similarity with the old cache: this interface may be with some limitations considered as a mirror to nsICacheSession, but le...
...And 2 more matches
NSS Sample Code Utilities_1
PR_fprintf(out, "%02x:", data[i]); column += 3; } else { PR_fprintf(out, "%02x", data[i]); column += 2; break; } if (column > 76 || (i % 16 == limit)) { Newline(out); column = level; limit = i % 16; } } if (column != level) { Newline(out); } } /* * GetDigit */ int GetDigit(char c) { if (c == 0) { return -1; } if (c <= '9' && c >= '0') { return c - '0'; } if (c <= 'f' && c >= 'a') { return c - 'a' + 0xa; } if (c <= 'F' && c >= 'A') { return c - 'A' + 0xa; } return -1; } /* * HexToBuf */ int HexToBuf(unsigned char *inString, SECItem *outbuf, PRBool isHexData) { int len = strle...
... if (c <= '9' && c >= '0') { return c - '0'; } if (c <= 'f' && c >= 'a') { return c - 'a' + 0xa; } if (c <= 'F' && c >= 'A') { return c - 'A' + 0xa; } return -1; } /* * HexToBuf */ int HexToBuf(unsigned char *inString, SECItem *outbuf, PRBool isHexData) { int len = strlen(inString); int outLen = len+1/2; int trueLen = 0; int digit1, digit2; outbuf->data = isHexData ? PORT_Alloc(outLen) : PORT_Alloc(len); if (!outbuf->data) { return -1; } if (isHexData) { while (*inString) { if ((*inString == '\n') || (*inString == ':')) { inString++; continue; } digit1 = GetDigit(*inString++); digit2 = GetD...
..., digit2; outbuf->data = isHexData ? ...
...And 2 more matches
sample2
PR_STDERR, "problem while SGN_Update\n"); goto cleanup; } } rv = SGN_End(sgn, res); if (rv != SECSuccess) { PR_fprintf(PR_STDERR, "problem while SGN_End\n"); goto cleanup; } cleanup: if (inFile) { PR_Close(inFile); } if (sgn) { SGN_DestroyContext(sgn, PR_TRUE); } return rv; } /* * Verify the signature using public key */ SECStatus VerifyData(const char *inFileName, SECKEYPublicKey *pk, SECItem *sigItem, secuPWData *pwdata) { unsigned int nb; unsigned char ibuf[4096]; SECStatus rv = SECFailure; VFYContext *vfy = NULL; PRFileDesc *inFile = NULL; /* Open the input file for reading */ inFile = PR_Open(inFileName, PR_RDONLY, 0); if (!inFile) { PR_fprintf(PR_STDERR, "Unable to open \"%s\" for reading.\n", inFileName); rv = SECFailure; goto cleanup; } vfy = VFY_CreateContext(pk, sigItem, SEC_OID_PKC...
...of inFileName and writes to signatureFileName */ SECStatus FindKeyAndSign(PK11SlotInfo *slot, CERTCertDBHandle* certHandle, secuPWData *pwdata, const char *nickNameStr, const char *headerFileName, const char *inFileName) { SECStatus rv; PRFileDesc *headerFile = NULL; PRFileDesc *inFile = NULL; CERTCertificate *cert = NULL; unsigned int signatureLen = 0; SECKEYPrivateKey *privkey = NULL; SECItem sigItem; SECOidTag hashOIDTag; /* Open the header file 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; } /* Get the certificate by nick name and write to header file */ cert = CERT_FindCertByNicknameOrEmailAddr(certHandle...
...NameStr); rv = SECFailure; goto cleanup; } WriteToHeaderFile(cert->derCert.data, cert->derCert.len, CERTVFY, headerFile); /* Find private key from certificate */ privkey = PK11_FindKeyByAnyCert(cert, NULL); if (privkey == NULL) { fprintf(stderr, "Couldn't find private key for cert\n"); rv = SECFailure; goto cleanup; } /* Sign the contents of the input file */ rv = SignData(inFileName, privkey, &sigItem); if (rv != SECSuccess) { PR_fprintf(PR_STDERR, "could not sign the contents from file - %s \n", inFileName); goto cleanup; } /* write signature to header file */ WriteToHeaderFile(sigItem.data, sigItem.len, SIG, headerFile); cleanup: if (headerFile) { PR_Close(headerFile); } if (privkey) { SECKEY_DestroyPrivateKey(privkey); } if (cert) { CERT_DestroyCertificate(cert); } return rv; } /* * Finds...
...And 2 more matches
nsACString_internal
onst nsCSubstringTuple&) - source this is public to support automatic conversion of tuple to string base type, which helps avoid converting to nsTAString. ...
...is is public to support automatic conversion of tuple to string base type, which helps avoid converting to nsTAString. ...
...ps avoid converting to nsTAString. ...
...And 2 more matches
nsAString_internal
ringTuple&) - source this is public to support automatic conversion of tuple to string base type, which helps avoid converting to nsTAString. ...
...omatic conversion of tuple to string base type, which helps avoid converting to nsTAString. ...
...ters nsSubstringTuple& tuple void nsAString_internal(PRUnichar*, PRUint32, PRUint32) - source Parameters PRUnichar* data PRUint32 length PRUint32 flags BeginReading PRUnichar* BeginReading() const - source reading iterators nsReadingIterator<short unsigned int>& BeginReading(nsReadingIterator<short unsigned int>&) const - source deprecated reading iterators Parameters nsReadingIterator<short unsigned int>& iter PRUnichar*& BeginReading(const PRUnichar*&) const - source Parameters PRUnichar*& iter EndReading PRUnichar* EndReading() const - source nsReadingIterator<short unsigned int>& EndReading(nsReadingIterator<short unsigned int>&) const - source Parameters nsReadingIterator<short unsigned int>& iter PRUnichar*& EndReading(const PRUnichar*&) const ...
...And 2 more matches
nsDependentCSubstring
Base Classes nsACString_internal Data Members No public members. ...
...rnal Data Members No public members. ...
... Constructors void nsDependentCSubstring(const nsACString_internal&, PRUint32, PRUint32) - source Parameters nsACString_internal& str PRUint32 startPos PRUint32 length void nsDependentCSubstring(const char*, const char*) - source Parameters char* start char* end void nsDependentCSubstring(const nsReadingIterator<char>&, const nsReadingIterator<char>&) - source Parameters nsReadingIterator<char>& start nsReadingIterator<char>& end void nsDependentCSubstring() - source Rebind void Rebind(const nsACString_internal&, PRUint32, PRUint32) - source Parameters nsACString_internal& <anonymous> PRUint32 startPos PRUint32 length void Rebind(const char*, const char*) - source Parameters char* start char* end BeginReading char* BeginReading() const - source re...
...And 2 more matches
Standard OS Libraries
winapi - WinAPI js-ctypes snippets that can be copied and pasted to scratchpad COM See Using COM from js-ctypes. UNIX Unix based operating systems are Linux, *BSD, Solaris, etc. There is a star/asterik ("*") before "BSD" because this means the BSD family such as FreeBSD, OpenBSD (who by the way made ssh), NetBSD, etc. GTK+ and Qt are graphic frameworks, the...
...ctypes.int(); let mask = new ctypes.unsigned_int(); XQueryPointer(display, rootWindow, root.address(), child.address(), rootX.address(), rootY.address(), windowX.address(), windowY.address(), mask.address() ); XCloseDisplay(display); Components.utils.reportError(rootX.value + "," + rootY.value); X11.close(); Resources for X11 Extended Window Manager Hints GitHubGISTS :: Noitidart / Search . x11 - X11 js-ctypes snippets that can be copied and pasted to scratchpad XCB All the above methods, GDK, GTK, and X11/Xlib are meant to be used on the main thread. If you would like to do stuff off of the main thread, in ChromeWorker's, then you should use XCB. XCB is thread safe. Resources for XCB GitHub :: Noitidart - ostypes / ostypes_x11.jsm - Some meth...
...CoreFoundation - CoreFoundation js-ctypes snippets that can be copied and pasted to scratchpad Cocoa See Using Objective-C from js-ctypes for more info. To call Objective-C based API from ctypes, use the following functions in libobjc.dylib: objc_getClass to g...
...And 2 more matches
Using the CSS Typed Object Model - Web APIs
access all the CSS properties and values -- including custom properties -- that are impacting an element. Let's see how this works by creating our first example, which explores computedStyleMap(). We start with some HTML: a paragraph with a link, as well as a definition list to which we will add all the CSS Property / Value pairs. ...
...s. <p> <a href="https://example.com">Link</a> </p> <dl id="regurgitation"></dl> We add JavaScript to grab our unstyled link and return back a definition list of all the default CSS property values impacting the link using computedStyleMap(). ...
...art by adding some CSS to our example, including a custom property and an inhertable property: p { font-weight: bold; } a { --color: red; color: var(--color); } Instead of getting all the properties, we create an array of properties of interest and use the StylePropertyMapReadOnly.get() method to get each of their values: <p> <a href="https://example.com">Link</a> </p> <dl id="regurgitation"></dl> // get the element const myElement = document.querySelector('a'); // get the <dl> we'll be populating const stylesList = document.querySelector('#regurgitation'); // Retrieve all computed styles with computedStyleMap() const allComputedStyles = myElement.computedStyleMap(); // array of properties we're interested in const ofInterest = ['font-weight', 'border-left-color', 'color',...
...And 2 more matches
Fullscreen API - Web APIs
y active (fullscreenElement is not null), we call exitFullscreen() on the document to shut off full-screen mode. Specifications Specification Status Fullscreen API Living Standard Browser compatibility Document.fullscreen The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetfullscreen DeprecatedChrome Full support 71 Full support 71 Full support ...
... No supportDeprecated. Not for use in new websites.Deprecated. Not for use in new websites.User must explicitly enable this feature.User must explicitly enable this feature.Uses a non-standard name.Uses a non-standard name. Document.fullscreenElement The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetfullscreenElementChrome Full support 53Prefixed Full support 53Prefixed Prefixed Implemented...
...must explicitly enable this feature.User must explicitly enable this feature.Uses a non-standard name.Uses a non-standard name.Requires a vendor prefix or different name for use.Requires a vendor prefix or different name for use. Document.fullscreenEnabled The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetfullscreenEnabledChrome Full support 45 Full support 45 Full support ...
...And 2 more matches
SubtleCrypto.importKey() - Web APIs
const rawKey = window.crypto.getRandomValues(new Uint8Array(16)); /* Import an AES secret key from an ArrayBuffer containing the raw bytes. Takes an ArrayBuffer string containing the bytes, and returns a Promise that will resolve to a CryptoKey representing the sec...
...SiviwLFfK_", "ext": true, "key_ops": ["sign"], "kty": "EC", "x": "SzrRXmyI8VWFJg1dPUNbFcc9jZvjZEfH7ulKI1UkXAltd7RGWrcfFxqyGPcwu6AQ", "y": "hHUag3OvDzEr0uUQND4PXHQTXP5IDGdYhJhL-WLKjnGjQAw0rNGy5V29-aV-yseW" }; Examples Note: You can try the working examples on GitHub. Raw import This example imports an AES key from an ArrayBuffer containing the bytes to use. See the complete code on GitHub. const rawKey = window.crypto.getRandomValues(new Uint8Array(16)); /* Import an AES secret key from an ArrayBuffer containing the raw bytes. Takes an ArrayBuffer string containing the bytes, and returns a Promise that will resolve to a CryptoKey representing the secret key. */ function importSecretKey(rawKey) { return window.crypto.subtle.importKey( "raw", rawKey, "AES-GCM", ...
... string containing the bytes, and returns a Promise that will resolve to a CryptoKey representing the secret key. */ function importSecretKey(rawKey) { return window.crypto.subtle.importKey( "raw", rawKey, "AES-GCM", true, ["encrypt", "decrypt"] ); } PKCS #8 import This example imports an RSA private signing key from a PEM-encoded PKCS #8 object. See the complete code on GitHub. /* Convert a string into an ArrayBuffer from https://developers.google.com/web/updates/2012/06/How-to-convert-ArrayBuffer-to-and-from-String */ function str2ab(str) { const buf = new ArrayBuffer(str.length); const bufView = new Uint8Array(buf); for (let i = 0, strLen = str.length; i < strLen; i++) { bufView[i] = str.charCodeAt(i); } return buf; } const pemEncodedKey = `-----BE...
...And 2 more matches
SubtleCrypto.verify() - Web APIs
It takes as its arguments a key to verify the signature with, some algorithm-specific parameters, the signature, and the original signed data. It returns a Promise which will be fulfilled with a Boolean value indicating whether the signature is valid. Syntax const result = crypto.subtle.verify(algorithm, key, signature, data); Parameters algorithm is a DOMString or object defining the algorithm to use, and for some algorithm choices, some extra parameters. The values given for the extra parameters must match those passed into the corresponding sign() call. ...
...n the following exception is encountered: InvalidAccessError Raised when the encryption key is not a key for the requested verifying algorithm or when trying to use an algorithm that is either unknown or isn't suitable for a verify operation. Supported algorithms The verify() method supports the same algorithms as the sign() method. Examples Note: You can try the working examples out on GitHub. RSASSA-PKCS1-v1_5 This code uses a public key to verify a signature. See the complete code on GitHub. /* Fetch the contents of the "message" textbox, and encode it in a form we can use for sign operation. */ function getMessageEncoding() { const messageBox = document.querySelector(".rsassa-pkcs1 #message"); let message = messageBox.value; let enc = new TextEncoder(); return enc.en...
...rsassa-pkcs1 .signature-value"); signatureValue.classList.remove("valid", "invalid"); let encoded = getMessageEncoding(); let result = await window.crypto.subtle.verify( "RSASSA-PKCS1-v1_5", publicKey, signature, encoded ); signatureValue.classList.add(result ? "valid" : "invalid"); } RSA-PSS This code uses a public key to verify a signature. See the complete code on GitHub. /* Fetch the contents of the "message" textbox, and encode it in a form we can use for sign operation. */ function getMessageEncoding() { const messageBox = document.querySelector(".rsa-pss #message"); let message = messageBox.value; let enc = new TextEncoder(); return enc.encode(message); } /* Fetch the encoded message-to-sign and verify it against the stored signature. * If it che...
...And 2 more matches
WebGL best practices - Web APIs
In practice, effectively all systems support at least the following: MAX_CUBE_MAP_TEXTURE_SIZE: 4096 MAX_RENDERBUFFER_SIZE: 4096 MAX_TEX...
...In practice, effectively all systems support at least the following: MAX_CUBE_MAP_TEXTURE_SIZE: 4096 MAX_RENDERBUFFER_SIZE: 4096 MAX_TEXTURE_SIZE: 4096 MAX_VIEWPORT_DIMS: [4096,4096] MAX_VERTEX_TEXTURE_IMAGE_UNITS: 4 MAX_TEXTURE_IMAGE_UNITS: ...
...eral of the issues mentioned above. It offers a way to support all common compressed texture formats with a single compressed texture file, through a JavaScript library that efficiently converts formats at load time. It also adds additional compression that makes Basis Universal compressed texture files much smaller than regular compressed textures over-the-wire, more comparable to JPEG. https://github.com/BinomialLLC/basis_universal/blob/master/webgl/README.md Memory usage of depth and stencil formats Depth and stencil attachments and formats are actually inseparable on many devices. You may ask for DEPTH_COMPONENT24 or STENCIL_INDEX8, but you're often getting D24X8 and X24S8 32bpp formats behind the scenes. Assume that the memory usage of depth and stencil formats is rounded up to the ne...
...And 2 more matches
window.location - Web APIs
Web › API › Window › location
Nulla sollicitudin diam non quam iaculis ac porta justo venenatis. Quisque tellus urna, molestie vitae egestas sit amet, suscipit sed sem. Quisque nec lorem eu velit faucibus tristique ut ut dolor. Cras eu tortor ut libero placerat venenatis ut ut massa. Sed quis libero augue, et consequat libero. Morbi rutrum augue sed turpis elementum sed luctus nisl molestie. Aenean vitae...
...s ac porta justo venenatis. Quisque tellus urna, molestie vitae egestas sit amet, suscipit sed sem. Quisque nec lorem eu velit faucibus tristique ut ut dolor. Cras eu tortor ut libero placerat venenatis ut ut massa. Sed quis libero augue, et consequat libero. Morbi rutrum augue sed turpis elementum sed luctus nisl molestie. Aenean vitae purus risus, a semper nisl. Pellentesque malesuada, est id sagittis consequat, libero mauris tincidunt tellus, eu sagittis arcu purus rutrum eros. Quisque eget eleifend mi. Duis pharetra mi ac eros mattis lacinia rutrum ipsum varius.</p> <p>Fusce cursus pulvinar aliquam. Duis justo enim, ornare vitae elementum sed, porta a quam. Aliquam eu enim eu libero mollis tempus. Morbi ornare aliquam posuere. Proin faucibus luctus libero, sed ultrices lorem sagittis et. ...
...Aliquam augue turpis, varius vel bibendum ut, aliquam at diam. Nam lobortis, dui eu hendrerit pellentesque, sem neque porttitor erat, non dapibus velit lectus in metus. Vestibulum sit amet felis enim. In quis est vitae nunc malesuada consequat nec nec sapien. Suspendisse aliquam massa placerat dui lacinia luctus sed vitae risus. ...
...And 2 more matches
Applying color to HTML elements using CSS - HTML: Hypertext Markup Language
a web page or can be placed in he page using the <img> element, just like any other type of image. WebGL The Web Graphics Library is an OpenGL ES-based API for drawing high-performance 2D and 3D graphics on the Web. See our WebGL tutorial to find out more. How to describe a color In order to represent a color in CSS, you have to find a way to translate the analog concept of "color" into a digital form that a computer can use. This is typically done by breaking down the color into components, such as how much of each of a set of primary colors to mix together, or how bright to make the color. As such, there are several ways you can describe color in CSS. For more detailed discussion of each of the color value types, see the reference for the CSS <color> unit. Keywords A set of standar...
...lack to white, including colors like darkgray and lightgrey), and a variety of other blended colors including lightseagreen, cornflowerblue, and rebeccapurple. See Color keywords in <color> for a list of all available color keywords. RGB values There are three ways to represent an RGB color in CSS. ...
...The string is case-insensitive. ...
...And 2 more matches
<input type="file"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › file
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... <input> elements with type="file" let the user choose one or more files from their device storage. Once chosen, the files can be uploaded to a server using form submission, or manipulated using JavaScript code and the File API. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Value A DOMString representing the path to the selected file. Events change and input Supported common attributes required Additional Attributes accept, capture, files, multiple IDL attributes files and value DOM interface HTMLInputElement Properties ...
... Regardless of the user's device or operating system, the file input provides a button that opens up a file picker dialog that allows the user to choose a file. Including the multiple attribute, as shown above, specifies that multiple files can be chosen at once. The user can choose multiple files from the file picker in any way that ...
...And 2 more matches
Grammar and types - JavaScript
ock-scoped, local variable, optionally initializing it to a value. const Declares a block-scoped, read-only named constant. Variables You use variables as symbolic names for values in your application. The names of variables, called identifiers, conform to certain rules. A JavaScript identifier must start with a letter, underscore (_), or dollar sign ($). Subsequent characters can also be digits (0-9). Because JavaScript is case sensitive, letters include the characters "A" through "Z" (uppercase) as well as "a" through "z" (lowercase). You can use most of ISO 8859-1 or Unicode letters such as a and u in identifiers. (For more details, see this blog post.) You can also use the Unicode escape sequences as characters in identifiers. Some examples of legal names are Number_hits, temp99,...
...onfuse the primitive Boolean values true and false with the true and false values of the Boolean object. The Boolean object is a wrapper around the primitive Boolean data type. See Boolean for more information. Numeric literals Number and BigInt types can be written in decimal (base 10), hexadecimal (base 16), octal (base 8) and binary (base 2). A decimal numeric literal is a sequence of digits without a leading 0 (zero). A leading 0 (zero) on a numeric literal, or a leading 0o (or 0O) indicates it is in octal. Octal numerics can include only the digits 0-7. A leading 0x (or 0X) indicates a hexadecimal numeric type. Hexadecimal numerics can include digits (0-9) and the letters a-f and A-F. (The case of a character does not change its value. Therefore: 0xa = 0xA = 10 and 0xf = 0xF = 1...
...s it is in octal. Octal numerics can include only the digits 0-7. A leading 0x (or 0X) indicates a hexadecimal numeric type. Hexadecimal numerics can include digits (0-9) and the letters a-f and A-F. (The case of a character does not change its value. Therefore: 0xa = 0xA = 10 and 0xf = 0xF = 15.) A leading 0b (or 0B) indicates a binary numeric literal. Binary numerics can only include the digits 0 and 1. Some examples of numeric literals are: 0, 117, -345, 123456789123456789n (decimal, base 10) 015, 0001, -0o77, 0o777777777777n (octal, base 8) 0x1123, 0x00111, -0xF1A7, 0x123456789ABCDEFn (hexadecimal, "hex" or base 16) 0b11, 0b0011, -0b11, 0b11101001010101010101n (binary, base 2) For more information, see Numeric literals in the Lexical grammar reference...
...And 2 more matches
Regular expression syntax cheatsheet - JavaScript
set, the dot loses its special meaning and matches a literal dot. Note that the m multiline flag doesn't change the dot behavior. So to match a pattern across multiple lines, the character set [^] can be used -- it will match any character including newlines. ES2018 added the s "dotAll" flag, which allows the dot to also match line terminators. \d Matches any digit (Arabic numeral). Equivalent to [0-9]. For example, /\d/ or /[0-9]/ matches "2" in "B2 is the suite number". \D Matches any character that is not a digit (Arabic numeral). Equivalent to [^0-9]. For example, /\D/ or /[^0-9]/ matches "B" in "B2 is the suite number". \w Matches any alphanumeric character from the basic Latin alphabet, including the underscor...
...foo" in "foo bar". \t Matches a horizontal tab. \r Matches a carriage return. \n Matches a linefeed. \v Matches a vertical tab. \f Matches a form-feed. [\b] Matches a backspace. If you're looking for the word-boundary character (\b), see Boundaries. \0 Matches a NUL character. Do not follow this with another digit. \cX Matches a control character using caret notation, where "X" is a letter from A-Z (corresponding to codepoints U+0001-U+001F). For example, /\cM/ matches "\r" in "\r\n". \xhh Matches the character with the code hh (two hexadecimal digits). \uhhhh Matches a UTF-16 code-unit with the value hhhh (four hexadecimal digits). \u{hhhh} or \u{hhhhh...
... \ Indicates that the following character should be treated specially, or "escaped". It behaves one of two ways. ...
...And 2 more matches
Intl.NumberFormat.prototype.resolvedOptions() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The Intl.NumberFormat.prototype.resolvedOptions() method returns a new object with properties reflecting the locale and number formatting options computed during initialization of this NumberFormat object. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax numberFormat.resolvedOptions() Return value A new object with properties reflecting the locale and number formatting options computed during the initialization of the given NumberFormat object. Description The resulting object has the following properties: locale The BCP 47 language tag for the locale actually used. If any Unicode extension values we...
... "auto" filled in as a default. useGrouping The values provided for these properties in the options argument or filled in as defaults. currency currencyDisplay The values provided for these properties in the options argument or filled in as defaults. These properties are only present if style is "currency". ...
...And 2 more matches
Authoring MathML - MathML
tely, some browsers are not able to render MathML equations or only have a limited support. Hence you will need to use a MathML polyfill to provide some fallback rendering. If you need only basic mathematical constructions such as those used on this MDN wiki then a small mathml.css stylesheet might be enough. To use it, just insert one line in your document header: <script src="https://fred-wang.github.io/mathml.css/mspace.js"></script> If you need more complex constructions, you might instead consider using the heavier MathJax library as a MathML polyfill: <script src="https://fred-wang.github.io/mathjax.js/mpadded-min.js"></script> Note that these two scripts perform feature detection of the mspace or mpadded elements (see the browser compatibility table on these pages). There is also a...
...g.github.io/mathjax.js/mpadded-min.js"></script> Note that these two scripts perform feature detection of the mspace or mpadded elements (see the browser compatibility table on these pages). There is also a similar script to display a warning at the top of the page for browsers without good MathML support and let the users choose between one of the fallback above: <script src="https://fred-wang.github.io/mathml-warning.js/mpadded-min.js"></script> If you don't want to use this link to GitHub but instead to integrate these polyfills or others in your own project, you might need the detection scripts to verify the level of MathML support. For example the following function verifies the MathML support by testing the mspace element (you may replace mspace with mpadded): function hasMathMLSup...
... to use Latin Modern for the text and Latin Modern Math for the mathematics: @namespace url('http://www.w3.org/1999/xhtml'); @namespace m url('http://www.w3.org/1998/Math/MathML'); body, m|mtext { font-family: Latin Modern; } m|math { font-family: Latin Modern Math; } You can then use the @font-face rule as usual to provide WOFF fallback for Latin Modern and Latin Modern Math. See this GitHub repository to get WOFF fonts and sample CSS stylesheets to use on your Web site and check its test page. MathML in XML documents (XHTML, EPUB, etc) If for some reason you need to use MathML in XML documents, be sure to satisfy the usual requirements: well-formed document, use of correct MIME type, MathML namespace "http://www.w3.org/1998/Math/MathML" on <math> roots. For example, the XHTML v...
...And 2 more matches
Using XPInstall to Install Plugins - Archive of obsolete content
Communicator 4.x uses the notion of SmartUpdate to install software, particularly plugins and Java applets to be run locally. SmartUpdate is not supported by Mozilla browsers (and Netscape/AOL browsers based on Mozilla such as Netscape 7), but because of the similarity between the two installer technologies, it is easy to convert your SmartUpdate files to XPInstall files. SmartUpdate involves a digitally signed JAR file which contained the software components to be installed as well as a JavaScript install.js file (called the install script) as the installer logic. Downloads and installs would be initiated with a security dialog box naming the certificate authority and the signer. Often, the SmartUpdate download was triggered via the pluginurl attribute of the embed tag: <embed type="applica...
..., the pluginurl attribute points to the signed JAR file, which Netscape Communicator 4.x would then download (subject to the security dialog boxes) if the plugin was not located on the user's machine. SmartUpdate differs from XPInstall in that: XPInstall uses ZIP files named XPI files (*.xpi) and SmartUpdate uses JAR files (*.jar) Unlike a SmartUpdate JAR file, XPI Packages do not have to be digitally signed with a code-signing certificate. XPI Packages make use of different APIs from within install.js, although the concept is the same. XPInstall for Mozilla-based browsers is analogous to SmartUpdate in Netscape Communicator 4.x browsers. Porting SmartUpdate deployments to XPInstall is trivial after gaining some familiarity with the new XPInstall API. The Recommended Installation Proce...
... a Mozilla-browser file that stores metadata about the software that has just been installed. This value can be queried via web-page delivered JavaScript, and is useful for initiating XPInstall downloads via Trigger Scripts. You can determine the version of the software that has been installed, and determine whether to update it, all via JavaScript in a web-page. A String representing the four digit version of the software. Caveat: Certain versions of Mozilla-based browsers (such as Netscape 6.x) treat the use of the equals character ("=") as an illegal token and thus do not allow invocation of initInstall with strings containing "=". A workaround to this would be to detect if initInstall has failed, and then invoke it again without the "=" string. Here is an example: var PLID = "MyPlugin.
...m servers to clients, make sure that XPI Packages are served with this MIME type in the HTTP headers. Associate the application/x-xpinstall MIME type with XPI Packages. The Uninstall Problem In its current iteration, XPInstall does not have an affiliated uninstall technology. It can therefore only be used to install files or deliver native code installers to the client, and if uninstall is a legitimate concern, it might be wise to write a native code (EXE) uninstaller to remove the software. XPInstall can therefore be the "agent of delivery" to streamline the download of the EXE software, but ultimately, the logic of installation and uninstallation will be handled by EXE, which can then create files and registry entries and also clean up after itself upon removal. Original Document Info...
How do you upload your files to a web server? - Learn web development
nt and how to write a simple webpage. Objective: Learn how to push files to a server using the various file transfer tools available. Summary If you have built a simple web page (see HTML basics for an example), you will probably want to put it online, on a web server. In this article we'll discuss how to do that, using various available options such as SFTP clients, RSync and GitHub. SFTP There are several SFTP clients out there. Our demo covers FileZilla, since it's free and available for Windows, macOS and Linux. To install FileZilla go to the FileZilla downloads page, click the big Download button, then install from the installer file in the usual way. Note: Of course there are lots of other options. See Publishing tools for more information. Open the FileZilla a...
...ded at How To Copy Files With Rsync Over SSH. Rsync GUI tools As with other command line tools, GUI tools also exist for Rsync, for those who are not as comfortable with using the command line. Acrosync is one such tool, and it is available for Windows and macOS. Again, you would have to get the connection credentials from your hosting provider, but this way you'd have a GUI to enter them in. ...
...ow To Copy Files With Rsync Over SSH. Rsync GUI tools As with other command line tools, GUI tools also exist for Rsync, for those who are not as comfortable with using the command line. Acrosync is one such tool, and it is available for Windows and macOS. Again, you would have to get the connection credentials from your hosting provider, but this way you'd have a GUI to enter them in. ...
...nc GUI tools As with other command line tools, GUI tools also exist for Rsync, for those who are not as comfortable with using the command line. Acrosync is one such tool, and it is available for Windows and macOS. Again, you would have to get the connection credentials from your hosting provider, but this way you'd have a GUI to enter them in. GitHub GitHub allows you to publish websites via GitHub pages (gh-pages). We've covered the basics of using this in the Publishing your website article from our Getting started with the Web guide, so we aren't going to repeat it all here. However, it is worth knowing that you can also host a website on GitHub, but use a custom domain with it. See Using a custom domain with GitHub Pages for a detailed guide. Other methods to upload files The FTP...
Document and website structure - Learn web development
sections, for example: header: <header>. navigation bar: <nav>. main content: <main>, with various content subsections represented by <article>, <section>, and <div> elements. sidebar: <aside>; often placed inside <main>. footer: <footer>. Active learning: exploring the code for our example Our example seen above is represented by the following code (you can also find the example in our GitHub repository). We'd like you to look at the example above, and then look over the listing below to see what parts make up what section of the visual. <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>My page title</title> <link href="https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300|Sonsie+One" rel="stylesheet" type="text/css"> <link rel="stylesheet" h...
...ttis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur.</p> <h3>Subsection</h3> <p>Donec ut librero sed accu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aenean ut gravida lorem. Ut turpis felis, pulvinar a semper sed, adipiscing id dolor.</p> <p>Pelientesque auctor nisi id magna consequat sagittis. Curabitur dapibus, enim sit amet elit pharetra tincidunt feugiat nist imperdiet. Ut convallis libero in urna ultrices accumsan. Donec sed odio eros.</p> <h3>Another subsection</h3> <p>Donec viverra mi quis quam pulvinar at malesuada arcu rhoncus. Cum soclis natoque penatibus et manis dis parturient montes, nascetur ridiculus mus. In rutrum accumsan ultricies. Mauris vitae ni...
...onec sed odio eros.</p> <h3>Another subsection</h3> <p>Donec viverra mi quis quam pulvinar at malesuada arcu rhoncus. Cum soclis natoque penatibus et manis dis parturient montes, nascetur ridiculus mus. In rutrum accumsan ultricies. Mauris vitae nisi at sem facilisis semper ac in est.</p> <p>Vivamus fermentum semper porta. ...
...nar at malesuada arcu rhoncus. Cum soclis natoque penatibus et manis dis parturient montes, nascetur ridiculus mus. In rutrum accumsan ultricies. Mauris vitae nisi at sem facilisis semper ac in est.</p> <p>Vivamus fermentum semper porta. Nunc diam velit, adipscing ut tristique vitae sagittis vel odio. Maecenas convallis ullamcorper ultricied. ...
From object to iframe — other embedding technologies - Learn web development
Clickjacking is one kind of common iframe attack where hackers embed an invisible iframe into your document (or embed your document into their own malicious website) and use it to capture users' interactions. This is a common way to mislead users or steal sensitive data. A quick example first though -- try loading the previous example we showed above into your browser -- you can find it live on Github (see the source code too.) You won't actually see anything displayed on the page, and if you look at the Console in the browser developer tools, you'll see a message telling you why. In Firefox, you'll get told Load denied by X-Frame-Options: /docs/Glossary does not permit framing. This is because the developers that built MDN have included a setting on the server that serves the website pages...
...at the cost, you must never embed third-party content with HTTP. (In the best case scenario, your user's Web browser will give them a scary warning.) All reputable companies that make content available for embedding via an <iframe> will make it available via HTTPS -- look at the URLs inside the <iframe> src attribute when you are embedding content from Google Maps or Youtube, for example. Note: Github pages allow content to be served via HTTPS by default, so is useful for hosting content. If you are using different hosting and are not sure, ask your hosting provider about it. Always use the sandbox attribute You want to give attackers as little power as you can to do bad things on your website, therefore you should give embedded content only the permissions needed for doing its job. Of c...
...ng). typemustmatch keeps the embedded file from running unless the type attribute provides the correct media type. typemustmatch can therefore confer significant security benefits when you're embedding content from a different origin (it can keep attackers from running arbitrary scripts through the plugin). ...
... necessary. Now let's look at an <object> example that embeds a PDF into a page (see the live example and the source code): <object data="mypdf.pdf" type="application/pdf" width="800" height="1200" typemustmatch> <p>You don't have a PDF plugin, but you can <a href="mypdf.pdf">download the PDF file. </a> </p> </object> PDFs were a necessary stepping stone between paper and digital, but they pose many accessibility challenges and can be hard to read on small screens. They do still tend to be popular in some circles, but it is much better to link to them so they can be downloaded or read on a separate page, rather than embedding them in a webpage. The case against plugins Once upon a time, plugins were indispensable on the Web. Remember the days when you had to install A...
Making decisions in your code — conditionals - Learn web development
ingDone === true) { let childsAllowance = 10; } else { let childsAllowance = 5; } This code as shown always results in the shoppingDone variable returning false, meaning disappointment for our poor child. It'd be up to us to provide a mechanism for the parent to set the shoppingDone variable to true if the child did the shopping. Note: You can see a more complete version of this example on GitHub (also see it running live.) else if The last example provided us with two choices, or outcomes -- but what if we want more than two? There is a way to chain on extra choices/outcomes to your if...else -- using else if. Each extra choice requires an additional block to put in between if() { ... } and else { ... } -- check out the following more involved example, which could be part of a sim...
... The very last choice, inside the else {...} block, is basically a "last resort" option -- the code inside it will be run if none of the conditions are true. In this case, it serves to empty the text out of the paragraph if nothing is selected, for example, if a user decides to re-select the "--Make a choice--" placeholder option shown at the beginning. Note: You can also find this example on GitHub (see it running live on there also.) A note on comparison operators Comparison operators are used to test the conditions inside our conditional statements. We first looked at comparison operators back in our Basic math in JavaScript -- numbers and operators article. Our choices are: === and !== -- test if one value is identical to, or not identical to, another. < and > -- test if one va...
...The ternary or conditional operator is a small bit of syntax that tests a condition and returns one value/expression if it is true, and another if it is false -- this can be useful in some situations, and can take up a lot less code...
...r. It starts with a test condition -- select.value === 'black'. If this returns true, we run the update() function with parameters of black and white, meaning that we end up with background color of black and text color of white. If it returns false, we run the update() function with parameters of white and black, meaning that the site color are inverted. Note: You can also find this example on GitHub (see it running live on there also.) Active learning: A simple calendar In this example, you are going to help us finish a simple calendar application. In the code you've got: A <select> element to allow the user to choose between different months. An onchange event handler to detect when the value selected in the <select> menu is changed. A function called createCalendar() that draws ...
Tools and testing - Learn web development
g scalable, interactive web applications. Many modern companies use frameworks as a standard part of their tooling, so many front-end development jobs now require framework experience. This module gives you some fundamental background knowledge about how client-side frameworks work and how they fit into your toolset, before moving on to tutorial series covering some of today's most popular ones. ...
...le, interactive web applications. Many modern companies use frameworks as a standard part of their tooling, so many front-end development jobs now require framework experience. This module gives you some fundamental background knowledge about how client-side frameworks work and how they fit into your toolset, before moving on to tutorial series covering some of today's most popular ones. ...
...This module aims to teach you what you need to know about both of them. Cross browser testing This module looks specifically at the area of testing web projects across different browsers. ...
...This module aims to teach you what you need to know about both of them. Cross browser testing This module looks specifically at the area of testing web projects across different browsers. Here we look at identifying your target audience (e.g. ...
SVG Guidelines
path/shape definition. Tools Tools can help to clean SVG files. Note, however that some of the rules stated above can be hard to detect with automated tools since they require too much context-awareness. To this date, there doesn't seem to be a tool that handles all of the above. ...
...VG files. Note, however that some of the rules stated above can be hard to detect with automated tools since they require too much context-awareness. To this date, there doesn't seem to be a tool that handles all of the above. ...
...es stated above can be hard to detect with automated tools since they require too much context-awareness. To this date, there doesn't seem to be a tool that handles all of the above. ...
... a tool that handles all of the above. ...
Localizing XLIFF files for iOS
iOS easy to do using translation tools. Editing the raw XLIFF file is also rather easy, especially if you're already familiar with XML. This tutorial will walk you through the steps you need to take to translation strings within an XLIFF file. String repository for Firefox on iOS The firefox-ios.xliff file is located in SVN. Decide where on your local computer you will store your copy of the github repo and navigate there in your terminal. Enter the command git clone https://github.com/mozilla-l10n/firefoxios-l10n/your-locale-code/ You should now see the firefox-ios project in your selected directoy with the firefox-ios.xliff file in it. Translating the XLIFF file Open the firefox-ios.xliff file in your favorite text editor. In the <file> tag, add the target-language attribute wi...
...</trans-unit> Save your translations along the way. Once you've completed translation, it's important to make sure the XML in your XLIFF file is valid (e.g., no broken tag sets). ...
...'ve completed translation, it's important to make sure the XML in your XLIFF file is valid (e.g., no broken tag sets). Open the file in Firefox to have it run a validity check and correct any errors it might yell about. ...
... translation, it's important to make sure the XML in your XLIFF file is valid (e.g., no broken tag sets). Open the file in Firefox to have it run a validity check and correct any errors it might yell about. ...
PR_dtoa
decpt A pointer to a memory location where the runtime will store the offset, relative to the beginning of the output string, of the conversion's decimal point. ...
... decpt A pointer to a memory location where the runtime will store the offset, relative to the beginning of the output string, of the conversion's decimal point. ...
... decpt A pointer to a memory location where the runtime will store the offset, relative to the beginning of the output string, of the conversion's decimal point. ...
...the returned value. Description This function converts the specified floating point number to a string, using the method specified by mode. Possible modes are: 0 Shortest string that yields d when read in and rounded to nearest. 1 Like 0, but with Steele & White stopping rule. For example, with IEEE 754 arithmetic, mode 0 gives 1e23 whereas mode 1 gives 9.999999999999999e22. 2 max(1, ndigits) significant digits. This gives a return value similar to that of ecvt, except that trailing zeros are suppressed. 3 Through ndigits past the decimal point. This gives a return value similar to that from fcvt, except that trailing zeros are suppressed, and ndigits can be negative. 4,5,8,9 Same as modes 2 and 3, but usingleft to right digit generation. 6-9 Same as modes 2 and 3, but do not ...
sslfnc.html
pointer to a string containing the pathname of the directory where the certificate, key, and security module databases reside. Returns The function returns one of these values: If successful, SECSuccess. If unsuccessful, SECFailure. Use PR_GetError to retrieve the error code. Description NSS_Init opens the certN.db, keyN.db, and secmod.db files (whereN is a numeric digit) in the specified directory. NSS_Init isnot idempotent, so call it only once. NSS_Init opens the database files read-only. If you are performing operations that require write permission, for example S/MIME operations such as adding a certificate, use NSS_InitReadWrite instead. Before calling NSS_Init, your program must call PR_Init. The policy flags for all cipher suites are turned off by ...
...to a string containing the pathname of the directory where the certificate, key, and security module databases reside. Returns The function returns one of these values: If successful, SECSuccess. If unsuccessful, SECFailure. Use PR_GetError to retrieve the error code. Description NSS_InitReadWrite opens the certN.db, keyN.db, and secmod.db files (whereN is a numeric digit) with both read and write permission in the specified directory. NSS_InitReadWrite isnot idempotent, so call it only once. Use NSS_InitReadWrite rather than NSS_Init if you are performing operations that require write permission, such as some S/MIME operations. Before calling NSS_InitReadWrite, your program must call PR_Init. The policy flags for all cipher suites are turned off by default,...
... NULL. Returns The function returns one of the following values: If successful, SECSuccess. If unsuccessful, SECFailure. Use PR_GetError to obtain the error code. Description The callback function set up by SSL_AuthCertificateHook is called to authenticate an incoming certificate. If the checksig parameter is set to PR_TRUE, the callback function also verifies the digital signature. NOTE: If you do not call SSL_AuthCertificateHook to supply a certificate authentication callback function, SSL uses the default callback function, SSL_AuthCertificate. The callback function has the following prototype: typedef SECStatus (*SSLAuthCertificate) ( void *arg, PRFileDesc *fd, PRBool checksig, PRBool isServer); This callback function has the following pa...
...s The function returns one of these values: If authentication is successful, SECSuccess. If authentication is not successful, SECFailure. Description SSL calls SSL_AuthCertificate by default (if no other callback function is provided) to authenticate an incoming certificate. If the checksig parameter is set to PR_TRUE (which is normally the case), the function also verifies the digital signature and the certificate chain. If the socket is a client socket, SSL_AuthCertificate tests the domain name in the SSL socket against the domain name in the server certificate's subject DN: If the domain name in the SSL socket doesn't match the domain name in the server certificate's subject DN, the function fails. If the SSL socket has not had a domain name set (that is, if SSL_S...
Shumway
's Add-ons menu (this will be listed as "Shockwave Flash" under the Plugins tab). This will be the experience met by your users who are running that version of Shumway. Hopefully, this displays your content with acceptable quality. The next step is to use the Inspector included as one of Shumway's examples. It can be run locally through a web server or you can use the version hosted on Mozilla's GitHub. Several methods exist to allow Inspector access to your SWF file. Once your Flash content is loaded, you can see how Shumway manages it in detail. Several buttons are available at the bottom of the screen to enable or disable various Shumway options. Note: If your applet runs at an abnormal speed, try toggling "Turbo" at the bottom of the inspector window. You may wish to do this before ope...
...t in detail. Several buttons are available at the bottom of the screen to enable or disable various Shumway options. Note: If your applet runs at an abnormal speed, try toggling "Turbo" at the bottom of the inspector window. You may wish to do this before opening your SWF file. Limitations of Shumway might be encountered through testing. ...
...Click on "New Issue" to file a new entry if a duplicate is not found. Please note that source code will be requested for the Shumway developers to use as small test cases. There does not currently exist a private method to contribute source code. ...
...ges problems relating to Shumway, itself. Bugzilla is intended for problems with integrating Shumway into Firefox. End-users and less involved developers may report issues by hovering over "Shumway" within Flash content, clicking "Report Problems", and filling the form. Performance and compatibility issues with Flash content should be reported through GitHub. From the main page for Shumway at GitHub, click on "Issues" and browse the outstanding issues for similar bugs to contribute to. Click on "New Issue" to file a new entry if a duplicate is not found. Please note that source code will be requested for the Shumway developers to use as small test cases. There does not currently exist a private method to contribute source code. You could also directly commit bug fixes as pull requests. T...
Virtualenv
m-installed python and not python that you are installing as a user. This page is mostly a stub for how virtualenv is used at Mozilla. For more information on virtualenv in general, see the virtualenv web site. Python packaging at Mozilla is covered in Python. Getting Virtualenv virtualenv is a python package. You can download it from its PyPI package page or install it with easy_install. ...
...ore information on virtualenv in general, see the virtualenv web site. Python packaging at Mozilla is covered in Python. Getting Virtualenv virtualenv is a python package. You can download it from its PyPI package page or install it with easy_install. The github virtualenv repository is maintained by the Python Packaging Authority (including Mozilla's Tarek Ziade and Ian Bicking). If you have git installed, you can clone the latest version of virtualenv: git clone git://github.com/pypa/virtualenv.git If you have pip or easy_install, you can install virtualenv directly from the web: pip install virtualenv # -or- easy_install virtualenv This will fetch virtualenv from PyPI and install it in your site-packages. You may need to use sudo to obtain appropriate permissions for the system. If...
... Again, you may need to use sudo to install globally. If you're running Ubuntu, there is also an Ubuntu package available: sudo apt-get install python-virtualenv virtualenv.py may also be run as standalone software with the same functionality. ...
...b virtualenv repository, extract from the tarball (in the PyPI case), and run python setup.py install. Again, you may need to use sudo to install globally. If you're running Ubuntu, there is also an Ubuntu package available: sudo apt-get install python-virtualenv virtualenv.py may also be run as standalone software with the same functionality. It will require it to be part of a clone of the github repository or have internet access to fetch setuptools. On Mac OS X, you will need Xcode to use virtualenv. See this article for details. Using Virtualenv Once you have virtualenv installed, you can make virtual environments: > virtualenv tmp New python executable in tmp/bin/python Installing setuptools............done. Installing pip...............done. A python binary, as well as easy...
Using the Gamepad API - Web APIs
ds()[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); }); The Gamepad object's properties are as follows: id: A string containing some information about the controller. This is not strictly specified, but in Firefox it will contain three pieces of information separated by dashes (-): two 4-digit hexadecimal strings containing the USB vendor and product id of the controller, and the name of the controller as provided by the driver. This information is intended to allow you to find a mapping for the controls on the device as well as display useful feedback to the user. index: An integer that is unique for each gamepad currently connected to the system. This can be used to distinguish mult...
..., this object will be updated every time the gamepad's state changes. Using button information Let's look at a simple example that displays connection information for one gamepad (it ignores subsequent gamepad connections) and allows you to move a ball around the screen using the four gamepad buttons on the right hand side of the gamepad. You can view the demo live, and find the source code on Github. To start with, we declare some variables: The gamepadInfo paragraph that the connection info is written into, the ball that we want to move, the start variable that acts as the ID for requestAnimation Frame, the a and b variables that act as position modifiers for moving the ball, and the shorthand variables that will be used for the requestAnimationFrame() and cancelAnimationFrame() cross b...
....style.left = a * 2 + "px"; ball.style.top = b * 2 + "px"; start = requestAnimationFrame(gameLoop); } Complete example: Displaying gamepad state This example shows how to use the Gamepad object, as well as the gamepadconnected and gamepaddisconnected events in order to display the state of all gamepads connected to the system. You can find a working demo and look at the full source code on Github. var haveEvents = 'ongamepadconnected' in window; var controllers = {}; function connecthandler(e) { addgamepad(e.gamepad); } function addgamepad(gamepad) { controllers[gamepad.index] = gamepad; var d = document.createElement("div"); d.setAttribute("id", "controller" + gamepad.index); var t = document.createElement("h1"); t.appendChild(document.createTextNode("gamepad: " + gam...
...Child(e); } d.appendChild(b); var a = document.createElement("div"); a.className = "axes"; for (var i = 0; i < gamepad.axes.length; i++) { var p = document.createElement("progress"); p.className = "axis"; //p.id = "a" + i; p.setAttribute("max", "2"); p.setAttribute("value", "1"); p.innerHTML = i; a.appendChild(p); } d.appendChild(a); // See https://github.com/luser/gamepadtest/blob/master/index.html var start = document.getElementById("start"); if (start) { start.style.display = "none"; } document.body.appendChild(d); requestAnimationFrame(updateStatus); } function disconnecthandler(e) { removegamepad(e.gamepad); } function removegamepad(gamepad) { var d = document.getElementById("controller" + gamepad.index); document.bo...
SubtleCrypto.encrypt() - Web APIs
AES in Cipher Block Chaining Mode, as specified in NIST SP800-38A. AES-GCM This represents AES in Galois/Counter Mode, as specified in NIST SP800-38D. One major difference between this mode and the others is that GCM is an "authenticated" mode, which means that it includes checks that the ciphertext has not been modified by an attacker. Examples Note: You can try the working examples out on GitHub. RSA-OAEP This code fetches the contents of a text box, encodes it for encryption, and encrypts it with using RSA-OAEP. See the complete code on GitHub. function getMessageEncoding() { const messageBox = document.querySelector(".rsa-oaep #message"); let message = messageBox.value; let enc = new TextEncoder(); return enc.encode(message); } function encryptMessage(publicKey) { let...
...lue; let enc = new TextEncoder(); return enc.encode(message); } function encryptMessage(publicKey) { let encoded = getMessageEncoding(); return window.crypto.subtle.encrypt( { name: "RSA-OAEP" }, publicKey, encoded ); } AES-CTR This code fetches the contents of a text box, encodes it for encryption, and encrypts it using AES in CTR mode. See the complete code on GitHub. function getMessageEncoding() { const messageBox = document.querySelector(".aes-ctr #message"); let message = messageBox.value; let enc = new TextEncoder(); return enc.encode(message); } function encryptMessage(key) { let encoded = getMessageEncoding(); // counter will be needed for decryption counter = window.crypto.getRandomValues(new Uint8Array(16)); return window.crypto.
...TR' , false, ["encrypt", "decrypt"]); const encrypted_content = await window.crypto.subtle.encrypt( { name: "AES-CTR", counter: iv, length: 128 }, key_encoded, data ); //Uint8Array console.log(encrypted_content); AES-CBC This code fetches the contents of a text box, encodes it for encryption, and encrypts it using AES in CBC mode. See the complete code on GitHub. function getMessageEncoding() { const messageBox = document.querySelector(".aes-cbc #message"); let message = messageBox.value; let enc = new TextEncoder(); return enc.encode(message); } function encryptMessage(key) { let encoded = getMessageEncoding(); // iv will be needed for decryption iv = window.crypto.getRandomValues(new Uint8Array(16)); return window.crypto.subtle.enc...
...key) { let encoded = getMessageEncoding(); // iv will be needed for decryption iv = window.crypto.getRandomValues(new Uint8Array(16)); return window.crypto.subtle.encrypt( { name: "AES-CBC", iv }, key, encoded ); } AES-GCM This code fetches the contents of a text box, encodes it for encryption, and encrypts it using AES in GCM mode. See the complete code on GitHub. function getMessageEncoding() { const messageBox = document.querySelector(".aes-gcm #message"); let message = messageBox.value; let enc = new TextEncoder(); return enc.encode(message); } function encryptMessage(key) { let encoded = getMessageEncoding(); // iv will be needed for decryption iv = window.crypto.getRandomValues(new Uint8Array(12)); return window.crypto.subtle.enc...
SubtleCrypto.exportKey() - Web APIs
lfills with an ArrayBuffer containing the key. Exceptions The promise is rejected when one of the following exceptions is encountered: InvalidAccessError Raised when trying to export a non-extractable key. NotSupported Raised when trying to export in an unknown format. TypeError Raised when trying to use an invalid format. Examples Note: You can try the working examples out on GitHub. Raw export This example exports an AES key as an ArrayBuffer containing the bytes for the key. See the complete code on GitHub. /* Export the given key and write it into the "exported-key" space. */ async function exportCryptoKey(key) { const exported = await window.crypto.subtle.exportKey( "raw", key ); const exportedKeyBuffer = new Uint8Array(exported); const exportKeyO...
...enerateKey( { name: "AES-GCM", length: 256, }, true, ["encrypt", "decrypt"] ).then((key) => { const exportButton = document.querySelector(".raw"); exportButton.addEventListener("click", () => { exportCryptoKey(key); }); }); PKCS #8 export This example exports an RSA private signing key as a PKCS #8 object. The exported key is then PEM-encoded. See the complete code on GitHub. /* Convert an ArrayBuffer into a string from https://developers.google.com/web/updates/2012/06/How-to-convert-ArrayBuffer-to-and-from-String */ function ab2str(buf) { return String.fromCharCode.apply(null, new Uint8Array(buf)); } /* Export the given key and write it into the "exported-key" space. */ async function exportCryptoKey(key) { const exported = await window.crypto.subtle.expor...
...y([1, 0, 1]), hash: "SHA-256", }, true, ["sign", "verify"] ).then((keyPair) => { const exportButton = document.querySelector(".pkcs8"); exportButton.addEventListener("click", () => { exportCryptoKey(keyPair.privateKey); }); }); SubjectPublicKeyInfo export This example exports an RSA public encryption key as a PEM-encoded SubjectPublicKeyInfo object. See the complete code on GitHub. /* Convert an ArrayBuffer into a string from https://developers.google.com/web/updates/2012/06/How-to-convert-ArrayBuffer-to-and-from-String */ function ab2str(buf) { return String.fromCharCode.apply(null, new Uint8Array(buf)); } /* Export the given key and write it into the "exported-key" space. */ async function exportCryptoKey(key) { const exported = await window.crypto.subtle.expor...
...publicExponent: new Uint8Array([1, 0, 1]), hash: "SHA-256", }, true, ["encrypt", "decrypt"] ).then((keyPair) => { const exportButton = document.querySelector(".spki"); exportButton.addEventListener("click", () => { exportCryptoKey(keyPair.publicKey); }); }); JSON Web Key import This code exports an ECDSA private signing key as a JSON Web Key object. See the complete code on GitHub. /* Export the given key and write it into the "exported-key" space. */ async function exportCryptoKey(key) { const exported = await window.crypto.subtle.exportKey( "jwk", key ); const exportKeyOutput = document.querySelector(".exported-key"); exportKeyOutput.textContent = JSON.stringify(exported, null, " "); } /* Generate a sign/verify key pair, then set up an event listene...
SubtleCrypto.wrapKey() - Web APIs
For key wrapping you have the additional option of AES-KW. AES-KW AES-KW is a way to use the AES cipher for key wrapping. One advantage of using AES-KW over another AES mode such as AES-GCM is that AES-KW does not require an initialization vector. To use AES-KW, the input must be a multiple of 64 bits. AES-KW is specified in RFC 3394. Examples Note: You can try the working examples out on GitHub. Raw wrap This example wraps an AES key. It uses "raw" as the export format and AES-KW, with a password-derived key, to encrypt it. See the complete code on GitHub. let salt; /* Get some key material to use as input to the deriveKey method. The key material is a password supplied by the user. */ function getKeyMaterial() { const password = window.prompt("Enter your password"); const e...
...ubtle.generateKey( { name: "AES-GCM", length: 256, }, true, ["encrypt", "decrypt"] ) .then((secretKey) => { return wrapCryptoKey(secretKey); }) .then((wrappedKey) => { console.log(wrappedKey); }); PKCS #8 wrap This example wraps an RSA private signing key. It uses "pkcs8" as the export format and AES-GCM, with a password-derived key, to encrypt it. See the complete code on GitHub. let salt; let iv; /* Get some key material to use as input to the deriveKey method. The key material is a password supplied by the user. */ function getKeyMaterial() { const password = window.prompt("Enter your password"); const enc = new TextEncoder(); return window.crypto.subtle.importKey( "raw", enc.encode(password), {name: "PBKDF2"}, false, ["deriveBits", "deri...
...Uint8Array([1, 0, 1]), hash: "SHA-256", }, true, ["sign", "verify"] ) .then((keyPair) => { return wrapCryptoKey(keyPair.privateKey); }) .then((wrappedKey) => { console.log(wrappedKey); }); SubjectPublicKeyInfo wrap This example wraps an RSA public encryption key. It uses "spki" as the export format and AES-CBC, with a password-derived key, to encrypt it. See the complete code on GitHub. let salt; let iv; /* Get some key material to use as input to the deriveKey method. The key material is a password supplied by the user. */ function getKeyMaterial() { const password = window.prompt("Enter your password"); const enc = new TextEncoder(); return window.crypto.subtle.importKey( "raw", enc.encode(password), {name: "PBKDF2"}, false, ["deriveBits", "deri...
...t: new Uint8Array([1, 0, 1]), hash: "SHA-256", }, true, ["encrypt", "decrypt"] ) .then((keyPair) => { return wrapCryptoKey(keyPair.publicKey); }) .then((wrappedKey) => { console.log(wrappedKey); }); JSON Web Key import This code wraps an ECDSA private signing key. It uses "jwk" as the export format and AES-GCM, with a password-derived key, to encrypt it. See the complete code on GitHub. let salt; let iv; /* Get some key material to use as input to the deriveKey method. The key material is a password supplied by the user. */ function getKeyMaterial() { const password = window.prompt("Enter your password"); const enc = new TextEncoder(); return window.crypto.subtle.importKey( "raw", enc.encode(password), {name: "PBKDF2"}, false, ["deriveBits", "deri...
Fundamentals of WebXR - Web APIs
d using events, while other controls are available through a special WebXR-specific implementation of the Gamepad object. Basic concepts Before getting into too much detail, let's consider some basic concepts that you need to know before you learn how to develop XR code. Field of view The term field of view (FOV) is one which applies to any visual technology, from old film cameras to modern digital video cameras, including the cameras in computers and mobile devices. What is field of view? The field of view is, at its essence, the extent of the environment you are able to see at any one time. The width of the field of view is measured as the angle defining the arc from the far left edge of your field of view to the far right edge, and is specified in either degrees or radians. A human ...
... light or infrared). WebXR session modes WebXR offers support for both augmented reality (AR) and virtual reality (VR) sessions, using the same API. Which type of session you want to create is specified when creating the session. This is done by specifying the appropriate session mode string for the kind of session you want to create. Virtual reality In a VR environment, the entire image is digitally created by your app or site, from foreground objects all the way to the background or skybox. Your frame drawing code will have to redraw every pixel of each view during each frame in order to avoid the potential of artifacts being left behind. Some platforms may provide previously-cleared frames to you, while others may optimize performance by not erasing the framebuffers in order to avoid h...
...air of cameras, one for each eye, to capture the scene in stereo in order to retain the world's depth, with the WebXR scene then rendered for each eye with that eye's captured background in place. Devices which use transparent glasses to allow the user to see the world, while overlaying the rendered image atop the scene. The user is, thus, directly viewing the real world instead of a series of digital photos of it. Both types of device should be capable of also presenting VR sessions. WebXR doesn't generally care which type of device you're using, and the rendering process is almost exactly the same as for VR, except you don't erase the background or skybox before rendering each frame. For more information about using WebXR to create augmented reality experiences, see Augmented reality wi...
... has. Goggles and glasses XR goggles are similar to headsets in that they involve the placing of graphics display surfaces in front of the eyes in order to render the views of a scene needed to simulate the depth of the simulated scene. The difference is that the goggles pass through the real world, overlaying the rendered image on top of the user's physical environment. This is done without digitally reproducing the world, as would be necessary with a full headset. Instead, the display surface is transparent, and if not displaying anything is essentially identical to wearing regular eyeglasses. When objects are drawn, they are drawn onto the goggles' lenses, either partially or completely blocking the physical environment from being seen through the obscured portion of the lens. CAVEs A...
WebXR performance guide - Web APIs
usable as possible on the broadest assortment of target devices. In this guide, we'll examine a variety of suggestions and recommendations that will help you make your WebXR app as performant as possible. Rendering tips ... Talk about general stuff like limiting how many different loops there are during rendering, avoiding unnecessary drawing, etc. ...
...performant as possible. Rendering tips ... Talk about general stuff like limiting how many different loops there are during rendering, avoiding unnecessary drawing, etc. Can probably also include stuff from https://github.com/immersive-web/webxr/blob/master/explainer.md#changing-the-field-of-view-for-inline-sessions Managing rendering quality ... This section will come in part from https://github.com/immersive-web/webxr/blob/master/explainer.md#controlling-rendering-quality Managing frame rate ... Managing use of depth ... ...
...include stuff from https://github.com/immersive-web/webxr/blob/master/explainer.md#changing-the-field-of-view-for-inline-sessions Managing rendering quality ... This section will come in part from https://github.com/immersive-web/webxr/blob/master/explainer.md#controlling-rendering-quality Managing frame rate ... Managing use of depth ... ...
...field-of-view-for-inline-sessions Managing rendering quality ... This section will come in part from https://github.com/immersive-web/webxr/blob/master/explainer.md#controlling-rendering-quality Managing frame rate ... Managing use of depth ... This section will combine information from https://github.com/immersive-web/webxr/blob/master/explainer.md#controlling-depth-precision and https://github.com/immersive-web/webxr/blob/master/explainer.md#preventing-the-compositor-from-using-the-depth-buffer Optimizing memory use When using libraries that perform things such as matrix mathematics, you typically have a number of working variables through which various vectors, matrices, and quaternions pass over time. It makes sense, then, to have a limited set of these objects, simply replacing...
:disabled - CSS: Cascading Style Sheets
Web › CSS › :disabled
Living Standard No ch...
... Living Standard No change. HTML5The definition of ':disabled' in that specification. Recommendation Defines the semantics of HTML and form...
... Living Standard No change. HTML5The definition of ':disabled' in that specification. Recommendation Defines the semantics of HTML and forms. Selectors Level 4The...
... // Attach `change` event listener to checkbox document.getElementById('billing-checkbox').onchange = toggleBilling; }, false); function toggleBilling() { // Select the billing text fields var billingItems = document.querySelectorAll('#billing input[type="text"]'); // Toggle the billing text fields for (var i = 0; i < billingItems.length; i++) { billingItems[i].disabled = !billingItems[i].disabled; } } Result Specifications Specification Status Comment HTML Living StandardThe definition of ':disabled' in that specification. Living Standard No change. HTML5The definition of ':disabled' in that specification. Recommendation Defines the semantics of HTML and forms. Selectors Level 4The definition of ':disabled' i...
:where() - CSS: Cascading Style Sheets
Web › CSS › :where
e> <h2>:is()-styled links</h2> <section class="is-styling"> <p>Here is my main content. This <a href="https://mozilla.org">contains a link</a>. </section> <aside class="is-styling"> <p>Here is my aside content. This <a href="https://developer.mozilla.org">also contains a link</a>. </aside> <footer class="is-styling"> <p>This is my footer, also containing <a href="https://github.com/mdn">a link</a>. </footer> </article> <article> <h2>:where()-styled links</h2> <section class="where-styling"> <p>Here is my main content. This <a href="https://mozilla.org">contains a link</a>. </section> <aside class="where-styling"> <p>Here is my aside content. This <a href="https://developer.mozilla.org">also contains a link</a>. </aside> <footer class="where-s...
...ere()-styled links</h2> <section class="where-styling"> <p>Here is my main content. This <a href="https://mozilla.org">contains a link</a>. </section> <aside class="where-styling"> <p>Here is my aside content. This <a href="https://developer.mozilla.org">also contains a link</a>. </aside> <footer class="where-styling"> <p>This is my footer, also containing <a href="https://github.com/mdn">a link</a>. </footer> </article> In this somewhat-contrived example, we have two articles that each contain a section, an aside, and a footer. They differ by the classes used to mark the child elements. To make selecting the links inside them simpler, but still distinct, we could use :is() or :where(), in the following manner: html { font-family: sans-serif; font-size: 150%; ...
...tors inside :where() have specificity 0, so the orange footer link will be overidden by our simple selector. You can see the result below (although bear in mind that currently :is() and :where() are currently only enabled by default in Firefox Nightly, version 77+. In other versions of Firefox it is behind a pref -- layout.css.is-where-selectors.enabled). Note: You can also find this example on GitHub; see is-where. Syntax :where( <complex-selector-list> )where <complex-selector-list> = <complex-selector>#where <complex-selector> = <compound-selector> [ <combinator>? <compound-selector> ]*where <compound-selector> = [ <type-selector>? <subclass-selector>* [ <pseudo-element-selector> <pseudo-class-selector>* ]* ]!<combinator> = '>' | '+' | '~' | [ '|' ]where <type-selector> = <wq-name> |...
...| '^' | '$' | '*' ]? '='<attr-modifier> = i | s Specifications Specification Status Comment Selectors Level 4The definition of ':where()' in that specification. Working Draft Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet:where()Chrome Full support 72Disabled Full support 72Disabled Disabled From version 72: thi...
font-weight - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The font-weight CSS property sets the weight (or boldness) of the font. The weights available depend on the font-family that is currently set. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Keyword values */ font-weight: normal; font-weight: bold; /* Keyword values relative to the parent */ font-weight: lighter; font-weight: bolder; /* Numeric keyword values */ font-weight: 100; font-weight: 200; font-weight: 300; font-weight: 400;// normal font-weight: 500; font-weight: 600; font-weight: 700;// bold font-weight: 800; font-weight: 900; /* Global values */ font-weight: inherit; font-weight: initial; f...
...tween 1 and 1000. ...
..."1" max="1000" /> <label for="weight">Weight</label> </header> <div class="container"> <p class="sample">...it would not be wonderful to meet a Megalosaurus, forty feet long or so, waddling like an elephantine lizard up Holborn Hill.</p> </div> CSS /* Mutator Sans is created by LettError (https://github.com/LettError/mutatorSans) and is used here under the terms of its license: https://github.com/LettError/mutatorSans/blob/master/LICENSE */ @font-face { src: url('https://mdn.mozillademos.org/files/16011/MutatorSans.ttf'); font-family:'MutatorSans'; font-style: normal; } label { font: 1rem monospace; white-space: nowrap; } .container { max-height: 150px; overflow-y: auto; } .sample { text-transform: uppercase; font: 1.5rem 'MutatorSans', sans-serif; } html, ...
<input type="datetime-local"> - HTML: Hypertext Markup Language
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... <input> elements of type datetime-local create input controls that let the user easily enter both a date and a time, including the year, month, and day as well as the time in hours and minutes. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The control's UI varies in general from browser to browser; at the moment support is patchy, with only Chrome/Opera and Edge on desktop and most modern versions of mobile browsers having usable implementations. In other browsers, these degrade gracefully to simple <input type="text"> controls. The control is intended to simply represent a local date and time, not necessarily t...
...er support for datetime-local, and the variations in how the inputs work, it may currently still be best to use a framework or library to present these, or to use a custom input of your own. Another option is to use separate date and time inputs, each of which is more widely supported than datetime-local. Some browsers may resort to a text-only input element that validates that the results are legitimate date/time values before letting them be delivered to the server, as well, but you shouldn't rely on this behavior since you can't easily predict it. For those of you not using a supporting browser, the Chrome/Opera datetime-local control looks like the below screenshot. Clicking the down arrow on the right hand side brings up a date picker to allow you to choose a date; you have to enter th...
...lient-side) In many servers, dates are stored as numbers instead of as strings--numbers of a fixed size and agnostic of format (aside from endianness). After the year 10,000, those numbers will just be a little bit bigger than before, so many servers will not see issues with forms submitted after the year 10,000. The problem is with the client side of things: parsing of dates with more than 4 digits in the year. <!--midnight of January 1st, 10000: the exact time of Y10K--> <input type="datetime-local" value=""+010000-01-01T05:00"/> It's that simple. Just prepare your code for any number of digits. Do not only prepare for 5 digits. Here is JavaScript code for programmatically setting the value: function setValue(element, date) { var isoString = date.toISOString() element.value = i...
<input type="email"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › email
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The input value is automatically validated to ensure that it's either empty or a properly-formatted e-mail address (or list of addresses) before the form can be submitted. ...
... <input> elements of type email are used to let the user enter and edit an e-mail address, or, if the multiple attribute is specified, a list of e-mail addresses. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The input value is automatically validated to ensure that it's either empty or a properly-formatted e-mail address (or list of addresses) before the form can be submitted. The :valid and :invalid CSS pseudo-classes are automatically applied as appropriate to visually denote whether the current value of the field is a valid e-mail address or not. On browsers that don't support inputs of type email, a email in...
... order confirmation, for webmail, and so forth. As such, the email input type can make your job as a web developer much easier since it can help simplify your work when building the user interface and logic for e-mail addresses. When you create an email input with the proper type value, email, you get automatic validation that the entered text is at least in the correct form to potentially be a legitimate e-mail address. This can help avoid cases in which the user mistypes their address, or provides an invalid address. It's important, however, to note that this is not enough to ensure that the specified text is an e-mail address which actually exists, corresponds to the user of the site, or is acceptable in any other way. It simply ensures that the value of the field is properly formatted to...
...uld be entered, and suggests that it should be a corporate beststartupever.com account. This is in addition to the fact that using type email will validate the text to ensure that it's formatted like an e-mail address. If the text in the input box isn't an e-mail address, you'll get an error message that looks something like this: If we left things at that, we would at least be validating on legitimate e-mail addresses. But we want to go one step farther: we want to make sure that the e-mail address is in fact in the form "username@beststartupever.com". This is where we'll use pattern. We set pattern to .+@beststartupever.com. This simple regular expression requests a string that consists of at least one character of any kind, then an "@" followed by the domain name "beststartupever.com". ...
Numbers and dates - JavaScript
and structures for context with other primitive types in JavaScript. You can use four types of number literals: decimal, binary, octal, and hexadecimal. Decimal numbers 1234567890 42 // Caution when using leading zeros: 0888 // 888 parsed as decimal 0777 // parsed as octal in non-strict mode (511 in decimal) Note that decimal literals can start with a zero (0) followed by another decimal digit, but if every digit after the leading 0 is smaller than 8, the number gets parsed as an octal number. Binary numbers Binary number syntax uses a leading zero followed by a lowercase or uppercase Latin letter "B" (0b or 0B). If the digits after the 0b are not 0 or 1, the following SyntaxError is thrown: "Missing binary digits after 0b". var FLT_SIGNBIT = 0b10000000000000000000000000000000; // ...
... var n = 0755; // 493 var m = 0644; // 420 Strict mode in ECMAScript 5 forbids octal syntax. Octal syntax isn't part of ECMAScript 5, but it's supported in all browsers by prefixing the octal number with a zero: 0644 === 420 and "\045" === "%". ...
...tax isn't part of ECMAScript 5, but it's supported in all browsers by prefixing the octal number with a zero: 0644 === 420 and "\045" === "%". In ECMAScript 2015, octal numbers are supported if they are prefixed with 0o, e.g.: var a = 0o10; // ES2015: 8 Hexadecimal numbers Hexadecimal number syntax uses a leading zero followed by a lowercase or uppercase Latin letter "X" (0x or 0X). If the digits after 0x are outside the range (0123456789ABCDEF), the following SyntaxError is thrown: "Identifier starts immediately after numeric literal". 0xFFFFFFFFFFFFFFFFF // 295147905179352830000 0x123456789ABCDEF // 81985529216486900 0XA // 10 Exponentiation 1E3 // 1000 2e6 // 2000000 0.1e2 // 10 Number object The built-in Number object has properties for numerical constant...
... rounding to a whole number of days. The parse method is useful for assigning values from date strings to existing Date objects. For example, the following code uses parse and setTime to assign a date value to the IPOdate object: var IPOdate = new Date(); IPOdate.setTime(Date.parse('Aug 9, 1995')); Example In the following example, the function JSClock() returns the time in the format of a digital clock. function JSClock() { var time = new Date(); var hour = time.getHours(); var minute = time.getMinutes(); var second = time.getSeconds(); var temp = '' + ((hour > 12) ? hour - 12 : hour); if (hour == 0) temp = '12'; temp += ((minute < 10) ? ':0' : ':') + minute; temp += ((second < 10) ? ':0' : ':') + second; temp += (hour >= 12) ? ' P.M.' : ' A.M.'; return temp; } ...
Array.prototype[@@iterator]() - JavaScript
case for this syntax over using the dot notation (Array.prototype.values()) is in a case where you don't know what object is going to be ahead of time. If you have a function that takes an iterator and then iterate over the value, but don't know if that Object is going to have a [Iterable].prototype.values method. This could be a built-in object like String object or a custom object. ...
... ...
... ...
... ...
Array.prototype.reduce() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a Pull Request. ...
... The reduce() method executes a reducer function (that you provide) on each element of the array, resulting in single output value. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a Pull Request. 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 callba...
... second call 10 1 1 [0, 1, 2, 3, 4] 11 third call 11 2 2 [0, 1, 2, 3, 4] 13 fourth call 13 3 3 [0, 1, 2, 3, 4] 16 fifth call 16 4 4 [0, 1, 2, 3, 4] 20 The value returned by reduce() in this case would be 20. ...
... [0, 1, 2, 3, 4] 11 third call 11 2 2 [0, 1, 2, 3, 4] 13 fourth call 13 3 3 [0, 1, 2, 3, 4] 16 fifth call 16 4 4 [0, 1, 2, 3, 4] 20 The value returned by reduce() in this case would be 20. ...
BigInt.prototype.toLocaleString() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax bigIntObj.toLocaleString([locales [, options]]) Parameters The locales and options arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. ...
...Chinese decimal console.log(bigint.toLocaleString('zh-Hans-CN-u-nu-hanidec')); // -> ???,???,???,???,???,??? // when requesting a language...
... ECMAScript Internationalization API (ECMA-402)The definition of 'BigInt.prototype.toLocaleString()' in that specification. ...
... ECMAScript Internationalization API (ECMA-402)The definition of 'BigInt.prototype.toLocaleString()' in that specification. ...
Date.prototype.toLocaleTimeString() - JavaScript
f this date. The new locales and options arguments let applications specify the language whose formatting conventions should be used and customize the behavior of the function. In older implementations, which ignore the locales and options arguments, the locale used and the form of the string returned are entirely implementation dependent. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dateObj.toLocaleTimeString([locales[, options]]) Parameters The locales and options arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. In ...
...US // US English uses 12-hour time with AM/PM console.log(date.toLocaleTimeString('en-US')); // -> "7:00:00 PM" // British English uses 24-hour time without AM/PM console.log(date.toLocaleTimeString('en-GB')); // -> "03:00:00" // Korean uses 12-hour time with AM/PM console.log(date.toLocaleTimeString('ko-KR')); // -> "?? 12:00:00" // Arabic in most Arabic speaking countries uses real Arabic digits console.log(date.toLocaleTimeString('ar-EG')); // -> "?:??:?? ?" // when requesting a language that may not be supported, such as // Balinese, include a fallback language, in this case Indonesian console.log(date.toLocaleTimeString(['ban', 'id'])); // -> "11.00.00" Using options The results provided by toLocaleTimeString() can be customized using the options argument: var date = new Date(Da...
... ECMAScript Internationalization API (ECMA-402)The definition of 'Date.prototype.toLocaleTimeString' in that specification. ...
... ECMAScript Internationalization API (ECMA-402)The definition of 'Date.prototype.toLocaleTimeString' in that specification. ...
Date.prototype.toUTCString() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dateObj.toUTCString() Return value A string representing the given date using the UTC time zone. ...
... The toUTCString() method converts a date to a string, using the UTC time zone. Based on rfc7231 and modified according to ecma-262 toUTCString, it can have negative values in the 2021 version The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...ples and send us a pull request. Syntax dateObj.toUTCString() Return value A string representing the given date using the UTC time zone. Description The value returned by toUTCString() is a string in the form Www, dd Mmm yyyy hh:mm:ss GMT, Where: Format Sring Description Www Day of week, as three letters (e.g. ...
...ne. Description The value returned by toUTCString() is a string in the form Www, dd Mmm yyyy hh:mm:ss GMT, Where: Format Sring Description Www Day of week, as three letters (e.g. Sun, Mon, ...) dd Day of month, as two digits with leading zero if required Mmm Month, as three letters (e.g. Jan, Feb, ...) yyyy Year, as four or more digits with leading zeroes if required hh Hour, as two digits with leading zero if required mm Minute, as two digits with leading zero if required ss Seconds, as two digits with leading zero if required Prior to ECMAScript 2018, the format of the return value varied according to the platform. The most common return value was an RFC-1123 formatted date stamp, w...
Math.log1p() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Math.log1p(x) Parameters x A number. Return value The natural logarithm (base e) of 1 plus the given number. ...
... The Math.log1p() function returns the natural logarithm (base e) of 1 + a number, that is ?x>-1,Math.log1p(x)=ln(1+x)\forall x > -1, \mathtt{\operatorname{Math.log1p}(x)} = \ln(1 + x) The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Math.log1p(x) Parameters x A number. Return value The natural logarithm (base e) of 1 plus the given number. If the number is less than -1, NaN is returned. Description For very small values of x, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 = 1.000000000000001, but 1 + 1e-16 = 1.00000000000...
... Return value The natural logarithm (base e) of 1 plus the given number. If the number is less than -1, NaN is returned. Description For very small values of x, adding 1 can reduce or eliminate precision. The double floats used in JS give you about 15 digits of precision. 1 + 1e-15 = 1.000000000000001, but 1 + 1e-16 = 1.000000000000000 and therefore exactly 1.0 in that arithmetic, because digits past 15 are rounded off. When you calculate log(1 + x), you should get an answer very close to x, if x is small (that's why these are called 'natural' logarithms). If you calculate Math.log(1 + 1.1111111111e-15) you should get an answer close to 1.1111111111e-15. Instead, you will end up taking the logarithm of 1.00000000000000111022 (the roundoff is in binary so sometimes it gets ugly), so...
..., you should get an answer very close to x, if x is small (that's why these are called 'natural' logarithms). If you calculate Math.log(1 + 1.1111111111e-15) you should get an answer close to 1.1111111111e-15. Instead, you will end up taking the logarithm of 1.00000000000000111022 (the roundoff is in binary so sometimes it gets ugly), so you get the answer 1.11022...e-15, with only 3 correct digits. If, instead, you calculate Math.log1p(1.1111111111e-15) you will get a much more accurate answer 1.1111111110999995e-15 with 15 correct digits of precision (actually 16 in this case). If the value of x is less than -1, the return value is always NaN. Because log1p() is a static method of Math, you always use it as Math.log1p(), rather than as a method of a Math object you created (Math is no...
Number.prototype.toFixed() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax numObj.toFixed([digits]) Parameters digits Optional The number of digits to appear after the decimal point; this may be a value between 0 and 20, inclusive, and implementations may optionally support a larger range of values. If this argument is omitted, it is treated as 0. Return value A string representing the given number using fixed-point notation. ...
...tax numObj.toFixed([digits]) Parameters digits Optional The number of digits to appear after the decimal point; this may be a value between 0 and 20, inclusive, and implementations may optionally support a larger range of values. If this argument is omitted, it is treated as 0. Return value A string representing the given number using fixed-point notation. Exceptions RangeError If digits is too small or too large. Values between 0 and 100, inclusive, will not cause a RangeError. Implementations are allowed to support larger and smaller values as chosen. TypeError If this method is invoked on an object that is not a Number. ...
...The number is rounded if necessary, and the fractional part is padded with zeros if necessary so that it has the specified length. If the absolute value of numObj is greater or equal to 1e+21, this method simply calls Number.prototype.toString() and returns a string in exponential notation. ...
...The number is rounded if necessary, and the fractional part is padded with zeros if necessary so that it has the specified length. If the absolute value of numObj is greater or equal to 1e+21, this method simply calls Number.prototype.toString() and returns a string in exponential notation. ...
jpm - Archive of obsolete content
cd $HOME && npm install jpm To run jpm from a terminal when installed locally, you must add the directory "$HOME/node_modules/.bin/" to your terminal's PATH first. Add the following line to the end of the file $HOME/.profile to add it to your PATH permanently (as the file .profile is executed every time a new terminal is opened): export PATH="$HOME/node_modules/.bin/:$PATH" Installing jpm from git Alternatively, you can also get the latest version of jpm using git: git clone https://github.com/mozilla-jetpack/jpm.git cd jpm npm install npm link After installing jpm After installation, at the command prompt, type: jpm You should see a screen summarizing the available jpm commands. Note that unlike cfx, jpm is available in every command prompt you start, as long as you installed it wi...
...the option to run add-ons which are unsigned.]: jpm run -b nightly You can set the JPM_FIREFOX_BINARY environment variable with the path to the version of Firefox you want to run. When you invoke jpm run or jpm test without the -b option, jpm first checks JPM_FIREFOX_BINARY, and use this as the path if it is set. Using .jpmignore to ignore files Using .jpmignore is similar to using .gitignore with git, .hgignore with Mercurial, or .npmignore with npm. By using this file, you can let jpm know which files you would like it to ignore when building a .xpi file with jpm xpi. Here is an example: # Ignore .DS_Store files created by mac .DS_Store # Ignore any zip or xpi files *.zip *.xpi A .jpmignore file with the above contents would ignore all zip files and .DS_Store files from t...
... you run or package an add-on using jpm run or jpm xpi, the add-on uses the versions of the modules in the version of Firefox that hosts it. As an add-on developer, this is usually what you want. But if you're developing the SDK modules themselves, of course, it isn't. In this case you need to: Get a local copy of the SDK modules that you want: this usually means checking out the SDK from its GitHub repo Set the JETPACK_ROOT environment variable to your local copy Pass the -o option to jpm run or jpm xpi: jpm run -o This instructs jpm to use the local copies of the SDK modules, not the ones in Firefox. If you do not want to set the JETPACK_ROOT environment variable, you can pass the location of your copy of the SDK modules along with -o: jpm run -o "/path/to/addon-sdk/" The path m...
Creating Reusable Modules - Archive of obsolete content
= fp.file.path; // work with returned nsILocalFile... } return path; } Hash function Firefox has built-in support for hash functions, exposed via the nsICryptoHash XPCOM interface The documentation page for that interface includes an example of calculating an MD5 hash of a file's contents, given its path. ...
...h(false); // convert the binary hash data to a hex string. ...
...k with the string paths. var path = fp.file.path; // work with returned nsILocalFile... } return path; } exports.promptForFile = promptForFile; md5.js Next, create another file in "lib", called "md5.js". ...
Bootstrapped extensions - Archive of obsolete content
you must have folders for each of the languages you want to provide; each folder must be named a valid locale (ex: en-US). Inside this folder must be a property file. Inside the chrome.manifest file these locale must be defined. For example if you had a subfolder of en-US in locale folder your chrome.manifest file will have to contain: locale NAME_OF_YOUR_ADDON en-US locale/ Here is an example: GitHub :: l10n-properties - on startup of this add-on it will show a prompt saying USA or Great Britain, which ever it deems closest to your locale. You can test different locale by going to about:config and changing preference of general.useragent.locale to en-US and then to en-GB and disabling then re-enabling the add-on. XUL and HTML Files - Using Entities from DTD Files Many times HTML pages ar...
...You can go to about:config and change the value of the preference general.useragent.locale to en-US and then to en-GB and then reload the open pages to see the localization change. Further reading How to convert an overlay extension to restartless a step by step g...
...e must also include a line pointing to the locale, just like in the above property section, if you had a folder named en-US in locale, the chrome.manifest file should contain: locale NAME_OF_YOUR_ADDON en-US locale/ Here is an example add-on that opens an HTML page and a XUL page on install: GitHub :: l10n-xhtml-xul. Here is an example showing how to use a localized HTML page as an options page: GitHub :: l10n-html-options. You can go to about:config and change the value of the preference general.useragent.locale to en-US and then to en-GB and then reload the open pages to see the localization change. Further reading How to convert an overlay extension to restartless a step by step guide. Some code samples are provided. The page is based on and expanded from Dave Garrett's step-by-step g...
Extension Versioning, Update and Compatibility - Archive of obsolete content
The toolkit version format supports the Firefox version format but allows greater flexibility. ...
... the already installed add-on updateURL must be specified in one of the following ways: The updateURL uses https, or there is no updateURL at all (which defaults to addons.mozilla.org which is https) The updateURL uses http and the updateKey entry is specified which will be used to verify the data in the update manifest. When you specify an updateKey in the install.rdf, you must include a digital signature in the update manifest or the information will be rejected. In the update manifest delivered from the updateURL the updateLink must be specified in one of the following ways: The updateLink to the XPI file must use https The updateLink can use http and you must include an updateHash for the XPI file using sha1, sha256, sha384 or sha512 hash algorithms. Any entries in the update...
...xtension... simple right-click gives you hash values for any file. There is also an enhancement bug about adding automatic hash generation of XPI files to mccoy. And all popular (scripting) languages offer support, for examples: Python, Perl: CPAN Digest, PHP Signing Update Manifests If you wish to serve your update RDF over regular http, Gecko 1.9 based applications will require that you digitally sign the update manifest to ensure that it's information isn't tampered with between you creating it and applications retrieving it. The McCoy tool should be used to sign the update RDF. The technical details of the signing mechanism are beyond the scope of this document however the basics are as follows: Step 1 - Done once, before you publish your add-on The target: Adding updateKey in in...
New Security Model for Web Services - Archive of obsolete content
ly be implemented for SOAP calls by untrusted scripts. When an attempt is made to access a resource at a previously-unknown URI, the sandbox reads a file at that domain with declarations to determine whether access is permitted to the script. If the file is not there, access is denied. The Problem External untrusted scripts loaded behind a firewall are executed in a sandbox. These scripts may legitimately require access to external resources, but permitting them to access internal resources permits the compromise of these resources that would normally not be available to applications outside of the firewall. The sandbox must distinguish and protect internal resources. Client-controlled Solutions Several client-controlled solutions have been designed to prevent sandboxed applications loade...
...icy has generally been successful in sandboxing Javascript and Java applets across the web. If the sandbox is unable to distinguish the common URI substring of the domain to be trusted from similar URIs of untrusted domains, then it could allow a script loaded from an indistinguishable domain to exploit firewall-protected resources. Also, this technique prevents the script from accessing many legitimate external resources not provided in the same domain as the script. This prevents a script from accessing web services and data published from any domain besides its own. White-listing By creating a white list of trusted URIs from which scripts are trusted to not compromise internal resources, it is possible to release domains from the stricter same-source sandbox. A white list is a good too...
...omains, but this requires extensive management which at best is quite error-prone for the end user and easily opens holes in a firewall that do not directly hurt the user who reconfigured his browser to try to access some external service but hurts the owners of other services behind the firewall. Signed Scripts A certain degree of additional trust may be lent to a script by having the author digitally sign it. But signed scripts have not really caught on as they require certificates do not change the basic problem that some completely-unknown party has written a script that might now have access to internal resources. Asking the User Where the sandbox cannot otherwise determine whether the executing script should be permitted access to the resource, a dialog box may be raised to ask the ...
XULRunner Hall of Fame - Archive of obsolete content
, update your status and share stuff easily across Facebook, MySpace, Twitter, and more - all at once! Simplify your online social life. Zotero Reference manager with Firefox, Chrome, and Safari integration. Both Firefox extension and XULRunner-based standalone application available. Source Applications based on XULRunner 1.9 or earlier Buzzbird XUL-based desktop twitter client. GitHub BlueGriffon The next-generation Web Editor based on the rendering engine of Firefox. Build instructions Convertigo Enterprise Mashup Server A Web integrator and Web clipper tool to build enterprise mashups Nightingale Nightingale is a communtiy fork of the Songbird media player, bringing back Linux support and much more. Build instructions Kirix Strata A new spe...
... Plain Old Webserver Google warns that this link is unsafe. A fully-functioning webserver that runs server-side Javascript. Latest release June 2009 Prism (formerly known as Webrunner) A simple, minimal web browser shell or "Single site browser." Useful for running web applications such as Gmail in a separate browser process. Songbird Songbird(TM) is a desktop Web player, a digital jukebox and Web browser mashup. Build instructions Spicebird A collaboration suite - e-mail, calendaring and instant messaging. Latest release: June 2010 - Build instructions Utilities / Prototypes AJAX Toolkit Framework (ATF) A part of the Eclipse Web Tools Platform (WTP) Aliwal Geocoder Geocode addresses onto a map Benjamin's XULRunner examples "mybrowser is ...
...ld instructions Utilities / Prototypes AJAX Toolkit Framework (ATF) A part of the Eclipse Web Tools Platform (WTP) Aliwal Geocoder Geocode addresses onto a map Benjamin's XULRunner examples "mybrowser is a very simple example browser", xulmine. An updated version of "mybrowser" that works with Firefox 25.0.1+ is available in Matthew Kastor's XULRunner examples at https://github.com/matthewkastor/XULRunner-Examples/ Exch A currency conversion tool using updated data from http://finance.yahoo.com/currency. You can use the Firefox extension or the stand-alone XUL application. OpenDocument Viewer Cross-platform viewer for OpenDocument files. TaskPool TaskPool is a little application to help keep track of time. You can add tasks to a pool, turn the...
application/http-index-format specification - Archive of obsolete content
The syntax of DATA is defined by the syntax spec for every NUMBER type. ...
...The syntax of DATA is defined by the syntax spec for every NUMBER type. ...
...gnored. 300 A URL pointing to the directory represented by the index if there is one. A valid path token must be URL escaped. Valid 200 tokens Note that all tokens are case insensitive. Filename The name of file that can be used to retrieve the file when combined with the full path provided by the 300 line. White space and 8 bit characters must be URL encoded. Content-Length Base 10 digits representing the size of the file in bytes. Only digits are legal. Last-Modified RFC 1123 date format URL encoded. Content-type MIME content type. Whitespace and 8-bit characters must be URL-encoded. The MIME-type for a directory can be given as application/http-index-format. File-type One of the following keywords to represent a special status for a file: FILE DIRECTORY SYMBOLIC-LI...
Building up a basic demo with A-Frame - Game development
n browser with good WebGL support (and WebXR support if you have available VR or AR hardware) such as the latest Firefox or Chrome -- download Firefox Nightly or Chrome (v54 or higher). (Optional) set up a VR device such as Oculus Rift or Google Cardboard. Create a new directory to store your project in. Save a copy of the latest A-Frame JavaScript library file inside your directory (check the GitHub repository for latest stable a dev builds). Open the A-Frame documentation in a separate tab -- it is useful to refer to. HTML structure The first step is to create an HTML document -- inside your project directory, create a new index.html file, and save the follow HTML inside it: <!doctype html> <html> <head> <meta charset="utf-8"> <title>MDN Games: A-Frame demo</title> <script src...
... A-Frame takes care of setting up everything you need: A default light source and camera are included, so the cube is visible. The controls are already working: you can use the mouse for looking around and the keyboard for movement (try the W, A, S, and D keys.) There's even an "Enter VR mode" button in the bottom right corner of the screen, to allow you to shift to full screen, stereosc...
...'s position on every frame. Try changing the given values on the y axis and see how it affects the movement. Conclusion Everything is rendered properly and animating -- congratulations on building your first A-Frame scene! Here's how the final version looks and works: If you have a VR device available, now is a good time to try out your scene with it too. Note: You can also check it out on GitHub. That was easier than you thought, right? A-Frame targets web developers by offering easy to use web markup and all the advantages that brings, such as JavaScript manipulation. It is easy to start with, but also provides a powerful API for advanced concepts, as well as dealing with cross browser differences and suchlike. The community is growing, just like the number of supported VR devices ...
MDN Web Docs Glossary: Definitions of Web-related terms
Cryptographic hash function Cryptography CSP CSRF CSS CSS Object Model (CSSOM) CSS pixel CSS preprocessor D Data structure Decryption Delta Denial of Service Descriptor (CSS) Deserialization Developer Tools DHTML Digest Digital certificate Distributed Denial of Service DMZ DNS Doctype Document directive document environment DOM (Document Object Model) Domain Domain name Domain sharding Dominator DoS attack DTLS (Datagram Transport Layer Security) DTMF (Dual-Tone Multi-Frequency signaling) ...
... Flex Flex Container Flex Item Flexbox Forbidden header name Forbidden response header name Fork Fragmentainer frame rate (FPS) FTP FTU Function Fuzz testing G Gaia Garbage collection Gecko General header GIF GIJ Git Global object Global scope Global variable Glyph Gonk Google Chrome GPL GPU Graceful degradation Grid Grid Areas Grid Axis Grid Cell Grid Column Grid container Grid Lines Grid Row Grid Tracks Guard Gutters Gzip...
... Wrapper X XForms XHR (XMLHttpRequest) XHTML XInclude XLink XML XPath XQuery XSLT Other 404 502 ALPN at-rule Attack Byte-Order Mark Character set client cryptosystem debug digital signature execution flex-direction GLSL Interface Library Memory management routers Self-Executing Anonymous Function Stylesheet Vector image ...
Basic native form controls - Learn web development
alue is set to text, or by omitting the type attribute altogether (text is the default value). The value text for this attribute is also the fallback value if the value you specify for the type attribute is unknown by the browser (for example if you specify type="color" and the browser doesn't support native color pickers). Note: You can find examples of all the single line text field types on GitHub at single-line-text-fields.html (see it live also). Here is a basic single line text field example: <input type="text" id="comment" name="comment" value="I'm a text field"> Single line text fields have only one true constraint: if you type text with line breaks, the browser removes those line breaks before sending the data to the server. The following screenshot shows default, focused and...
...rm widgets, once the form is submitted all widgets that have a name attribute are sent, even if no value has been filled out. In the case of checkable items, their values are sent only if they are checked. If they are not checked, nothing is sent, not even their name. If they are checked but have no value, the name is sent with a value of on. Note: You can find the examples from this section on GitHub as checkable-items.html (see it live also). For maximum usability/accessibility, you are advised to surround each list of related items in a <fieldset>, with a <legend> providing an overall description of the list. Each individual pair of <label>/<input> elements should be contained in its own list item (or similar). The associated <label> is generally placed immediately after the radio but...
... have the <button> element itself. This can take a type attribute of value submit, reset, or button to mimic the behevior of the three <input> types mentioned above. The main difference between the two is that actual <button> elements are much easier to style. Note: The image input type also renders as a button. We'll cover that later too. Note: You can find the examples from this section on GitHub as button-examples.html (see it live also). Below you can find examples of each button <input> type, along with the equivalent button type. submit <button type="submit"> This is a <strong>submit button</strong> </button> <input type="submit" value="This is a submit button"> reset <button type="reset"> This is a <strong>reset button</strong> </button> <input type="reset" value="...
UI pseudo-classes - Learn web development
sed some JavaScript to toggle the disabling of the billing address fields: // Wait for the page to finish loading document.addEventListener('DOMContentLoaded', function () { // Attach `change` event listener to checkbox document.getElementById('billing-checkbox').addEventListener('change', toggleBilling); }, false); function toggleBilling() { // Select the billing text fields let billingItems = document.querySelectorAll('#billing input[type="text"]'); // Select the billing text labels let billingLabels = document.querySelectorAll('.billing-label'); // Toggle the billing text fields and labels for (let i = 0; i < billingItems.length; i++) { billingItems[i].disabled = !billingItems[i].disabled; if(billingLabels[i].getAttribute('class') === 'billing-label disabled-la...
...; top: -3px; } This provides a little "Default" label on the one the was originally selected when the page loaded. Note here we are using the general sibling combinator (~) rather than the adjacent sibling combinator (+) -- we need to do this because the <span> does not come right after the <input> in the source order. See the live result below: Note: You can also find the example live on GitHub at radios-checked-default.html (also see the source code.) For the :indeterminate example, we've got no default selected radio button -- this is important -- if there was, then there would be no indeterminate state to style. We style the indeterminate radio buttons with the following CSS: input[type="radio"]:indeterminate { border: 2px solid red; animation: 0.4s linear infinite alternat...
... More pseudo-classes There are a number of other pseudo-classes of interest, and we don't have space to write about them all in detail here. Let's talk about a few more that you should take the time to inve...
Video and audio content - Learn web development
e URL of an image which will be displayed before the video is played. It is intended to be used for a splash screen or advertising screen. preload Used for buffering large files; it can take one of three values: "none" does not buffer the file "auto" buffers the media file "metadata" buffers only the metadata for the file You can find the above example available to play live on Github (also see the source code.) Note that we haven't included the autoplay attribute in the live version -- if the video starts to play as soon as the page loads, you don't get to see the poster! The <audio> element The <audio> element works just like the <video> element, with a few small differences as outlined below. A typical example might look like so: <audio controls> <source src="viper.
... differences as outlined below. A typical example might look like so: <audio controls> <source src="viper.mp3" type="audio/mp3"> <source src="viper.ogg" type="audio/ogg"> <p>Your browser doesn't support HTML5 audio. Here is a <a href="viper.mp3">link to the audio</a> instead.</p> </audio> This produces something like the following in a browser: Note: You can run the audio demo live on Github (also see the audio player source code.) This takes up less space than a video player, as there is no visual component -- you just need to display controls to play the audio. Other differences from HTML video are as follows: The <audio> element doesn't support the width/height attributes -- again, there is no visual component, so there is nothing to assign a width or height to. It also d...
...ontrols> <source src="example.mp4" type="video/mp4"> <source src="example.webm" type="video/webm"> <track kind="subtitles" src="subtitles_en.vtt" srclang="en"> </video> This will result in a video that has subtitles displayed, kind of like this: For more details, please read Adding captions and subtitles to HTML5 video. You can find the example that goes along with this article on Github, written by Ian Devlin (see the source code too.) This example uses some JavaScript to allow users to choose between different subtitles. Note that to turn the subtitles on, you need to press the "CC" button and select an option -- English, Deutsch, or Espanol. Note: Text tracks also help you with SEO, since search engines especially thrive on text. Text tracks even allow search engines to l...
Graceful asynchronous programming with Promises - Learn web development
ide an <img> element. This is very similar to the example we looked at in the first article of the series, but we'll do it a bit differently as we get you building your own promise-based code. Note: The following example will not work if you just run it directly from the file (i.e. via a file:// URL). You need to run it through a local testing server, or use an online solution such as Glitch or GitHub pages. First of all, download our simple HTML template and the sample image file that we'll fetch. Add a <script> element at the bottom of the HTML <body>. Inside your <script> element, add the following line: let promise = fetch('coffee.jpg'); This calls the fetch() method, passing it the URL of the image to fetch from the network as a parameter. This can also take an...
...sion of the example live (see the source code also). Chaining the blocks together This is a very longhand way of writing this out; we've deliberately done this to help you understand what is going on clearly. As shown earlier on in the article, you can chain together .then() blocks (and also .catch() blocks). ...
...nd run the code as is, after one second you'll get the message alerted. Now try setting the message to an empty string or the interval to a negative number, for example, and you'll be able to see the promise reject with the appropriate error messages! You could also try doing something else with the resolved message rather than just alerting it. Note: You can find our version of this example on GitHub as custom-promise2.html (see also the source code). A more real-world example The above example was kept deliberately simple to make the concepts easy to understand, but it is not really very async. The asynchronous nature is basically faked using setTimeout(), although it does still show that promises are useful for creating a custom function with a sensible flow of operations, good error ...
Introduction to events - Learn web development
ecific elements, such as <video>). Inline event handlers -- don't use these You might also see a pattern like this in your code: <button onclick="bgChange()">Press me</button> function bgChange() { const rndCol = 'rgb(' + random(255) + ',' + random(255) + ',' + random(255) + ')'; document.body.style.backgroundColor = rndCol; } Note: You can find the full source code for this example on GitHub (also see it running live). The earliest method of registering event handlers found on the Web involved event handler HTML attributes (or inline event handlers) like the one shown above -- the attribute value is literally the JavaScript code you want to run when the event occurs. The above example invokes a function defined inside a <script> element on the same page, but you could also inser...
...yntax is obviously different. We could rewrite our random color example to look like this: const btn = document.querySelector('button'); function bgChange() { const rndCol = 'rgb(' + random(255) + ',' + random(255) + ',' + random(255) + ')'; document.body.style.backgroundColor = rndCol; } btn.addEventListener('click', bgChange); Note: You can find the full source code for this example on GitHub (also see it running live). Inside the addEventListener() function, we specify two parameters -- the name of the event we want to register this handler for, and the code that comprises the handler function we want to run in response to it. Note: It is perfectly appropriate to put all the code inside the addEventListener() function, in an anonymous function, like this: btn.addEventListener('...
...ent handlers to provide extra features and information. For example, let's rewrite our random color example again slightly: function bgChange(e) { const rndCol = 'rgb(' + random(255) + ',' + random(255) + ',' + random(255) + ')'; e.target.style.backgroundColor = rndCol; console.log(e); } btn.addEventListener('click', bgChange); Note: You can find the full source code for this example on GitHub (also see it running live). Here you can see we are including an event object, e, in the function, and in the function setting a background color style on e.target -- which is the button itself. The target property of the event object is always a reference to the element the event occurred upon. So, in this example, we are setting a random background color on the button, not the page. Note...
What is JavaScript? - Learn web development
So what can it really do? The core client-side JavaScript language consists of some common programming features that allow you to do things like: Store useful values inside variables. In the above example for instance, we ask for a new name to be entered then store that n...
...rough the steps again and check that you did everything right. Did you save your local copy of the starting code as a .html file? Did you add your <script> element just before the </head> tag? Did you enter the JavaScript exactly as shown? JavaScript is case sensitive, and very fussy, so you need to enter the syntax exactly as shown, otherwise it may not work. Note: You can see this version on GitHub as apply-javascript-internal.html (see it live too). External JavaScript This works great, but what if we wanted to put our JavaScript in an external file? Let's explore this now. First, create a new file in the same directory as your sample HTML file. Call it script.js -- make sure it has that .js filename extension, as that's how it is recognized as JavaScript. Replace your current <s...
...k', createParagraph); } Save and refresh your browser, and you should see the same thing! It works just the same, but now we've got our JavaScript in an external file. This is generally a good thing in terms of organizing your code and making it reusable across multiple HTML files. Plus, the HTML is easier to read without huge chunks of script dumped in it. Note: You can see this version on GitHub as apply-javascript-external.html and script.js (see it live too). Inline JavaScript handlers Note that sometimes you'll come across bits of actual JavaScript code living inside HTML. It might look something like this: function createParagraph() { let para = document.createElement('p'); para.textContent = 'You clicked the button!'; document.body.appendChild(para); } <button onclick...
Website security - Learn web development
er, he would no longer be able to use that same form to attack every user. Web frameworks often include such CSRF prevention mechanisms. Other threats Other common attacks/vulnerabilities include: Clickjacking. In this attack, a malicious user hijacks clicks meant for a visible top-level site and routes them to a hidden page beneath. This technique might be used, for example, to display a legitimate bank site but capture the login credentials into an invisible <iframe> controlled by the attacker. Clickjacking could also be used to get the user to click a button on a visible site, but in doing so actually unwittingly click a completely different button. As a defense, your site can prevent itself from being embedded in an iframe in another site by setting the appropriate HTTP headers. De...
... to get the user to click a button on a visible site, but in doing so actually unwittingly click a completely different button. As a defense, your site can prevent itself from being embedded in an iframe in another site by setting the appropriate HTTP headers. Denial of Service (DoS). DoS is usually achieved by flooding a target site with fake requests so that access to a site is disrupted for legitimate users. The requests may simply be numerous, or they may individually consume large amounts of resource (e.g., slow reads or uploading of large files). DoS defenses usually work by identifying and blocking "bad" traffic while allowing legitimate messages through. These defenses are typically located before or in the web server (they are not part of the web application itself). Directory Trav...
...ffering a bug bounty like Mozilla does here. Only store and display data that you need. For example, if your users must store sensitive information like credit card details, only display enough of the card number that it can be identified by the user, and not enough that it can be copied by an attacker and used on another site. The most common pattern at this time is to only display the last 4 digits of a credit card number. Web frameworks can help mitigate many of the more common vulnerabilities. Summary This article has explained the concept of web security and some of the more common threats against which your website should attempt to protect. Most importantly, you should understand that a web application cannot trust any data from the web browser. All user data should be sanitized b...
Getting started with React - Learn web development
nd npx (the node package runner). You may also use the Yarn package manager as an alternative, but we'll assume you are using npm in this set of tutorials. See Package management basics for more information on npm and yarn. If you're using Windows, you will need to install some software to give you parity with Unix/macOS terminal in order to use the terminal commands mentioned in this tutorial. Gitbash (which comes as part of the git for Windows toolset) or Windows Subsystem for Linux (WSL) are both suitable. See Command line crash course for more information on these, and on terminal commands in general. Also bear in mind that React and ReactDOM produce apps that only work on a fairly modern set of browsers -- IE9+ by way of some polyfills. It is recommended that you use a modern browser ...
... run the following in your terminal: npx create-react-app moz-todo-react This creates a moz-todo-react directory, and does several things inside it: Installs some npm packages essential to the functionality of the app. Writes scripts for starting and serving the application. Creates a structure of files and directories that define the basic app architecture. Initializes the directory as a git repository, if you have git installed on your computer. Note: if you have the yarn package manager installed, create-react-app will default to using it instead of npm. If you have both package managers installed and explicitly want to use NPM, you can add the flag --use-npm when you run create-react-app: npx create-react-app moz-todo-react --use-npm create-react-app will display a number of...
...eate-react-app will start being served at a local server at localhost:3000, and open the app in a new browser tab. Your browser will display something like this: Application structure create-react-app gives us everything we need to develop a React application. 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...
Componentizing our Svelte app - Learn web development
Prerequisites: At minimum, it is recommended that you are familiar with the core HTML, CSS, and JavaScript languages, and have knowledge of the terminal/command line. You'll need a terminal with node + npm installed to compile and build your app. Objective: To learn how to break our app into components and share information among them. ...
...ites: At minimum, it is recommended that you are familiar with the core HTML, CSS, and JavaScript languages, and have knowledge of the terminal/command line. You'll need a terminal with node + npm installed to compile and build your app. Objective: To learn how to break our app into components and share information among them. Code along with us Git Clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git Then to get to the current app state, run cd mdn-svelte-tutorial/04-componentizing-our-app Or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/04-componentizing-our-app Remember to run npm install && npm run dev to start your app in development mode. REPL...
...formation among components: the Context API and Stores. The Context API provides a mechanism for a components and their descendants to "talk" to each other without passing around data and functions as props, or dispatching lots of events. Stores allows you to share reactive data among components that are not hierarchically related. We will look at Stores later on in the series. The code so far Git To see the state of the code as it should be at the end of this article, access your copy of our repo like this: cd mdn-svelte-tutorial/05-advanced-concepts Or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/05-advanced-concepts Remember to run npm install && npm run dev to start your app in development mode. REPL To see the current state of the code in a REPL...
Working with Svelte stores - Learn web development
ons on screen, which can receive messages from any component. In this case, the Alert component is independent from the rest -- it is not a parent or child of any other -- so the messages don't fit into the component hierarchy. We will also see how to develop our own custom store to persist the todo information to web storage, allowing our todos to persist over page reloads. Code along with us Git Clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git Then to get to the current app state, run cd mdn-svelte-tutorial/06-stores Or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/06-stores Remember to run npm install && npm run dev to start your app in development mode. REPL To code along w...
...om the Svelte REPL you won't be able to complete this step. For security reasons the Svelte REPL works in a sandboxed environment which will not let you access web torage, and you will get a "The operation is insecure" error. In order to follow this section you'll have to clone the repo and go to the mdn-svelte-tutorial/06-stores folder or you can directly download the folder's content with npx degit opensas/mdn-svelte-tutorial/06-stores. So, to implement a custom store that saves its content to web storage, we will need a writable store that: Initially reads the value from web storage, and if it's not present initializes it with a default value. Whenever the value is modified, updates the store itself and also the data in local storage. Moreover, because web storage only supports sav...
...te also supports specifying different transitions to apply when the element is added or removed from the DOM with the in:fn/out:fn directives, and it also allows you to define your custom CSS and JavaScript transitions. It also has several easing functions to specify the rate of change over time. Have a look at the ease visualizer to explore the various ease functions available. The code so far Git To see the state of the code as it should be at the end of this article, access your copy of our repo like this: cd mdn-svelte-tutorial/07-next-steps Or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/07-next-steps Remember to run npm install && npm run dev to start your app in development mode. REPL To see the current state of the code in a REPL, visit: http...
Dynamic behavior in Svelte: working with variables and props - Learn web development
s, and have knowledge of the terminal/command line. You'll need a terminal with node + npm installed to compile and build your app. Objective: Learn and put into practice some basic Svelte concepts, like creating components, passing data using props, render JavaScript expressions into our markup, modify the components state and iterating over lists. ...
...wledge of the terminal/command line. You'll need a terminal with node + npm installed to compile and build your app. Objective: Learn and put into practice some basic Svelte concepts, like creating components, passing data using props, render JavaScript expressions into our markup, modify the components state and iterating over lists. Code along with us Git Clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git Then to get to the current app state, run cd mdn-svelte-tutorial/03-adding-dynamic-behavior Or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/03-adding-dynamic-behavior Remember to run npm install && npm run dev to start your app in development mode. RE...
...terTodos(todos)... } depends on filter, and the list of filtered todos won't be updated when the filter changes. Always remember that Svelte analyzes our code to find out dependencies, so it's better to be explicit about it and not rely on the visibility of top-level variables. Besides, it's a good practice to make our code clear and explicit about what information it is using. The code so far Git To see the state of the code as it should be at the end of this article, access your copy of our repo like this: cd mdn-svelte-tutorial/04-componentizing-our-app Or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/04-componentizing-our-app Remember to run npm install && npm run dev to start your app in development mode. REPL To see the current state of the code...
Understanding client-side JavaScript frameworks - Learn web development
oking at how frameworks tend to work from a high level and the differences between them. React tutorials Note: React tutorials last tested in May 2020, with React/ReactDOM 16.13.1 and create-react-app 3.4.1. If you need to check your code against our version, you can find a finished version of the sample React app code in our todo-react repository. For a running live version, see https://mdn.github.io/todo-react-build/. 1. Getting started with React In this article we will say hello to React. We'll discover a little bit of detail about its background and use cases, set up a basic React toolchain on our local computer, and create and play with a simple starter app, learning a bit about how React works in the process. 2. Beginning our React todo list Let's say that we've been tasked...
...s you with a list of React resources that you can use to go further in your learning. Ember tutorials Note: Ember tutorials last tested in May 2020, with Ember/Ember CLI version 3.18.0. If you need to check your code against our version, you can find a finished version of the sample Ember app code in the ember-todomvc-tutorial repository. For a running live version, see https://nullvoxpopuli.github.io/ember-todomvc-tutorial/ (this also includes a few additional features not covered in the tutorial). 1. Getting started with Ember In our first Ember article we will look at how Ember works and what it's useful for, install the Ember toolchain locally, create a sample app, and then do some initial setup to get it ready for development. 2. Ember app structure and componentization In th...
...s you with a list of resources that you can use to go further in your learning, plus some useful troubleshooting and other information. Vue tutorials Note: Vue tutorials last tested in May 2020, with Vue 2.6.11. If you need to check your code against our version, you can find a finished version of the sample Vue app code in our todo-vue repository. For a running live version, see https://mdn.github.io/todo-vue/dist/. 1. Getting started with Vue Now let's introduce Vue, the third of our frameworks. In this article, we'll look at a little bit of Vue background, learn how to install it and create a new project, study the high-level structure of the whole project and an individual component, see how to run the project locally, and get it prepared to start building our example. 2. Creat...
Handling common HTML and CSS problems - Learn web development
r message informing you what the problem is. Dirty Markup also allows you to make fixes to your markup using the Clean button. However, it is not very convenient to have to copy and paste your code over to a web page to check its validity several times. What you really want is a linter that will fit into your standard workflow with the minimum of hassle. Many code editors have linter plugins. Github's Atom code editor for example has a rich plugin ecosystem available, with many linting options. To show you an example of how such plugins generally work: Install Atom (if you haven't got an up-to-date version already installed) -- download it from the Atom page linked above. Go to Atom's Preferences... dialog (e.g. by Choosing Atom > Preferences... on Mac, or File > Preferences... on Win...
... If you view the example on a supporting browser like desktop/Android Chrome or iOS Safari, you'll see the special widgets/features in action as you try to input data. On a non-supporting platform such as Firefox or Internet Explorer, the inputs will just fallback to normal text inputs, so at least the user can still enter some information. Note: Of course, this ...
...rustrating for you and your users if such a mistake slips through to production code, but at least it means the whole site doesn't come crashing down because of one error, and if used cleverly you can use it to your advantage. Let's look at an example -- a simple box styled with CSS, which has some styling provided by various CSS3 features: Note: You can also see this example running live on GitHub as button-with-fallback.html (also see the source code). The button has a number of declarations that style, but the two we are most interested in are as follows: button { ... background-color: #ff0000; background-color: rgba(255,0,0,1); box-shadow: inset 1px 1px 3px rgba(255,255,255,0.4), inset -1px -1px 3px rgba(0,0,0,0.4); } button:hover { background-color: rgba...
Handling common JavaScript problems - Learn web development
vaScript code on the left and provides an output on the right, including metrics, warnings, and errors. Code editor plugins It is not very convenient to have to copy and paste your code over to a web page to check its validity several times. What you really want is a linter that will fit into your standard workflow with the minimum of hassle. Many code editors have linter plugins, for example Github's Atom code editor has a JSHint plugin available. To install it: Install Atom (if you haven't got an up-to-date version already installed) -- download it from the Atom page linked above. Go to Atom's Preferences... dialog (e.g. by Choosing Atom > Preferences... on Mac, or File > Preferences... on Windows/Linux) and choose the Install option in the left-hand menu. In the Search packages t...
...de section is this: function showHeroes(jsonObj) { let heroes = jsonObj['members']; for(i = 0; i < heroes.length; i++) { ... So the code falls over as soon as we try to access a property of jsonObj (which as you might expect, is supposed to be a JSON object). This is supposed to be fetched from an external .json file using the following XMLHttpRequest call: let requestURL = 'https://mdn.github.io/learning-area/javascript/oojs/json/superheroes.json'; let request = new XMLHttpRequest(); request.open('GET', requestURL); request.send(); let superHeroes = request.response; populateHeader(superHeroes); showHeroes(superHeroes); But this fails. The Console API You may already know what is wrong with this code, but let's explore it some more to show how you could investigate this. For a ...
...mple, jQuery When choosing a library to use, make sure that it works across the set of browsers you want to support, and test your implementation thoroughly. Also make sure that the library is popular and well-supported, and isn't likely to just become obsolete next week. Talk to other developers to find out what they recommend, see how much activity and how many contributors the library has on Github (or wherever else it is stored), etc. Note: JavaScripting.com gives you a good idea of just how many JavaScript libraries there are available, and can be useful for finding libraries for specific purposes. Library usage at a basic level tends to consist of downloading the library's files (JavaScript, possibly some CSS or other dependencies too) and attaching them to your page (e.g. via a <...
Setting up your own test automation environment - Learn web development
e page you actually want to test, you use the get() method of the driver instance you created earlier, for example: driver.get('http://www.google.com'); Note: See the WebDriver class reference for details of the features in this section and the ones below it. You can use any URL to point to your resource, including a file:// URL to test a local document: driver.get('file:///Users/chrismills/git/learning-area/tools-testing/cross-browser-testing/accessibility/fake-div-buttons.html'); or driver.get('http://localhost:8888/fake-div-buttons.html'); But it is better to use a remote server location so the code is more flexible -- when you start using a remote server to run your tests (see later on), your code will break if you try to use local paths. Add this line to the bottom of quick_te...
...browser-testing/accessibility/fake-div-buttons.html'); or driver.get('http://localhost:8888/fake-div-buttons.html'); But it is better to use a remote server location so the code is more flexible -- when you start using a remote server to run your tests (see later on), your code will break if you try to use local paths. Add this line to the bottom of quick_test.js now: driver.get('http://mdn.github.io/learning-area/tools-testing/cross-browser-testing/accessibility/native-keyboard-accessibility.html'); Interacting with the document Now we've got a document to test, we need to interact with it in some way, which usually involves first selecting a specific element to test something about. You can select UI elements in many ways in WebDriver, including by ID, class, element name, etc. The ...
...with continuous integration (CI) tools -- this is useful, as it means you can run your tests via a CI tool, and only commit new changes to your code repository if the tests pass. It is out of scope to look at this area in detail in this article, but we'd suggest getting started with Travis CI -- this is probably the easiest CI tool to get started with and has good integration with web tools like GitHub and Node. To get started, see for example: Travis CI for complete beginners Building a Node.js project (with Travis) Using LambdaTest with Travis CI Using LambdTest with CircleCI Using LambdaTest with Jenkins Using Sauce Labs with Travis CI Note: If you wish to perform continuous testing with codeless automation then you can use Endtest. Summary This module should have proven fu...
Command line crash course - Learn web development
rating systems. But things are getting better. Windows has traditionally had its own terminal-like program called cmd ("the command prompt") for a long time, but this definitely doesn't have parity with Unix commands, and is equivalent to the old-style Windows DOS prompt. Better programs exist for providing a terminal experience on Windows, such as Powershell (see here to find installers), and Gitbash (which comes as part of the git for Windows toolset) However, the best option for Windows in the modern day is the Windows Subsystem for Linux (WSL) -- a compatibility layer for running Linux operating systems directly from inside Windows 10, allowing you to run a "true terminal" directly on Windows, without needing a virtual machine. This can be installed directly from the Windows store fo...
...s list of pros and cons for globally installing is far from exhaustive: Pros of installing globally Cons of installing globally Accessible anywhere in your terminal May not be compatible with your project's codebase Only install once Other developers in your team won't have access to these tools, for example if you are sharing the codebase over a tool like git. Uses less disk space Related to the previous point, it makes project code harder to replicate (if you install your tools locally, they can be set up as dependencies and installed with npm install). Always the same version Feels like any other unix command Although the cons list is shorter, the negative impact of global installing is potentially much l...
...ally where tools excel; our personal preference is the kind of automation that "just happens" without having to configure anything. With Prettier there's a number of ways automation can be achieved and though they're beyond the scope of this article, there's some excellent resources online to help (some of which have been linked to). You can invoke prettier: Before you commit your code into a git repository using Husky. Whenever you hit "save" in your code editor, be it VS Code, Atom, or Sublime Text. As part of continuous integration checks using tools like Github Actions. Our personal preference is the second one -- while using say VS Code, Prettier kicks in and cleans up any formatting it needs to do every time we hit save. You can find a lot more information about using Prettier i...
Learn web development
development, it is still useful to know how servers and server-side code features work. This topic provides a general introduction to how the server-side works and detailed tutorials showing how to build up a server-side app using two popular frameworks: Django (Python) and Express (Node.js). Getting our code examples The code examples you'll encounter in the Learning Area are all available on GitHub. If you want to copy them all to your computer, the easiest way is to download a ZIP of the latest master code branch. If you prefer to copy the repo in a more flexible way that allows for automatic updates, you can follow the more complex instructions: Install Git on your machine. This is the underlying version control system software that GitHub works on top of. Open your computer's com...
...you can follow the more complex instructions: Install Git on your machine. This is the underlying version control system software that GitHub works on top of. Open your computer's command prompt (Windows) or terminal (Linux, macOS). To copy the learning area repo to a folder called learning-area in the current location your command prompt/terminal is pointing to, use the following command: git clone https://github.com/mdn/learning-area You can now enter the directory and find the files you are after (either using your Finder/File Explorer or the cd command). You can update the learning-area repository with any changes made to the master version on GitHub with the following steps: In your command prompt/terminal, go inside the learning-area directory using cd. For example, if yo...
...ter (either using your Finder/File Explorer or the cd command). You can update the learning-area repository with any changes made to the master version on GitHub with the following steps: In your command prompt/terminal, go inside the learning-area directory using cd. For example, if you were in the parent directory: cd learning-area Update the repository using the following command: git pull Contact us If you want to get in touch with us about anything, the best way is to drop us a message on our Discourse forum. We'd like to hear from you about anything you think is wrong or missing on the site, requests for new learning topics, requests for help with items you don't understand, or any other questions or concerns. If you're interested in helping develop/improve the conten...
ChromeWorker
loping privileged code, and would like to create a worker that can use js-ctypes to perform calls to native code, you can do so by using ChromeWorker instead of the standard Worker object. It works exactly like a standard Worker, except that it has access to js-ctypes via a global ctypes object available in the global scope of the worker. Examples of ChromeWorker's using js-ctypes are availabe on Github and are linked to from the See Also section below. To use a postMessage with callback version of ChromeWorker that features promises, see PromiseWorker. Addons must use absolute URLs to load their workers, and those URLs have to be using a chrome:// or resource:// protocol (file:// is not accepted). Addons that wish to use file:// URLs must first register a resource replacement path, using co...
...ol-addon/worker.js'); More references: You can use ChromeWorker from JavaScript code modules. See Using workers in JavaScript code modules for details. You can use ChromeWorker modules in ChromeWorkers. See Using web workers for examples and details. ...
...de modules for details. You can use ChromeWorker modules in ChromeWorkers. See Using web workers for examples and details. ...
nss tech note3
set of required cert type and key usage for all the CA certs in the cert chain. To determine if a cert is valid for a given cert usage, it must have the the cert type and key usage required for that cert usage, and all the CA certs in the cert chain must have the cert type and key usage required for CA certs for that cert usage. ...
...ATURE GOVT_APPROVED KEY_AGREEMENT KEY_ENCIPHERMENT NON_REPUDIATION There are 9 Cert types: EMAIL EMAIL_CA OBJECT_SIGNING OBJECT_SIGNING_CA SSL_CA SSL_CLIENT SSL_SERVER STATUS_RESPONDER TIME_STAMP For the cert being checked, the requirements are: Cert Usage Requried Key Usage Required Cert Type -------------------- -------------------- ----------------------- SSLClient: DIGITAL_SIGNATURE; SSL_CLIENT; SSLServer: KEY_AGREEMENT OR KEY_ENCIPHERMENT; SSL_SERVER; SSLServerWithStepUp: GOVT_APPROVED AND SSL_SERVER KEY_AGREEMENT or KEY_ENCIPHERMENT SSLCA: CERT_SIGN; SSL_CA; EmailSigner: DIGITAL_SIGNATURE; EMAIL; EmailRecipient: KEY_AGREEMENT OR KEY_ENCIPHERMENT; EMAIL; ObjectSigner: DIGITAL_SIGNATURE; OBJECT_SIGNING; StatusResponder: DIGITAL...
...t authentication certs with email addresses to also be used as email certs (provded they have adequate key usage). A cert with the extended key usage extension and the Netscape cert type extension that as cert type SSL_CA is also always given cert type EMAIL_CA. This allows all SSL intermediate CAs to also be used as email intermediate CAs. ...
Mork
Mozilla › Tech › Mork
It is structured as a comment so it can be safely ignored by the parser. The header is: // <!-- <mdb:mork:z v="1.4"/> --> This file is therefore version 1.4 of the Zany Mork format for the Message Database. Versions 1.0-1.3 were never used in any publicly-available source code. Other serializations of mork have also nev...
...d using the mid at the beginning of the table. Furthermore, the scope of the mid also serves as the default scope of rows defined within the table. The meta-row of the table (different from the meta-row of a row) contains a few things you might care about. The first is the kind column (k), where the mid is typically column-scoped (:c). Next is the status column (s), which is defined as a single digit that is the priority (which appears to be unused), a 'u' if it is unique (i.e., the only table of its kind), and a 'v' if it is verbose (which also appears to be unused). The presence of a row or rowReference in the meta-table indicates that said row is the meta-row of the table: it contains arbitrary properties for the entire table just like a normal row. For example, the message summary format...
...or the value, except that it cannot refer to a mid. The values of cells and aliases, when not specified by a mid reference, are one of the cases where whitespace is significant. Using the '\' character quotes the next character; at the end of the line, it represents a continuation such as that found in C\C++ code. The '$' character quotes the next two characters (which must be valid hexadecimal digits) and these three in total represent an octet with the value of the digits. Mids are unique identifiers represented by the tuple (scope, id); if the ids are the same but the scopes are different, the two mids are different. In many places, the mid's scope has an assumed default value; if the scope component is not present, it assumes this default value. Morkreader usage Morkreader has both intern...
NS_ConvertASCIItoUTF16
s PRUint32 aInteger PRInt32 aRadix void AppendInt(PRInt64, PRInt32) - source Parameters PRInt64 aInteger PRInt32 aRadix AppendFloat void AppendFloat(float) - source Append the given float to this string Parameters float aFloat void AppendFloat(double) - source Parameters double aFloat BeginReading PRUnichar* BeginReading() const - source reading iterators nsReadingIterator<short unsigned int>& BeginReading(nsReadingIterator<short unsigned int>&) const - source deprecated reading iterators Parameters nsReadingIterator<short unsigned int>& iter PRUnichar*& BeginReading(const PRUnichar*&) const - source Parameters PRUnichar*& iter EndReading PRUnichar* EndReading() const - source nsReadingIterator<short unsigned int>& EndReading(nsReadingItera...
...t unsigned int>&) const - source deprecated reading iterators Parameters nsReadingIterator<short unsigned int>& iter PRUnichar*& BeginReading(const PRUnichar*&) const - source Parameters PRUnichar*& iter EndReading PRUnichar* EndReading() const - source nsReadingIterator<short unsigned int>& EndReading(nsReadingIterator<short unsigned int>&) const - source Parameters nsReadingIterator<short unsigned int>& iter PRUnichar*& EndReading(const PRUnichar*&) const - source Parameters PRUnichar*& iter BeginWriting PRUnichar* BeginWriting() - source writing iterators nsWritingIterator<short unsigned int>& BeginWriting(nsWritingIterator<short unsigned int>&) - source deprecated writing iterators Parameters nsWritingIterator<short unsigned int>& iter PRUnicha...
...inWriting PRUnichar* BeginWriting() - source writing iterators nsWritingIterator<short unsigned int>& BeginWriting(nsWritingIterator<short unsigned int>&) - source deprecated writing iterators Parameters nsWritingIterator<short unsigned int>& iter PRUnichar*& BeginWriting(PRUnichar*&) - source Parameters PRUnichar*& iter EndWriting PRUnichar* EndWriting() - source nsWritingIterator<short unsigned int>& EndWriting(nsWritingIterator<short unsigned int>&) - source Parameters nsWritingIterator<short unsigned int>& iter PRUnichar*& EndWriting(PRUnichar*&) - source Parameters PRUnichar*& iter Data PRUnichar* Data() const - source accessors Length PRUint32 Length() const - source IsEmpty PRBool IsEmpty() const - source IsVoid PRBool IsVo...
NS_ConvertUTF8toUTF16
s PRUint32 aInteger PRInt32 aRadix void AppendInt(PRInt64, PRInt32) - source Parameters PRInt64 aInteger PRInt32 aRadix AppendFloat void AppendFloat(float) - source Append the given float to this string Parameters float aFloat void AppendFloat(double) - source Parameters double aFloat BeginReading PRUnichar* BeginReading() const - source reading iterators nsReadingIterator<short unsigned int>& BeginReading(nsReadingIterator<short unsigned int>&) const - source deprecated reading iterators Parameters nsReadingIterator<short unsigned int>& iter PRUnichar*& BeginReading(const PRUnichar*&) const - source Parameters PRUnichar*& iter EndReading PRUnichar* EndReading() const - source nsReadingIterator<short unsigned int>& EndReading(nsReadingItera...
...t unsigned int>&) const - source deprecated reading iterators Parameters nsReadingIterator<short unsigned int>& iter PRUnichar*& BeginReading(const PRUnichar*&) const - source Parameters PRUnichar*& iter EndReading PRUnichar* EndReading() const - source nsReadingIterator<short unsigned int>& EndReading(nsReadingIterator<short unsigned int>&) const - source Parameters nsReadingIterator<short unsigned int>& iter PRUnichar*& EndReading(const PRUnichar*&) const - source Parameters PRUnichar*& iter BeginWriting PRUnichar* BeginWriting() - source writing iterators nsWritingIterator<short unsigned int>& BeginWriting(nsWritingIterator<short unsigned int>&) - source deprecated writing iterators Parameters nsWritingIterator<short unsigned int>& iter PRUnicha...
...inWriting PRUnichar* BeginWriting() - source writing iterators nsWritingIterator<short unsigned int>& BeginWriting(nsWritingIterator<short unsigned int>&) - source deprecated writing iterators Parameters nsWritingIterator<short unsigned int>& iter PRUnichar*& BeginWriting(PRUnichar*&) - source Parameters PRUnichar*& iter EndWriting PRUnichar* EndWriting() - source nsWritingIterator<short unsigned int>& EndWriting(nsWritingIterator<short unsigned int>&) - source Parameters nsWritingIterator<short unsigned int>& iter PRUnichar*& EndWriting(PRUnichar*&) - source Parameters PRUnichar*& iter Data PRUnichar* Data() const - source accessors Length PRUint32 Length() const - source IsEmpty PRBool IsEmpty() const - source IsVoid PRBool IsVo...
nsAdoptingString
s PRUint32 aInteger PRInt32 aRadix void AppendInt(PRInt64, PRInt32) - source Parameters PRInt64 aInteger PRInt32 aRadix AppendFloat void AppendFloat(float) - source Append the given float to this string Parameters float aFloat void AppendFloat(double) - source Parameters double aFloat BeginReading PRUnichar* BeginReading() const - source reading iterators nsReadingIterator<short unsigned int>& BeginReading(nsReadingIterator<short unsigned int>&) const - source deprecated reading iterators Parameters nsReadingIterator<short unsigned int>& iter PRUnichar*& BeginReading(const PRUnichar*&) const - source Parameters PRUnichar*& iter EndReading PRUnichar* EndReading() const - source nsReadingIterator<short unsigned int>& EndReading(nsReadingItera...
...t unsigned int>&) const - source deprecated reading iterators Parameters nsReadingIterator<short unsigned int>& iter PRUnichar*& BeginReading(const PRUnichar*&) const - source Parameters PRUnichar*& iter EndReading PRUnichar* EndReading() const - source nsReadingIterator<short unsigned int>& EndReading(nsReadingIterator<short unsigned int>&) const - source Parameters nsReadingIterator<short unsigned int>& iter PRUnichar*& EndReading(const PRUnichar*&) const - source Parameters PRUnichar*& iter BeginWriting PRUnichar* BeginWriting() - source writing iterators nsWritingIterator<short unsigned int>& BeginWriting(nsWritingIterator<short unsigned int>&) - source deprecated writing iterators Parameters nsWritingIterator<short unsigned int>& iter PRUnicha...
...inWriting PRUnichar* BeginWriting() - source writing iterators nsWritingIterator<short unsigned int>& BeginWriting(nsWritingIterator<short unsigned int>&) - source deprecated writing iterators Parameters nsWritingIterator<short unsigned int>& iter PRUnichar*& BeginWriting(PRUnichar*&) - source Parameters PRUnichar*& iter EndWriting PRUnichar* EndWriting() - source nsWritingIterator<short unsigned int>& EndWriting(nsWritingIterator<short unsigned int>&) - source Parameters nsWritingIterator<short unsigned int>& iter PRUnichar*& EndWriting(PRUnichar*&) - source Parameters PRUnichar*& iter Data PRUnichar* Data() const - source accessors Length PRUint32 Length() const - source IsEmpty PRBool IsEmpty() const - source IsVoid PRBool IsVo...
nsAutoString
s PRUint32 aInteger PRInt32 aRadix void AppendInt(PRInt64, PRInt32) - source Parameters PRInt64 aInteger PRInt32 aRadix AppendFloat void AppendFloat(float) - source Append the given float to this string Parameters float aFloat void AppendFloat(double) - source Parameters double aFloat BeginReading PRUnichar* BeginReading() const - source reading iterators nsReadingIterator<short unsigned int>& BeginReading(nsReadingIterator<short unsigned int>&) const - source deprecated reading iterators Parameters nsReadingIterator<short unsigned int>& iter PRUnichar*& BeginReading(const PRUnichar*&) const - source Parameters PRUnichar*& iter EndReading PRUnichar* EndReading() const - source nsReadingIterator<short unsigned int>& EndReading(nsReadingItera...
...t unsigned int>&) const - source deprecated reading iterators Parameters nsReadingIterator<short unsigned int>& iter PRUnichar*& BeginReading(const PRUnichar*&) const - source Parameters PRUnichar*& iter EndReading PRUnichar* EndReading() const - source nsReadingIterator<short unsigned int>& EndReading(nsReadingIterator<short unsigned int>&) const - source Parameters nsReadingIterator<short unsigned int>& iter PRUnichar*& EndReading(const PRUnichar*&) const - source Parameters PRUnichar*& iter BeginWriting PRUnichar* BeginWriting() - source writing iterators nsWritingIterator<short unsigned int>& BeginWriting(nsWritingIterator<short unsigned int>&) - source deprecated writing iterators Parameters nsWritingIterator<short unsigned int>& iter PRUnicha...
...inWriting PRUnichar* BeginWriting() - source writing iterators nsWritingIterator<short unsigned int>& BeginWriting(nsWritingIterator<short unsigned int>&) - source deprecated writing iterators Parameters nsWritingIterator<short unsigned int>& iter PRUnichar*& BeginWriting(PRUnichar*&) - source Parameters PRUnichar*& iter EndWriting PRUnichar* EndWriting() - source nsWritingIterator<short unsigned int>& EndWriting(nsWritingIterator<short unsigned int>&) - source Parameters nsWritingIterator<short unsigned int>& iter PRUnichar*& EndWriting(PRUnichar*&) - source Parameters PRUnichar*& iter Data PRUnichar* Data() const - source accessors Length PRUint32 Length() const - source IsEmpty PRBool IsEmpty() const - source IsVoid PRBool IsVo...
nsDependentString
s PRUint32 aInteger PRInt32 aRadix void AppendInt(PRInt64, PRInt32) - source Parameters PRInt64 aInteger PRInt32 aRadix AppendFloat void AppendFloat(float) - source Append the given float to this string Parameters float aFloat void AppendFloat(double) - source Parameters double aFloat BeginReading PRUnichar* BeginReading() const - source reading iterators nsReadingIterator<short unsigned int>& BeginReading(nsReadingIterator<short unsigned int>&) const - source deprecated reading iterators Parameters nsReadingIterator<short unsigned int>& iter PRUnichar*& BeginReading(const PRUnichar*&) const - source Parameters PRUnichar*& iter EndReading PRUnichar* EndReading() const - source nsReadingIterator<short unsigned int>& EndReading(nsReadingItera...
...t unsigned int>&) const - source deprecated reading iterators Parameters nsReadingIterator<short unsigned int>& iter PRUnichar*& BeginReading(const PRUnichar*&) const - source Parameters PRUnichar*& iter EndReading PRUnichar* EndReading() const - source nsReadingIterator<short unsigned int>& EndReading(nsReadingIterator<short unsigned int>&) const - source Parameters nsReadingIterator<short unsigned int>& iter PRUnichar*& EndReading(const PRUnichar*&) const - source Parameters PRUnichar*& iter BeginWriting PRUnichar* BeginWriting() - source writing iterators nsWritingIterator<short unsigned int>& BeginWriting(nsWritingIterator<short unsigned int>&) - source deprecated writing iterators Parameters nsWritingIterator<short unsigned int>& iter PRUnicha...
...inWriting PRUnichar* BeginWriting() - source writing iterators nsWritingIterator<short unsigned int>& BeginWriting(nsWritingIterator<short unsigned int>&) - source deprecated writing iterators Parameters nsWritingIterator<short unsigned int>& iter PRUnichar*& BeginWriting(PRUnichar*&) - source Parameters PRUnichar*& iter EndWriting PRUnichar* EndWriting() - source nsWritingIterator<short unsigned int>& EndWriting(nsWritingIterator<short unsigned int>&) - source Parameters nsWritingIterator<short unsigned int>& iter PRUnichar*& EndWriting(PRUnichar*&) - source Parameters PRUnichar*& iter Data PRUnichar* Data() const - source accessors Length PRUint32 Length() const - source IsEmpty PRBool IsEmpty() const - source IsVoid PRBool IsVo...
nsFixedString
s PRUint32 aInteger PRInt32 aRadix void AppendInt(PRInt64, PRInt32) - source Parameters PRInt64 aInteger PRInt32 aRadix AppendFloat void AppendFloat(float) - source Append the given float to this string Parameters float aFloat void AppendFloat(double) - source Parameters double aFloat BeginReading PRUnichar* BeginReading() const - source reading iterators nsReadingIterator<short unsigned int>& BeginReading(nsReadingIterator<short unsigned int>&) const - source deprecated reading iterators Parameters nsReadingIterator<short unsigned int>& iter PRUnichar*& BeginReading(const PRUnichar*&) const - source Parameters PRUnichar*& iter EndReading PRUnichar* EndReading() const - source nsReadingIterator<short unsigned int>& EndReading(nsReadingItera...
...t unsigned int>&) const - source deprecated reading iterators Parameters nsReadingIterator<short unsigned int>& iter PRUnichar*& BeginReading(const PRUnichar*&) const - source Parameters PRUnichar*& iter EndReading PRUnichar* EndReading() const - source nsReadingIterator<short unsigned int>& EndReading(nsReadingIterator<short unsigned int>&) const - source Parameters nsReadingIterator<short unsigned int>& iter PRUnichar*& EndReading(const PRUnichar*&) const - source Parameters PRUnichar*& iter BeginWriting PRUnichar* BeginWriting() - source writing iterators nsWritingIterator<short unsigned int>& BeginWriting(nsWritingIterator<short unsigned int>&) - source deprecated writing iterators Parameters nsWritingIterator<short unsigned int>& iter PRUnicha...
...inWriting PRUnichar* BeginWriting() - source writing iterators nsWritingIterator<short unsigned int>& BeginWriting(nsWritingIterator<short unsigned int>&) - source deprecated writing iterators Parameters nsWritingIterator<short unsigned int>& iter PRUnichar*& BeginWriting(PRUnichar*&) - source Parameters PRUnichar*& iter EndWriting PRUnichar* EndWriting() - source nsWritingIterator<short unsigned int>& EndWriting(nsWritingIterator<short unsigned int>&) - source Parameters nsWritingIterator<short unsigned int>& iter PRUnichar*& EndWriting(PRUnichar*&) - source Parameters PRUnichar*& iter Data PRUnichar* Data() const - source accessors Length PRUint32 Length() const - source IsEmpty PRBool IsEmpty() const - source IsVoid PRBool IsVo...
nsPromiseFlatString
s PRUint32 aInteger PRInt32 aRadix void AppendInt(PRInt64, PRInt32) - source Parameters PRInt64 aInteger PRInt32 aRadix AppendFloat void AppendFloat(float) - source Append the given float to this string Parameters float aFloat void AppendFloat(double) - source Parameters double aFloat BeginReading PRUnichar* BeginReading() const - source reading iterators nsReadingIterator<short unsigned int>& BeginReading(nsReadingIterator<short unsigned int>&) const - source deprecated reading iterators Parameters nsReadingIterator<short unsigned int>& iter PRUnichar*& BeginReading(const PRUnichar*&) const - source Parameters PRUnichar*& iter EndReading PRUnichar* EndReading() const - source nsReadingIterator<short unsigned int>& EndReading(nsReadingItera...
...t unsigned int>&) const - source deprecated reading iterators Parameters nsReadingIterator<short unsigned int>& iter PRUnichar*& BeginReading(const PRUnichar*&) const - source Parameters PRUnichar*& iter EndReading PRUnichar* EndReading() const - source nsReadingIterator<short unsigned int>& EndReading(nsReadingIterator<short unsigned int>&) const - source Parameters nsReadingIterator<short unsigned int>& iter PRUnichar*& EndReading(const PRUnichar*&) const - source Parameters PRUnichar*& iter BeginWriting PRUnichar* BeginWriting() - source writing iterators nsWritingIterator<short unsigned int>& BeginWriting(nsWritingIterator<short unsigned int>&) - source deprecated writing iterators Parameters nsWritingIterator<short unsigned int>& iter PRUnicha...
...inWriting PRUnichar* BeginWriting() - source writing iterators nsWritingIterator<short unsigned int>& BeginWriting(nsWritingIterator<short unsigned int>&) - source deprecated writing iterators Parameters nsWritingIterator<short unsigned int>& iter PRUnichar*& BeginWriting(PRUnichar*&) - source Parameters PRUnichar*& iter EndWriting PRUnichar* EndWriting() - source nsWritingIterator<short unsigned int>& EndWriting(nsWritingIterator<short unsigned int>&) - source Parameters nsWritingIterator<short unsigned int>& iter PRUnichar*& EndWriting(PRUnichar*&) - source Parameters PRUnichar*& iter Data PRUnichar* Data() const - source accessors Length PRUint32 Length() const - source IsEmpty PRBool IsEmpty() const - source IsVoid PRBool IsVo...
nsString
s PRUint32 aInteger PRInt32 aRadix void AppendInt(PRInt64, PRInt32) - source Parameters PRInt64 aInteger PRInt32 aRadix AppendFloat void AppendFloat(float) - source Append the given float to this string Parameters float aFloat void AppendFloat(double) - source Parameters double aFloat BeginReading PRUnichar* BeginReading() const - source reading iterators nsReadingIterator<short unsigned int>& BeginReading(nsReadingIterator<short unsigned int>&) const - source deprecated reading iterators Parameters nsReadingIterator<short unsigned int>& iter PRUnichar*& BeginReading(const PRUnichar*&) const - source Parameters PRUnichar*& iter EndReading PRUnichar* EndReading() const - source nsReadingIterator<short unsigned int>& EndReading(nsReadingItera...
...t unsigned int>&) const - source deprecated reading iterators Parameters nsReadingIterator<short unsigned int>& iter PRUnichar*& BeginReading(const PRUnichar*&) const - source Parameters PRUnichar*& iter EndReading PRUnichar* EndReading() const - source nsReadingIterator<short unsigned int>& EndReading(nsReadingIterator<short unsigned int>&) const - source Parameters nsReadingIterator<short unsigned int>& iter PRUnichar*& EndReading(const PRUnichar*&) const - source Parameters PRUnichar*& iter BeginWriting PRUnichar* BeginWriting() - source writing iterators nsWritingIterator<short unsigned int>& BeginWriting(nsWritingIterator<short unsigned int>&) - source deprecated writing iterators Parameters nsWritingIterator<short unsigned int>& iter PRUnicha...
...inWriting PRUnichar* BeginWriting() - source writing iterators nsWritingIterator<short unsigned int>& BeginWriting(nsWritingIterator<short unsigned int>&) - source deprecated writing iterators Parameters nsWritingIterator<short unsigned int>& iter PRUnichar*& BeginWriting(PRUnichar*&) - source Parameters PRUnichar*& iter EndWriting PRUnichar* EndWriting() - source nsWritingIterator<short unsigned int>& EndWriting(nsWritingIterator<short unsigned int>&) - source Parameters nsWritingIterator<short unsigned int>& iter PRUnichar*& EndWriting(PRUnichar*&) - source Parameters PRUnichar*& iter Data PRUnichar* Data() const - source accessors Length PRUint32 Length() const - source IsEmpty PRBool IsEmpty() const - source IsVoid PRBool IsVo...
nsXPIDLString
s PRUint32 aInteger PRInt32 aRadix void AppendInt(PRInt64, PRInt32) - source Parameters PRInt64 aInteger PRInt32 aRadix AppendFloat void AppendFloat(float) - source Append the given float to this string Parameters float aFloat void AppendFloat(double) - source Parameters double aFloat BeginReading PRUnichar* BeginReading() const - source reading iterators nsReadingIterator<short unsigned int>& BeginReading(nsReadingIterator<short unsigned int>&) const - source deprecated reading iterators Parameters nsReadingIterator<short unsigned int>& iter PRUnichar*& BeginReading(const PRUnichar*&) const - source Parameters PRUnichar*& iter EndReading PRUnichar* EndReading() const - source nsReadingIterator<short unsigned int>& EndReading(nsReadingItera...
...t unsigned int>&) const - source deprecated reading iterators Parameters nsReadingIterator<short unsigned int>& iter PRUnichar*& BeginReading(const PRUnichar*&) const - source Parameters PRUnichar*& iter EndReading PRUnichar* EndReading() const - source nsReadingIterator<short unsigned int>& EndReading(nsReadingIterator<short unsigned int>&) const - source Parameters nsReadingIterator<short unsigned int>& iter PRUnichar*& EndReading(const PRUnichar*&) const - source Parameters PRUnichar*& iter BeginWriting PRUnichar* BeginWriting() - source writing iterators nsWritingIterator<short unsigned int>& BeginWriting(nsWritingIterator<short unsigned int>&) - source deprecated writing iterators Parameters nsWritingIterator<short unsigned int>& iter PRUnicha...
...inWriting PRUnichar* BeginWriting() - source writing iterators nsWritingIterator<short unsigned int>& BeginWriting(nsWritingIterator<short unsigned int>&) - source deprecated writing iterators Parameters nsWritingIterator<short unsigned int>& iter PRUnichar*& BeginWriting(PRUnichar*&) - source Parameters PRUnichar*& iter EndWriting PRUnichar* EndWriting() - source nsWritingIterator<short unsigned int>& EndWriting(nsWritingIterator<short unsigned int>&) - source Parameters nsWritingIterator<short unsigned int>& iter PRUnichar*& EndWriting(PRUnichar*&) - source Parameters PRUnichar*& iter Data PRUnichar* Data() const - source accessors Length PRUint32 Length() const - source IsEmpty PRBool IsEmpty() const - source IsVoid PRBool IsVo...
WebIDL bindings
++ helpers, as the structure backing the iterable data for the interface is left up to the developer. With that in mind, the generated iterable bindings expect the wrapper object to provide certain methods for the interface to access. Iterable interfaces have different requirements, based on if they are single or pair value iterators. ...
...ace 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. ...
... as an indexed getter, as required by the spec. See the indexed getter implementation section for more information on building this kind of structure. ...
Mozilla
ery property for every element. See the Gecko Overview for more information about the style system. Adding a new event This draft document covers how to add a new event to the Mozilla (Firefox) source code. Adding a new word to the en-US dictionary Occasionally bugs are filed pointing out situations where perfectly legitimate words are missing from the English spell check dictionary in Firefox. This article describes the process for adding a word to the dictionary. Adding phishing protection data providers Phishing protection technology lets Firefox help protect users by comparing the URLs the user visits to a list of known scam sites, and presenting a warning to the...
...ontent to Layout Gecko maintains two separate representations of a document in memory: the content tree and the frame tree. Changes to a document originate in the content tree (from DOM modification by scripting, insertion of elements from the parser, etc.) and are propogated to the layout tree through magic that primarily resides in //github.com/RealityRipple/UXP/blob/master/layout/base/nsCSSFrameConstructor.cpp Getting Started with Chat Note that on 2nd March 2020, Mozilla moved away from IRC to Matrix for its public channels, the IRC server was shut down. Git Moved here: https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.htm...
...er behind your firewall: A really nasty hole. Mozilla Projects Mozilla has a number of projects other than Firefox itself. Many of these are components of Firefox or are tools used to create Firefox, but may be used by other projects as well. Here you'll find links to documentation about these projects. Mozilla projects on GitHub There are a number of tools and services whose code is hosted on GitHub. This article offers a quick guide for getting started with Mozilla code on GitHub. It also lists some interesting GitHub repositories containing Mozilla project code. Mozilla Quirks Mode Behavior The following is a rough list of the differences that exist bet...
AudioListener - Web APIs
e not marked read only, which is how they appear in the specification's IDL. AudioListener.positionX Represents the horizontal position of the listener in a right-hand cartesian coordinate sytem. The default is 0. AudioListener.positionY Represents the vertical position of the listener in a right-hand cartesian coordinate sytem. The default is 0. AudioListener.positionZ Represents the longitudinal (back and forth) position of the listener in a right-hand cartesian coordinate sytem. The default is 0. AudioListener.forwardX Represents the horizontal position of the listener's forward direction in the same cartesian coordinate sytem as the position (positionX, positionY, and positionZ) values. The forward and up values are linearly independent of each other. The default is 0. AudioLi...
...rward and up values are linearly independent of each other. The default is 0. AudioListener.forwardY Represents the vertical position of the listener's forward direction in the same cartesian coordinate sytem as the position (positionX, positionY, and positionZ) values. The forward and up values are linearly independent of each other. The default is 0. AudioListener.forwardZ Represents the longitudinal (back and forth) position of the listener's forward direction in the same cartesian coordinate sytem as the position (positionX, positionY, and positionZ) values. The forward and up values are linearly independent of each other. The default is -1. AudioListener.upX Represents the horizontal position of the top of the listener's head in the same cartesian coordinate sytem as the position (...
...lues. The forward and up values are linearly independent of each other. The default is 0. AudioListener.upY Represents the vertical position of the top of the listener's head in the same cartesian coordinate sytem as the position (positionX, positionY, and positionZ) values. The forward and up values are linearly independent of each other. The default is 1. AudioListener.upZ Represents the longitudinal (back and forth) position of the top of the listener's head in the same cartesian coordinate sytem as the position (positionX, positionY, and positionZ) values. The forward and up values are linearly independent of each other. The default is 0. Methods AudioListener.setOrientation() Sets the orientation of the listener. AudioListener.setPosition() Sets the position of the listen...
Geolocation.clearWatch() - Web APIs
n/error monitoring handlers previously installed using Geolocation.watchPosition(). Syntax navigator.geolocation.clearWatch(id); Parameters id The ID number returned by the Geolocation.watchPosition() method when installing the handler you wish to remove. ...
... handlers previously installed using Geolocation.watchPosition(). Syntax navigator.geolocation.clearWatch(id); Parameters id The ID number returned by the Geolocation.watchPosition() method when installing the handler you wish to remove. ...
...to remove. Example var id, target, option; function success(pos) { var crd = pos.coords; if (target.latitude === crd.latitude && target.longitude === crd.longitude) { console.log('Congratulation, you reach the target'); navigator.geolocation.clearWatch(id); } }; function error(err) { console.warn('ERROR(' + err.code + '): ' + err.message); }; target = { latitude : 0, longitude: 0, } options = { enableHighAccuracy: false, timeout: 5000, maximumAge: 0 }; id = navigator.geolocation.watchPosition(success, error, options); Specifications Specification Status Comment Geolocation API Recommendation Initial specification. ...
Geolocation.watchPosition() - Web APIs
ptions Optional An optional PositionOptions object that provides configuration options for the location watch. Return value An integer ID that identifies the registered handler. The ID can be passed to the Geolocation.clearWatch() to unregister the handler. ...
...n optional PositionOptions object that provides configuration options for the location watch. Return value An integer ID that identifies the registered handler. The ID can be passed to the Geolocation.clearWatch() to unregister the handler. ...
...handler. Examples var id, target, options; function success(pos) { var crd = pos.coords; if (target.latitude === crd.latitude && target.longitude === crd.longitude) { console.log('Congratulations, you reached the target'); navigator.geolocation.clearWatch(id); } } function error(err) { console.warn('ERROR(' + err.code + '): ' + err.message); } target = { latitude : 0, longitude: 0 }; options = { enableHighAccuracy: false, timeout: 5000, maximumAge: 0 }; id = navigator.geolocation.watchPosition(success, error, options); Specifications Specification Status Comment Geolocation APIThe definition of 'watchPosition()' in that specification. Recommendation Initial specification. ...
Geolocation API - Web APIs
eolocationPosition Represents the position of a user. A GeolocationPosition instance is returned by a successful call to one of the methods contained inside Geolocation, inside a success callback, and contains a timestamp plus a GeolocationCoordinates object instance. GeolocationCoordinates Represents the coordinates of a user's position; a GeolocationCoordinates instance contains latitude, longitude, and other important related information. GeolocationPositionError A GeolocationPositionError is returned by an unsuccessful call to one of the methods contained inside Geolocation, inside an error callback, and contains an error code and message. Navigator.geolocation The entry point into the API. Returns a Geolocation object instance, from which all other functionality can be accessed. ...
...ion The entry point into the API. Returns a Geolocation object instance, from which all other functionality can be accessed. Dictionaries PositionOptions Represents an object containing options to pass in as a parameter of Geolocation.getCurrentPosition() and Geolocation.watchPosition(). Examples In the following example the Geolocation API is used to retrieve the user's latitude and longitude. If sucessful, the available hyperlink is populated with an openstreetmap.org URL that will show their location. body { padding: 20px; background-color:#ffffc9 } button { margin: .5rem 0; } HTML <button id = "find-me">Show my location</button><br/> <p id = "status"></p> <a id = "map-link" target="_blank"></a> JavaScript function geoFindMe() { const status = document.querySel...
...ton id = "find-me">Show my location</button><br/> <p id = "status"></p> <a id = "map-link" target="_blank"></a> JavaScript function geoFindMe() { const status = document.querySelector('#status'); const mapLink = document.querySelector('#map-link'); mapLink.href = ''; mapLink.textContent = ''; function success(position) { const latitude = position.coords.latitude; const longitude = position.coords.longitude; status.textContent = ''; mapLink.href = `https://www.openstreetmap.org/#map=18/${latitude}/${longitude}`; mapLink.textContent = `Latitude: ${latitude} ?, Longitude: ${longitude} ?`; } function error() { status.textContent = 'Unable to retrieve your location'; } if(!navigator.geolocation) { status.textContent = 'Geolocation is not supp...
Key Values - Web APIs
lliteCS" Communication Satellite button. KEYCODE_TV_SATELLITE_CS (239) "TVSatelliteToggle" Toggles among available satellites. KEYCODE_TV_SATELLITE_SERVICE (240) "TVTerrestrialAnalog" Selects analog terrestrial television service (analog cable or antenna reception). KEYCODE_TV_TERRESTRIAL_ANALOG (235) "TVTerrestrialDigital" Selects digital terrestrial television service (digital cable or antenna receiption). KEYCODE_TV_TERRESTRIAL_DIGITAL (236) "TVTimer" Timer programming button. KEYCODE_TV_TIMER_PROGRAMMING (258) [1] Firefox added proper support for the "TV" key in Firefox 37; before that, this key generated the key code "Live". [2] These keys were "Unidentifi...
...and off. VK_CC KEYCODE_CAPTIONS (175) "Dimmer" Adjusts the brightness of the device by toggling between two brightness levels or by cycling among multiple brightness levels. VK_DIMMER GDK_KEY_BrightnessAdjust (0x1008FF3B) "DisplaySwap" Cycles among video sources. VK_DISPLAY_SWAP "DVR" Switches the input source to the Digital Video Recorder (DVR). KEYCODE_DVR (173) "Exit" The Exit button, which exits the curreent application or menu. VK_EXIT Qt::Key_Exit (0x0102000a) "FavoriteClear0" Clears the program or content stored in the first favorites list slot. VK_CLEAR_FAVORITE_0 "FavoriteClear1" Clears the program or content stored in the seco...
... GDK_KEY_KP_Subtract (0xFFAD) KEYCODE_NUMPAD_SUBTRACT (156) "Separator" [1] The numeric keypad's places separator character. (In the United States this is a comma, but elsewhere it is frequently a period.) VK_SEPARATOR (0x6C) kVK_JIS_KeypadComma (0x5F) GDK_KEY_KP_Separator (0xFFAC) KEYCODE_NUMPAD_COMMA (159) "0" through "9" The actual digit keys on the numeric keypad. VK_NUMPAD0 (0x60) - VK_NUMPAD9 (0x69) kVK_Keypad0 (0x52) - kVK_Keypad9 (0x5C) GDK_KEY_KP_0 (0xFFB0) - GDK_KEY_KP_9 (0xFFB9) KEYCODE_NUMPAD_0 (144) - KEYCODE_NUMPAD_9 (153) [1] While older browsers used words like "Add", "Decimal", "Multiply", and so forth modern browsers identify these using the actual character ("+", ".", "*", and so forth). ...
NonDocumentTypeChildNode.nextElementSibling - Web APIs
entSibling; console.log('Siblings of div-01:'); while (el) { console.log(el.nodeName); el = el.nextElementSibling; } </script> This example outputs the following into the console when it loads: Siblings of div-01: DIV SCRIPT Polyfill for Internet Explorer 8 This property is unsupported prior to IE9, so the following snippet can be used to add support to IE8: // Source: https://github.com/Alhadis/Snippets/blob/master/js/polyfills/IE8-child-elements.js if(!("nextElementSibling" in document.documentElement)){ Object.defineProperty(Element.prototype, "nextElementSibling", { get: function(){ var e = this.nextSibling; while(e && 1 !== e.nodeType) e = e.nextSibling; return e; } }); } Polyfill for Interne...
...ills/IE8-child-elements.js if(!("nextElementSibling" in document.documentElement)){ Object.defineProperty(Element.prototype, "nextElementSibling", { get: function(){ var e = this.nextSibling; while(e && 1 !== e.nodeType) e = e.nextSibling; return e; } }); } Polyfill for Internet Explorer 9+ and Safari // Source: https://github.com/jserz/js_piece/blob/master/DOM/NonDocumentTypeChildNode/nextElementSibling/nextElementSibling.md (function (arr) { arr.forEach(function (item) { if (item.hasOwnProperty('nextElementSibling')) { return; } Object.defineProperty(item, 'nextElementSibling', { configurable: true, enumerable: true, get: function () { var el = this; while (el ...
...face. Element Traversal SpecificationThe definition of 'ElementTraversal.nextElementSibling' in that specification. Obsolete Added its initial definition to the ElementTraversal pure interface and use it on Element. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetnextElementSiblingChrome Full support 4Edge Full support 12Notes Full suppor...
Using Service Workers - Web APIs
-web-platform-features; restart browser (note that some features are now enabled by default in Chrome.) Opera: Go to opera://flags and enable Support for ServiceWorker; restart browser. Microsoft Edge: Go to about:flags and tick Enable service workers; restart browser. You'll also need to serve your code via HTTPS -- Service workers are restricted to running across HTTPS for security reasons. GitHub is therefore a good place to host experiments, as it supports HTTPS. In order to facilitate local development, localhost is considered a secure origin by browsers as well. Basic architecture With service workers, the following steps are generally observed for basic set up: The service worker URL is fetched and registered via serviceWorkerContainer.register(). If successful, the service w...
...e-powered function to read image data from a JSON object and load the images using Ajax, before displaying the images in a line down the page. We've kept things static and simple for now. It also registers, installs, and activates a service worker, and when more of the spec is supported by browsers it will cache all the files required so it will work offline! You can see the source code on GitHub, and view the example live. The one bit we'll call out here is the promise (see app.js lines 22-47), which is a modified version of what you read about above, in the Promises test demo. It is different in the following ways: In the original, we only passed in a URL to an image we wanted to load. In this version, we pass in a JSON fragment containing all the data for a single image (see what...
... that support both will ignore the AppCache and let SW take over. Why is my service worker failing to register? This could be for the following reasons: You are not running your application through HTTPS. The path to your service worker file is not written correctly -- it needs to be written relative to the origin, not your app's root directory. In our example, the worker is at https://mdn.github.io/sw-test/sw.js, and the app's root is https://mdn.github.io/sw-test/. But the path needs to be written as /sw-test/sw.js, not /sw.js. The service worker being pointed to is on a different origin to that of your app. This is also not allowed. Also note: The service worker will only catch requests from clients under the service worker's scope. The max scope for a service worker is the...
SubtleCrypto.decrypt() - Web APIs
n algorithm, or invalid key for the specified encryption algorithm). OperationError Raised when the operation failed for an operation-specific reason (e.g. algorithm parameters of invalid sizes, or there was an error decrypting the ciphertext). Supported algorithms The decrypt() method supports the same algorithms as the encrypt() method. Examples Note: You can try the working examples on GitHub. RSA-OAEP This code decrypts ciphertext using RSA-OAEP. See the complete code on GitHub. function decryptMessage(privateKey, ciphertext) { return window.crypto.subtle.decrypt( { name: "RSA-OAEP" }, privateKey, ciphertext ); } AES-CTR This code decrypts ciphertext using AES in CTR mode. Note that counter must match the value that was used for encryption. See the ...
...This code decrypts ciphertext using RSA-OAEP. See the complete code on GitHub. function decryptMessage(privateKey, ciphertext) { return window.crypto.subtle.decrypt( { name: "RSA-OAEP" }, privateKey, ciphertext ); } AES-CTR This code decrypts ciphertext using AES in CTR mode. Note that counter must match the value that was used for encryption. See the complete code on GitHub. function decryptMessage(key, ciphertext) { return window.crypto.subtle.decrypt( { name: "AES-CTR", counter, length: 64 }, key, ciphertext ); } AES-CBC This code decrypts ciphertext using AES in CBC mode. Note that iv must match the value that was used for encryption. See the complete code on GitHub. function decryptMessage(key, ciphertext) { return ...
... must match the value that was used for encryption. See the complete code on GitHub. function decryptMessage(key, ciphertext) { return window.crypto.subtle.decrypt( { name: "AES-CBC", iv: iv }, key, ciphertext ); } AES-GCM This code decrypts ciphertext using AES in GCM mode. Note that iv must match the value that was used for encryption. See the complete code on GitHub. function decryptMessage(key, ciphertext) { return window.crypto.subtle.decrypt( { name: "AES-GCM", iv: iv }, key, ciphertext ); } Specifications Specification Status Comment Web Cryptography APIThe definition of 'SubtleCrypto.decrypt()' in that specification. Recommendation Initial definition. ...
SubtleCrypto.generateKey() - Web APIs
rithms) or a CryptoKeyPair (for public-key algorithms). Exceptions The promise is rejected when the following exception is encountered: SyntaxError Raised when the result is a CryptoKey of type secret or private but keyUsages is empty. SyntaxError Raised when the result is a CryptoKeyPair and its privateKey.usages attribute is empty. Examples Note: You can try the working examples on GitHub. RSA key pair generation This code generates an RSA-OAEP encryption key pair. See the complete code on GitHub. let keyPair = window.crypto.subtle.generateKey( { name: "RSA-OAEP", modulusLength: 4096, publicExponent: new Uint8Array([1, 0, 1]), hash: "SHA-256" }, true, ["encrypt", "decrypt"] ); Elliptic curve key pair generation This code generates an ECDSA signing ...
...s code generates an RSA-OAEP encryption key pair. See the complete code on GitHub. let keyPair = window.crypto.subtle.generateKey( { name: "RSA-OAEP", modulusLength: 4096, publicExponent: new Uint8Array([1, 0, 1]), hash: "SHA-256" }, true, ["encrypt", "decrypt"] ); Elliptic curve key pair generation This code generates an ECDSA signing key pair. See the complete code on GitHub. let keyPair = window.crypto.subtle.generateKey( { name: "ECDSA", namedCurve: "P-384" }, true, ["sign", "verify"] ); HMAC key generation This code generates an HMAC signing key. See the complete code on GitHub. let key = window.crypto.subtle.generateKey( { name: "HMAC", hash: {name: "SHA-512"} }, true, ["sign", "verify"] ); AES key generation This code gen...
... name: "ECDSA", namedCurve: "P-384" }, true, ["sign", "verify"] ); HMAC key generation This code generates an HMAC signing key. See the complete code on GitHub. let key = window.crypto.subtle.generateKey( { name: "HMAC", hash: {name: "SHA-512"} }, true, ["sign", "verify"] ); AES key generation This code generates an AES-GCM encryption key. See the complete code on GitHub. let key = window.crypto.subtle.generateKey( { name: "AES-GCM", length: 256 }, true, ["encrypt", "decrypt"] ); Specifications Specification Status Comment Web Cryptography APIThe definition of 'SubtleCrypto.generateKey()' in that specification. Recommendation Initial definition. ...
SubtleCrypto.unwrapKey() - Web APIs
g to use an algorithm that is either unknown or isn't suitable for encryption or wrapping. SyntaxError Raised when keyUsages is empty but the unwrapped key is of type secret or private. TypeError Raised when trying to use an invalid format. Supported algorithms The unwrapKey() method supports the same algorithms as the wrapKey() method. Examples Note: You can try the working examples on Github. Unwrapping a "raw" key In this example we unwrap an AES-GCM symmetric key. The key was exported in "raw" format and encrypted using the AES-KW algorithm, with a key derived from a password. To unwrap, we ask the user for the password and use PBKDF2 and some salt to derive the AES-KW unwrapping key. The salt needs to be the same as the salt that was used to derive the original AES-KW key w...
...e AES-KW algorithm, with a key derived from a password. To unwrap, we ask the user for the password and use PBKDF2 and some salt to derive the AES-KW unwrapping key. The salt needs to be the same as the salt that was used to derive the original AES-KW key wrapping key. Once we have the unwrapping key we pass it into unwrapKey() with the wrapped key and other parameters. See the complete code on GitHub. /* Salt that is to be used in derivation of the key-wrapping key, alongside the password the user supplies. This must match the salt value that was originally used to derive the key. */ const saltBytes = [89,113,135,234,168,204,21,36,55,93,1,132,242,242,192,156]; /* The wrapped key itself. */ const wrappedKeyBytes = [171,223,14,36,201,233,233,120,164,68,217,192,226,80, 224,39,199,235,23...
...e salt needs to be the same as the salt that was used to derive the original AES-GCM key wrapping key. Once we have the unwrapping key we pass it into unwrapKey() with the wrapped key and other parameters. Note that when using AES-GCM we have to pass the iv value into unwrapKey(), and this must be the same as the iv that was used in the corresponding wrapKey() operation. See the complete code on GitHub. /* Salt that is to be used in derivation of the key-wrapping key, alongside the password the user supplies. This must match the salt value that was originally used to derive the key. */ const saltBytes = [180,253,62,216,47,35,90,55,218,233,103,10,172,143,161,177]; /* IV that is to be used in decrypting the key to unwrap. This must the the same IV that was originally used to encrypt the key.
ValidityState.patternMismatch - Web APIs
ail, url, password, or search -- and the pattern value is set to a valid regular expression, if the value don't doesn't conform to the constraints set by the pattern value, the patternMismatch property will be true. ...
...oesn't conform to the constraints set by the pattern value, the patternMismatch property will be true. Examples Given the following: <p> <label>Enter your phone number in the format (123)456-7890 (<input name="tel1" type="tel" pattern="[0-9]{3}" placeholder="###" aria-label="3-digit area code" size="2"/>)- <input name="tel2" type="tel" pattern="[0-9]{3}" placeholder="###" aria-label="3-digit prefix" size="2"/> - <input name="tel3" type="tel" pattern="[0-9]{4}" placeholder="####" aria-label="4-digit number" size="3"/> </label> </p> Here we have 3 sections for a north American phone number with an implicit label encompassing all three components of the phone number, expecting 3-digits, 3-digits and 4-digits respectively, as defined by the pattern attribute set on each. If the val...
...When true, the element matches the :invalid CSS pseudo-classes. input:invalid { border: red solid 3px; } Note, in this case, we get a patternMismatch not a validityState.tooLong or validityState.tooShort if the values are too long or too short because it is the pattern that is dictating the length of the value. ...
Signaling and video calling - Web APIs
e negotiation messages. In this article, we will further enhance the WebSocket chat first created as part of our WebSocket documentation (this article link is forthcoming; it isn't actually online yet) to support opening a two-way video call between users. You can try out this example on Glitch, and you can remix the example to experiment with it as well. You can also look at the full project on GitHub. Note: If you try out the example on Glitch, please note that any changes made to the code will immediately reset any connections. In addition, there is a short timeout period; the Glitch instance is for quick experiments and testing only. The signaling server Establishing a WebRTC connection between two devices requires the use of a signaling server to resolve how to connect them over th...
... id="received_video" autoplay></video> <video id="local_video" autoplay muted></video> <button id="hangup-button" onclick="hangUpCall();" disabled> Hang Up </button> </div> </div> The page structure defined here is using <div> elements, giving us full control over the page layout by enabling the use of CSS. We'll skip layout detail in this guide, but take a look at the CSS on Github to see how we handled it. Take note of the two <video> elements, one for your self-view, one for the connection, and the <button> element. The <video> element with the id "received_video" will present video received from the connected user. We specify the autoplay attribute, ensuring once the video starts arriving, it immediately plays. This removes any need to explicitly handle playback in o...
...tion has finished. function handleICEGatheringStateChangeEvent(event) { // Our sample just logs information to console here, // but you can do whatever you need. } Next steps You can now try out this example on Glitch to see it in action. Open the Web console on both devices and look at the logged output--although you don't see it in the code as shown above, the code on the server (and on GitHub) has a lot of console output so you can see the signaling and connection processes at work. Another obvious improvement would be to add a "ringing" feature, so that instead of just asking the user for permission to use the camera and microphone, a "User X is calling. Would you like to answer?" prompt appears first. ...
Using IIR filters - Web APIs
ple. Demo Our simple example for this guide provides a play/pause button that starts and pauses audio play, and a toggle that turns an IIR filter on and off, altering the tone of the sound. It also provides a canvas on which is drawn the frequency response of the audio, so you can see what effect the IIR filter has. You can check out the full demo here on Codepen. Also see the source code on GitHub. It includes some different coefficient values for different lowpass frequencies -- you can change the value of the filterNumber constant to a value between 0 and 3 to check out the different available effects. Browser support IIR filters are supported well across modern browsers, although they have been implemented more recently than some of the more longstanding Web Audio API features, lik...
...they have been implemented more recently than some of the more longstanding Web Audio API features, like Biquad filters. The IIRFilterNode The Web Audio API now comes with an IIRFilterNode interface. But what is this and how does it differ from the BiquadFilterNode we have already? An IIR filter is a infinite impulse response filter. It's one of two primary types of filters used in audio and digital signal processing. The other type is FIR -- finite impulse response filter. There's a really good overview to IIF filters and FIR filters here. A biquad filter is actually a specific type of infinite impulse response filter. It's a commonly-used type and we already have it as a node in the Web Audio API. If you choose this node the hard work is done for you. For instance, if you want to filter...
...ke it's not for you. If you want to play with the IIR filter node and need some values to help along the way, there's a table of already calculated values here; on pages 4 & 5 of the linked PDF the an values refer to the feedForward values and the bn values refer to the feedback. musicdsp.org is also a great resource if you want to read more about different filters and how they are implemented digitally. With that all in mind, let's take a look at the code to create an IIR filter with the Web Audio API. Setting our IIRFilter co-efficients When creating an IIR filter, we pass in the feedforward and feedback coefficients as options (coefficients is how we describe the values). Both of these parameters are arrays, neither of which can be larger than 20 items. When setting our coefficients, ...
XREnvironmentBlendMode - Web APIs
are ignored since the alpha values for the rendered imagery are all treated as being 1.0 (fully opaque). additive Primarily used by AR devices with transparent lenses which directly allow reality to pass through to the user's eyes, the additive blending mode is designed to be used in a situation in which the device has no control over the background and its brightness, since that isn't being digitally controlled. All the device can do is add more light to the image; it can't make things get darker. Therefore, black is rendered as fully transparent, and there's no way to make a pixel fully opaque. As with the opaque setting, alpha values specified are ignored and treated as if they were 1.0. alpha-blend Used by headsets or goggles which use cameras to capture the real world and display it...
...y controlled. All the device can do is add more light to the image; it can't make things get darker. Therefore, black is rendered as fully transparent, and there's no way to make a pixel fully opaque. As with the opaque setting, alpha values specified are ignored and treated as if they were 1.0. ...
... use cameras to capture the real world and display it digitally on the screen or screens used to render the content for the user to see, this offers a way to create an AR presentation using a VR device. Alpha blending can also be used by non-wearable devices that provide AR modes, such as phones or tablets using cameras to capture the real world for use in AR apps. Since the real world is being digitally presented, the brightness of each pixel can be controlled, whether it's reality or the rendered XR image, the user's environment can be blended with the virtual environment with each pixel having its color and brightness precisely controlled. In this mode, the XRSession's renderState.baseLayer property provides relative weights of the artificial layer during the compositing process. Pixels w...
XRSession.environmentBlendMode - Web APIs
are ignored since the alpha values for the rendered imagery are all treated as being 1.0 (fully opaque). additive Primarily used by AR devices with transparent lenses which directly allow reality to pass through to the user's eyes, the additive blending mode is designed to be used in a situation in which the device has no control over the background and its brightness, since that isn't being digitally controlled. All the device can do is add more light to the image; it can't make things get darker. Therefore, black is rendered as fully transparent, and there's no way to make a pixel fully opaque. As with the opaque setting, alpha values specified are ignored and treated as if they were 1.0. alpha-blend Used by headsets or goggles which use cameras to capture the real world and display it...
...y controlled. All the device can do is add more light to the image; it can't make things get darker. Therefore, black is rendered as fully transparent, and there's no way to make a pixel fully opaque. As with the opaque setting, alpha values specified are ignored and treated as if they were 1.0. ...
... use cameras to capture the real world and display it digitally on the screen or screens used to render the content for the user to see, this offers a way to create an AR presentation using a VR device. Alpha blending can also be used by non-wearable devices that provide AR modes, such as phones or tablets using cameras to capture the real world for use in AR apps. Since the real world is being digitally presented, the brightness of each pixel can be controlled, whether it's reality or the rendered XR image, the user's environment can be blended with the virtual environment with each pixel having its color and brightness precisely controlled. In this mode, the XRSession's renderState.baseLayer property provides relative weights of the artificial layer during the compositing process. Pixels w...
ARIA: textbox role - Accessibility
ingle line input, in which Return or Enter submits the form; in this case, it is preferable to use an HTML <input> with type="text". To create a multi-line text box which supports line breaks, as in an HTML <textarea>, set aria-multiline="true". Including the HTML contenteditable attribute ensures the text node is editable. ...
...eferable to use an HTML <input> with type="text". To create a multi-line text box which supports line breaks, as in an HTML <textarea>, set aria-multiline="true". Including the HTML contenteditable attribute ensures the text node is editable. <!-- Simple text input field --> <div id="txtboxLabel">Enter your five-digit zipcode</div> <div role="textbox" contenteditable="true" aria-placeholder="5-digit zipcode" aria-labelledby="txtboxLabel"></div> <!-- Multi-line text area --> <div id="txtboxMultilineLabel">Enter the tags for the article</div> <div role="textbox" contenteditable="true" aria-multiline="true" aria-labelledby="txtboxMultilineLabel" aria-required="true"></div> Semantic elements are more concise and require no JavaScript to support textbox features. <label for="txtbox">Ente...
...-labelledby="txtboxLabel"></div> <!-- Multi-line text area --> <div id="txtboxMultilineLabel">Enter the tags for the article</div> <div role="textbox" contenteditable="true" aria-multiline="true" aria-labelledby="txtboxMultilineLabel" aria-required="true"></div> Semantic elements are more concise and require no JavaScript to support textbox features. <label for="txtbox">Enter your five-digit zipcode</label> <input type="text" placeholder="5-digit zipcode" id="txtbox"/> <!-- Multi-line text area --> <label for="txtboxMultiline">Enter the tags for the article</label> <textarea id="txtboxMultiline" required></textarea> Where a text field is read-only, indicated this by setting aria-readonly="true" on the element. Associated ARIA properties aria-activedescendent attribute Ta...
Variable fonts guide - CSS: Cascading Style Sheets
ge can be supplied, so the font can be slanted just a tiny bit. However, any value from -90-90 degrees is valid. Note: The deg keyword is not used when utilizing font-variation-settings. font-style: oblique 14deg; font-variation-settings: 'slnt' 14; The following live example's CSS can be edited to allow you to play with font slant/oblique values. Optical size This is something new to digital fonts and CSS, but is actually a centuries-old technique in designing and creating metal type. Optical sizing refers to the practice of varying the overall stroke thickness of letterforms based on physical size. If the size was very small (such as an equivalent to 10 or 12px), the characters would have an overall thicker stroke, and perhaps other small modifications to ensure that it would repr...
...n a much larger size was being used (like 48 or 60px), there might be much greater variation in thick and thin stroke weights, showing the typeface design more in line with the original intent. While this was originally done to compensate for the ink and paper printing process (very thin lines at small sizes often didn't print, giving the letterforms a broken appearance), it translates well to digital displays when compensating for screen quality and physical size rendering. Optical size values are generally intended to be automatically applied corresponding to font-size, but can also be manipulated using the lower-level font-variation-settings syntax. There is a new attribute, font-optical-sizing, created to support variable fonts in CSS. When using font-optical-sizing, the only allowed v...
.... The second example uses CSS Custom Properties to set values for a font-variation-settings string, and shows how you can more easily update single variable values by overriding a single variable rather than rewriting the whole string. Note the hover effect on the h2, which only alters the grade axis custom property value. ...
CSS values and units - CSS: Cascading Style Sheets
See the <custom-ident> and <string> reference pages for more details. Pre-defined keyword values Pre-defined keywords are text values defined by the specification for that property. These keywords are also CSS Identifiers and are therefore used without quotes. When viewing CSS property value syntax in a CSS...
...nd-image: url("https://www.exammple.com/images/my-background.png"); } The parameter for url() can be either quoted or unquoted. If unquoted, it is parsed as a <url-token>, which has extra requirements including the escaping of certain characters. See <url> for more information. Numeric data types <integer> <number> <dimension> <percentage> Integers An integer is one or more decimal digits, 0 through 9, such as 1024 or -55. An integer may be preceded by a + or - symbol, with no space between the symbol and the integer. Numbers A <number> represents a real number, which may or may not have a decimal point with a fractional component, for example 0.255, 128 or -1.2. Numbers may also be preceded by a + or - symbol. Dimensions A <dimension> is a <number> with a unit attached to it...
...SS Values and Units Module Level 3 Candidate Recommendation Adds calc(), ch, rem, vw, vw, vmin, vmax, Q CSS Color Module Level 4 Working Draft Adds commaless syntaxes for the rgb(), rgba(), hsl(), and hsla() functions. Allows alpha values in rgb() and hsl(), turning rgba() and hsla() into (deprecated) aliases for them. Adds color keyword rebeccapurple. Adds 4- and 8-digit hex color values, where the last digit(s) represents the alpha value. Adds hwb(), device-cmyk(), and color() functions. CSS Color Module Level 3 Recommendation Deprecates system-colors. Adds SVG colors. Adds the rgba(), hsl(), and hsla() functions. CSS Images Module Level 4 Working Draft Adds element(), image(), image-set(), conic-gradient() CSS...
animation-direction - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. It is often convenient to use the shorthand property animation to set all animation properties at once. ...
... The animation-direction CSS property sets whether an animation should play forward, backward, or alternate back and forth between playing the sequence forward and backward. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. It is often convenient to use the shorthand property animation to set all animation properties at once. Syntax /* Single animation */ animation-direction: normal; animation-direction: reverse; animation-direction: alternate; animation-direction: alternate-reverse; /* Multiple animations */ animation-direction: normal, reverse; animation-direction: alternate, reverse, normal; /* Global values */...
...mples See CSS animations for examples. Specifications Specification Status Comment CSS AnimationsThe definition of 'animation-direction' in that specification. Working Draft Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetanimation-directionChrome Full support 43 Full support 43 Full support ...
background-color - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The background-color CSS property sets the background color of an element. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Keyword values */ background-color: red; background-color: indigo; /* Hexadecimal value */ background-color: #bbff00; /* Fully opaque */ background-color: #bf0; /* Fully opaque shorthand */ background-color: #11ffee00; /* Fully transparent */ background-color: #1fe0; /* Fully transparent shorthand */ background-color: #11ffeeff; /* Fully opaque */ background-color: #1fef; /* Fully opaque shorthand */ /* RGB value */ background-color: rgb(255, 255, 128); ...
... CSS Level 1The definition of 'background-color' in that specification. Initial definition ...
background-position-x - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The value of this property is overridden by any declaration of the background or background-position shorthand properties applied to the element after it. ...
... The background-position-x CSS property sets the initial horizontal position for each background image. The position is relative to the position layer set by background-origin. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The value of this property is overridden by any declaration of the background or background-position shorthand properties applied to the element after it. Syntax /* Keyword values */ background-position-x: left; background-position-x: center; background-position-x: right; /* <percentage> values */ background-position-x: 25%; /* <length> values */ background-position-x: 0px; background-positi...
...kgrounds and Borders Module Level 4The definition of 'background-position-x' in that specification. Editor's Draft Initial specification of longhand sub-properties of background-position to match longstanding implementations. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetbackground-position-xChrome Full support 1Edge Full support 12Firefox Full su...
background-position-y - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The value of this property is overridden by any declaration of the background or background-position shorthand properties applied to the element after it. ...
... The background-position-y CSS property sets the initial vertical position for each background image. The position is relative to the position layer set by background-origin. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The value of this property is overridden by any declaration of the background or background-position shorthand properties applied to the element after it. Syntax /* Keyword values */ background-position-y: top; background-position-y: center; background-position-y: bottom; /* <percentage> values */ background-position-y: 25%; /* <length> values */ background-position-y: 0px; background-position...
...kgrounds and Borders Module Level 4The definition of 'background-position-y' in that specification. Editor's Draft Initial specification of longhand sub-properties of background-position to match longstanding implementations. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetbackground-position-yChrome Full support 1Edge Full support 12Firefox Full su...
background-position - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The background-position CSS property sets the initial position for each background image. The position is relative to the position layer set by background-origin. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Keyword values */ background-position: top; background-position: bottom; background-position: left; background-position: right; background-position: center; /* <percentage> values */ background-position: 25% 75%; /* <length> values */ background-position: 0 0; background-position: 1cm 2cm; background-position: 10ch 8em; /* Multiple images */ background-position: 0 0, center; /* Edge offsets va...
...ification. Recommendation Allows for keyword values and <length> and <percentage> values to be mixed. CSS Level 1The definition of 'background-position' in that specification. Recommendation Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetbackground-positionChrome Full support 1Edge Full support 12Firefox Full supp...
background-size - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The background-size CSS property sets the size of the element's background image. The image can be left to its natural size, stretched, or constrained to fit the available space. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Spaces not covered by a background image are filled with the background-color property, and the background color will be visible behind background images that have transparency/translucency. Syntax /* Keyword values */ background-size: cover; background-size: contain; /* One-value syntax */ /* the width of the image (height becomes 'auto') */ background-size: 50%; background-size: 3.2em; b...
...les. Specifications Specification Status Comment CSS Backgrounds and Borders Module Level 3The definition of 'background-size' in that specification. Candidate Recommendation Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetbackground-sizeChrome Full support 3 Full support 3 Full support ...
border-bottom-width - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The border-bottom-width CSS property sets the width of the bottom border of an element. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Keyword values */ border-bottom-width: thin; border-bottom-width: medium; border-bottom-width: thick; /* <length> values */ border-bottom-width: 10em; border-bottom-width: 3vmax; border-bottom-width: 6px; /* Global keywords */ border-bottom-width: inherit; border-bottom-width: initial; border-bottom-width: unset; Values <line-width> Defines the width of the border, either as an explicit nonnegative <length> or a keyword. If it's a keyword, it must be one of the f...
...)The definition of 'border-bottom-width' in that specification. Recommendation No significant change. CSS Level 1The definition of 'border-bottom-width' in that specification. Recommendation Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetborder-bottom-widthChrome Full support 1Edge Full support 12Firefox Full supp...
border-left-style - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Note: The specification doesn't define how borders of different styles connect in the corners. ...
... Note: The specification doesn't define how borders of different styles connect in the corners. ...
...'border-left-style' in that specification. Candidate Recommendation No significant change. CSS Level 2 (Revision 1)The definition of 'border-left-style' in that specification. Recommendation Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetborder-left-styleChrome Full support 1Edge Full support 12Firefox Full suppor...
border-right-style - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Note: The specification doesn't define how borders of different styles connect in the corners. ...
... Note: The specification doesn't define how borders of different styles connect in the corners. ...
...order-right-style' in that specification. Candidate Recommendation No significant change. CSS Level 2 (Revision 1)The definition of 'border-right-style' in that specification. Recommendation Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetborder-right-styleChrome Full support 1Edge Full support 12Firefox Full suppo...
border - CSS: Cascading Style Sheets
Web › CSS › border
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The border shorthand CSS property sets an element's border. It sets the values of border-width, border-style, and border-color. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Constituent properties This property is a shorthand for the following CSS properties: border-color border-style border-width Syntax /* style */ border: solid; /* width | style */ border: 2px dotted; /* style | color */ border: outset #f33; /* width | style | color */ border: medium dashed green; /* Global values */ border: inherit; border: initial; border: unset; The border property may be specified using one, two, or three of ...
...der' in that specification. Recommendation Accepts the inherit keyword. Also accepts transparent as a valid color. CSS Level 1The definition of 'border' in that specification. Recommendation Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetborderChrome Full support 1Edge Full support 12Firefox Full support ...
caption-side - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The caption-side CSS property puts the content of a table's <caption> on the specified side. The values are relative to the writing-mode of the table. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Directional values */ caption-side: top; caption-side: bottom; /* Warning: non-standard values */ caption-side: left; caption-side: right; caption-side: top-outside; caption-side: bottom-outside; /* Global values */ caption-side: inherit; caption-side: initial; caption-side: unset; The caption-side property is specified as one of the keyword values listed below. Values top The caption box should be p...
...ation. Editor's Draft Defines the top and bottom values as relative to the writing-mode value. CSS Level 2 (Revision 1)The definition of 'caption-side' in that specification. Recommendation Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetcaption-sideChrome Full support 1Edge Full support 12Firefox Full support ...
clear - CSS: Cascading Style Sheets
Web › CSS › clear
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. When applied to non-floating blocks, it moves the border edge of the element down until it is below the margin edge of all relevant floats. ...
... The clear CSS property sets whether an element must be moved below (cleared) floating elements that precede it. The clear property applies to floating and non-floating elements. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. When applied to non-floating blocks, it moves the border edge of the element down until it is below the margin edge of all relevant floats. The non-floated block's top margin collapses. Vertical margins between two floated elements on the other hand will not collapse. When applied to floating elements, the margin edge of the bottom element is moved below the margin edge of all relevant floats...
...he definition of 'clear' in that specification. Recommendation No significant changes, though details are clarified. CSS Level 1The definition of 'clear' in that specification. Recommendation Initial definition Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetclearChrome Full support 1Edge Full support 12Firefox Full support ...
<custom-ident> - CSS: Cascading Style Sheets
used as an identifier. It is case-sensitive, and certain values are forbidden in various contexts to prevent ambiguity. Syntax The syntax of <custom-ident> is similar to CSS identifiers (such as property names), except that it is case-sensitive. It consists of one or more characters, where characters can be any of the following: any alphabetical character (A to Z, or a to z), any decimal digit (0 to 9), a hyphen (-), an underscore (_), an escaped character (preceded by a backslash, \), a Unicode character (in the format of a backslash, \, followed by one to six hexadecimal digits, representing its Unicode code point) Note that id1, Id1, iD1 and ID1 are all different identifiers as they are case-sensitive. On the other hand, as there are several ways to escape a character, toto\? ...
...code point) Note that id1, Id1, iD1 and ID1 are all different identifiers as they are case-sensitive. On the other hand, as there are several ways to escape a character, toto\? and toto\3F are the same identifiers. Forbidden values A <custom-ident> must not be placed between single or double quotes as this would be identical to a <string>. Moreover, the first character must not be a decimal digit, nor a hyphen (-) followed by a decimal digit or another hyphen. To prevent ambiguity, each property that uses <custom-ident> forbids the use of specific values: animation-name Forbids the global CSS values (unset, initial, and inherit), as well as none. counter-reset counter-increment Forbids the global CSS values (unset, initial, and inherit), as well as none. @counter-style list-styl...
...ground-level A mix of alphanumeric characters and a dash -test A dash followed by alphanumeric characters _internal An underscore followed by alphanumeric characters \22 toto A Unicode character followed by a sequence of alphanumeric characters bili\.bob A correctly escaped period Invalid identifiers 34rem It must not start with a decimal digit. -12rad It must not start with a dash followed by a decimal digit. bili.bob Only alphanumeric characters, _, and - needn't be escaped. --toto It must not start with two dashes. This would be a custom property. 'bilibob' This would be a <string>. "bilibob" This would be a <string>. Specifications Specification Status Comment ...
direction - CSS: Cascading Style Sheets
Web › CSS › direction
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...property sets the direction of text, table columns, and horizontal overflow. Use rtl for languages written from right to left (like Hebrew or Arabic), and ltr for those written from left to right (like English and most other languages). The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Note that text direction is usually defined within a document (e.g., with HTML's dir attribute) rather than through direct use of the direction property. The property sets the base text direction of block-level elements and the direction of embeddings created by the unicode-bidi property. It also sets the default alignment of text, blo...
...e Level 3The definition of 'direction' in that specification. Proposed Recommendation No change. CSS Level 2 (Revision 1)The definition of 'direction' in that specification. Recommendation Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetdirectionChrome Full support 2Edge Full support 12Firefox Full support ...
empty-cells - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. This property has an effect only when the border-collapse property is separate. ...
... This property has an effect only when the border-collapse property is separate. ...
... gray; padding: 0.5rem; } Result Specifications Specification Status Comment CSS Level 2 (Revision 1)The definition of 'empty-cells' in that specification. Recommendation Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetempty-cellsChrome Full support 1Edge Full support 12Firefox Full support ...
font-style - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Italic font faces are generally cursive in nature, usually using less horizontal space than their unstyled counterparts, while oblique faces are usually just sloped versions of the regular face. ...
...t an <angle>. ...
...max="90" /> <label for="slant">Slant</label> </header> <div class="container"> <p class="sample">...it would not be wonderful to meet a Megalosaurus, forty feet long or so, waddling like an elephantine lizard up Holborn Hill.</p> </div> CSS /* AmstelvarAlpha-VF is created by David Berlow (https://github.com/TypeNetwork/Amstelvar) and is used here under the terms of its license: https://github.com/TypeNetwork/Amstelvar/blob/master/OFL.txt */ @font-face { src: url('https://mdn.mozillademos.org/files/16044/AmstelvarAlpha-VF.ttf'); font-family:'AmstelvarAlpha'; font-style: normal; } label { font: 1rem monospace; } .container { max-height: 150px; overflow: scroll; } .sample { font: 2rem 'AmstelvarAlpha', sans-serif; } html, body { max-height: 100vh; max-width: ...
font-variant - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The font-variant CSS shorthand property allows you to set all the font variants for a font. You can also set the CSS Level 2 (Revision 1) values of font-variant, (that is, normal or small-caps), by using the font shorthand. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Constituent properties This property is a shorthand for the following CSS properties: font-variant-alternates font-variant-caps font-variant-east-asian font-variant-ligatures font-variant-numeric Syntax font-variant: small-caps; font-variant: common-ligatures small-caps; /* Global values */ font-variant: inherit; font-variant: ini...
... CSS Level 2 (Revision 1)The definition of 'font-variant' in that specification. Recommendation No change CSS Level 1The definition of 'font-variant' in that specification. Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetfont-variantChrome Full support 1Edge Full support 12Firefox Full support ...
max-height - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. max-height overrides height, but min-height overrides max-height. ...
... The max-height CSS property sets the maximum height of an element. It prevents the used value of the height property from becoming larger than the value specified for max-height. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. max-height overrides height, but min-height overrides max-height. Syntax /* <length> value */ max-height: 3.5em; /* <percentage> value */ max-height: 75%; /* Keyword values */ max-height: none; max-height: max-content; max-height: min-content; max-height: fit-content(20em); /* Global values */ max-height: inherit; max-height: initial; max-height: unset; Values <length> Defines the ...
...ht' in that specification. Working Draft Adds the max-content, min-content, fit-content keywords. CSS Level 2 (Revision 1)The definition of 'max-height' in that specification. Recommendation Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetmax-heightChrome Full support 18Edge Full support 12Firefox Full support ...
max-width - CSS: Cascading Style Sheets
Web › CSS › max-width
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. max-width overrides width, but min-width overrides max-width. ...
... max-width overrides width, but min-width overrides max-width. ...
...th' in that specification. Working Draft Adds the max-content, min-content, fit-content keywords. CSS Level 2 (Revision 1)The definition of 'max-width' in that specification. Recommendation Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetmax-widthChrome Full support 1Edge Full support 12Firefox Full support ...
min-width - CSS: Cascading Style Sheets
Web › CSS › min-width
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The element's width is set to the value of min-width whenever min-width is larger than max-width or width. ...
... The min-width CSS property sets the minimum width of an element. It prevents the used value of the width property from becoming smaller than the value specified for min-width. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The element's width is set to the value of min-width whenever min-width is larger than max-width or width. Syntax /* <length> value */ min-width: 3.5em; /* <percentage> value */ min-width: 10%; /* Keyword values */ min-width: max-content; min-width: min-content; min-width: fit-content(20em); /* Global values */ min-width: inherit; min-width: initial; min-width: unset; Values <length> ...
...t specification. Candidate Recommendation Adds the auto keyword and uses it as the initial value. CSS Level 2 (Revision 1)The definition of 'min-width' in that specification. Recommendation Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetmin-widthChrome Full support 1Edge Full support 12Firefox Full support ...
mix-blend-mode - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The mix-blend-mode CSS property sets how an element's content should blend with the content of the element's parent and the element's background. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Keyword values */ mix-blend-mode: normal; mix-blend-mode: multiply; mix-blend-mode: screen; mix-blend-mode: overlay; mix-blend-mode: darken; mix-blend-mode: lighten; mix-blend-mode: color-dodge; mix-blend-mode: color-burn; mix-blend-mode: hard-light; mix-blend-mode: soft-light; mix-blend-mode: difference; mix-blend-mode: exclusion; mix-blend-mode: hue; mix-blend-mode: saturation; mix-blend-mode: color; mix-blend-m...
...unt */ Result Specifications Specification Status Comment Compositing and Blending Level 1The definition of 'mix-blend-mode' in that specification. Candidate Recommendation Initial definition Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetmix-blend-modeChrome Full support 41Edge Full support 79Firefox Full support ...
pointer-events - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The pointer-events CSS property sets under what circumstances (if any) a particular graphic element can become the target of pointer events. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Keyword values */ pointer-events: auto; pointer-events: none; pointer-events: visiblePainted; /* SVG only */ pointer-events: visibleFill; /* SVG only */ pointer-events: visibleStroke; /* SVG only */ pointer-events: visible; /* SVG only */ pointer-events: painted; /* SVG only */ pointer-events: fill; /* SVG only */ pointer-events: stroke; /* SVG only */ pointer-events: all; ...
...finition of 'pointer-events' in that specification. Recommendation Initial definition Its extension to HTML elements, though present in early drafts of CSS Basic User Interface Module Level 3, has been pushed to its level 4. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetpointer-eventsChrome Full support 1Edge Full support 12Firefox Full support ...
quotes - CSS: Cascading Style Sheets
Web › CSS › quotes
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The quotes CSS property sets how the browser should render quotation marks that are added using the open-quotes or close-quotes values of the CSS content property. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Keyword value */ quotes: none; quotes: auto; /* <string> values */ quotes: "<<" ">>"; /* Set open-quote and close-quote to the French quotation marks */ quotes: "<<" ">>" "<" ">"; /* Set two levels of quotation marks */ /* Global values */ quotes: inherit; quotes: initial; quotes: unset; Values none The open-quote and close-quote values of the content property produce no quota...
... CSS Generated Content Module Level 3The definition of 'quotes' in that specification. Working Draft CSS Level 2 (Revision 1)The definition of 'quotes' in that specification. Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetquotesChrome Full support 11Edge Full support 12Firefox Full support ...
right - CSS: Cascading Style Sheets
Web › CSS › right
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The right CSS property participates in specifying the horizontal position of a positioned element. It has no effect on non-positioned elements. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <length> values */ right: 3px; right: 2.4em; /* <percentage>s of the width of the containing block */ right: 10%; /* Keyword value */ right: auto; /* Global values */ right: inherit; right: initial; right: unset; Values <length> A negative, null, or positive <length> that represents: for absolutely positioned elements, the distance to the right edge of the containing block. for relatively positioned e...
... 3The definition of 'right' in that specification. Working Draft Adds behavior for sticky positioning. CSS Level 2 (Revision 1)The definition of 'right' in that specification. Recommendation Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetrightChrome Full support 1Edge Full support 12Firefox Full support ...
HTML attribute: pattern - HTML: Hypertext Markup Language
fferent from JavaScript regular expressions: in the case of pattern attribute, we are matching against the entire value, not just any subset, as if a ^(?: were implied at the start of the pattern and )$ at the end. ...
...value, not just any subset, as if a ^(?: were implied at the start of the pattern and )$ at the end. Examples Given the following: <p> <label>Enter your phone number in the format (123)456-7890 (<input name="tel1" type="tel" pattern="[0-9]{3}" placeholder="###" aria-label="3-digit area code" size="2"/>)- <input name="tel2" type="tel" pattern="[0-9]{3}" placeholder="###" aria-label="3-digit prefix" size="2"/> - <input name="tel3" type="tel" pattern="[0-9]{4}" placeholder="####" aria-label="4-digit number" size="3"/> </label> </p> Here we have 3 sections for a north American phone number with an implicit label encompassing all three components of the phone number, expecting 3-digits, 3-digits and 4-digits respectively, as defined by the pattern attribute set on each. If the val...
...When true, the element matches the :invalid CSS pseudo-classes. input:invalid { border: red solid 3px; } Had we used minlength and maxlength attributes instead, we may have seen validityState.tooLong or validityState.tooShort being true. ...
<col> - HTML: Hypertext Markup Language
Web › HTML › Element › col
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. <col> allows styling columns using CSS, but only a few properties will have an effect on the column (see the CSS 2.1 specification for a list). ...
... The HTML <col> element defines a column within a table and is used for defining common semantics on all common cells. It is generally found within a <colgroup> element. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. <col> allows styling columns using CSS, but only a few properties will have an effect on the column (see the CSS 2.1 specification for a list). Content categories None. Permitted content None, it is an empty element. Tag omission It must have start tag, but must not have an end tag. Permitted parents <colgroup> only, though it can be implicitly defined ...
...+b) CSS selector. Set a to zero and b to the position of the column in the table, e.g. td:nth-child(2) { text-align: right; } to right-align the second column. If the table does use a colspan attribute, the effect can be achieved by combining adequate CSS attribute selectors like [colspan=n], though this is not trivial. bgcolor The background color of the table. It is a 6-digit hexadecimal RGB code, prefixed by a '#'. One of the predefined color kewords can also be used. To achieve a similar effect, use the CSS background-color property. char This attribute is used to set the character to align the cells in a column on. Typical values for this include a period (.) when attempting to align numbers or monetary values. If align is not set to char, this attribute is...
<input type="number"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › number
<input> elements of type number are used to let the user enter a number. They include built-in validation to reject non-numerical entries. The browser may opt to provide stepper arrows to let the user increase and decrease the value using their mouse or by simply tapping with a fingertip. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. On browsers that don't support inputs of type number, a number input falls back to type text. Value Any floating-point number, or empty. Events change and input Supported common attributes autocomplete, list, placeholder, readonly IDL att...
... example allows any value between 0.0 and 10.0, with decimals to two places. For example, "9.52" is valid, but "9.521" is not. Controlling input size <input> elements of type number don't support form sizing attributes such as size. You'll have to resort to CSS to change the size of these controls. ...
...bmitted (or data which is too large, is of the wrong type, and so forth). Pattern validation <input type="number"> elements do not support use of the pattern attribute for making entered values conform to a specific regex pattern. The rationale for this is that number inputs won't be valid if they contain anything except numbers, and you can constrain the minimum and maximum number of valid digits using the min and max attributes (as explained above). Examples We've already covered the fact that by default, the increment is 1, and you can use the step attribute to allow decimal inputs. Let's take a closer look. In the following example is a form for entering the user's height. It defaults to accepting a height in meters, but you can click the relevant button to change the form to accep...
<input type="url"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › url
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The input value is automatically validated to ensure that it's either empty or a properly-formatted URL before the form can be submitted. The :valid and :invalid CSS pseudo-classes are automatically applied as appropriate to visually denote whether the current value of the field is a valid URL or not. ...
...d. To see the status of the change being implemented in Firefox, see bug 1490661. Permitted values are: go, done, next, search, and send. The browser decides, using this hint, what label to put on the enter key. Using URL inputs When you create a URL input with the proper type value, url, you get automatic validation that the entered text is at least in the correct form to potentially be a legitimate URL. This can help avoid cases in which the user mis-types their web site's address, or provides an invalid one. It's important, however, to note that this is not enough to ensure that the specified text is a URL which actually exists, corresponds to the user of the site, or is acceptable in any other way. It simply ensures that the value of the field is properly formatted to be a URL. No...
...o trouble while writing your validation regular expressions and they're not working properly, check your browser's console; there may be helpful error messages there to aid you in solving the problem. Examples There's not much else to say about url type inputs; check the Pattern validation and Using URL inputs sections for numerous examples. You can also find our pattern validation example on GitHub (see it running live also). Specifications Specification Status Comment HTML Living StandardThe definition of '<input type="url">' in that specification. Living Standard Initial definition HTML 5.1The definition of '<input type="url">' in that specification. Recommendation Initial definition URLThe definition of 'URL syntax' in that s...
<style>: The Style Information element - HTML: Hypertext Markup Language
Web › HTML › Element › style
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The <style> element must be included inside the <head> of the document. ...
... The HTML <style> element contains style information for a document, or part of a document. It contains CSS, which is applied to the contents of the document containing the <style> element. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The <style> element must be included inside the <head> of the document. In general, it is better to put your styles in external stylesheets and apply them using <link> elements. If you include multiple <style> and <link> elements in your document, they will be applied to the DOM in the order they are included in the document -- make sure you include them in the correct order, to av...
...ransmits a policy. It is critical to provide a nonce that cannot be guessed as bypassing a resource's policy is otherwise trivial. title This attribute specifies alternative style sheet sets. Deprecated attributes scoped This attribute specifies that the styles only apply to the elements of its parent(s) and children. This attribute may be re-introduced in the future per https://github.com/w3c/csswg-drafts/issues/3547. If you want to use the attribute now, you can use a polyfill. Examples A simple stylesheet In the following example, we apply a very simple stylesheet to a document: <!doctype html> <html> <head> <style> p { color: red; } </style> </head> <body> <p>This is my paragraph.</p> </body> </html> Multiple style elements In this exampl...
<table>: The Table element - HTML: Hypertext Markup Language
Web › HTML › Element › table
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The HTML <table> element represents tabular data -- that is, information presented in a two-dimensional table comprised of rows and columns of cells containing data. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content Permitted content In this order: an optional <caption> element, zero or more <colgroup> elements, an optional <thead> element, either one of the following: zero or more <tbody> elements one or more <tr> elements an optional <tfoot> element Tag omiss...
...ing values: left: the table is displayed on the left side of the document; center: the table is displayed in the center of the document; right: the table is displayed on the right side of the document. Set margin-left and margin-right to auto or margin to 0 auto to achieve an effect that is similar to the align attribute. bgcolor The background color of the table. It is a 6-digit hexadecimal RGB code, prefixed by a '#'. One of the predefined color kewords can also be used. To achieve a similar effect, use the CSS background-color property. border This integer attribute defines, in pixels, the size of the frame surrounding the table. If set to 0, the frame attribute is set to void. To achieve a similar effect, use the CSS border shorthand property. cellpaddi...
<textarea> - HTML: Hypertext Markup Language
Web › HTML › Element › textarea
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The HTML <textarea> element represents a multi-line plain-text editing control, useful when you want to allow users to enter a sizeable amount of free-form text, for example a comment on a review or feedback form. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The above example demonstrates a number of features of <textarea>: An id attribute to allow the <textarea> to be associated with a <label> element for accessibility purposes A name attribute to set the name of the associated data point submitted to the server when the form is submitted. rows and cols attributes to allow you to specify an exact size for...
...ification. Living Standard HTML5The definition of '<textarea>' in that specification. Recommendation HTML 4.01 SpecificationThe definition of '<textarea>' in that specification. Recommendation Browser Compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternettextareaChrome Full support YesEdge Full support 12Firefox Full support ...
<th> - HTML: Hypertext Markup Language
Web › HTML › Element › th
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories None. Permitted content Flow content, but with no header, footer, sectioning content, or heading content descendants. ...
... Content categories None. ...
...Unimplemented in CSS3. axis Obsolete since HTML5 This attribute contains a list of space-separated strings. Each string is the id of a group of cells that this header applies to. Note: Do not use this attribute as it is obsolete in the latest standard: use the scope attribute instead. bgcolor This attribute defines the background color of each cell in a column. It consists of a 6-digit hexadecimal code as defined in sRGB and is prefixed by '#'. This attribute may be used with one of sixteen predefined color strings: black = "#000000" green = "#008000" silver = "#C0C0C0" lime = "#00FF00" gray = "#808080" olive = "#808000" white = "#FFFFFF" yellow = "#FFFF00" ...
<video>: The Video Embed element - HTML: Hypertext Markup Language
Web › HTML › Element › video
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The above example shows simple usage of the <video> element. ...
... The HTML Video element (<video>) embeds a media player which supports video playback into the document. You can use <video> for audio content as well, but the <audio> element may provide a more appropriate user experience. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The above example shows simple usage of the <video> element. In a similar manner to the <img> element, we include a path to the media we want to display inside the src attribute; we can include other attributes to specify information such as video width and height, whether we want it to autoplay and loop, whether we want to show the browser's defaul...
...nd ending tag are mandatory. Permitted parents Any element that accepts embedded content. Implicit ARIA role No corresponding role Permitted ARIA roles application DOM interface HTMLVideoElement Specifications Specification Feedback HTML Living StandardThe definition of '<video>' in that specification. WHATWG HTML GitHub issues ...
id - HTML: Hypertext Markup Language
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The id global attribute defines an identifier (ID) which must be unique in the whole document. Its purpose is to identify the element when linking (using a fragment identifier), scripting, or styling (with CSS). The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. This attribute's value is an opaque string: this means that web authors should not rely on it to convey human-readable information (although having your IDs somewhat human-readable can be useful for code comprehension, e.g. consider ticket-18659 versus r45tgfe-freds&$@). id's value must not contain whitespace (spaces, tabs etc.). Browsers treat non-conform...
... code comprehension, e.g. consider ticket-18659 versus r45tgfe-freds&$@). id's value must not contain whitespace (spaces, tabs etc.). Browsers treat non-conforming IDs that contain whitespace as if the whitespace is part of the ID. In contrast to the class attribute, which allows space-separated values, elements can only have one single ID value. Note: Using characters except ASCII letters, digits, '_', '-' and '.' may cause compatibility problems, as they weren't allowed in HTML 4. Though this restriction has been lifted in HTML5, an ID should start with a letter for compatibility. Specifications Specification Status Comment HTML Living StandardThe definition of 'id' in that specification. Living Standard No change from latest snapshot, HTML 5.1 ...
Identifying resources on the Web - HTTP
e HTTP and HTTPS schemes. Increasingly, browsers are removing support for using FTP to load subresources, for security reasons. ...
...TP and HTTPS schemes. Increasingly, browsers are removing support for using FTP to load subresources, for security reasons. ...
... browsers are removing support for using FTP to load subresources, for security reasons. FTP is still acceptable at the top level (such as typed directly into the browser's URL bar, or the target of a link), although some browsers may delegate loading FTP content to another application. ...
HTTP Index - HTTP
Web › HTTP › Index
Authenticate header. 171 Public-Key-Pins HPKP, HTTP, Reference, Security, header The HTTP Public-Key-Pins response header associates a specific cryptographic public key with a certain web server to decrease the risk of MITM attacks with forged certificates. If one or several keys are pinned and none of them are used by the server, the browser will not accept the response as legitimate, and will not display it. 172 Public-Key-Pins-Report-Only HPKP, HTTP, Security, header The HTTP Public-Key-Pins-Report-Only response header sends reports of pinning violation to the report-uri specified in the header but, unlike Public-Key-Pins still allows browsers to connect to the server if the pinning is violated. 173 Range HTTP, HTTP Header, Range Req...
...g The Tk response header indicates the tracking status that applied to the corresponding request. 188 Trailer HTTP, Reference, header The Trailer response header allows the sender to include additional fields at the end of chunked messages in order to supply metadata that might be dynamically generated while the message body is sent, such as a message integrity check, digital signature, or post-processing status. 189 Transfer-Encoding HTTP, Reference, header The Transfer-Encoding header specifies the form of encoding used to safely transfer the payload body to the user. 190 Upgrade-Insecure-Requests HTTP, HTTPS, Security, header The HTTP Upgrade-Insecure-Requests request header sends a signal to the server expressing the cli...
...lling the request. 262 501 Not Implemented HTTP, Server error, Status code The HyperText Transfer Protocol (HTTP) 501 Not Implemented server error response code means that the server does not support the functionality required to fulfill the request. 263 502 Bad Gateway HTTP, Server error, Status code The information shown below has been pulled from MDN's GitHub (https://github.com/mdn/browser-compat-data). 264 503 Service Unavailable 503 error, HTTP, Server error, Status code The HyperText Transfer Protocol (HTTP) 503 Service Unavailable server error response code indicates that the server is not ready to handle the request. 265 504 Gateway Timeout HTTP, Server error, Status code The HyperText Transfer Protoc...
JavaScript modules - JavaScript
Full support Full support No support No supportSee implementation notes.See implementation notes.User must explicitly enable this feature.User must explicitly enable this feature. Introducing an example To demonstrate usage of modules, we've created a simple set of examples that you can find on GitHub. These examples demonstrate a simple set of modules that create a <canvas> element on a webpage, and then draw (and report information about) different shapes on the canvas. These are fairly trivial, but have been kept deliberately simple to demonstrate modules clearly. Note: If you want to download the examples and run them locally, you'll need to run them through a local web server. Bas...
... Content-Type header that contains a JavaScript MIME type such as text/javascript. If you don't, you'll get a strict MIME type checking error along the lines of "The server responded with a non-JavaScript MIME type" and the browser won't run your JavaScript. Most servers already set the correct type for .js files, but not yet for .mjs files. Servers that already serve .mjs files correctly include GitHub Pages and http-server for Node.js. This is OK if you are using such an environment already, or if you aren't but you know what you are doing and have access (i.e. you can configure your server to set the correct Content-Type for .mjs files). It could however cause confusion if you don't control the server you are serving files from, or are publishing files for public use, as we are here. For...
...javascript (or another JavaScript-compatible MIME-type, but text/javascript is recommended), otherwise you'll get a strict MIME type checking error like "The server responded with a non-JavaScript MIME type". If you try to load the HTML file locally (i.e. with a file:// URL), you'll run into CORS errors due to JavaScript module security requirements. You need to do your testing through a server. GitHub pages is ideal as it also serves .js files with the correct MIME type. Because .mjs is a non-standard file extension, some operating systems might not recognise it, or try to replace it with something else. For example, we found that macOS was silently adding on .js to the end of .mjs files and then automatically hiding the file extension. So all of our files were actually coming out as x.mjs...
Unicode property escapes - JavaScript
codePropertyName=UnicodePropertyValue} // Binary and non-binary values \p{UnicodeBinaryPropertyName} // Negation: \P is negated \p \P{UnicodePropertyValue} \P{UnicodeBinaryPropertyName} General_Category (gc) Script (sc) Script_Extensions (scx) See also PropertyValueAliases.txt UnicodeBinaryPropertyName The name of a binary property. E.g.: ASCII, Alpha, Math, Diacritic, Emoji, Hex_Digit, Math, White_space, etc. See Unicode Data PropList.txt for more info. UnicodePropertyName The name of a non-binary property: UnicodePropertyValue One of the tokens listed in the Values section, below. Many values have aliases or shorthand (e.g. the value Decimal_Number for the General_Category property may be written Nd, digit, or Decimal_Number). For most values, the UnicodePropertyName part...
...llic}/u); // ? For more details, please refer to the Unicode specification and the Scripts table in the ECMAScript specification. If a character is used in a limited set of scripts, the Script property will only match for the "predominant" used script. If we want to match characters based on a "non-predominant" script, we could use the Script_Extensions property (Scx for short). // ? 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. character classes With JavaScript regul...
... 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. character classes With JavaScript regular expressions, it is also possible to use character classes and especially \w or \d to match letters or digits. However, such forms only match characters from the Latin script (in other words, a to z and A to Z for \w and 0 to 9 for \d). As shown in this example, it might be a bit clumsy to work with non Latin texts. Unicode property escapes categories encompass much more characters and \p{Letter} or \p{Number} will work for any script. // Trying to use ranges to avoid \w limitations: const nonEnglish...
Text formatting - JavaScript
mozilla.org/show_bug.cgi?id=857438 ). String literals You can create simple strings using either single or double quotes: 'foo' "bar" More advanced strings can be created using escape sequences: Hexadecimal escape sequences The number after \x is interpreted as a hexadecimal number. '\xA9' // "(C)" Unicode escape sequences The Unicode escape sequences require at least four hexadecimal digits following \u. '\u00A9' // "(C)" Unicode code point escapes New in ECMAScript 2015. With Unicode code point escapes, any character can be escaped using hexadecimal numbers so that it is possible to use Unicode code points up to 0x10FFFF. With simple Unicode escapes it is often necessary to write the surrogate halves separately to achieve the same result. See also String.fromCodePoint() or Str...
...ies of the Intl object. Date and time formatting The DateTimeFormat object is useful for formatting date and time. The following formats a date for English as used in the United States. (The result is different in another time zone.) const msPerDay = 24 * 60 * 60 * 1000; // July 17, 2014 00:00:00 UTC. const july172014 = new Date(msPerDay * (44 * 365 + 11 + 197)); const options = { year: '2-digit', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', timeZoneName: 'short' }; const americanDateTime = new Intl.DateTimeFormat('en-US', options).format; console.log(americanDateTime(july172014)); // 07/16/14, 5:00 PM PDT Number formatting The NumberFormat object is useful for formatting numbers, for example currencies. const gasPrice = new Intl.NumberFormat...
...onst americanDateTime = new Intl.DateTimeFormat('en-US', options).format; console.log(americanDateTime(july172014)); // 07/16/14, 5:00 PM PDT Number formatting The NumberFormat object is useful for formatting numbers, for example currencies. const gasPrice = new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD', minimumFractionDigits: 3 }); console.log(gasPrice.format(5.259)); // $5.259 const hanDecimalRMBInChina = new Intl.NumberFormat('zh-CN-u-nu-hanidec', { style: 'currency', currency: 'CNY' }); console.log(hanDecimalRMBInChina.format(1314.25)); // ? ?,???.?? Collation The Collator object is useful for comparing and sorting strings. For example, there are actually two different sort orders i...
SyntaxError: JSON.parse: bad parsing - JavaScript
axError: JSON.parse: unterminated string literal SyntaxError: JSON.parse: bad control character in string literal SyntaxError: JSON.parse: bad character in string literal SyntaxError: JSON.parse: bad Unicode escape SyntaxError: JSON.parse: bad escape character SyntaxError: JSON.parse: unterminated string SyntaxError: JSON.parse: no number after minus sign SyntaxError: JSON.parse: unexpected non-digit SyntaxError: JSON.parse: missing digits after decimal point SyntaxError: JSON.parse: unterminated fractional number SyntaxError: JSON.parse: missing digits after exponent indicator SyntaxError: JSON.parse: missing digits after exponent sign SyntaxError: JSON.parse: exponent part is missing a number SyntaxError: JSON.parse: unexpected end of data SyntaxError: JSON.parse: unexpected keyword SyntaxE...
...y names must be double-quoted strings You cannot use single-quotes around properties, like 'foo'. JSON.parse("{'foo': 1}"); // SyntaxError: JSON.parse: expected property name or '}' // at line 1 column 2 of the JSON data Instead write "foo": JSON.parse('{"foo": 1}'); Leading zeros and decimal points You cannot use leading zeros, like 01, and decimal points must be followed by at least one digit. ...
...ike 01, and decimal points must be followed by at least one digit. ...
Array.prototype.reduceRight() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. See also Array.prototype.reduce() for left-to-right. ...
... See also Array.prototype.reduce() for left-to-right. ...
... Polyfill reduceRight was added to the ECMA-262 standard in the 5th edition; as such it may not be present in all implementations of the standard. You can work around this by inserting the following code at the beginning of your scripts, allowing use of reduceRight in implementations which do not natively support it. ...
Array.prototype.findIndex() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. See also the find() method, which returns the value of an array element, instead of its index. ...
... The findIndex() method returns the index of the first element in the array that satisfies the provided testing function. Otherwise, it returns -1, indicating that no element passed the test. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. See also the find() method, which returns the value of an array element, instead of its index. Syntax arr.findIndex(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. It takes three arguments: element The current ...
...dex() is set before the first invocation of callback. callback will not process the elements appended to the array after the call to findIndex() begins. If an existing, unvisited element of the array is changed by callback, its value passed to the callback will be the value at the time findIndex() visits the element's index. Elements that are deleted are still visited. Polyfill // https://tc39.github.io/ecma262/#sec-array.prototype.findindex if (!Array.prototype.findIndex) { Object.defineProperty(Array.prototype, 'findIndex', { value: function(predicate) { // 1. Let O be ? ToObject(this value). if (this == null) { throw new TypeError('"this" is null or not defined'); } var o = Object(this); // 2. Let len be ? ToLength(? Get(O, "length")). ...
Array.prototype.lastIndexOf() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax arr.lastIndexOf(searchElement[, fromIndex]) Parameters searchElement Element to locate in the array. ...
... The lastIndexOf() 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 fromIndex. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax arr.lastIndexOf(searchElement[, fromIndex]) Parameters searchElement Element to locate in the array. fromIndex Optional The index at which to start searching backwards. Defaults to the array's length minus one (arr.length - 1), i.e. the whole array will be searched. If the index is greater than or equal to the length of the array, the whole array will be searched. If nega...
...his by inserting the following code at the beginning of your scripts, allowing use of lastIndexOf in implementations which do not natively support it. This algorithm is exactly the one specified in ECMA-262, 5th edition, assuming Object, TypeError, Number, Math.floor, Math.abs, and Math.min have their original values. ...
Array.prototype.map() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. 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. ...
...e beginning of your scripts, allowing use of map in implementations which do not natively support it. This algorithm is exactly the one specified in ECMA-262, 5th edition, assuming Object, TypeError, and Array have their original values and that callback.call evaluates to the original value of Function.prototype.call. // Production steps of ECMA-262, Edition 5, 15.4.4.19 // Reference: http://es5.github.io/#x15.4.4.19 if (!Array.prototype.map) { Array.prototype.map = function(callback/*, thisArg*/) { var T, A, k; if (this == null) { throw new TypeError('this is null or not defined'); } // 1. Let O be the result of calling ToObject passing the |this| // value as the argument. var O = Object(this); // 2. Let lenValue be the result of calling the Get i...
...t O be the result of calling ToObject passing the |this| // value as the argument. var O = Object(this); // 2. Let lenValue be the result of calling the Get internal // method of O with the argument "length". // 3. Let len be ToUint32(lenValue). var len = O.length >>> 0; // 4. If IsCallable(callback) is false, throw a TypeError exception. // See: http://es5.github.com/#x9.11 if (typeof callback !== 'function') { throw new TypeError(callback + ' is not a function'); } // 5. If thisArg was supplied, let T be thisArg; else let T be undefined. if (arguments.length > 1) { T = arguments[1]; } // 6. Let A be a new array created as if by the expression new Array(len) // where Array is the standard built-in constructo...
Date.prototype.toString() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dateObj.toString() Return value A string representing the given date. Description Date instances inherit their toString() method from Date.prototype, not Object.prototype. ...
...epresenting the given date. Description Date instances inherit their toString() method from Date.prototype, not Object.prototype. Date.prototype.toString() returns a string representation of the Date in the format specified in ECMA-262 which can be summarised as: Week day: 3 letter English week day name, e.g. "Sat" space Month name: 3 letter English month name, e.g. "Sep" space Date: 2 digit day in month, e.g. "01" space Year: 4 digit year, e.g. "2018" space Hour: 2 digit hour of day, e.g. "14" colon Minute: 2 digit minute of hour, e.g. "53" colon Second: 2 digit second of minute, e.g. "26" space The string "GMT" Timezone offset sign, either: "+" for positive offsets (0 or greater) "-" for negative offsets (less than zero) Two digit hour offset, e.g. "14" T...
..."00" Optionally, a timezone name consisting of: space Left bracket, i.e. "(" An implementation dependent string representation of the timezone, which might be an abbreviation or full name (there is no standard for names or abbreviations of timezones), e.g. "Line Islands Time" or "LINT" Right bracket, i.e. ")" E.g. ...
Function.prototype.bind() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The bind() method creates a new function that, when called, has its this keyword set to the provided value, with a given sequence of arguments preceding any provided when the new function is called. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax let boundFunc = func.bind(thisArg[, arg1[, arg2[, ...argN]]]) Parameters thisArg The value to be passed as the this parameter to the target function func when the bound function is called. The value is ignored if the bound function is constructed using the new operator. When using bind to create a function (supplied as a callback) inside a setTimeout, any pri...
...tions from the specification rarely (if ever) come up in most coding situations. If you do not understand any of the deviations from the specification above, then it is safe in this particular case to not worry about these noncompliant deviation details. If it's absolutely necessary and performance is not a concern, a far slower (but more specification-compliant solution) can be found at https://github.com/Raynos/function-bind. Examples Creating a bound function The simplest use of bind() is to make a function that, no matter how it is called, is called with a particular this value. A common mistake for new JavaScript programmers is to extract a method from an object, then to later call that function and expect it to use the original object as its this (e.g., by using the method in callb...
Intl.DateTimeFormat.prototype.formatRange() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The Intl.DateTimeFormat.prototype.formatRange() formats a date range in the most concise way based on the locale and options provided when instantiating Intl.DateTimeFormat object. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Intl.DateTimeFormat.prototype.formatRange(startDate, endDate) Examples Basic formatRange usage This method receives two Dates and formats the date range in the most concise way based on the locale and options provided when instantiating Intl.DateTimeFormat. let date1 = new Date(Date.UTC(2007, 0, 10, 10, 0, 0)); let date2 = new Date(Date.UTC(2007, 0, 10, 11, 0, 0)); let date3 = n...
...le and options provided when instantiating Intl.DateTimeFormat. ...
Intl.DateTimeFormat.prototype.formatToParts() - JavaScript
d for the fractional seconds, for example "0" or "00" or "000". hour The string used for the hour, for example "3" or "03". literal The string used for separating date and time values, for example "/", ",", "o'clock", "de", etc. minute The string used for the minute, for example "00". month The string used for the month, for example "12". relatedYear The string used for the related 4-digit Gregorian year, in the event that the calendar's representation would be a yearName instead of a year, for example "2019". second The string used for the second, for example "07" or "42". timeZoneName The string used for the name of the time zone, for example "UTC". weekday The string used for the weekday, for example "M", "Monday", or "Montag". year The string used for the year, for exam...
...ature is available in the proposal repository. Examples DateTimeFormat outputs localized, opaque strings that cannot be manipulated directly: var date = Date.UTC(2012, 11, 17, 3, 0, 42); var formatter = new Intl.DateTimeFormat('en-us', { weekday: 'long', year: 'numeric', month: 'numeric', day: 'numeric', hour: 'numeric', minute: 'numeric', second: 'numeric', fractionalSecondDigits: 3, hour12: true, timeZone: 'UTC' }); formatter.format(date); // "Monday, 12/17/2012, 3:00:42.000 AM" However, in many User Interfaces there is a desire to customize the formatting of this string. The formatToParts method enables locale-aware formatting of strings produced by DateTimeFormat formatters by providing you the string in parts: formatter.formatToParts(date); // return value: ...
...d Mixed calendars In some cases, calendars use named years. Chinese and Tibetan calendars, for example, use a 60-year sexagenary cycle of named years. These years are disambiguated by relationship to corresponding years on the Gregorian calendar. When this is the case, the result of formatToParts() will contain an entry for relatedYear when a year would normally be present, containing the 4-digit Gregorian year, instead of an entry for year. Setting an entry in the bag for year (with any value) will yield both the and the yearName Gregorian relatedYear: let opts = { year: "numeric", month: "numeric", day: "numeric" }; let df = new Intl.DateTimeFormat("zh-u-ca-chinese", opts); df.formatToParts(Date.UTC(2012, 11, 17, 3, 0, 42)); // return value [ { type: 'relatedYear', value: '2012'...
Intl.DateTimeFormat - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Constructor Intl.DateTimeFormat() Creates a new DateTimeFormat object. Static methods Intl.DateTimeFormat.supportedLocalesOf() Returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale. ...
...y-year order console.log(new Intl.DateTimeFormat('en-US').format(date)); // -> "12/19/2012" // British English uses day-month-year order console.log(new Intl.DateTimeFormat('en-GB').format(date)); // -> "19/12/2012" // Korean uses year-month-day order console.log(new Intl.DateTimeFormat('ko-KR').format(date)); // -> "2012. 12. ...
...S', options).format(date)); // -> "Thursday, December 20, 2012, GMT" // sometimes you want to be more precise options = { hour: 'numeric', minute: 'numeric', second: 'numeric', timeZone: 'Australia/Sydney', timeZoneName: 'short' }; console.log(new Intl.DateTimeFormat('en-AU', options).format(date)); // -> "2:00:00 pm AEDT" // sometimes you want to be very precise options.fractionalSecondDigits = 3; console.log(new Intl.DateTimeFormat('en-AU', options).format(date)); // -> "2:00:00.200 pm AEDT" // sometimes even the US needs 24-hour time options = { year: 'numeric', month: 'numeric', day: 'numeric', hour: 'numeric', minute: 'numeric', second: 'numeric', hour12: false, timeZone: 'America/Los_Angeles' }; console.log(new Intl.DateTimeFormat('en-US', options).format(date)); // ->...
Intl.NumberFormat - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Constructor Intl.NumberFormat() Creates a new NumberFormat object. Static methods Intl.NumberFormat.supportedLocalesOf() Returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale. ...
...Chinese decimal console.log(new Intl.NumberFormat('zh-Hans-CN-u-nu-hanidec').format(number)); // -> ???,???.??? // when requesting a la...
... using the options argument: var number = 123456.789; // request a currency format console.log(new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(number)); // -> 123.456,79 EUR // the Japanese yen doesn't use a minor unit console.log(new Intl.NumberFormat('ja-JP', { style: 'currency', currency: 'JPY' }).format(number)); // -> ?123,457 // limit to three significant digits console.log(new Intl.NumberFormat('en-IN', { maximumSignificantDigits: 3 }).format(number)); // -> 1,23,000 Using style and unit console.log(new Intl.NumberFormat("pt-PT", { style: 'unit', unit: "mile-per-hour" }).format(50)); // -> 50 mi/h console.log((16).toLocaleString('en-GB', { style: "unit", unit: "liter", unitDisplay: "long" })); // -> 16 litres Specifications ...
Intl.PluralRules.prototype.resolvedOptions() - JavaScript
g that led to this locale, the key-value pairs that were requested and are supported for this locale are included in locale. pluralCategories An Array of plural categories used by the given locale, seleced from the list "zero", "one", "two", "few", "many" and "other". type The type used (cardinal or ordinal). ...
...le, the key-value pairs that were requested and are supported for this locale are included in locale. pluralCategories An Array of plural categories used by the given locale, seleced from the list "zero", "one", "two", "few", "many" and "other". type The type used (cardinal or ordinal). Only one of the following two groups of properties is included: minimumIntegerDigits minimumFractionDigits maximumFractionDigits The values provided for these properties in the options argument or filled in as defaults. These properties are present only if neither minimumSignificantDigits nor maximumSignificantDigits was provided in the options argument. minimumSignificantDigits maximumSignificantDigits The values provided for these properties in the options argument or filled in as defaults. Th...
...antDigits The values provided for these properties in the options argument or filled in as defaults. These properties are present only if at least one of them was provided in the options argument. Examples Using the resolvedOptions method var de = new Intl.PluralRules('de-DE'); var usedOptions = de.resolvedOptions(); usedOptions.locale; // "de-DE" usedOptions.maximumFractionDigits; // 3 usedOptions.minimumFractionDigits; // 0 usedOptions.minimumIntegerDigits; // 1 usedOptions.pluralCategories; // Array [ "one", "other" ] usedOptions.type; // "cardinal" Specifications Specification ECMAScript Internationalization API (ECMA-402)The definition of 'Intl.PluralRules.prototype.resolvedOptions' in that specification. ...
Intl - JavaScript
ges, scripts, regions (including countries), and (rarely used) variants in Unicode BCP 47 locale identifiers are registered in the IANA Language Subtag Registry. This registry is periodically updated over time, and implementations may not always be up to date, so be careful not to rely too much on tags being universally supported. BCP 47 also allows for extensions, each consisting of a single digit or letter (other than "x") and one or more two- to eight-letter or digit tags, all separated by hyphens. JavaScript internationalization functions use the "u" (Unicode) extension, which can be used to request additional customization of Collator, NumberFormat, or DateTimeFormat objects. Examples: "de-DE-u-co-phonebk": Use the phonebook variant of the German sort order, which interprets umlaute...
...ens. JavaScript internationalization functions use the "u" (Unicode) extension, which can be used to request additional customization of Collator, NumberFormat, or DateTimeFormat objects. Examples: "de-DE-u-co-phonebk": Use the phonebook variant of the German sort order, which interprets umlauted vowels as corresponding character pairs: a -> ae, o -> oe, u -> ue. "th-TH-u-nu-thai": Use Thai digits (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) in number formatting. "ja-JP-u-ca-japanese": Use the Japanese calendar in date and time formatting, so that 2013 is expressed as the year 25 of the Heisei period, or ??25. "en-GB-u-ca-islamic": use British English with the Islamic (Hijri) calendar, where the Gregorian date 14 October, 2017 is the Hijri date 24 Muharram, 1439. Other BCP 47 extension tags can be ...
... that 2013 is expressed as the year 25 of the Heisei period, or ??25. "en-GB-u-ca-islamic": use British English with the Islamic (Hijri) calendar, where the Gregorian date 14 October, 2017 is the Hijri date 24 Muharram, 1439. Other BCP 47 extension tags can be found in the Unicode CLDR Project. Finally, an extension using the letter "x" may appear, followed by one or one- to eight-letter or digit tags. This extension allows applications to encode information for their own private use, that will be ignored by all Intl operations. Locale negotiation The list of locales specified by the locales argument, after Unicode extensions have been removed from them, is interpreted as a prioritized request from the application. The runtime compares it against the locales it has available and picks ...
JSON.parse() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The JSON.parse() method parses a JSON string, constructing the JavaScript value or object described by the string. An optional reviver function can be provided to perform a transformation on the resulting object before it is returned. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax JSON.parse(text[, reviver]) Parameters text The string to parse as JSON. See the JSON object for a description of JSON syntax. reviver Optional If a function, this prescribes how the value originally produced by parsing is transformed, before being returned. Return value The Object, Array, string, number, boolean, or nu...
...object for a description of JSON syntax. reviver Optional If a function, this prescribes how the value originally produced by parsing is transformed, before being returned. Return value The Object, Array, string, number, boolean, or null value corresponding to the given JSON text. Exceptions Throws a SyntaxError exception if the string to parse is not valid JSON. ...
Number.prototype.toLocaleString() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax numObj.toLocaleString([locales [, options]]) Parameters The locales and options arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. ...
...Chinese decimal console.log(number.toLocaleString('zh-Hans-CN-u-nu-hanidec')); // -> ???,???.??? // when requesting a language that may not be supported, such as // ...
...oLocaleString can be customized using the options argument: var number = 123456.789; // request a currency format console.log(number.toLocaleString('de-DE', { style: 'currency', currency: 'EUR' })); // -> 123.456,79 EUR // the Japanese yen doesn't use a minor unit console.log(number.toLocaleString('ja-JP', { style: 'currency', currency: 'JPY' })) // -> ?123,457 // limit to three significant digits console.log(number.toLocaleString('en-IN', { maximumSignificantDigits: 3 })); // -> 1,23,000 // Use the host default language with options for number formatting var num = 30000.65; console.log(num.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2})); // -> "30,000.65" where English is the default language, or // -> "30.000,65" where German is the default language, or...
Number.prototype.toPrecision() - JavaScript
See the discussion of rounding in the description of the Number.prototype.toFixed() method, which also applies to toPrecision(). ...
...See the discussion of rounding in the description of the Number.prototype.toFixed() method, which also applies to toPrecision(). ...
...the precision argument is omitted, behaves as Number.prototype.toString(). If the precision argument is a non-integer value, it is rounded to the nearest integer. Exceptions RangeError If precision is not between 1 and 100 (inclusive), a RangeError is thrown. Implementations are allowed to support larger and smaller values as well. ECMA-262 only requires a precision of up to 21 significant digits. Examples Using toPrecision let numObj = 5.123456 console.log(numObj.toPrecision()) // logs '5.123456' console.log(numObj.toPrecision(5)) // logs '5.1235' console.log(numObj.toPrecision(2)) // logs '5.1' console.log(numObj.toPrecision(1)) // logs '5' numObj = 0.000123 console.log(numObj.toPrecision()) // logs '0.000123' console.log(numObj.toPrecision(5)) // logs '0.00012300'...
String.prototype.split() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...ides a String into an ordered list of substrings, puts these substrings into an array, and returns the array. The division is done by searching for a pattern; where the pattern is provided as the first parameter in the method's call. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax str.split([separator[, limit]]) Parameters separator Optional The pattern describing where each split should occur. The separator can be a simple string or it can be a regular expression. The simplest case is when separator is just a single character; this is used to split a delimited string. For example, a string ...
...he separator in the result If separator is a regular expression that contains capturing parentheses (), matched results are included in the array. const myString = 'Hello 1 word. Sentence number 2.' const splits = myString.split(/(\d)/) console.log(splits) This script displays the following: [ "Hello ", "1", " word. Sentence number ", "2", "." ] Note: \d matches the character class for digits between 0 and 9. Reversing a String using split() This is not a robust way to reverse a string: const str = 'asdfghjkl' const strReverse = str.split('').reverse().join('') // 'lkjhgfdsa' // split() returns an array on which reverse() and join() can be applied It doesn't work if the string contains grapheme clusters, even when using a unicode-aware split. (Use, for example, esrever instea...
String.prototype.startsWith() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax str.startsWith(searchString[, position]) Parameters searchString The characters to be searched for at the start of this string. ...
... The startsWith() method determines whether a string begins with the characters of a specified string, returning true or false as appropriate. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax str.startsWith(searchString[, position]) Parameters searchString The characters to be searched for at the start of this string. position Optional The position in this string at which to begin searching for searchString. Defaults to 0. Return value true if the given characters are found at the beginning of the string; otherwise, false. Description This method lets you determine whether or not a string begins w...
... Examples Using startsWith() //startswith let str = 'To be, or not to be, that is the question.' console.log(str.startsWith('To be')) // true console.log(str.startsWith('not to be')) // false console.log(str.startsWith('not to be', 10)) // true Specifications Specification ECMAScript (ECMA-262)The definition of 'String.prototype.s...
String - JavaScript
s a primitive string instead, although generally, authors need not worry about the distinction. A String object can always be converted to its primitive counterpart with the valueOf() method. ...
...\XXX (where XXX is 1-3 octal digits; range of 0-377) ISO-8859-1 character / Unicode code point between U+0000 and U+00FF \' single quote \" double quote \\ backslash \n new line \r carriage return \v vertical tab \t tab \b backspace \f form feed \uXXXX (where XXXX is 4 hex digits; range of 0x0000-0xFFFF) UTF-16 code unit / Unicode code point between U+0000 and U+FFFF \u{X} ... ...
... \" double quote \\ backslash \n new line \r carriage return \v vertical tab \t tab \b backspace \f form feed \uXXXX (where XXXX is 4 hex digits; range of 0x0000-0xFFFF) UTF-16 code unit / Unicode code point between U+0000 and U+FFFF \u{X} ... \u{XXXXXX} (where X...XXXXXX is 1-6 hex digits; range of 0x0-0x10FFFF) UTF-32 code unit / Unicode code point between U+0000 and U+10FFFF \xXX (where XX is 2 hex digits; range of 0x00-0xFF) ISO-8859-1 character / Unicode code point between U+0000 and U+00FF Long literal strings Sometimes, your code will include strings which are very long. Rather than having lines that go on endlessly, or wrap at the whim of your ed...
TypedArray.prototype.fill() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The fill() method fills all the elements of a typed array from a start index to an end index with a static value. This method has the same algorithm as Array.prototype.fill(). TypedArray is one of the typed array types here. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax typedarray.fill(value[, start = 0[, end = this.length]]) Parameters value Value to fill the typed array with. start Optional. Start index. Defaults to 0. end Optional. End index (not included). Defaults to this.length. Return value The modified array. Description The elements interval to fill is [start, end). The fill method...
...es of 0 and the length of the this object. If start is negative, it is treated as length+start where length is the length of the array. If end is negative, it is treated as length+end. Polyfill Since there is no global object with the name TypedArray, polyfilling must be done on an "as needed" basis. Use the following "polyfill" along with the Array.prototype.fill() polyfill. ...
TypedArray.prototype.join() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax typedarray.join([separator = ',']); Parameters separator Optional. Specifies a string to separate each element. ...
... The join() method joins all elements of an array into a string. This method has the same algorithm as Array.prototype.join(). TypedArray is one of the typed array types here. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax typedarray.join([separator = ',']); Parameters separator Optional. Specifies a string to separate each element. The separator is converted to a string if necessary. If omitted, the typed array elements are separated with a comma (","). Return value A string with all array elements joined. Polyfill Since there is no global object with the name TypedArray, polyfilling must be don...
... Parameters separator Optional. Specifies a string to separate each element. The separator is converted to a string if necessary. If omitted, the typed array elements are separated with a comma (","). Return value A string with all array elements joined. Polyfill Since there is no global object with the name TypedArray, polyfilling must be done on an "as needed" basis. // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.join if (!Uint8Array.prototype.join) { Object.defineProperty(Uint8Array.prototype, 'join', { value: Array.prototype.join }); } If you need to support truly obsolete JavaScript engines that don't support Object.defineProperty, it's best not to polyfill Array.prototype methods at all, as you can't make them non-enumerable. Examples Using join ...
TypedArray.prototype.some() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The some() method tests whether some element in the typed array passes the test implemented by the provided function. This method has the same algorithm as Array.prototype.some(). TypedArray is one of the typed array types here. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax typedarray.some(callback[, thisArg]) Parameters callback Function to test for each element, taking three arguments: currentValue The current element being processed in the typed array. index The index of the current element being processed in the typed array. array The typed array some was called upon. thisArg ...
...e, the value undefined will be passed for use as its this value. The this value ultimately observable by callback is determined according to the usual rules for determining the this seen by a function. some does not mutate the typed array on which it is called. Polyfill Since there is no global object with the name TypedArray, polyfilling must be done on an "as needed" basis. // https://tc39.github.io/ecma262/#sec-%typedarray%.prototype.some if (!Uint8Array.prototype.some) { Object.defineProperty(Uint8Array.prototype, 'some', { value: Array.prototype.some }); } If you need to support truly obsolete JavaScript engines that don't support Object.defineProperty, it's best not to polyfill Array.prototype methods at all, as you can't make them non-enumerable. Examples Testing size...
parseInt() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax parseInt(string [, radix]) Parameters string The value to parse. If this argument is not a string, then it is converted to one using the ToString abstract operation. Leading whitespace in this argument is ignored. ...
... Octal interpretations with no radix Although discouraged by ECMAScript 3 and forbidden by ECMAScript 5, many implementations interpret a numeric string beginning with a leading 0 as octal. The following may have an octal result, or it may have a decimal result. Always specify a radix to avoid this unreliable behavior. parseInt('0e0') // 0 parseInt('08') // 0, because '8' is not an octal digit. The ECMAScript 5 specification of the function parseInt no longer allows implementations to treat Strings beginning with a 0 character as octal values. ECMAScript 5 states: The parseInt function produces an integer value dictated by interpretation of the contents of the string argument according to the specified radix. Leading whitespace in string is ignored. If radix is undefined or 0, it ...
... parseInt(4.7, 10) parseInt(4.7 * 1e22, 10) // Very large number becomes 4 parseI...
Using the WebAssembly JavaScript API - WebAssembly
ed to know. Note: If you are unfamiliar with the basic concepts mentioned in this article and need more explanation, read WebAssembly concepts first, then come back. Some simple examples Let's run through some examples that explain how to use the WebAssembly JavaScript API, and how to use it to load a wasm module in a web page. Note: You can find the sample code in our webassembly-examples GitHub repo. Preparing the example First we need a wasm module! Grab our simple.wasm file and save a copy in a new directory on your local machine. 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). Now, to help us understand what is going on here, let's look at the text represen...
...m underlying sources. This is achieved using the WebAssembly.compileStreaming() and WebAssembly.instantiateStreaming() methods. These methods are easier than their non-streaming counterparts, because they can turn the byte code directly into Module/Instance instances, cutting out the need to separately put the Response into an ArrayBuffer. This example (see our instantiate-streaming.html demo on GitHub, and view it live also) shows how to use instantiateStreaming() to fetch a wasm module, import a JavaScript function into it, compile and instantiate it, and access its exported function -- all in one step. Add the following to your script, below the first block: WebAssembly.instantiateStreaming(fetch('simple.wasm'), importObject) .then(obj => obj.instance.exports.exported_func()); The net ...
... Multiplicity Now we've demonstrated usage of the main key WebAssembly building blocks, this is a good place to mention the concept of multiplicity. This provides WebAssembly with a multitude of advances in terms of architectural efficiency: One module can have N Instances, in the same way that one function literal can produce N closure values. One module insta...
Module structure of the SDK - Archive of obsolete content
el modules it is sdk/<path_to_module>/<module_name>: // load the high-level "tabs" module var tabs = require("sdk/tabs"); // load the low-level "uuid" module var uuid = require('sdk/util/uuid'); The path to specify for a low-level module is given along with the module name itself in the title of the module's documentation page (for example, system/environment). Although the SDK repository in GitHub includes copies of these modules, they are built into Firefox and by default, when you run or build an add-on using jpm run or jpm xpi, it is the versions of the modules in Firefox that are used. If you need to use a different version of the modules, you can do this by checking out the version of the SDK that you need and passing the -o or --overload option to jpm run or jpm xpi. Local Module...
... To import modules into password-store: // password-store.js code var dialog = require("../password-dialog"); var hash = require("../secrets/hash"); External Modules As well as using the SDK's modules and writing your own, you can use modules that have been developed outside the SDK and made available to other add-on authors. There's a list of these "community-developed modules" in the SDK's GitHub Wiki, and to learn how to use them, see the tutorial on using external modules to add menu items to Firefox. To import external modules, treat them like local modules: copy them somewhere under your add-ons "lib" directory and reference them with a path relative to the importing module. For example, this add-on places external modules in a "dependencies" directory: my-addon lib ...
context-menu - Archive of obsolete content
'});', items: [googleItem, wikipediaItem] }); To create sub-menus, one of the items in your main menu must be defined as a menu. ...
...a: "http://www.google.com/search?q=" }); var wikipediaItem = cm.Item({ label: "Wikipedia", data: "http://en.wikipedia.org/wiki/Special:Search?search=" }); var bingItem = cm.Item({ label: "Bing", data: "http://www.bing.com/search?q=" }); var yahooItem = cm.Item({ label: "Yahoo", data: "https://search.yahoo.com/search?p=" }); var moreMenu = cm.Menu({ label: "More Search", items: [bingItem, yahooItem] }); var searchMenu = cm.Menu({ label: "Search With", context: cm.SelectorContext("a[href]"), contentScript: 'self.on("click", function (node, data) {' + ' var searchURL = data + node.textContent;' + ' window.location.href = searchURL;' + '});', items: [googleItem, wikipediaItem, moreMenu] }); If you need a tooltip: Fir...
ui/button/action - Archive of obsolete content
disabled boolean Determines whether the button is disabled. Disabled buttons appear disabled in the UI, and do not respond to clicks. Defaults to false. onClick function Click handler for the button. badge Number or String New in Firefox 36. Badge to attach to the button. The badge can contain as many characters (or digits) as you like, but only the first four will be displayed. badgeColor CSS <color> value New in Firefox 36. Color for the badge. If badgeColor is omitted and badge is specified, then the badge is red. ActionButton Methods click() Click the button. This will cause the button to generate the click event: var { ActionButton } = require('sdk/ui/butt...
...utton's unique ID. This is read-only. label The button's label. icon The button's icon or icons, as a URL, relative path, or object containing a set of key-value pairs. disabled Boolean property indicating whether or not the button is disabled. badge New in Firefox 36. Value to attach to the button as a badge. May be a number or a string. The badge can contain as many characters (or digits) as you like, but only the first four will be displayed. badgeColor New in Firefox 36. Color for the badge, specified as a CSS <color> value. Events click This event is emitted when a user clicks the button or your add-on calls the button's click() method. Arguments state : The button's state. This contains all the button's properties. ...
ui/button/toggle - Archive of obsolete content
isabled buttons appear disabled in the UI, and do not respond to clicks. Defaults to false. onChange function Change handler for the button. onClick function Click handler for the button. badge Number or String New in Firefox 36. Badge to attach to the button. The badge can contain as many characters (or digits) as you like, but only the first four will be displayed. badgeColor CSS <color> value New in Firefox 36. Color for the badge. If badgeColor is omitted and badge is specified, then the badge is red. ToggleButton Methods click() Click the button. This will cause the button to generate the click event: var { ToggleButton } = require('sdk/ui/butt...
...her or not the button is checked. It's initialized to false, or the value of the checked option to the button's constructor. It is then flipped, on a per-window basis, whenever the user clicks the button or when the button's click() method is called. badge New in Firefox 36. Value to attach to the button as a badge. May be a number or a string. The badge can contain as many characters (or digits) as you like, but only the first four will be displayed. badgeColor New in Firefox 36. Color for the badge, specified as a CSS <color> value. Events click This event is emitted when a user clicks the button or your add-on calls the button's click() method. Arguments state : The button's state. This includes all the button's properties. change This event is emitted when a user clicks ...
package.json - Archive of obsolete content
le is simple format. You can describe Keys in any order. But sometimes it should be better reorder it for improve readability. ...
...order it for improve readability. ...
Forms related code snippets - Archive of obsolete content
...
...et a preview of an image before uploading it.[article] This example shows how to use it in this way. Note: The FileReader() constructor was not supported by Internet Explorer for versions before 10. For a full compatibility code you can see our crossbrowser possible solution for image preview. Filter the digitation into a form field This example shows the use of the onkeypress event during a digitation into a form field in order to match some rules. ...
StringView - Archive of obsolete content
|*| http://www.gnu.org/licenses/lgpl-3.0.html |*| \*/ function StringView (vInput, sEncoding /* optional (default: UTF-8) */, nOffset /* optional */, nLength /* optional */) { var fTAView, aWhole, aRaw, fPutOutptCode, fGetOutptChrSize, nInptLen, nStartIdx = isFi...
... Manual Methods overview Constructor stringView new StringView(stringView input, optional DOMString encoding, optional unsigned long startOffset, optional unsigned long length); stringView new StringView(DOMString input, optional DOMString encoding, optional unsigned long startOffset, optional unsigned long length); stringView new StringView(unsigned long input); ...
Install Manifests - Archive of obsolete content
an be opened in a new tab since Firefox 7.0a1. To do so, set optionsType to 3 and set optionsURL to a the path of a page to open. <em:optionsType>3</em:optionsType> <em:optionsURL>chrome://myaddon/content/options.html</em:optionsURL> This section here contains an example of localized HTML page as an option panel in a new tab: Bootstrapped Extensions :: Localization (L10n) (example linked to is: GitHub :: l10n-html-options). optionsURL The chrome:// URL of the extension's options dialog box. This is only useful to extensions. If this property is specified, when the extension is selected in the Extensions list, the Options button is enabled and will show this. <em:optionsURL>chrome://myext/content/options.xul</em:optionsURL> Gecko 7 note In Firefox 7 you can also simply include your opt...
...then it must request unpacking: Binary XPCOM components Plugins Search plugins DLLs loaded with ctypes Dictionaries Window icons Examples <Description about="urn:mozilla:install-manifest"> <em:id>extension@mysite.com</em:id> <em:unpack>true</em:unpack> ... </Description> updateKey To ensure the security of update rdf data that is retrieved over plain HTTP you must use a digital signature to verify the contents of the data. In order to do so you must include the public part of the cryptographic key in an updateKey entry in the install.rdf of the add-on. This can be generated using the McCoy tool. Any line breaks and whitespace as part of this entry are ignored. <em:updateKey>MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDK426erD/H3XtsjvaB5+PJqbhj Zc9EDI5OCJS8R3F...
Security best practices in extensions - Archive of obsolete content
cious code. The main way to do this is by creating an iframe or browser element in the sidebar, and loading your content there. Give the element a type="content" attribute, which essentially sandboxes the code there and blocks callback rights into chrome. Using eval() in an extension Using the built-in JavaScript eval function is frowned upon in the context of extensions. While there are some legitimate use-cases, most of the time there are safer alternatives. This blog post offers some excellent reasons not to use eval(). Sandboxed HTTP connections The main purpose of sandboxed HTTP connections is to interact with a web service, without interfering with the cookies set in the browser by that service/site. For example, if you are loading pictures or other data from a photo sharing site, y...
...ome urls in chrome XUL or HTML such as the following example are not allowed: <script type="text/javascript" src="http://mysite.greatsite.com/js/wow-content.js" /> In general, scripts that are from remote sources that run in the chrome context are not acceptable, as many times the source of the script can never be 100% guaranteed, and they are vulnerable to man-in-the-middle attacks. The only legitimate environment for remote scripts is to run in a sandbox. For more information, refer to the evalInSandbox() section. evalInSandbox The evalInSandbox document explains very well how it works, so there will be no repetition here. The usefulness of it and power of how it works is best illustrated by the popular Greasemonkey extension, which works on the premise of scripts being downloaded and s...
List of Mozilla-Based Applications - Archive of obsolete content
eXe eLearning XHTML editor Seems to be using XUL for some of their webui Facebook Open Platform Facebook Open Platform The FBML parser used in the platform is based on Mozilla code Fennec Browser for mobiles As Mark notes: Fennec is not Firefox, it's a completely different application FindThatFont! ...
...Based on XUL Liaison Groupware client for Novell's email and collaboration server Previously called MozNGW Linbox Kiosk Browser (fr) web browser Dedicated browser for french prefecture and town hall litl Internet computer for home Uses SpiderMonkey and Gecko LiziLayers GIS application 3Liz also creates some GIS Firefox add-ons Logitech Harmony Remote Software software for remote control device Uses GRE or XULrunner Longman Dictionary of Contemporary English CD-ROM Lotus Notes / Sametime groupware The latest version of IBM Lotus Notes and Sametime can embed XUL applications Lucidor e-book reader Lx-Office accounting tool Looks like it makes at least some use ...
generateCRMFRequest() - Archive of obsolete content
d key will support. Acceptable values are (the mentioned values for keyUsage pertain to the keyUsage value of the Certificate Extension that will ultimately be in the issued certificate): "rsa-ex" - generate an RSA key for key exchange only (This will have eyEncipherment set for keyUsage.) "rsa-dual-use" - generate a single RSA key for both signing and encryption. (This will have digitalSignature, keyEncipherment, and nonRepudiation set for keyUsage.) "rsa-sign" - generate an RSA key for signing only. (This will have digitalSignature set for keyUsage.) "rsa-nonrepudiation" - generate a single RSA key for nonRepudiation only. (This will have non-repudiation set for keyUsage.) "rsa-sign-nonrepudiation" - generate a single RSA key use for both signing and nonRepudia...
... and nonRepudiation set for keyUsage.) "rsa-sign" - generate an RSA key for signing only. (This will have digitalSignature set for keyUsage.) "rsa-nonrepudiation" - generate a single RSA key for nonRepudiation only. (This will have non-repudiation set for keyUsage.) "rsa-sign-nonrepudiation" - generate a single RSA key use for both signing and nonRepudiation. (This will have both digitalSignature and nonRepudiation set for keyUsage.) "dsa-sign" - generate a single DSA key for signing only. (This will have digitalSignature set for keyUsage.) "dsa-nonrepudiation" - generate a single DSA key for nonRepudiation. (This will have nonRepudiation set for keyUsage.) "dsa-sign-nonrepudiation" - generate a single DSA key for signing and non-repudiation. (This will have digi...
Mozilla Crypto FAQ - Archive of obsolete content
d for Mozilla SSL support, including the RSA public key algorithm (now in the public domain). NSS 3.1 will be available in beta form in September 2000, with the final release to follow in October 2000. NSS 3.1 will be used in the 1.3 release of PSM, which will provide a complete open source implementation of SSL for Mozilla. PSM 1.3 will also provide support for Mozilla users to obtain personal digital certificates and perform other PKI-related functions. Note that due to various implementation issues, PSM support for Mozilla on the Macintosh is lagging somewhat behind PSM support on Windows, Linux, and other platforms. Also note that the NSS developers are creating code for support of S/MIME secure messages; however full S/MIME support within Mozilla will require further development, and ma...
...s on the Battle for Privacy in the Age of Surveillance, by Bruce Schneier and David Banisar (ed.). A collection of public documents relating to U.S. encryption policy and related topics. Building in Big Brother: The Cryptographic Policy Debate, by Lance Hoffman (ed.). An earlier (circa 1995) collection of essays and public documents, with a concentration on the Clipper chip controversy and the Digital Telephony Act. Cryptography & Liberty 2000: An International Survey of Encryption Policy, by the Electronic Privacy Information Center. The latest in a series of annual surveys of government policies relating to encryption, covering over a hundred countries. The Limits of Trust: Cryptography, Governments, and Electronic Commerce, by Stewart Baker and Paul Hurst. An in-depth (but badly outdate...
Creating toolbar buttons (Customize Toolbar Window) - Archive of obsolete content
It is based on the code from the repo above. Here are some discussions at Mozillazine about adding a toolbar button in a Bootstrap addon: Programmatically add a button to toolbar palette? The advantage to add...
...It is based on the code from the repo above. ...
Threats - Archive of obsolete content
credit-card payments but never sends any goods. Malware. Website malware is a growing problem. Business needs have changed the way websites store sensistive data, with more usage of cloud services. But hackers may make out money, data and confidential information from your website by infecting website with malware. For example, Site can be infected with a malware redirect hack in which a legitimate redirects to spam site or a phishing page. This kind of malware is widespread on wordpress websites. For more detailed look on this you can refer to this detailed post on wordpress malware redirect. Phishing. Phishing is a method of a social engineering with the goal of obtaining sensitive data such as passwords, usernames, credit card numbers. The attacks often comes in form of instant me...
.... This kind of malware is widespread on wordpress websites. For more detailed look on this you can refer to this detailed post on wordpress malware redirect. Phishing. Phishing is a method of a social engineering with the goal of obtaining sensitive data such as passwords, usernames, credit card numbers. The attacks often comes in form of instant messages or phishing emails which appear to be legitimate but they are used to obtain personal information. For example, a mail which appears to be to be sent from a bank, asking to verify your identity by giving away your private information. DDOS Network attack. The volume and strength of DDoS attacks are growing as hackers try to bring organizations offline or steal their data by flooding websites and networks with spurious traffic. Origina...
Security - Archive of obsolete content
But encryption and decryption, by themselves, do not address another problem: tampering.Encryption and DecryptionEncryption is the process of transforming information so it is unintelligible to anyone but the intended recipient. ...
... related standards and techniques underlie the security features of many products such as signed and encrypted email, single sign-on, and Secure Sockets Layer (SSL) communications. This document introduces the basic concepts of public-key cryptography. For an overview of SSL, see "Introduction to SSL." For an overview of encryption and decryption, see "Encryption and Decryption." Information on digital signatures is available from "Digital Signatures." Introduction to SSLThis document introduces the Secure Sockets Layer (SSL) protocol. SSL has been universally accepted on the World Wide Web for authenticated and encrypted communication between clients and servers.NSPR Release Engineering GuideThis paper is for engineers performing formal release for the NetScape Portable Runtime (NSPR) ac...
Browser Detection and Cross Browser Support - Archive of obsolete content
to those areas where it is still required. Limit the use of User Agent String based Detection Server side browser detection requires the use of user agent strings. We recommend that the use of user agent string based detection be limited to server side situations and except in those circumstances where it is absolutely required such as when details of the Gecko branch are required. There are legitimate reasons to use the user agent string (or the navigator object) to determine exactly what vendor, version or operating system is being used. Many financial sites (banks, online stock trading firms, etc) have very strict policies with respect to what browsers they support. This is due to the history of security exploits that have been discovered in older browsers. If you have the need to only ...
...4 Netscape 6.2.2 0.9.4.1 Netscape 6.2.3 0.9.4.1 CompuServe 7 0.9.4.2 Netscape 7.0 1.0.1 Netscape 7.01 1.0.2 As you can see, all versions of Netscape 6.2 and CompuServe 7 were created from the 0.9.4 branch. The distinction between 0.9.4, 0.9.4.1, 0.9.4.2 is minor. Note: The branch tag is a string and can contain more than single digits in any particular level. For example, it is conceivable that someday there will exist branch tags similar to 2.2.0 and 2.12.36. Since these values are strings, it is not possible to use relative string comparisons to determine which branch tag came later. In our example, branch 2.2.0 was created before 2.12.36 however comparing these values as strings shows '2.2.0' > '2.12.36'. The JavaScript fu...
Implementation Status - Archive of obsolete content
XPath Expressions in XForms Section Title Status Notes Bugs 7.1 XPath Datatypes supported 7.2 Evaluation Context partial 7.3 References, Dependencies, and Dynamic Dependencies partial we probably a...
... supported 6.1.6 constraint supported 6.1.7 p3ptype unsupported 279049; 6.2.1 Atomic Datatype partial We will support simpleType's using length, minlength, maxlength, pattern, maxinclusive, mininclusive, maxexclusive, minexclusive, totaldigits, and fractiondigits 7. XPath Expressions in XForms Section Title Status Notes Bugs 7.1 XPath Datatypes supported 7.2 Evaluation Context partial 7.3 References, Dependencies, and Dynamic Dependencies partial we probably already do most of it...
The Business Benefits of Web Standards - Archive of obsolete content
ications on how to parse the standard formats are well documented and here to stay. Contrary to popular belief, coding to standards does not mean producing less compelling content. As a matter of fact, almost anything taking advantage of proprietary extensions can be done in a standards-compliant way, with the added benefit of being cross-platform and future-proof. By ensuring that all of the digital content owned by the operator is marked up in a consistent and standards compliant way, the content base becomes a perennially reusable asset without any additional costs in the future. Extensibility Using strict HTML and separating structure from content paves the way to XHTML, an XML-compatible version of HTML. Using XHTML will enable web authors to leverage tools from the XML world, such a...
...t and the ongoing publishing of emerging content can be measured and controlled. This is a very powerful management tool. This is the power of Web Standards. It supplies a far better development framework, for content providers, for web developers, and for CSS stylists alike. It is simply not possible for everybody not to gain and share in the huge benefits of Standards. Customers, developers, digital media creators, can be freed from the tyranny of graphics led development, code generators, and incomprehensible markup. But the real value is at the bottom line. The message to accountants, executives and shareholders alike should be irresistible. Benefits of CSS over JavaScript Specifically, graphics and JavaScript are often used for special effects on text fragments. As Style Sheet techn...
Game distribution - Game development
e. Another good measure to take is to provide an online demo if you're planning on packaging it and selling it in a closed store like iTunes or Steam. If you're working on a side project just for fun, then leaving the source open will benefit those who would like to learn from what you've created. You don't even have to worry about looking for a hosting provider as it's possible to host games on GitHub Pages. You'll get free hosting, version control and possible contributors if your project is interesting enough. Publishers and portals As the name may suggest, publishers can handle the publishing of your game for you. Whether you should go that way or not depends on what your plan is for having your game distributed: Do you want to send it wherever possible, or do you want to restrict its ...
...erly known as Node-Webkit, this is the first choice when it comes to building a desktop game that works on Windows, Mac and Linux. The distributions are packaged with the WebKit engine to provide rendering on any platform. Other alternative tools are: Intel XDK -- an exciting alternative, similar to CocoonIO. Electron -- known as Atom Shell -- is an open-sourced and cross-platform tool from GitHub. Manifold.js -- this tool from the Microsoft team can create native distributions of HTML5 games from iOS, Android, and Windows. Summary Distribution is the way to give the world access to your game. There are many options available and there's no single good answer as to which is the best. When you've published the game it's time to focus on promotion -- letting people know your game exis...
Building up a basic demo with Babylon.js - Game development
siveColor -- the one that will be visible for us. We can use the built-in Color3 function to define it. The third line assigns the newly created material to our box. Congratulations, you've created your first object in a 3D environment using Babylon.js! It was easier than you thought, right? Here's how it should look: And here's the code we have created so far: You can also check it out on GitHub. More shapes We have a box on the scene already; now let's try adding more shapes. Torus Let's try adding a torus -- add the following lines below the previous code: var torus = BABYLON.Mesh.CreateTorus("torus", 2, 0.5, 15, scene); torus.position.x = -5; torus.rotation.x = 1.5; This will create a torus and add it to the scene; the parameters are: name, diameter, thickness, tessellation ...
...es and see how it affects the animation. Moving By changing the position of the cylinder directly we can move it on the scene -- add this line below the previous one: cylinder.position.y = Math.sin(t*3); The cylinder will float up and down on the y axis thanks to the Math.sin() function. Conclusion Here's the final code listing, along with a viewable live example: You can also see it on GitHub and fork the repository if you want to play with it yourself locally. Now you know the basics of Babylon.js engine; happy experimentation! ...
Building up a basic demo with the PlayCanvas engine - Game development
and its color is set, it has to be updated so our changes are going to be applied. Then all we need to do is set the box's material to the newly created boxMaterial. Congratulations, you've created your first object in a 3D environment using PlayCanvas! It was easier than you thought, right? Here's how it should look: And here's the code we have created so far: You can also check it out on GitHub. More shapes Now we will add more shapes to the scene. Let's move the cube 2 units to the left to make space for some friends -- add the following line just below the previous code: box.translate(-2, 0, 0); Now let's add a new shape -- how about a cylinder? Cylinder Add the following lines at the bottom of your JavaScript code: var cylinder = new pc.Entity(); cylinder.addComponent("mod...
... Add the following code to achieve that. cone.setPosition(2, Math.sin(timer*2), 0); This will move the cone up and down by applying the sin value to the y axis on each frame, with a little bit of adjustment to make it look cooler. Try changing the value to see how it affects the animation. Conclusion Here's the final code listing, along with a viewable live example: You can also see it on GitHub and fork the repository if you want to play with it yourself locally. Now you know the basics of PlayCanvas engine; happy experimentation! Summary Now you can continue reading the PlayCanvas editor article, go back to the Building up a basic demo with PlayCanvas page, or go back a level higher to the main 3D Games on the Web page. ...
Building up a basic demo with Three.js - Game development
scaling as we like. Let's apply a little rotation to the cube, so we can see more than one face. Again, adding our code below the previous: cube.rotation.set(0.4, 0.2, 0); Congratulations, you've created an object in a 3D environment! This might have proven easier than you first thought? Here's how it should look: And here's the code we have created so far: You can also check it out on GitHub. More shapes and materials Now we will add more shapes to the scene, and explore other shapes, materials, lighting, and more. Let's move the cube to the left, to make space for some friends. Adding the following line just below the previous one: cube.position.x = -25; Now onto more shapes and materials. What might happen when you add a torus, wrapped in the Phong material? Try adding the ...
...Add the following, again just below our requestAnimationFrame() invocation: dodecahedron.position.y = -7*Math.sin(t*2); This will move the dodecahedron up and down, by applying the sin() value to the y axis on each frame, and a little adjustment to make it look cooler. Try changing these values, to see how it affects the animations. Conclusion Here's the final code: You can also see it on GitHub and fork the repository, if you want to play with it locally. Now you understand the basics of Three.js, you can jump back to the parent page, 3D on the Web. You could also try learning raw WebGL, to gain a better understanding of what's going on underneath. See our WebGL documentation. ...
GLSL Shaders - Game development
be in this file to explain how the shaders work. The cube's source code Instead of creating everything from scratch we can reuse the Building up a basic demo with Three.js source code of the cube. Most of the components like the renderer, camera, and lights will stay the same, but instead of the basic material we will set the cube's color and position using shaders. Go to the cube.html file on GitHub, copy all the JavaScript code from inside the second <script> element, and paste it into the third <script> element of the current example. Save and load index.html in your browser -- you should see a blue cube. The vertex shader code Let's continue by writing a simple vertex shader -- add the code below inside the body's first <script> tag: void main() { gl_Position = projectionMatrix * m...
...l is given. In our case the cube will have both vertex and texture shaders applied. That's it -- you've just created the simplest possible shader, congratulations! Here's what the cube should look like: It looks exactly the same as the Three.js cube demo but the slightly different position and the same blue color are both achieved using the shader. ...
3D games on the Web - Game development
t provides built-in functions to help you implement common 3D functionality more quickly. See the Building up a basic demo with Babylon.js subpage for the basics of using Babylon.js, including setting up a development environment, structuring the necessary HTML, and writing the JavaScript code. Building up a basic demo with PlayCanvas PlayCanvas is a popular 3D WebGL game engine open-sourced on GitHub, with an editor available online and good documentation. See the Building up a basic demo with PlayCanvas subpage for higher-level details, and further articles showing how to create demos using the PlayCanvas library, and the online editor. Building up a basic demo with Three.js Three.js, like any other library, gives you a huge advantage: instead of writing hundreds of lines of WebGL code ...
... tools and techniques to build games that will be exported to the web. Where to go next With this article we just scratched the surface of what's possible with currently available technologies. You can build immersive, beautiful and fast 3D games on the Web using WebGL, and the libraries and frameworks build on top of it. Source code You can find all the source code for this series demos on GitHub. APIs Canvas API WebGL API Frameworks Three.js Whitestorm.js (based on Three.js) PlayCanvas Babylon.js A-Frame Tutorials Building up a basic demo with Three.js Building up a basic demo with Whitestorm.js Building up a basic demo with PlayCanvas Building up a basic demo with Babylon.js Building up a basic demo with A-Frame ...
Unconventional controls - Game development
lay -- steering the ship and shooting the bullets. There's good Hello World and Getting Started JavaScript tutorials available on the Leap Motion documentation pages, which will get you through the basics. You can also check out the tutorial about using Leap Motion plugin for Kiwi.js, or the case study of building a web game with Leap Motion and Pixi.js. Be sure to visit the LeapJS repository on GitHub to learn about the JavaScript client for the Leap Motion controller and read the documentation there. If all else fails, there's also a gallery of working examples you can look at. To get the Leap Motion working on your computer you have to first install it by following the steps at leapmotion.com/setup. When everything is installed and the controller is connected to your computer we can proc...
... Summary I hope you liked the experiments -- if you have any others that you think might interest other people, feel free to add details of them here. And remember: have fun making games! Previous Overview: Control mechanisms ...
Implementing controls using the Gamepad API - Game development
implementation in browsers across Windows and Mac OS X. There's also a number of other devices with various different button layouts that more or less work across browser implementations. The code discussed in this article was tested with a few gamepads, but the author's favorite configuration is a wireless Xbox 360 controller and the Firefox browser on Mac OS X. Case Study: Hungry Fridge The GitHub Game Off II competition ran in November 2013 and Enclave Games decided to take part in it. The theme for the competition was "change", so they submitted a game where you have to feed the Hungry Fridge by tapping the healthy food (apples, carrots, lettuces) and avoid the "bad" food (beer, burgers, pizza.) A countdown changes the type of food the Fridge wants to eat every few seconds, so you hav...
...nts to eat at each point, or else you'll lose energy. The game encapsulates two totally different types of "change" -- good food vs. bad food, and mobile vs. desktop. Demo The full version of the Hungry Fridge game was built first, and then to showcase the Gamepad API in action and show the JavaScript source code, a simple demo was created. It's part of the Gamepad API Content Kit available on GitHub where you can dive deep into the code and study exactly how it works. The code explained below is from the full version of the Hungry Fridge game, but it's almost identical to the one from the demo -- the only difference is that the full version uses the turbo variable to decide whether or not the game will be launched using Super Turbo mode. It works independently, so it could be turned on e...
2D maze game with device orientation - Game development
recommended to get the most from this tutorial. Example game By the end of the tutorial you will have a fully functional demo game: Cyber Orb. It will look something like this: Phaser framework Phaser is a framework for building desktop and mobile HTML5 games. It's quite new, but growing rapidly thanks to the passionate community involved in the development process. You can check it out on GitHub where it's open sourced, read the online documentation and go through the big collection of examples. The Phaser framework provides you with a set of tools that will speed up development and help handle generic tasks needed to complete the game, so you can focus on the game idea itself. Starting with the project You can see Cyber Orb source code on GitHub. The folder structure is quite strai...
...levels of increasing difficulty. You can even implement achievements, leaderboards and medals for different actions in the game. There are endless possibilities -- they only depend on your imagination. Summary I hope this tutorial will help you dive into 2D game development and inspire you to create awesome games on your own. You can play the demo game Cyber Orb and check out its source code on GitHub. HTML5 gives us raw tools, the frameworks built on top of it are getting faster and better, so now is a great time get into web game development. In this tutorial we used Phaser, but there are a number of other frameworks worth considering too like ImpactJS, Construct 2 or PlayCanvas -- it depends on your preferences, coding skills (or lack thereof), project scale, requirements and other aspe...
Visual-js game engine - Game development
s GUI editor and game instance creator. ( + server engine tools + server part of web apps ) -3D PART : webgl based on three.js engine -3D PART : webGL2 based on glmatrix 2.0 -2D PART (new): This is TypeScript based game engine (client part ts). With strong connection with webpack Physics done with (matter.js) matter ts This part is removed from this project. New link is : https://github.com/zlatnaspirala/visual-ts-game-engine Basic licence rules : 1) Each file in this project has its own license , be careful , do not violate the basic rules. 2) You are free to use any version of Visual JS library in any other project (even commercial projects) as long as the copyright header is left intact Except for plugins on sale and graphics that come with them (they have spec...
...icles/javascript-motion-detection.html WEBRTC - webcam communication is under : Creator Muaz Khan www.MuazKhan.com MIT License - www.WebRTC-Experiment.com/licence Socket.io.js - http://socket.io/download/ ( also implemented intro build.js ) webgl2 based on : Copyright (C) 2014 Tappali Ekanathan Keestu (keestu@gmail.com) GNU General Public License OBJ loader : https://github.com/frenchtoast747/webgl-obj-loader Textures download from http://textures.com More texture downloads http://www.textures4photoshop.com/ Female Body v3.blend this file has been released by AndresCuccaro under the following license: Creative Commons Attribution 3.0 About GUI for windows (canvas2d part only) : windows GUI application version 1.0 (using visual-js 0.9 li...
Visual typescript game engine - Game development
console.log("Platformer: ", master.get.Platformer); master.get.Platformer.attachAppEvents(); Project structure builds/ is autogenerated. Don't edit or add content in this folder. src,/ is the main client part (Browser web application). Main file: app.ts src/libs/ is a common and smart pack of classes, interfaces etc. easy access. server/ folder is fully independent server size. I use one git repo but consider '/server' represent the standalone application. There's server package.json independently from the client part also config is not common. I just like it like that. +-- package.json +-- package-lock.json +-- webpack.config.js +-- tsconfig.json +-- tslint.json +-- launch.json +-- workplace.code-workspace logo.png LICENSE +-- build/ (This is auto generated) | +-- externals/ | ...
...Lobby.html' }), ... See register and login example. Code format : npm run fix npm run tslint or use : tslint -c tslint.json 'src/**/*.ts' --fix tslint -c tslint.json 'src/**/*.ts' The external licence in this project : - Networking based on : Muaz Khan MIT License www.WebRTC-Experiment.com/licence - Base physics based on : Original source: Matter.js https://github.com/liabru/matter-js Matter.ts Used because typescript orientation. https://www.npmjs.com/package/@types/matter-js Crypto icons downloaded from https://www.behance.net/JunikStudio Todo list for 2019 I'm still far away from the project objective : Make visual nodes for editor mode in gameplay. Item's selling for crypto values. Create examples demos in minimum 20 gameplay variants (ta...
Alpha (alpha channel) - MDN Web Docs Glossary: Definitions of Web-related terms
Each of these components is called a channel. In a typical image file, the color channels describe how much red, green, and blue are used to make up the final color. To represent a color through which the background can be seen to some extent, a fourth channel is added to the color: the alpha channel. The alpha channel specifies how opaque the color is. For example, the color #8921F2 (also described as rgb(137, 33, 242) or hsl(270, 89%, 54)) is a nice shade of purple. ...
...but with an alpha channel set at 0.5 (50% opacity). ...
DoS attack - MDN Web Docs Glossary: Definitions of Web-related terms
There are also Distributed Denial of Service (DDoS) Attacks in which a multitude of servers are used to exhaust the computing capacity of an attacked computer. Types of DoS attack DoS attacks are more of a category than a particular kind of attack. ...
... There are also Distributed Denial of Service (DDoS) Attacks in which a multitude of servers are used to exhaust the computing capacity of an attacked computer. Types of DoS attack DoS attacks are more of a category than a particular kind of attack. ...
Denial of Service - MDN Web Docs Glossary: Definitions of Web-related terms
There are also Distributed Denial of Service (DDoS) Attacks in which a multitude of servers are used to exhaust the computing capacity of an attacked computer. Types of DoS attack DoS attacks are more of a category than a particular kind of attack. ...
... There are also Distributed Denial of Service (DDoS) Attacks in which a multitude of servers are used to exhaust the computing capacity of an attacked computer. Types of DoS attack DoS attacks are more of a category than a particular kind of attack. ...
Distributed Denial of Service - MDN Web Docs Glossary: Definitions of Web-related terms
Normally many persons, using many bots, attack high-profile Web servers like banks or credit-card payment gateways. DDoS concerns computer networks and CPU resource management. In a typical DDoS attack, the assailant begins by exploiting a vulnerability in one computer system and making it the DDoS master. The attack master, also known as the botmaster, identifies and infects other vulnerable systems with malware. ...
...ed machines to launch an attack against a specified target. There are two types of DDoS attacks: a network-centric attack (which overloads a service by using up bandwidth) and an application-layer attack (which overloads a service or database with application calls). The overflow of data to the target causes saturation in the target machine so that it cannot respond or responds very slowly to legitimate traffic (hence the name "denial of service"). The infected computers' owners normally don't know that their computers have been compromised, and they also suffer loss of service. A computer under an intruder's control is called a zombie or bot. A network of co-infected computers is known as a botnet or a zombie army. Both Kaspersky Labs and Symantec have identified botnets -- not spam, viru...
Identifier - MDN Web Docs Glossary: Definitions of Web-related terms
An identifier differs from a string in that a string is data, while an identifier is part of the code. ...
... An identifier differs from a string in that a string is data, while an identifier is part of the code. ...
SMPTE (Society of Motion Picture and Television Engineers) - MDN Web Docs Glossary: Definitions of Web-related terms
...
... ...
Signature (security) - MDN Web Docs Glossary: Definitions of Web-related terms
A signature, or digital signature, is a protocol showing that a message is authentic. From the hash of a given message, the signing process first generates a digital signature linked to the signing entity, using the entity's private key. On receiving the message, the verification process authenticates the sender - uses the sender's public key to decrypt the signature and recover the hash, which can only be created with the sender's private key, and checks message integrity - compares the hash with a newly calculated one from the received document (the two hashes will differ if the document has been tampered with) The system fails if the private key is compromised or the recipient is deceitfully given the wrong public key. ...
...nd recover the hash, which can only be created with the sender's private key, and checks message integrity - compares the hash with a newly calculated one from the received document (the two hashes will differ if the document has been tampered with) The system fails if the private key is compromised or the recipient is deceitfully given the wrong public key. Learn more General knowledge Digital signature on Wikipedia See digest, encryption ...
Legacy layout methods - Learn web development
: 620px; } .col.span9 { width: 700px; } .col.span10 { width: 780px; } .col.span11 { width: 860px; } .col.span12 { width: 940px; } With these classes created we can now lay out different width columns on the grid. Try saving and loading the page in your browser to see the effects. Note: If you are having trouble getting the above example to work, try comparing it against our finished version on GitHub (see it running live also). Try modifying the classes on your elements or even adding and removing some containers, to see how you can vary the layout. For example, you could make the second row look like this: <div class="row"> <div class="col span8">13</div> <div class="col span4">14</div> </div> Now you've got a grid system working, you can simply define the rows and the number of c...
...ol.span9 { width: 72.91666664%; } .col.span10 { width: 81.24999997%; } .col.span11 { width: 89.5833333%; } .col.span12 { width: 97.91666663%; } Now save your code, load it in a browser, and try changing the viewport width -- you should see the column widths adjust nicely to suit. Note: If you are having trouble getting the above example to work, try comparing it against our finished version on GitHub (see it running live also). Easier calculations using the calc() function You could use the calc() function to do the math right inside your CSS -- this allows you to insert simple mathematical equations into your CSS values, to calculate what a value should be. It is especially useful when there is complex math to be done, and you can even compute a calculation that uses different units, f...
Practical positioning examples - Learn web development
e same position on the screen. Our finished example will look like this: Note: You can see the finished example running live at fixed-info-box.html (source code). Check it out to get an idea of what you will be building in this section of the article. As a starting point, you can use your completed example from the first section of the article, or make a local copy of info-box.html from our Github repo. HTML additions First of all, we need some additional HTML to represent the web site main content. Add the following <section> just below your opening <body> tag, just before the existing section: <section class="fake-content"> <h1>Fake content</h1> <p>This is fake content. Your main web page contents would probably go here.</p> <p>This is fake content. Your main web page content...
...want to use up most of it by showing a menu or info panel instead of the useful content. Our finished example will look like this: Note: You can see the finished example running live at hidden-info-panel.html (source code). Check it out to get an idea of what you will be building in this section of the article. As a starting point, make a local copy of hidden-info-panel-start.html from our Github repo. This doesn't follow on from the previous example, so a fresh start file is required. Let's have a look at the HTML in the file: <label for="toggle">?</label> <input type="checkbox" id="toggle"> <aside> ... </aside> To start with here we've got a <label> element and an <input> element -- <label> elements are normally used to associate a text label with a form element for accessibili...
Styling lists - Learn web development
Objective: To become familiar with the best practices and properties related to styling lists. A simple list example To begin with, let's look at a simple list example. Throughout this article, we'll look at unordered, ordered, and description lists -- all have styling features that are similar, and some that are particular to their type of list. ...
... for reference have a top and bottom margin of 16px (1em), the same as the different list types. ...
How to structure a web form - Learn web development
has a label associated with it. The third example is best -- the actual label is read out all together, and the label read out with the input is "name required edit text". Note: You might get slightly different results, depending on your screenreader. This was tested in VoiceOver (and NVDA behaves similarly). We'd love to hear about your experiences too. Note: You can find this example on GitHub as required-labels.html (see it live also). don't test the example with 2 or 3 of the versions uncommented -- screenreaders will definitely get confused if you have multiple labels AND multiple inputs with the same ID! Common HTML structures used with forms Beyond the structures specific to web forms, it's good to remember that form markup is just HTML. This means that you can use all the p...
...as mm/dd/yyyy</em> </label> <input type="date" id="date" name="expiration"> </p> </section> The last section we'll add is a lot simpler, containing only a <button> of type submit, for submitting the form data. Add this to the bottom of your form now: <p> <button type="submit">Validate the payment</button> </p> You can see the finished form in action below (also find it on GitHub -- see our payment-form.html source and running live): Test your skills! You've reached the end of this article, but can you remember the most important information? You can find a further test to verify that you've retained this information before you move on -- see Test your skills: Form structure. Summary You now have all the knowledge you'll need to properly structure your web forms.
Other form controls - Learn web development
imple way to let users select from many different options without taking up much space in the user interface. HTML has two forms of drop down content: the select box, and the autocomplete box. In both cases the interaction is the same -- once the control is activated, the browser displays a list of values the user can select between. Note: You can find examples of all the drop-down box types on GitHub at drop-down-content.html (see it live also). Select box A simple select box is created with a <select> element with one or more <option> elements as its children, each of which specifies one of its possible values. <select id="simple" name="simple"> <option>Banana</option> <option selected>Cherry</option> <option>Lemon</option> </select> If required, the default value for the s...
...s behave differently from case to case, so consider such uses as progressive enhancement, and ensure they degrade gracefully. Other form features There are a few other form features that are not as obvious as the ones we have already mentioned, but still useful in some situations, so we thought it would be worth giving them a brief mention. Note: You can find the examples from this section on GitHub as other-examples.html (see it live also). Meters and progress bars Meters and progress bars are visual representations of numeric values. Progress A progress bar represents a value that changes over time up to a maximum value specified by the max attribute. Such a bar is created using a <progress> element. <progress max="100" value="75">75/100</progress> This is for implementing anyt...
Sending form data - Learn web development
ame/value pairs. After the URL web address has ended, we include a question mark (?) followed by the name/value pairs, each one separated by an ampersand (&). In this case we are passing two pieces of data to the server: say, which has a value of Hi to, which has a value of Mom The HTTP request looks like this: GET /?say=Hi&to=Mom HTTP/2.0 Host: foo.com Note: You can find this example on GitHub -- see get-method.html (see it live also). The POST method The POST method is a little different. It's the method the browser uses to talk to the server when asking for a response that takes into account the data provided in the body of the HTTP request: "Hey server, take a look at this data and send me back an appropriate result." If a form is sent using this method, the data is appended t...
...equest looks like so, with the data included in the request body instead: POST / HTTP/2.0 Host: foo.com Content-Type: application/x-www-form-urlencoded Content-Length: 13 say=Hi&to=Mom The Content-Length header indicates the size of the body, and the Content-Type header indicates the type of resource sent to the server. We'll discuss these headers later on. Note: You can find this example on GitHub -- see post-method.html (see it live also). Viewing HTTP requests HTTP requests are never displayed to the user (if you want to see them, you need to use tools such as the Firefox Network Monitor or the Chrome Developer Tools). As an example, your form data will be shown as follows in the Chrome Network tab. After submitting the form: Open the developer tools. Select "Network" Select "...
Front-end web developer - Learn web development
It is a good idea to know HTML, CSS, and JavaScript before working through this section, as the tools discussed work alongside many of these technologies. ...
...good idea to know HTML, CSS, and JavaScript before working through this section, as the tools discussed work alongside many of these technologies. ...
What’s in the head? Metadata in HTML - Learn web development
Next, choose your browser's File > Save Page As... menu and choose a sensible ...
...Next, choose your browser's File > Save Page As... menu and choose a sensible place to save the file. Now open the file in your browser. ...
Mozilla splash page - Learn web development
attempting this assessment you should have already worked through the rest of the Multimedia and embedding module. Objective: To test knowledge around embedding images and video in web pages, frames, and HTML responsive image techniques. Starting point To start off this assessment, you need to grab the HTML and all the images available in the mdn-splash-page-start directory on github. Save the contents of index.html in a file called index.html on your local drive, in a new directory. Then save pattern.png in the same directory (right click on the image to get an option to save it.) Access the different images in the originals directory and save them in the same way; you'll want to save them in a different directory for now, as you'll need to manipulate (some of) them usin...
..., srcset and sizes attributes. In each case (except one -- which one is inherently responsive?) we want the browser to serve the 120px wide version when the viewport width is 500px wide or less, or the 400px wide version otherwise. Make sure you match the correct images with the correct links! Note: To properly test the srcset/sizes examples, you'll need to upload your site to a server (using Github pages is an easy and free solution), then from there you can test whether they are working properly using browser developer tools such as the Firefox Network Monitor. An art directed red panda Inside the <div> with the class of red-panda, we want to insert a <picture> element that serves the small portrait panda image if the viewport is 600px wide or less, and the large landscape image othe...
Responsive images - Learn web development
typical scenario. A typical website may contain a header image and some content images below the header. The header image will likely span the whole of the width of the header, and the content image will fit somewhere inside the content column. Here's a simple example: This works well on a wide screen device, such as a laptop or desktop (you can see the example live and find the source code on Github.) We won't discuss the CSS much in this lesson, except to say that: The body content has been set to a maximum width of 1200 pixels -- in viewports above that width, the body remains at 1200px and centers itself in the available space. In viewports below that width, the body will stay at 100% of the width of the viewport. The header image has been set so that its center always stays in the...
...r example. The standard <img> element traditionally only lets you point the browser to a single source file: <img src="elva-fairy-800w.jpg" alt="Elva dressed as a fairy"> We can however use two new attributes -- srcset and sizes -- to provide several additional source images along with hints to help the browser pick the right one. ...
HTML table advanced features and accessibility - Learn web development
ctive learning: Adding a caption Let's try this out, revisiting an example we first met in the previous article. Open up your language teacher's school timetable from the end of HTML Table Basics, or make a local copy of our timetable-fixed.html file. Add a suitable caption for the table. Save your code and open it in a browser to see what it looks like. Note: You can find our version on GitHub -- see timetable-caption.html (see it live also). Adding structure with <thead>, <tfoot>, and <tbody> As your tables get a bit more complex in structure, it is useful to give them more structural definition. One clear way to do this is by using <thead>, <tfoot>, and <tbody>, which allow you to mark up a header, footer, and body section for the table. These elements don't make the table any...
... Nesting Tables It is possible to nest a table inside another one, as long as you include the complete structure, including the <table> element. This is generally not really advised, as it makes the markup more confusing and less accessible to screenreader users, and in many cases you might as well just insert extra cells/rows/columns into...
Choosing the right approach - Learn web development
on Repeating operation Multiple sequential operations Multiple simultaneous operations No Yes No (unless it is the same one) No Code example The following function creates a new Date() object, extracts a time string out of it using toLocaleTimeString(), and then displays it in the UI. ...
...if at all possible, use this instead of setInterval()/recursive setTimeout(), unless you need a specific framerate. Useful for... ...
Cooperative asynchronous JavaScript: Timeouts and intervals - Learn web development
r than once. You can also pass any parameters required by the function being executed as subsequent parameters of the setInterval() call. Let's look at an example. The following function creates a new Date() object, extracts a time string out of it using toLocaleTimeString(), and then displays it in the UI. ...
...n active requestAnimation() call, which takes the draw() function as its parameter. This starts the animation off, constantly running the draw() function at a rate as near 60 FPS as possible. rAF = requestAnimationFrame(draw); Below the draw() function definition, add a call to the the draw() function to start the animation. draw(); Note: You can find the finished example live on GitHub. (You can see the source code, also.) Clearing a requestAnimationFrame() call Clearing a requestAnimationFrame() call can be done by calling the corresponding cancelAnimationFrame() method. (Note that the function name starts with "cancel", not "clear" as with the "set..." methods.) Just pass it the value returned by the requestAnimationFrame() call to cancel, which you stored in the vari...
Build your own function - Learn web development
er to get different messages displayed in the box! A more complex parameter On to the next parameter. This one is going to involve slightly more work -- we are going to set it so that depending on what the msgType parameter is set to, the function will display a different icon and a different background color. First of all, download the icons needed for this exercise (warning and chat) from GitHub. Save them in a new folder called icons in the same location as your HTML file. Note: The warning and chat icons were originally found on iconfinder.com, and designed by Nazarrudin Ansyari -- Thanks! (The actual icon pages were since moved or removed.) Next, find the CSS inside your HTML file. We'll make a few changes to make way for the icons. First, update the .msgBox width from: wid...
...ayMessage('Woo, this is a different message!'); to one of these: displayMessage('Your inbox is almost full -- delete some mails', 'warning'); displayMessage('Brian: Hi there, how are you today?','chat'); You can see how useful our (now not so) little function is becoming. Note: If you have trouble getting the example to work, feel free to check your code against the finished version on GitHub (see it running live also), or ask us for help. Test your skills! You've reached the end of this article, but can you remember the most important information? You can find some further tests to verify that you've retained this information before you move on -- see Test your skills: Functions. These tests require skills that are covered in the next article, so you might want to read those fi...
Function return values - Learn web development
s if it were this: ctx.arc(500, 200, 35, 0, 2 * Math.PI); The function calls on the line are run first, and their return values substituted for the function calls, before the line itself is then executed. Active learning: our own return value function Let's have a go at writing our own functions featuring return values. First of all, make a local copy of the function-library.html file from GitHub. This is a simple HTML page containing a text <input> field and a paragraph. There's also a <script> element, in which we have stored a reference to both HTML elements in two variables. This little page will allow you to enter a number into the text box, and display different numbers related to it in the paragraph below. Let's add some useful functions to this <script> element. Below the two ...
...a sentence is printed out inside the paragraph element that states the square, cube, and factorial values of the number. The sentence calls the squared(), cubed(), and factorial() functions to calculate the required values. Save your code, load it in a browser, and try it out. Note: If you have trouble getting the example to work, feel free to check your code against the finished version on GitHub (see it running live also), or ask us for help. Now it's your turn! At this point, we'd like you to have a go at writing out a couple of functions of your own and adding them to the library. How about the square or cube root of the number? Or the circumference of a circle with a given radius? Some extra function related tips: Look at another example of writing error handling into functi...
Client-side storage - Learn web development
n great detail in this article, although we will show a simple example in the Offline asset storage section below. Storing simple data -- web storage The Web Storage API is very easy to use -- you store simple name/value pairs of data (limited to strings, numbers, etc.) and retrieve these values when needed. Basic syntax Let's show you how: First, go to our web storage blank template on GitHub (open this in a new tab). Open the JavaScript console of your browser's developer tools. All of your web storage data is contained within two object-like structures inside the browser: sessionStorage and localStorage. The first one persists data for as long as the browser is open (the data is lost when the browser is closed) and the second one persists data even after the browser i...
...er' in navigator) { navigator.serviceWorker .register('/learning-area/javascript/apis/client-side-storage/cache-sw/video-store-offline/sw.js') .then(function() { console.log('Service Worker Registered'); }); } Note: The given path to the sw.js file is relative to the site origin, not the JavaScript file that contains the code. The service worker is at https://mdn.github.io/learning-area/javascript/apis/client-side-storage/cache-sw/video-store-offline/sw.js. The origin is https://mdn.github.io, and therefore the given path has to be /learning-area/javascript/apis/client-side-storage/cache-sw/video-store-offline/sw.js. If you wanted to host this example on your own server, you'd have to change this accordingly. This is rather confusing, but it has to work this ...
Fetching data from the server - Learn web development
longer being developed, in favor of Microsoft's new Edge browser), but you might need XHR for a while yet. A more complex example To round off the article, we'll look at a slightly more complex example that shows some more interesting uses of Fetch. We have created a sample site called The Can Store -- it's a fictional supermarket that only sells canned goods. You can find this example live on GitHub, and see the source code. By default, the site displays all the products, but you can use the form controls in the left hand column to filter them by category, or search term, or both. There is quite a lot of complex code that deals with filtering the products by category and search terms, manipulating strings so the data displays correctly in the UI, etc. We won't discuss all of it in the...
...bout the best equivalent to Fetch's response.ok in XHR is to check whether request.status is equal to 200, or if request.readyState is equal to 4. The properties for getting the status and status message are the same, but they are found on the request (XHR) object, not the response object. Note: If you have trouble with this, feel free to check your code against the finished version on GitHub (see the source here, and also see it running live). Summary This article shows how to start working with both XHR and Fetch to fetch data from the server. ...
Introduction to web APIs - Learn web development
ttpRequest object (each one represents an HTTP request to the server to retrieve a new resource of some kind) has a number of events available on them, for example, the load event is fired when a response has been successfully returned containing the requested resource, and it is now available. The following code provides a simple example of how this would be used: let requestURL = 'https://mdn.github.io/learning-area/javascript/oojs/json/superheroes.json'; let request = new XMLHttpRequest(); request.open('GET', requestURL); request.responseType = 'json'; request.send(); request.onload = function() { const superHeroes = request.response; populateHeader(superHeroes); showHeroes(superHeroes); } Note: You can see this code in action in our ajax.html example (see it live also). The f...
... annoying and we really shouldn't be subjecting our users to it. Note: Depending on how strict the browser is, such security mechanisms might even stop the example from working locally, i.e. if you load the local example file in your browser instead of running it from a web server. At the time of writing, our Web Audio API example wouldn't work locally on Google Chrome -- we had to upload it to GitHub before it would work. Summary At this point, you should have a good idea of what APIs are, how they work, and what you can do with them in your JavaScript code. You are probably excited to start actually doing some fun things with specific APIs, so let's go! Next up, we'll look at manipulating documents with the Document Object Model (DOM). Overview: Client-side web APIs Next In th...
Video and Audio APIs - Learn web development
querySelector('.timer'); const timer = document.querySelector('.timer span'); const timerBar = document.querySelector('.timer div'); Here we are creating constants to hold references to all the objects we want to manipulate. We have three groups: The <video> element, and the controls bar. The play/pause, stop, rewind, and fast forward buttons. The outer timer wrapper <div>, the digital timer readout <span>, and the inner <div> that gets wider as the time elapses. Next, insert the following at the bottom of your code: media.removeAttribute('controls'); controls.style.visibility = 'visible'; These two lines remove the default browser controls from the video, and make the custom controls visible. Playing and pausing the video Let's implement probably the most...
... fairly long function, so let's go through it step by step: First of all, we work out the number of minutes and seconds in the HTMLMediaElement.currentTime value. Then we initialize two more variables -- minuteValue and secondValue. The two if statements work out whether the number of minutes and seconds are less than 10. If so, they add a leading zero to the values, in the same way that a digital clock display works. The actual time value to display is set as minuteValue plus a colon character plus secondValue. The Node.textContent value of the timer is set to the time value, so it displays in the UI. The length we should set the inner <div> to is worked out by first working out the width of the outer <div> (any element's clientWidth property will contain its length), and then multip...
Inheritance in JavaScript - Learn web development
ape = new Teacher('Severus', 'Snape', 58, 'male', ['Potions'], 'Dark arts', 5); snape.greeting(); // Hi! I'm Severus. snape.farewell(); // Severus has left the building. Bye for now. snape.age // 58 snape.subject; // Dark arts Like we did with Teachers, we could create other subclasses of Person to make them more specialized without modifying the base class. Note: You can find this example on GitHub as es2015-class-inheritance.html (see it live also). Getters and Setters There may be times when we want to change the values of an attribute in the classes we create or we don't know what the final value of an attribute will be. Using the Teacher example, we may not know what subject the teacher will teach before we create them, or their subject may change between terms. We can handle suc...
...new value" setter method. The example below shows the two features in action: // Check the default value console.log(snape.subject) // Returns "Dark arts" // Change the value snape.subject = "Balloon animals" // Sets _subject to "Balloon animals" // Check it again and see if it matches the new value console.log(snape.subject) // Returns "Balloon animals" Note: You can find this example on GitHub as es2015-getters-setters.html (see it live also). Note: Getters and setters can be very useful at times, for example when you want to run some code every time a property is requested or set. For simple cases, however, plain property access without a getter or setter will do just fine. When would you use inheritance in JavaScript? Particularly after this last article, you might be thinki...
Working with JSON - Learn web development
eader> <section> </section> Plus a <script> element to contain the JavaScript code we will be writing in this exercise. At the moment it only contains two lines, which grab references to the <header> and <section> elements and store them in variables: const header = document.querySelector('header'); const section = document.querySelector('section'); We have made our JSON data available on our GitHub, at https://mdn.github.io/learning-area/javascript/oojs/json/superheroes.json. We are going to load it into our page, and use some nifty DOM manipulation to display it, like this: Obtaining the JSON To obtain the JSON, we use an API called XMLHttpRequest (often called XHR). This is a very useful JavaScript object that allows us to make network requests to retrieve resources from a server ...
...g that we can update small sections of content without having to reload the entire page. This has led to more responsive web pages, and sounds exciting, but it is beyond the scope of this article to teach it in much more detail. To start with, we store the URL of the JSON we want to retrieve in a variable. Add the following at the bottom of your JavaScript code: let requestURL = 'https://mdn.github.io/learning-area/javascript/oojs/json/superheroes.json'; To create a request, we need to create a new request object instance from the XMLHttpRequest constructor, using the new keyword. Add the following below your last line: let request = new XMLHttpRequest(); Now we need to open the request using the open() method. Add the following line: request.open('GET', requestURL); This ta...
HTML performance features - Learn web development
d, and basic knowledge of client-side web technologies. Objective: To learn about the impact of HTML elements and attributes on web performance optimization. Elements & attributes impacting performance The <picture> Element The <video> Element The <source> Element The <img> srcset attribute Responsive images Preloading content with rel="preload" - (https://w3c.github.io/preload/ ) async / defer attributes <iframe> <object> <script> rel attribute Conclusion Previous Overview: Performance Next In this module The "why" of web performance What is web performance? How do users perceive performance? Measuring performance Multimedia: images Multimedia: video JavaScript performance best practices. HTML performance features CSS performan...
...rformance Multimedia: images Multimedia: video JavaScript performance best practices. HTML performance features CSS performance features Fonts and performance Mobile performance Focusing on performance See Also The <picture> Element The <video> Element The <source> Element The <img> srcset attribute Responsive images Preloading content with rel="preload" - (https://w3c.github.io/preload/ ) ...
Getting started with Ember - Learn web development
ge also enables lighter asset payloads due to compiling the templates into a "byte code" that can be parsed faster than JavaScript. The Glimmer VM enables extremely fast DOM change tracking without the need to manage and diff a cached virtual representation (which is a common approach to mitigating the slow I/O of DOM changes). For more information on the technical aspects of The Glimmer VM, the github repository has some documentation -- specifically, References and Validators may be of interest. Everything else in Ember is just JavaScript. In particular, JavaScript classes. This is where most of the "framework" parts come into play, as there are superclasses, where each type of thing has a different purpose and different expected location within your project. Here is a demonstration the ...
... the classic TodoMVC sample app, teaching you how to use the essentials of the Ember framework along the way. TodoMVC is a basic to-do tracking app implemented in many different technologies. Here is the completed Ember version, for reference. A note on TodoMVC and accessibility The TodoMVC project has a few issues in terms of adhering to accessible/default web practices. There are a couple of GitHub issues open about this on the TodoMVC family of projects: Add keyboard access to demos Re-enable Outline on focusable elements Ember has a strong commitment to being accessible by default and there is an entire section of the Ember Guides on accessibility on what it means for website / app design. That said, because this tutorial is a focus on the JavaScript side of making a small web a...
Introduction to client-side frameworks - Learn web development
y are worth highlighting. Citations for this table: React browser support: official docs Ember browser support: Ember 3.0 release announcement Ember templating language (official docs) Does the framework have a strong community? This is perhaps the hardest metric to measure, because community size does not correlate directly to easy-to-access numbers. You can check a project's number of GitHub stars or weekly npm downloads to get an idea of its popularity, but sometimes the best thing to do is search a few forums or talk to other developers. It is not just about the community's size, but also how welcoming and inclusive it is, and how good available documentation is. Opinions on the web Don't just take our word on this matter -- there are discussions all over the web. The Wikimedi...
... SSR solutions are written and maintained by the community, whereas some are "official" solutions provided by the framework's maintainer. Static site generators Static site generators are programs that dynamically generate all the webpages of a multi-page website -- including any relevant CSS or JavaScript -- so that they can be published in any number of places. The publishing host could be a GitHub pages branch, a Netlify instance, or any private server of your choosing, for example. There are a number of advantages of this approach, mostly around performance (your user's device isn't building the page with JavaScript; it's already complete) and security (static pages have fewer attack vectors). These sites can still utilize JavaScript where they need to, but they are not dependent upon ...
Advanced Svelte: Reactivity, lifecycle, accessibility - Learn web development
The following new components will be developed throughout the course of this article: MoreActions: Displays the Check All and Remove Completed buttons, and emits the corresponding events required to handle their functionality. NewTodo: Displays the <input> field and Add button for adding a new todo. TodosStatus: Displays the "x out of y items completed" status heading. Code along with us Git Clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git Then to get to the current app state, run cd mdn-svelte-tutorial/05-advanced-concepts Or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/05-advanced-concepts Remember to run npm install && npm run dev to start your app in development mode. ...
...odos, both to sighted users and screenreader users. Note: You might be wondering why we need to declare a new variable for component binding -- why can't we just call TodosStatus.focus()? You might have multiple TodosStatus instances active, so you need a way to reference each particular instance. That's why you have to specify a variable to bind each specific instance to. The code so far Git To see the state of the code as it should be at the end of this article, access your copy of our repo like this: cd mdn-svelte-tutorial/06-stores Or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/06-stores Remember to run npm install && npm run dev to start your app in development mode. REPL To see the current state of the code in a REPL, visit: https://svel...
Focus management with Vue refs - Learn web development
uns after a component has been removed from the DOM activated() -- Only used in components wrapped in a special keep-alive tag. Runs after the component is activated. deactivated() -- only used in components wrapped in a special keep-alive tag. Runs after the component is deactivated. Note: The Vue Docs provide a nice diagram for visualizing when these hooks happen. This article from the Digital Ocean Community Blog dives into the lifecycle methods more deeply. Now that we've gone over the lifecycle methods, let's use one to trigger focus when our ToDoItemEditForm component is mounted. In ToDoItemEditForm.vue, attach ref="labelInput" to the <input> element, like so: <input :id="id" ref="labelInput" type="text" autocomplete="off" v-model.lazy.trim="newName" /> Next, add a mounted()...
...focus management, and for our app! Congratulations for working your way through all our Vue tutorials. In the next article we'll round things off with some further resources to take your Vue learning further. Note: If you need to check your code against our version, you can find a finished version of the sample Vue app code in our todo-vue repository. For a running live version, see https://mdn.github.io/todo-vue/dist/. Previous Overview: Client-side JavaScript frameworks Next In this module Introduction to client-side frameworks Framework main features React Getting started with React Beginning our React todo list Componentizing our React app React interactivity: Events and state React interactivity: Editing, filtering, conditional rendering Accessibili...
Package management basics - Learn web development
to and thus can be installed from. npm, as well as being a package manager, is also the name of the most commonly-used package registry for JavaScript packages. The npm registry exists at npmjs.com. npm is not the only option. You could manage your own package registry -- products like Microsoft Azure allow you to create proxies to the npm registry (so you can override or lock certain packages), GitHub also offers a package registry service, and there will be likely more options appearing as time goes on. What is important is that you ensure you've chosen the best registry for you. Many projects will use npm, and we'll stick to this in our examples throughout the rest of the module. Using the package ecosystem Let's run through an example to get you started with using a package manager an...
...ion: The starting version number for the app: Again, Just press Return to accept the default 1.0.0. description: A quick description of the app's purpose. Type in something really simple, like "A simple npm package to learn about using npm", then press Return. entry point: This will be the top-level JavaScript file of the app. The default index.js is fine for now -- press Return. test command, git repository, and keywords: press Return to leave each of these blank for now. author: The author of the project. Type your own name, and press Return. license: The license to publish the package under: Press Return to accept the default for now. Press Return one more time to accept these settings. Go into your parcel-experiment directory and you should now find you've got a package.json file.
Testopia
nsion, which means that all tr_*.cgi scripts which are currently in the bugzilla/ root directory are being moved into extensions/Testopia/lib/. This is not an trivial task, it takes time (it started in August 2014), and we decided that it was not a good idea to release half-baked code which still needs testing to make sure we didn't regress anything. ...
...ugust 2014), and we decided that it was not a good idea to release half-baked code which still needs testing to make sure we didn't regress anything. The good news is that the current code in the git repository already works with Bugzilla 5.0, and so if you upgraded to 5.0 already, and if you don't mind having a work-in-progress extension on your machine, you can decide to pull the code from the git repository. This would also let us get some early feedback in case you find regressions. If you find bugs in the code available from the git repository, please report it to us so that we can fix most critical ones on time for Testopia 3.0. Do not ask when we plan to release 3.0, because we really don't know. "As soon as possible" is our best answer. Testopia 2.5 This versions supports Bugzilla...
Phishing: a short definition
ollowing is a non-exhaustive list of the most common approaches. Shifting blame to users Some quick-to-implement, and cost-effective solutions, hold users accountable for their actions instead of restricting what's technically possible. Earlier responses by affected banks, and payment providers, was to attempt educating users to not click links in emails, along with requesting to verify email legitimacy through checking for relevant personal information. Another solution is to strengthen logins with pictures, or colored words, often chosen when signing up for a service. Users look for these when logging in, and only enter their credentials when they recognize the user defined pictures or words. A study on the efficacy of security indicators, presented at the 2007 IEEE Symposium on Securit...
...better way to use phones as second factor, are One-Time Password (OTP) protocols, like TOTP and HOTP. At service registration, the provider will often generate a QR code to be read by an OTP app. This QR code is nothing more than a random, secret key, that is stored on the user's phone. After verifying username and password, the user is prompted to open the OTP app and enter the corresponding 6-digit code, representing a hashed version of the secret key and a nonce - potentially time-based. OTP is the most widely supported second factor schemes and can be used to secure your most important accounts. Unfortunately, some users still feel it's too tedious unlocking a phone, opening the OTP app, and manually typing a few digits each time a provider requests a new token. This can be phished by an...
Localization Use Cases
essages: Firefox OS ulegl awarii Boot2Gecko uleglo awarii Isolation Let's look at how the Settings app formats sizes. ...
...p formats sizes. ...
L20n
A JavaScript localization framework to unleash your natural language's power with simple code. Introducing L20n L20n reinvents software localization. Users should be able to benefit from the entire expressive power of the natural language. L20n keeps simple things simple, and at the same time makes complex things possible. Through L20n, Mozilla is creating a new generation of technology that places more power in localizers' hands. ...
...ory eXchange standard for translation memory data. L20n syntax cheatsheet for localizers A simple cheatsheet to help localizers as they localize projects with L20n. Additional resources Some additional resources for developers and localizers involved with L20n. L20n.org You can try L20n live in your browser on the project page. L20n Tinker Test out your own L20n code in L20n Tinker. GitHub Where the main code for the L20n infrastructure and design spec lives. Wiki page Info about the project to develop L20n. ...
Optimizing Applications For NSPR
program with this restriction in mind. PR_Interrupt is implemented except for <tt>PR_Connect()</tt>. IRIX The IRIX (classic) implementation has a known race condition in creating new threads. If the spawned thread establishes and exits before the parent thread is resumed, the parent will be left with an invalid pointer to the child. The problem has a solution that will be available soon. Digital Unix Digital Unix (aka, OSF1) requires the latest patches for the pthreads library. The changes are not evident until one tries to do thread suspension (<tt>PR_SuspendAll()</tt>) which is in preparation for garbage collection. Digital Unix is the main platform used for NSPR's prototype use of IPv6. There are some conflicts between the patches needed to use IPv6 and those needed for pthreads.
... Linux The pthreads version of Linux (which is not the default) uses the same signals that NSPR uses to suspend threads in preparation for garbage collection. No solution in hand. ...
NSS 3.21 release notes
Global CA 3 SHA-1 Fingerprint: AB:48:F3:33:DB:04:AB:B9:C0:72:DA:5B:0C:C1:D0:57:F0:36:9B:46 CN = UTN - DATACorp SGC SHA-1 Fingerprint: 58:11:9F:0E:12:82:87:EA:50:FD:D9:87:45:6F:4F:78:DC:FA:D...
...1 Fingerprint: D3:C0:63:F2:19:ED:07:3E:34:AD:5D:75:0B:32:76:29:FF:D5:9A:F2 CN = USERTrust Legacy Secure Server CA SHA-1 Fingerprint: 7C:2F:91:E2:BB:96:68:A9:C6:F6:BD:10:19:2C:6B:52:5A:1B:BA:48 Friendly Name: Digital Signature Trust Co. Global CA 1 SHA-1 Fingerprint: 81:96:8B:3A:EF:1C:DC:70:F5:FA:32:69:C2:92:A3:63:5B:D1:23:D3 Friendly Name: Digital Signature Trust Co. Global CA 3 SHA-1 Fingerprint: AB:48:F3:33:DB:04:AB:B9:C0:72:DA:5B:0C:C1:D0:57:F0:36:9B:46 CN = UTN - DATACorp SGC SHA-1 Fingerprint: 58:11:9F:0E:12:82:87:EA:50:FD:D9:87:45:6F:4F:78:DC:FA:D6:D4 O = TURKTRUST Bilgi Iletisim ve Bilisim Guvenligi Hizmetleri A.S. (c) Kasim 2005 SHA-1 Fingerprint: B4:35:D4:E1:11:9D:1C:66:90:A7...
NSS tools : modutil
all script and the required libraries must be bundled in a JAR file, which is specified with the -jar argument. modutil -dbdir sql:/home/mt"jar-install-filey/sharednssdb -jar install.jar -installdir sql:/home/my/sharednssdb This installation JAR file was signed by: ---------------------------------------------- **SUBJECT NAME** C=US, ST=California, L=Mountain View, CN=Cryptorific Inc., OU=Digital ID Class 3 - Netscape Object Signing, OU="www.verisign.com/repository/CPS Incorp. by Ref.,LIAB.LTD(c)9 6", OU=www.verisign.com/CPS Incorp.by Ref . LIABILITY LTD.(c)97 VeriSign, OU=VeriSign Object Signing CA - Class 3 Organization, OU="VeriSign, Inc.", O=VeriSign Trust Network **ISSUER NAME**, OU=www.verisign.com/CPS Incorp.by Ref. LIABILITY LTD.(c)97 VeriSign, OU=VeriSign Object Signing C...
...ecuted during the course of the installation. Typically, this string is used for a setup program provided by a module vendor, such as a self-extracting setup executable. More than one file can be specified as executable, in which case the files are run in the order in which they are specified in the script file. FilePermissions sets permissions on any referenced files in a string of octal digits, according to the standard Unix format. This string is a bitwise OR. user read: 0400 user write: 0200 user execute: 0100 group read: 0040 group write: 0020 group execute: 0010 other read: 0004 other write: 0002 other execute: 0001 Some platforms may not understand these permissions. They are applied only insofar as they make sense for the current platform. If this attribute is omitt...
NSS Tools modutil
ecifies that the file is to be executed during the course of the installation. Typically this string would be used for a setup program provided by a module vendor, such as a self-extracting setup.exe. More than one file can be specified as executable, in which case the files are run in the order in which they are specified in the script file. FilePermissions Interpreted as a string of octal digits, according to the standard Unix format. This string is a bitwise OR of the following constants: user read: 0400 user write: 0200 user execute: 0100 group read: 0040 group write: 0020 group execute: 0010 other read: 0004 other write: 0002 other execute: 0001 Some pla...
...urrently running, you should exit Communicator before continuing thisoperation. Type 'q <enter>' to abort, or <enter> to continue: After you press Enter, the tool displays the following: Using database directory c:\databases... This installation JAR file was signed by: ---------------------------------------------- **SUBJECT NAME** C=US, ST=California, L=Mountain View, CN=Cryptorific Inc., OU=Digital IDClass 3 - Netscape Object Signing, OU="www.verisign.com/repository/CPSIncorp. by Ref.,LIAB.LTD(c)9 6", OU=www.verisign.com/CPS Incorp.by Ref. LIABILITY LTD.(c)97 VeriSign, OU=VeriSign Object Signing CA - Class 3Organization, OU="VeriSign, Inc.", O=VeriSign Trust Network **ISSUERNAME**, OU=www.verisign.com/CPS Incorp.by Ref. LIABILITY LTD.(c)97VeriSign, OU=VeriSign Object Signing CA - Class 3 ...
NSS tools : modutil
Mozilla › Projects › NSS › tools › modutil
ript and the required libraries must be bundled in a JAR file, which is specified with the -jar argument. modutil -dbdir sql:/home/mt"jar-install-filey/sharednssdb -jar install.jar -installdir sql:/home/my/sharednssdb This installation JAR file was signed by: ---------------------------------------------- **SUBJECT NAME** C=US, ST=California, L=Mountain View, CN=Cryptorific Inc., OU=Digital ID Class 3 - Netscape Object Signing, OU="www.verisign.com/repository/CPS Incorp. by Ref.,LIAB.LTD(c)9 6", OU=www.verisign.com/CPS Incorp.by Ref . LIABILITY LTD.(c)97 VeriSign, OU=VeriSign Object Signing CA - Class 3 Organization, OU="VeriSign, Inc.", O=VeriSign Trust Network **ISSUER NAME**, OU=www.verisign.com/CPS Incorp.by Ref. LIABILITY LTD.(c)97 VeriSign, OU=VeriSign Object Signing C...
... the course of the installation. Typically, this string is used for a setup program provided by a module vendor, such as a self-extracting setup executable. More than one file can be specified as executable, in which case the files are run in the order in which they are specified in the script file. FilePermissions sets permissions on any referenced files in a string of octal digits, according to the standard Unix format. This string is a bitwise OR. user read: 0400 user write: 0200 user execute: 0100 group read: 0040 group write: 0020 group execute: 0010 other read: 0004 other write: 0002 other execute: 0001 Some platforms may not understand thes...
NSS tools : signver
Mozilla › Projects › NSS › tools › signver
Name signver -- Verify a detached PKCS#7 signature for a file. Synopsis signtool -A | -V -d directory [-a] [-i input_file] [-o output_file] [-s signature_file] [-v] Description The Signature Verification Tool, signver, is a simple command-line utility that unpacks a base-64-encoded PKCS#7 signed object and verifies the digital signature using standard cryptographic techniques. The Signature Verification Tool can also display the contents of the signed object. Options -A Displays all of the information in the PKCS#7 signature. -V Verifies the digital signature. -d [sql:]directory Specify the database directory which contains the certificates and keys. signver supports two types of database...
...s not used, then the tool assumes that the given databases are in the old format. -a Sets that the given signature file is in ASCII format. -i input_file Gives the input file for the object with signed data. -o output_file Gives the output file to which to write the results. -s signature_file Gives the input file for the digital signature. -v Enables verbose output. Extended Examples Verifying a Signature The -V option verifies that the signature in a given signature file is valid when used to sign the given object (from the input file). signver -V -s signature_file -i signed_file -d sql:/home/my/sharednssdb signatureValid=yes Printing Signature Data The -A option prints all of the...
Getting SpiderMonkey source code
at https://hg.mozilla.org/index.cgi/mozilla-central/file/tip. This fetches a snapshot of the current Mozilla tree. If you have problems with the instructions above, you can read the full details of using Mercurial to get Mozilla code here. That page also contains links to several bundles, which can be useful if you have a poor network connection. Getting the latest SpiderMonkey source code from Git The following command line downloads the entire Mozilla repository, including the full change history and a lot of Gecko and Firefox source code that isn't part of SpiderMonkey. It also changes to the SpiderMonkey directory (js/src). git clone https://github.com/mozilla/gecko-dev.git cd gecko-dev/js/src If you want a faster (about 5 times as of January 2015) download, try doing a shallow clon...
...loads the entire Mozilla repository, including the full change history and a lot of Gecko and Firefox source code that isn't part of SpiderMonkey. It also changes to the SpiderMonkey directory (js/src). git clone https://github.com/mozilla/gecko-dev.git cd gecko-dev/js/src If you want a faster (about 5 times as of January 2015) download, try doing a shallow clone (no version control history). git clone --depth 1 https://github.com/mozilla/gecko-dev.git If you have any problems check the https://wiki.mozilla.org/Github page. Getting older SpiderMonkey sources from CVS Note: You will need to explicitly fetch the JavaScript shell sources even if you currently build another Mozilla project, as there are files specific to the shell that are not normally found in a Mozilla source tree. Jus...
Hacking Tips
owing time spent in which engine and which function like this. Whenever running a testcase the file "tl-data.json" and several "tl-*" files get created in the "/tmp" directory. (Per proces a "tl-data-*PID*.json" file and per thread a "tl-tree.*PID*.*ID*.tl", "tl-event.*PID*.*ID*.tl" and "tl-dict.*PID*.*ID*.json" file). These files contain all information to create a tracelogger graph. On https://github.com/h4writer/tracelogger you can find the instructions to create the graph (Tools V2 > 1. Creating a tracelogging graph). Note 1: when you are doing this from "file:///" you will probably get a security warning in the console. This is because firefox doesn't allow loading files from the harddisk using httprequest, even when the file loading the file is on the harddisk. There are two solutions...
... this check in "about:config", by temporarily switching "security.fileuri.strict_origin_policy" to false Note 2: The files can be very big and take a long time to load in the browser. Therefore it might be good to reduce the logged file. This will remove entries that took only a minor time (=entries that will only show up with les than 1px). This can be done with the reduce.py script in https://github.com/haytjes/tracelogger/tree/master/tools_v2. You need to download "engine.js", "reduce.py", "reduce.js", "reduce-tree.js" and "reduce-corrections.js". Running this tool is a matter of running "python reduce.py JS_SHELL /tmp/tl-data.json tl-reduced". Where JS_SHELL is a real shell. Using callgrind (JS shell) As SpiderMonkey just-in-time compiler are rewriting the executed program, valgrind s...
TPS Tests
t to mention the first run is very likely to fail, since it expects a clean start). Note: Be prepared not to use your computer for 15 or so minutes after starting a full run of TPS, as it will open and close a fairly large number of Firefox windows. ...
...on the first run is very likely to fail, since it expects a clean start). Note: Be prepared not to use your computer for 15 or so minutes after starting a full run of TPS, as it will open and close a fairly large number of Firefox windows. ...
Redis Tips
ment, make sure you have played with redis for at least 5 or 10 minutes. If you have not, here is a fantastic on-line, interactive redis tutorial: http://try.redis.io/ For reference later on, you'll want the source of all things redis: https://redis.io You'll want to run a redis-server on your machine, and use the redis-cli at the command-line for hacking. Node.JS redis client: https://github.com/mranney/node_redis npm install redis Python redis client: https://github.com/andymccurdy/redis-py There are some gotchas with the Python API: https://github.com/andymccurdy/redis-py#api-reference SELECT statement not implemented DEL is 'delete' in python ZADD argument order is wrong SETEX argument order is wrong The default redis port is 6379. In node, create client with e...
...monly-used and/or rapidly-changing metadata in redis. Maybe the data doesn't belong in your redis memory at all? For example, if you have a job queueing system, you might want redis to manage the queues themselves, and store pointers for the job data which might be retrieved by workers from some different, disk-resident db. (This is, for instance, how TJ Holowaychuk's implemented kue: https://github.com/learnboost/kue.) Memory usage in redis is important to think about. The speed benefits of redis are lost when you overflow into disk memory. As a conservative calculation, I multiply all the bytes I think I might store and multiply by 10, which antirez once recommended as a worst-case factor for data structure overhead. Keyspace Design Here are some things I keep in mind when creat...
Handling Mozilla Security Bugs
up in general, and from the module owner's peers in particular. If anyone else in the security bug group has a problem with the module owner's decision, they can appeal to mozilla.org staff, who will make the final decision. The criteria for membership in the Mozilla security bug group are as follows: The applicant must be trusted by those already in the group. The applicant should have a legitimate purpose for wishing to join the group. The applicant must be able to add value to the group's activities in some way. In practice, if over time a particular person happens to be frequently added to the CC list for security-sensitive bugs, then they would be a good candidate to be invited to join the security bug group. (As described previously, once added to the security bug group, that p...
... voluntary guidelines below: Before making a security bug world-readable, please provide a few days notice to the Mozilla security bug group by sending an email to the private security bug group mailing list. Please try not to keep bugs in the security-sensitive category for an unreasonably long amount of time. Please try to be understanding and accommodating if a Mozilla distributor has a legitimate need to keep a bug in the security-sensitive category for some reasonable additional time period, e.g., to get a new release distributed to users. (Regarding this point, if all Mozilla distributors have a representative on the security bug group, then even if a bug remains in the security-sensitive category, all affected distributors can still be informed and take appropriate action.) The ...
A Web PKI x509 certificate primer
h a.example.com and b.example.com Basic constraints This allows certificates to be asserted as issuing certificates (it is mandatory for CA certificates). It can also be used to express the maximum depth of the trust path from the CA. Key usage This extension is used to constrain the purpose for the key in the certificate. More than one key usage can be asserted. Examples of key usages are: digitalSignature, keyEncipherment, dataEncipherment, keyCertSign, and cRLSign. For CA certificates the keyCertSign bit must be set. Extended key usages This is another bitfield to constrain the usages of the key of the certificate. Its is directed mostly at what type of application the certificate was issued for. Examples of extended key usages are: serverAuth, clientAuth, and OCSPSigning. For end-en...
... SSL certificate from one of the CAs who already have a root certificate included in the major browsers. Firefox uses a default set of X.509v3 root certificates for various Certification Authorities (CAs). The root certificates included by default have their "trust bits" set to indicate if the CA's root certificates may be used to verify certificates for SSL servers, S/MIME email users, and/or digitally-signed code objects without having to ask users for further permission or information. CAs apply to have their root certificates included by default in Mozilla products by following the Mozilla CA Certificate Policy and applying for inclusion as per CA:How_to_apply. Users may override the default root certificate settings using the Certificate Manager. Some organizations make use of the set...
NS_ConvertUTF16toUTF8
meters PRUint32 aInteger PRInt32 aRadix void AppendInt(PRInt64, PRInt32) - source Parameters PRInt64 aInteger PRInt32 aRadix AppendFloat void AppendFloat(float) - source Append the given float to this string Parameters float aFloat void AppendFloat(double) - source Parameters double aFloat BeginReading char* BeginReading() const - source reading iterators nsReadingIterator<char>& BeginReading(nsReadingIterator<char>&) const - source deprecated reading iterators Parameters nsReadingIterator<char>& iter char*& BeginReading(const char*&) const - source Parameters char*& iter EndReading char* EndReading() const - source nsReadingIterator<char>& EndReading(nsReadingIterator<char>&) const - source Parameters nsReadingIterator<char>& iter ch...
...BeginReading(const char*&) const - source Parameters char*& iter EndReading char* EndReading() const - source nsReadingIterator<char>& EndReading(nsReadingIterator<char>&) const - source Parameters nsReadingIterator<char>& iter char*& EndReading(const char*&) const - source Parameters char*& iter BeginWriting char* BeginWriting() - source writing iterators nsWritingIterator<char>& BeginWriting(nsWritingIterator<char>&) - source deprecated writing iterators Parameters nsWritingIterator<char>& iter char*& BeginWriting(char*&) - source Parameters char*& iter EndWriting char* EndWriting() - source nsWritingIterator<char>& EndWriting(nsWritingIterator<char>&) - source Parameters nsWritingIterator<char>& iter char*& EndWriting(char*&) - sour...
NS_LossyConvertUTF16toASCII
meters PRUint32 aInteger PRInt32 aRadix void AppendInt(PRInt64, PRInt32) - source Parameters PRInt64 aInteger PRInt32 aRadix AppendFloat void AppendFloat(float) - source Append the given float to this string Parameters float aFloat void AppendFloat(double) - source Parameters double aFloat BeginReading char* BeginReading() const - source reading iterators nsReadingIterator<char>& BeginReading(nsReadingIterator<char>&) const - source deprecated reading iterators Parameters nsReadingIterator<char>& iter char*& BeginReading(const char*&) const - source Parameters char*& iter EndReading char* EndReading() const - source nsReadingIterator<char>& EndReading(nsReadingIterator<char>&) const - source Parameters nsReadingIterator<char>& iter ch...
...BeginReading(const char*&) const - source Parameters char*& iter EndReading char* EndReading() const - source nsReadingIterator<char>& EndReading(nsReadingIterator<char>&) const - source Parameters nsReadingIterator<char>& iter char*& EndReading(const char*&) const - source Parameters char*& iter BeginWriting char* BeginWriting() - source writing iterators nsWritingIterator<char>& BeginWriting(nsWritingIterator<char>&) - source deprecated writing iterators Parameters nsWritingIterator<char>& iter char*& BeginWriting(char*&) - source Parameters char*& iter EndWriting char* EndWriting() - source nsWritingIterator<char>& EndWriting(nsWritingIterator<char>&) - source Parameters nsWritingIterator<char>& iter char*& EndWriting(char*&) - sour...
nsAdoptingCString
meters PRUint32 aInteger PRInt32 aRadix void AppendInt(PRInt64, PRInt32) - source Parameters PRInt64 aInteger PRInt32 aRadix AppendFloat void AppendFloat(float) - source Append the given float to this string Parameters float aFloat void AppendFloat(double) - source Parameters double aFloat BeginReading char* BeginReading() const - source reading iterators nsReadingIterator<char>& BeginReading(nsReadingIterator<char>&) const - source deprecated reading iterators Parameters nsReadingIterator<char>& iter char*& BeginReading(const char*&) const - source Parameters char*& iter EndReading char* EndReading() const - source nsReadingIterator<char>& EndReading(nsReadingIterator<char>&) const - source Parameters nsReadingIterator<char>& iter ch...
...BeginReading(const char*&) const - source Parameters char*& iter EndReading char* EndReading() const - source nsReadingIterator<char>& EndReading(nsReadingIterator<char>&) const - source Parameters nsReadingIterator<char>& iter char*& EndReading(const char*&) const - source Parameters char*& iter BeginWriting char* BeginWriting() - source writing iterators nsWritingIterator<char>& BeginWriting(nsWritingIterator<char>&) - source deprecated writing iterators Parameters nsWritingIterator<char>& iter char*& BeginWriting(char*&) - source Parameters char*& iter EndWriting char* EndWriting() - source nsWritingIterator<char>& EndWriting(nsWritingIterator<char>&) - source Parameters nsWritingIterator<char>& iter char*& EndWriting(char*&) - sour...
nsCAutoString
aRadix void AppendInt(PRInt64, PRInt32) - source Parameters PRInt64 aInteger PRInt32 aRadix AppendFloat void AppendFloat(float) - source Append the given float to this string Parameters float aFloat void AppendFloat(double) - source Parameters double aFloat BeginReading char* BeginReading() const - source reading iterators nsReadingIterator<char>& BeginReading(nsReadingIterator<char>&) const - source deprecated reading iterators Parameters nsReadingIterator<char>& iter char*& BeginReading(const char*&) const - source Parameters char*& iter EndReading char* EndReading() const - source nsReadingIterator<char>& EndReading(nsReadingIterator<char>&) const - source Parameters nsReadingIt...
...onst - source Parameters char*& iter EndReading char* EndReading() const - source nsReadingIterator<char>& EndReading(nsReadingIterator<char>&) const - source Parameters nsReadingIterator<char>& iter char*& EndReading(const char*&) const - source Parameters char*& iter BeginWriting char* BeginWriting() - source writing iterators nsWritingIterator<char>& BeginWriting(nsWritingIterator<char>&) - source deprecated writing iterators Parameters nsWritingIterator<char>& iter char*& BeginWriting(char*&) - source Parameters char*& iter EndWriting char* EndWriting() - source nsWritingIterator<char>& EndWriting(nsWritingIterator<char>&) - source Parameters nsWritingIterator<char>& iter char*&...
nsCString
meters PRUint32 aInteger PRInt32 aRadix void AppendInt(PRInt64, PRInt32) - source Parameters PRInt64 aInteger PRInt32 aRadix AppendFloat void AppendFloat(float) - source Append the given float to this string Parameters float aFloat void AppendFloat(double) - source Parameters double aFloat BeginReading char* BeginReading() const - source reading iterators nsReadingIterator<char>& BeginReading(nsReadingIterator<char>&) const - source deprecated reading iterators Parameters nsReadingIterator<char>& iter char*& BeginReading(const char*&) const - source Parameters char*& iter EndReading char* EndReading() const - source nsReadingIterator<char>& EndReading(nsReadingIterator<char>&) const - source Parameters nsReadingIterator<char>& iter ch...
...BeginReading(const char*&) const - source Parameters char*& iter EndReading char* EndReading() const - source nsReadingIterator<char>& EndReading(nsReadingIterator<char>&) const - source Parameters nsReadingIterator<char>& iter char*& EndReading(const char*&) const - source Parameters char*& iter BeginWriting char* BeginWriting() - source writing iterators nsWritingIterator<char>& BeginWriting(nsWritingIterator<char>&) - source deprecated writing iterators Parameters nsWritingIterator<char>& iter char*& BeginWriting(char*&) - source Parameters char*& iter EndWriting char* EndWriting() - source nsWritingIterator<char>& EndWriting(nsWritingIterator<char>&) - source Parameters nsWritingIterator<char>& iter char*& EndWriting(char*&) - sour...
nsDependentCString
meters PRUint32 aInteger PRInt32 aRadix void AppendInt(PRInt64, PRInt32) - source Parameters PRInt64 aInteger PRInt32 aRadix AppendFloat void AppendFloat(float) - source Append the given float to this string Parameters float aFloat void AppendFloat(double) - source Parameters double aFloat BeginReading char* BeginReading() const - source reading iterators nsReadingIterator<char>& BeginReading(nsReadingIterator<char>&) const - source deprecated reading iterators Parameters nsReadingIterator<char>& iter char*& BeginReading(const char*&) const - source Parameters char*& iter EndReading char* EndReading() const - source nsReadingIterator<char>& EndReading(nsReadingIterator<char>&) const - source Parameters nsReadingIterator<char>& iter ch...
...BeginReading(const char*&) const - source Parameters char*& iter EndReading char* EndReading() const - source nsReadingIterator<char>& EndReading(nsReadingIterator<char>&) const - source Parameters nsReadingIterator<char>& iter char*& EndReading(const char*&) const - source Parameters char*& iter BeginWriting char* BeginWriting() - source writing iterators nsWritingIterator<char>& BeginWriting(nsWritingIterator<char>&) - source deprecated writing iterators Parameters nsWritingIterator<char>& iter char*& BeginWriting(char*&) - source Parameters char*& iter EndWriting char* EndWriting() - source nsWritingIterator<char>& EndWriting(nsWritingIterator<char>&) - source Parameters nsWritingIterator<char>& iter char*& EndWriting(char*&) - sour...
nsFixedCString
meters PRUint32 aInteger PRInt32 aRadix void AppendInt(PRInt64, PRInt32) - source Parameters PRInt64 aInteger PRInt32 aRadix AppendFloat void AppendFloat(float) - source Append the given float to this string Parameters float aFloat void AppendFloat(double) - source Parameters double aFloat BeginReading char* BeginReading() const - source reading iterators nsReadingIterator<char>& BeginReading(nsReadingIterator<char>&) const - source deprecated reading iterators Parameters nsReadingIterator<char>& iter char*& BeginReading(const char*&) const - source Parameters char*& iter EndReading char* EndReading() const - source nsReadingIterator<char>& EndReading(nsReadingIterator<char>&) const - source Parameters nsReadingIterator<char>& iter ch...
...BeginReading(const char*&) const - source Parameters char*& iter EndReading char* EndReading() const - source nsReadingIterator<char>& EndReading(nsReadingIterator<char>&) const - source Parameters nsReadingIterator<char>& iter char*& EndReading(const char*&) const - source Parameters char*& iter BeginWriting char* BeginWriting() - source writing iterators nsWritingIterator<char>& BeginWriting(nsWritingIterator<char>&) - source deprecated writing iterators Parameters nsWritingIterator<char>& iter char*& BeginWriting(char*&) - source Parameters char*& iter EndWriting char* EndWriting() - source nsWritingIterator<char>& EndWriting(nsWritingIterator<char>&) - source Parameters nsWritingIterator<char>& iter char*& EndWriting(char*&) - sour...
nsPromiseFlatCString
meters PRUint32 aInteger PRInt32 aRadix void AppendInt(PRInt64, PRInt32) - source Parameters PRInt64 aInteger PRInt32 aRadix AppendFloat void AppendFloat(float) - source Append the given float to this string Parameters float aFloat void AppendFloat(double) - source Parameters double aFloat BeginReading char* BeginReading() const - source reading iterators nsReadingIterator<char>& BeginReading(nsReadingIterator<char>&) const - source deprecated reading iterators Parameters nsReadingIterator<char>& iter char*& BeginReading(const char*&) const - source Parameters char*& iter EndReading char* EndReading() const - source nsReadingIterator<char>& EndReading(nsReadingIterator<char>&) const - source Parameters nsReadingIterator<char>& iter ch...
...BeginReading(const char*&) const - source Parameters char*& iter EndReading char* EndReading() const - source nsReadingIterator<char>& EndReading(nsReadingIterator<char>&) const - source Parameters nsReadingIterator<char>& iter char*& EndReading(const char*&) const - source Parameters char*& iter BeginWriting char* BeginWriting() - source writing iterators nsWritingIterator<char>& BeginWriting(nsWritingIterator<char>&) - source deprecated writing iterators Parameters nsWritingIterator<char>& iter char*& BeginWriting(char*&) - source Parameters char*& iter EndWriting char* EndWriting() - source nsWritingIterator<char>& EndWriting(nsWritingIterator<char>&) - source Parameters nsWritingIterator<char>& iter char*& EndWriting(char*&) - sour...
nsXPIDLCString
meters PRUint32 aInteger PRInt32 aRadix void AppendInt(PRInt64, PRInt32) - source Parameters PRInt64 aInteger PRInt32 aRadix AppendFloat void AppendFloat(float) - source Append the given float to this string Parameters float aFloat void AppendFloat(double) - source Parameters double aFloat BeginReading char* BeginReading() const - source reading iterators nsReadingIterator<char>& BeginReading(nsReadingIterator<char>&) const - source deprecated reading iterators Parameters nsReadingIterator<char>& iter char*& BeginReading(const char*&) const - source Parameters char*& iter EndReading char* EndReading() const - source nsReadingIterator<char>& EndReading(nsReadingIterator<char>&) const - source Parameters nsReadingIterator<char>& iter ch...
...BeginReading(const char*&) const - source Parameters char*& iter EndReading char* EndReading() const - source nsReadingIterator<char>& EndReading(nsReadingIterator<char>&) const - source Parameters nsReadingIterator<char>& iter char*& EndReading(const char*&) const - source Parameters char*& iter BeginWriting char* BeginWriting() - source writing iterators nsWritingIterator<char>& BeginWriting(nsWritingIterator<char>&) - source deprecated writing iterators Parameters nsWritingIterator<char>& iter char*& BeginWriting(char*&) - source Parameters char*& iter EndWriting char* EndWriting() - source nsWritingIterator<char>& EndWriting(nsWritingIterator<char>&) - source Parameters nsWritingIterator<char>& iter char*& EndWriting(char*&) - sour...
nsICryptoHash
var s = Array.from(hash, (c, i) => toHexString(hash.charCodeAt(i))).join(""); // s now contains your hash in hex This gives 5eb63bbbe01eeed093cb22bb8f5acdc3 for the hash value. This example, while simple, shows most of the functionali...
...var s = Array.from(hash, (c, i) => toHexString(hash.charCodeAt(i))).join(""); // s now contains your hash in hex: should be // 5eb63bbbe01eeed093cb22bb8f5acdc3 See also Firefox 1.5 ...
Xptcall Porting Status
and TestXPC on my machine which runs kernel 2.2.7, glibc 2.1.1, and egcs 1.1.2. I have not tested it with older GNU compilers such as gcc 2.8.x. From looking at the Linux x86 code, I gather that the vtable layout is a little different for those compilers and the code will need minor modifications in order to work properly. I am not sure how much of the code can be used for OpenVMS Alpha and/or Digital UNIX. Currently the code is dependent on the g++ name mangling convention and a few GNU extensions so I'm not sure how useful it will be for the other systems. Hopefully the comments in the code are detailed enough to help people attempting a port. <font color="white">Done</font> SunOS x86 Arthur Jones <aljones@lbl.gov> <font color="red">?</font> Philip Pokorny <ppokorny@mindspring.com> Th...
...the interim maintainer until someone more suitable can be found. <font color="white">Done</font> BeOS x86 Duncan Wilcox <duncan@be.com> unix (yet another reuse of the Linux 86 code!) Duncan says this is all working. He did the code for old cfront style 'this' adjustment for others to use too! <font color="white">HELP!</font> BeOS PPC - - <font color="white">Done</font> Compaq Tru64 UNIX (Digital UNIX) Steve Streeter <streeter@zk3.dec.com> Code passes the tests and is checked in. <font color="black">Working</font> Neutrio x86 Jerry L. Kirk <Jerry.Kirk@Nexwarecorp.com> Patches for xptc*_unixish_x86.cpp checked in. Waiting for verification that this is really finished. <font color="black">Investigating</font> SCO UW7 and OSR5 J. Kean Johnston <jkj@sco.com> Evan Hunt <evanh@sco.com...
Using Objective-C from js-ctypes
nt messages; * thus Block instances need are creted using the core.wrapId() function. */ // Apple Docs :: Working with blocks - https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/WorkingwithBlocks/WorkingwithBlocks.html var _NSConcreteGlobalBlock = ctypes.open(ctypes.libraryName('objc')).declare('_NSConcreteGlobalBlock', ctypes.voidptr_t); // //github.com/RealityRipple/UXP/blob/master/js/src/ctypes/Library.cpp?offset=0#271 /** * The "block descriptor" is a static singleton struct. Probably used in more * complex Block scenarios involving actual closure variables needing storage * (in `NodObjC`, JavaScript closures are leveraged instead). */ // struct is seen here in docs: http://clang.llvm.org/docs/Block-ABI-Apple.html var Bloc...
...ck_literal_1', [ { isa: ctypes.voidptr_t }, { flags: ctypes.int32_t }, { reserved: ctypes.int32_t }, { invoke: ctypes.voidptr_t }, { descriptor: Block_descriptor_1.ptr } ]); var BLOCK_CONST = { BLOCK_HAS_COPY_DISPOSE: 1 << 25, BLOCK_HAS_CTOR: 1 << 26, BLOCK_IS_GLOBAL: 1 << 28, BLOCK_HAS_STRET: 1 << 29, BLOCK_HAS_SIGNATURE: 1 << 30 }; // based on work from here: https://github.com/trueinteractions/tint2/blob/f6ce18b16ada165b98b07869314dad1d7bee0252/modules/Bridge/core.js#L370-L394 var bl = Block_literal_1(); // Set the class of the instance bl.isa = _NSConcreteGlobalBlock; // Global flags bl.flags = BLOCK_CONST.BLOCK_HAS_STRET; bl.reserved = 0; bl.invoke = aFuncTypePtr; // create descriptor var desc = Block_descriptor_1(); desc.reserved = 0; desc.size =...
Working with ArrayBuffers
Type conversion page explains the fundamentals of this operation. The second code example provides a specific illustration of the operation. An ArrayBuffer is a simply byte array. The js-ctypes equivalent is a ctypes.uint8_t.array(###) (ctypes.unsigned_char are also ctypes.uint8_t). bug 732936 includes a discussion of working with an ArrayBuffer. This feature is based on the following work: //github.com/RealityRipple/UXP/blob/master/js/src/ctypes/CTypes.cpp#3080 //github.com/RealityRipple/UXP/blob/master/js/src/vm/ArrayBufferObject.cpp#1301 Example 1 - Image Data The following example illustrates how to transfer a byte array pointed by ctypes.uint8_t.ptr to ImageData of canvas. This example is based on the fact that the ImageData returned from CanvasRenderingContext2D.getImageData is a...
...B takes ~1400 ms, for an array length of 52,428,800 (which is image size of 1280 x 1024 pixels). Method 3: Transfer byte array by calling memcpy This is the recommended method, as it only takes a couple of milliseconds, even for large arrays. Notice that the following example does not cast the pixelBuffer. Passing an ArrayBuffer object to pointer type will pass the pointer to buffer (Based on //github.com/RealityRipple/UXP/blob/master/js/src/ctypes/CTypes.cpp#3080). Further, it returns dataPointer, and there is no extra allocation (Based on //github.com/RealityRipple/UXP/blob/master/js/src/vm/ArrayBufferObject.cpp#1301). var lib; switch (OS.Constants.Sys.Name.toLowerCase()) { case 'winnt': case 'winmo': case 'winnt': //windows lib = ctypes.open('msvcrt'); break;...
Deprecated tools - Firefox Developer Tools
nabled you to ensure that all the nodes are connected in the way you expect. It was possible to edit the AudioParam properties for each node in the graph. Some non-AudioParam properties, like an OscillatorNode's type property, were displayed and editable as well. It was deprecated due to lack of use. More details about the Web Audio Editor Alternatives Alternatives include AudioN and https://github.com/spite/WebAudioExtension web extensions. Shader editor Bugzilla issue: bug 1342237 Removed as of Firefox 67 Description The Shader Editor allowed users to examine and edit the source of the WebGL vertex and fragment shaders. It was deprecated due to low usage and maintenance costs. More details about the Shader Editor Alternatives An alternative to this panel is this extension: ht...
...m/spite/WebAudioExtension web extensions. Shader editor Bugzilla issue: bug 1342237 Removed as of Firefox 67 Description The Shader Editor allowed users to examine and edit the source of the WebGL vertex and fragment shaders. It was deprecated due to low usage and maintenance costs. More details about the Shader Editor Alternatives An alternative to this panel is this extension: https://github.com/spite/ShaderEditorExtension, or Spector.js also supports a Shader Editor that requires a library to use a shader reloader hook. Currently only the Babylon library does. ...
BasicCardResponse.expiryMonth - Web APIs
Example Let's look at a sample payment request: var request = new PaymentRequest(supportedInstruments, details, options); // Call show() to trigger the browser's payment flow. request.show().then(function(instrumentResponse) { // Do something with the response from the UI. ...
...illing address is a PaymentAddress object } } Specifications Specification Status Comment Basic Card PaymentThe definition of 'expiryMonth' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetexpiryMonthChrome No support NoEdge No support <=18 -- 79Firefox Full support ...
BasicCardResponse.expiryYear - Web APIs
Example Let's look at a sample payment request: var request = new PaymentRequest(supportedInstruments, details, options); // Call show() to trigger the browser's payment flow. request.show().then(function(instrumentResponse) { // Do something with the response from the UI. ...
...billing address is a PaymentAddress object } } Specifications Specification Status Comment Basic Card PaymentThe definition of 'expiryYear' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetexpiryYearChrome No support NoEdge No support <=18 -- 79Firefox Full support ...
ChildNode.after() - Web APIs
Web › API › ChildNode › after
e.log(parent.outerHTML); // "<div><p></p><span></span>Text</div>" ChildNode.after() is unscopable The after() method is not scoped into the with statement. See Symbol.unscopables for more information. ...
...n (arr) { arr.forEach(function (item) { if (item.hasOwnProperty('after')) { return; } Object.defineProperty(item, 'after', { configurable: true, enumerable: true, writable: true, value: function after() { var argArr = Array.prototype.slice.call(arguments), docFrag = document.createDocumentFragment(); argArr.forEach(function (argItem) { var isNode = argItem instanceof Node; docFrag.appendChild(isNode ? argItem : document.createTextNode(String(argItem))); }); this.parentNode.insertBefore(docFrag, this.nextSibling); } }); }); })([Element.prototype, CharacterData.prototype, DocumentType.prototype]); Another polyfill // from: https://github.com/FabioVergani/js-Polyfill_Element.
ChildNode.before() - Web APIs
Web › API › ChildNode › before
(parent.outerHTML); // "<div><span></span>Text<p></p></div>" ChildNode.before() is unscopable The before() method is not scoped into the with statement. See Symbol.unscopables for more information. ...
...arr) { arr.forEach(function (item) { if (item.hasOwnProperty('before')) { return; } Object.defineProperty(item, 'before', { configurable: true, enumerable: true, writable: true, value: function before() { var argArr = Array.prototype.slice.call(arguments), docFrag = document.createDocumentFragment(); argArr.forEach(function (argItem) { var isNode = argItem instanceof Node; docFrag.appendChild(isNode ? argItem : document.createTextNode(String(argItem))); }); this.parentNode.insertBefore(docFrag, this); } }); }); })([Element.prototype, CharacterData.prototype, DocumentType.prototype]); Specification Specification Status Comment DOMThe definition of 'C...
Element.computedStyleMap() - Web APIs
that is an alternative to CSSStyleDeclaration. Syntax var stylePropertyMapReadOnly = Element.computedStyleMap() Parameters None. Return value A StylePropertyMapReadOnly interface. Examples We start with some simple HTML: a paragraph with a link, and a definition list to which we will add all the CSS Property / Value pairs. ...
...>Link</a> </p> <dl id="regurgitation"></dl> We add a little bit of CSS a { --colour: red; color: var(--colour); } We add JavaScript to grab our link and return back a definition list of all the CSS property values using computedStyleMap(). ...
Event.composed - Web APIs
Web › API › Event › composed
hadow> element and then the <closed-shadow> element, you'll notice two things. The composed property returns true beause the click event is always able to propagate across shadow boundaries. You'll notice a difference in the value of composedPath for the two elements. ...
...ou'll notice a difference in the value of composedPath for the two elements. The <open-shadow> element's composed path is this: Array [ p, ShadowRoot, open-shadow, body, html, HTMLDocument https://mdn.github.io/web-components-examples/composed-composed-path/, Window ] Whereas the <closed-shadow> element's composed path is a follows: Array [ closed-shadow, body, html, HTMLDocument https://mdn.github.io/web-components-examples/composed-composed-path/, Window ] In the second case, the event listeners only propagate as far as the <closed-shadow> element itself, but not to the nodes inside the shadow boundary. Specifications Specification Status Comment DOMThe definition of 'composed' in that specification. Living Standard ...
Event.composedPath() - Web APIs
ement and then the <closed-shadow> element, you'll notice two things. First, the composed property returns true beause the click event is always able to propagate across shadow boundaries. Second, you'll notice a difference in the value of composedPath for the two elements. ...
... you'll notice a difference in the value of composedPath for the two elements. The <open-shadow> element's composed path is this: Array [ p, ShadowRoot, open-shadow, body, html, HTMLDocument https://mdn.github.io/web-components-examples/composed-composed-path/, Window ] Whereas the <closed-shadow> element's composed path is a follows: Array [ closed-shadow, body, html, HTMLDocument https://mdn.github.io/web-components-examples/composed-composed-path/, Window ] In the second case, the event listeners only propagate as far as the <closed-shadow> element itself, but not to the nodes inside the shadow boundary. Specifications Specification Status Comment DOMThe definition of 'composedPath()' in that specification. Living Standard ...
Guide to the Fullscreen API - Web APIs
ebkitRequestFullscreen() mozRequestFullScreen() msRequestFullscreen() Specifications Specification Status Comment Fullscreen API Living Standard Initial version. Browser compatibility Document.fullscreen The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetfullscreen DeprecatedChrome Full support 71 Full support 71 Full support ...
... No supportDeprecated. Not for use in new websites.Deprecated. Not for use in new websites.User must explicitly enable this feature.User must explicitly enable this feature.Uses a non-standard name.Uses a non-standard name. Document.fullscreenEnabled The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetfullscreenEnabledChrome Full support 45 Full support 45 Full support ...
GeolocationCoordinates - Web APIs
tionCoordinates interface represents the position and altitude of the device on Earth, as well as the accuracy with which these properties are calculated. Properties The GeolocationCoordinates interface doesn't inherit any properties. GeolocationCoordinates.latitude Read only Secure context Returns a double representing the position's latitude in decimal degrees. GeolocationCoordinates.longitude Read only Secure context Returns a double representing the position's longitude in decimal degrees. GeolocationCoordinates.altitude Read only Secure context Returns a double representing the position's altitude in meters, relative to sea level. This value can be null if the implementation cannot provide the data. GeolocationCoordinates.accuracy Read only Secure context Returns a double...
... GeolocationCoordinates.altitudeAccuracy Read only Secure context Returns a double representing the accuracy of the altitude expressed in meters. This value can be null. GeolocationCoordinates.heading Read only Secure context Returns a double representing the direction towards which the device is facing. ...
GestureEvent - Web APIs
stureEvent() Creates a GestureEvent object. Properties This interface also inherits properties of its parents, UIEvent and Event. GestureEvent.rotation Read only Change in rotation (in degrees) since the event's beginning. Positive values indicate clockwise rotation; negative values indicate anticlockwise rotation. Initial value: 0.0 GestureEvent.scale Read only Distance between two digits since the event's beginning. Expressed as a floating-point multiple of the initial distance between the digits at the beginning of the gesture. Values below 1.0 indicate an inward pinch (zoom out). Values above 1.0 indicate an outward unpinch (zoom in). Initial value: 1.0 Methods This interface also inherits methods of its parents, UIEvent and Event. GestureEvent.initGestureEvent() Initia...
... the event has already being dispatched, this method does nothing. Gesture event types gesturestart gesturechange gestureend Specifications Not part of any specification. Apple has a description at the Safari Developer Library. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetGestureEvent Non-standardChrome No support NoEdge No support NoFirefox No sup...
HTMLDetailsElement: toggle event - Web APIs
d to take away. </details> <details id="ch3"> <summary>Chapter III</summary> Boethius falls back upon his present sense of misery. Philosophy reminds him of the brilliancy of his former fortunes. ...
... Living Standard ...
HTMLImageElement.useMap - Web APIs
.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 guide to using image maps. Example The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLImageElement.useMap' in that specification. Living Standard Browser compatibility The compatibility ...
...eractive-examples and send us a pull request. Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLImageElement.useMap' in that specification. Living Standard Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetuseMapChrome Full support 1Edge Full support 12Firefox Full support ...
Checking when a deadline is due - Web APIs
aken from a Date object. The main example application we will be referring to in this article is To-do list notifications, a simple to-do list application that stores task titles and deadline times and dates via IndexedDB, and then provides users with notifications when deadline dates are reached, via the Notification, and Vibration APIs. You can download the To-do list notifications app from github and play around with the source code, or view the app running live. The basic problem In the to-do app, we wanted to first record time and date information in a format that is both machine readable and human understandable when displayed, and then check whether each time and date is occurring at the current moment. Basically, we want to check what the time and date is right now, and then che...
...ear of the deadline. Because these values are the most ambiguous for users to enter (7, sunday, sun? 04, 4, April, Apr? 2013, '13, 13?), I decided the best solution was to give them a choice to pick from, which also saves on annoying typing for mobile users. The days are recorded as numerical days of the month, the months are recorded as full month names, and the years are recorded as full four digit year numbers. When the form's submit button is pressed, we run the addData() function, which starts like this: function addData(e) { e.preventDefault(); if(title.value == '' || hours.value == null || minutes.value == null || day.value == '' || month.value == '' || year.value == null) { note.innerHTML += '<li>Data not submitted -- form incomplete.</li>'; return; } In this segme...
NonDocumentTypeChildNode.previousElementSibling - Web APIs
' + el.nodeName + '</li>'); el = el.previousElementSibling; } document.write('</ol>'); </script> This example outputs the following into the page when it loads: Siblings of div-03 1. LI 2. LI 3. DIV 4. ...
...s/blob/master/js/polyfills/IE8-child-elements.js if(!("previousElementSibling" in document.documentElement)){ Object.defineProperty(Element.prototype, "previousElementSibling", { get: function(){ var e = this.previousSibling; while(e && 1 !== e.nodeType) e = e.previousSibling; return e; } }); } Polyfill for Internet Explorer 9+ and Safari // Source: https://github.com/jserz/js_piece/blob/master/DOM/NonDocumentTypeChildNode/previousElementSibling/previousElementSibling.md (function (arr) { arr.forEach(function (item) { if (item.hasOwnProperty('previousElementSibling')) { return; } Object.defineProperty(item, 'previousElementSibling', { configurable: true, enumerable: true, get: function () { let el = this; ...
PannerNode - Web APIs
ts value can be altered using its value property. The default is value is 1. PannerNode.orientationY Represents the vertical position of the audio source's vector in a right-hand cartesian coordinate system. The default is 0. While this AudioParam cannot be directly changed, its value can be altered using its value property. The default is value is 0. PannerNode.orientationZ Represents the longitudinal (back and forth) position of the audio source's vector in a right-hand cartesian coordinate system. The default is 0. While this AudioParam cannot be directly changed, its value can be altered using its value property. The default is value is 0. PannerNode.panningModel An enumerated value determining which spatialisation algorithm to use to position the audio in 3D space. PannerNode.posi...
...be directly changed, its value can be altered using its value property. The default is value is 0. PannerNode.positionY Represents the vertical position of the audio in a right-hand cartesian coordinate system. The default is 0. While this AudioParam cannot be directly changed, its value can be altered using its value property. The default is value is 0. PannerNode.positionZ Represents the longitudinal (back and forth) position of the audio in a right-hand cartesian coordinate system. The default is 0. While this AudioParam cannot be directly changed, its value can be altered using its value property. The default is value is 0. PannerNode.refDistance A double value representing the reference distance for reducing volume as the audio source moves further from the listener. For distances ...
ParentNode.append() - Web APIs
Web › API › ParentNode › append
text", <p> ] ParentNode.append() is unscopable The append() method is not scoped into the with statement. See Symbol.unscopables for more information. ...
...arr) { arr.forEach(function (item) { if (item.hasOwnProperty('append')) { return; } Object.defineProperty(item, 'append', { configurable: true, enumerable: true, writable: true, value: function append() { var argArr = Array.prototype.slice.call(arguments), docFrag = document.createDocumentFragment(); argArr.forEach(function (argItem) { var isNode = argItem instanceof Node; docFrag.appendChild(isNode ? argItem : document.createTextNode(String(argItem))); }); this.appendChild(docFrag); } }); }); })([Element.prototype, Document.prototype, DocumentFragment.prototype]); Specification Specification Status Comment DOMThe definition of 'ParentNode.appen...
ParentNode.prepend() - Web APIs
); // NodeList [ #text "Some text", <p> ] ParentNode.prepend() is unscopable The prepend() method is not scoped into the with statement. See Symbol.unscopables for more information. ...
...) { arr.forEach(function (item) { if (item.hasOwnProperty('prepend')) { return; } Object.defineProperty(item, 'prepend', { configurable: true, enumerable: true, writable: true, value: function prepend() { var argArr = Array.prototype.slice.call(arguments), docFrag = document.createDocumentFragment(); argArr.forEach(function (argItem) { var isNode = argItem instanceof Node; docFrag.appendChild(isNode ? argItem : document.createTextNode(String(argItem))); }); this.insertBefore(docFrag, this.firstChild); } }); }); })([Element.prototype, Document.prototype, DocumentFragment.prototype]); Specification Specification Status Comment DOMThe definition of...
PaymentCurrencyAmount.value - Web APIs
An optional leading minus sign ("-") can be included to indicate a negative value, such as to represent a refund or discount. ...
... (".") as the decimal point, rather than the comma (","), even if the user's locale normally uses the comma. You must convert the entered text to this form or it will not be valid. Syntax value = paymentCurrencyAmount.value; Value A DOMString indicating the numeric value of the payment. This must be a valid decimal number, with an optional leading minus sign ("-"), then one or more decimal digits 0 through 9, optionally with a decimal point (".") with at least one digit following it to represent fractional units. There must not be any leading or trailing whitespace in the string. For uniformity and consistency, the value is always given using the period (".") as the decimal character, regardless of the user's locale. You need to convert the value to this format before submitting the pay...
PointerEvent - Web APIs
ointerdown event from a device that does not support hover (see pointerdown). This event type is similar to pointerover, but differs in that it does not bubble. pointerdown The event is fired when a pointer becomes active. For mouse, it is fired when the device transitions from no buttons depressed to at least one button depressed. For touch, it is fired when physical contact is made with the digitizer. For pen, it is fired when the stylus makes physical contact with the digitizer. pointermove This event is fired when a pointer changes coordinates. pointerrawupdate This event is fired when any of a pointer's properties change. pointerup This event is fired when a pointer is no longer active. pointercancel A browser fires this event if it concludes the pointer will no longer be abl...
...nerate events (for example the related device is deactived). pointerout This event is fired for several reasons including: pointing device is moved out of the hit test boundaries of an element; firing the pointerup event for a device that does not support hover (see pointerup); after firing the pointercancel event (see pointercancel); when a pen stylus leaves the hover range detectable by the digitizer. pointerleave This event is fired when a pointing device is moved out of the hit test boundaries of an element. For pen devices, this event is fired when the stylus leaves the hover range detectable by the digitizer. gotpointercapture This event is fired when an element receives pointer capture. lostpointercapture This event is fired after pointer capture is released for a pointer. Gl...
Using Pointer Events - Web APIs
one in the touch events overview, except it uses the pointer events input event model. Another difference is that because pointer events are pointer device agnostic, the application accepts coordinate-based inputs from a mouse, a pen, or a fingertip using the same code. This application will only work on a browser that supports pointer events. A live version of this application is available on GitHub. The source code is available on Github and pull requests and bug reports are welcome. Definitions Surface A touch-sensitive surface. This may be a trackpad, a touch screen, or even a virtual mapping of a user's desk surface (or mousepad) with the physical screen. Touch point A point of contact with the surface. This may be a finger (or elbow, ear, nose, whatever, but typically a fin...
...rTouch() function is used to pick a color based on the touch's unique identifier. This identifier is an opaque number, but we can at least rely on it differing between the currently-active touches. function colorForTouch(touch) { var r = touch.pointerId % 16; var g = Math.floor(touch.pointerId / 3) % 16; var b = Math.floor(touch.pointerId / 7) % 16; r = r.toString(16); // make it a hex digit g = g.toString(16); // make it a hex digit b = b.toString(16); // make it a hex digit var color = "#" + r + g + b; log("color for touch with identifier " + touch.pointerId + " = " + color); return color; } The result from this function is a string that can be used when calling <canvas> functions to set drawing colors. For example, for a PointerEvent.pointerId value of 10, the resultin...
Pointer events - Web APIs
input: pressure, contact geometry, tilt, etc. In fact, the PointerEvent interface inherits all of the MouseEvent properties, thus facilitating the migration of content from mouse events to pointer events. Terminology active buttons state The condition when a pointer has a non-zero value for the buttons property. For example, in the case of a pen, when the pen has physical contact with the digitizer, or at least one button is depressed while hovering. active pointer Any pointer input device that can produce events. A pointer is considered active if it can still produce further events. For example, a pen that is a down state is considered active because it can produce additional events when the pen is lifted or moved. digitizer A sensing device with a surface that can detect contact. ...
...te events (for example the related device is deactived). pointerout onpointerout Fired for several reasons including: pointer is moved out of the hit test boundaries of an element; firing the pointerup event for a device that does not support hover (see pointerup); after firing the pointercancel event (see pointercancel); when a pen stylus leaves the hover range detectable by the digitizer. pointerleave onpointerleave Fired when a pointer is moved out of the hit test boundaries of an element. For pen devices, this event is fired when the stylus leaves the hover range detectable by the digitizer. gotpointercapture ongotpointercapture Fired when an element receives pointer capture. lostpointercapture onlostpointercapture Fired after po...
PushSubscription.options - Web APIs
g the following values: userVisibleOnly: A boolean, indicating that the returned push subscription will only be used for messages whose effect is made visible to the user. applicationServerKey: A public key your push server will use to send messages to client apps via a push server. ...
...ptic curve digital signature (ECDSA), over the P-256 curve. Specifications Specification Status Comment Push APIThe definition of 'options' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetoptionsChrome Full support 42Edge Full support 16Firefox Full support ...
StylePropertyMapReadOnly.get() - Web APIs
opertyMapReadOnly.get(property) Parameters property The name of the property to retrieve the value of. Return value A CSSStyleValue object. Examples Let's get just a few properties and values. Let's start by creating a link inside a paragraph in our HTML, and adding a definition list which we will populate with JavaScript: <p> <a href="https://example.com">Link</a> </p> <dl id="regurgitation"></dl> We add a bit of CSS, including a custom property and an inhertable property: p { font-weight: bold; } a { --colour: red; color: var(--colour); } We use the Element's computedStyleMap() to return a StylePropertyMapReadOnly object. We create an array of properties of interest and use the StylePropertyMapReadOnly's get() method to get only those values. // get the element con...
...lour: red; color: var(--colour); } We use the Element's computedStyleMap() to return a StylePropertyMapReadOnly object. We create an array of properties of interest and use the StylePropertyMapReadOnly's get() method to get only those values. ...
SubtleCrypto.deriveBits() - Web APIs
ryptoKey.usages value of that key doesn't contain deriveKey. NotSupported Raised when trying to use an algorithm that is either unknown or isn't suitable for derivation, or if the algorithm requested for the derived key doesn't define a key length. Supported algorithms See the Supported algorithms section of the deriveKey() documentation. Examples Note: You can try the working examples on GitHub. ECDH In this example Alice and Bob each generate an ECDH key pair. We then use Alice's private key and Bob's public key to derive a shared secret. See the complete code on GitHub. async function deriveSharedSecret(privateKey, publicKey) { const sharedSecret = await window.crypto.subtle.deriveBits( { name: "ECDH", namedCurve: "P-384", public: publicKey }, p...
...er("click", () => { // Alice then generates a secret using her private key and Bob's public key. // Bob could generate the same secret using his private key and Alice's public key. deriveSharedSecret(alicesKeyPair.privateKey, bobsKeyPair.publicKey); }); }); PBKDF2 In this example we ask the user for a password, then use it to derive some bits using PBKDF2. See the complete code on GitHub. let salt; /* Get some key material to use as input to the deriveBits method. The key material is a password supplied by the user. */ function getKeyMaterial() { const password = window.prompt("Enter your password"); const enc = new TextEncoder(); return window.crypto.subtle.importKey( "raw", enc.encode(password), {name: "PBKDF2"}, false, ["deriveBits", "deriveKey"]...
SubtleCrypto.deriveKey() - Web APIs
pplying a function such as HMAC to the input password along with some salt, and repeating this process many times. The more times the process is repeated, the more computationally expensive key derivation is: this makes it harder for an attacker to use brute-force to discover the key using a dictionary attack. PBKDF2 is specified in RFC 2898. Examples Note: You can try the working examples on GitHub. ECDH In this example Alice and Bob each generate an ECDH key pair, then exchange public keys. They then use deriveKey() to derive a shared AES key, that they could use to encrypt messages. See the complete code on GitHub. /* Derive an AES key, given: - our ECDH private key - their ECDH public key */ function deriveSecretKey(privateKey, publicKey) { return window.crypto.subtle.deriveKey(...
...esSecretKey); }); // Bob can use his copy to decrypt the message. let decryptButton = document.querySelector(".ecdh .decrypt-button"); decryptButton.addEventListener("click", () => { decrypt(bobsSecretKey); }); } PBKDF2 In this example we ask the user for a password, then use it to derive an AES key using PBKDF2, then use the AES key to encrypt a message. See the complete code on GitHub. /* Get some key material to use as input to the deriveKey method. The key material is a password supplied by the user. */ function getKeyMaterial() { let password = window.prompt("Enter your password"); let enc = new TextEncoder(); return window.crypto.subtle.importKey( "raw", enc.encode(password), "PBKDF2", false, ["deriveBits", "deriveKey"] ); } async function ...
TextEncoder - Web APIs
Example const encoder = new TextEncoder() const view = encoder.encode('EUR') console.log(view); // Uint8Array(3) [226, 130, 172] Constructor TextEncoder() Returns a newly constructed TextEncoder that will generate a byte stream with UTF-8 encoding. Properties The TextEncoder interface doesn't inherit any property. TextEncoder.prototype.encodingRead only Always returns "utf-8". ...
... Living Standard Initial definition. ...
A simple RTCDataChannel sample - Web APIs
ngth=120 disabled> </label> <button id="sendButton" name="sendButton" class="buttonright" disabled> Send </button> </div> Finally, there's the little box into which we'll insert the messages. This <div> block will be the second peer. <div class="messagebox" id="receivebox"> <p>Messages received:</p> </div> The JavaScript code While you can just look at the code itself on GitHub, below we'll review the parts of the code that do the heavy lifting. The WebRTC API makes heavy use of Promises. They make it very easy to chain the steps of the connection process together; if you haven't already read up on this functionality of ECMAScript 2015, you should read up on them. Similarly, this example uses arrow functions to simplify syntax. Starting up When the script is run, ...
... ...
Improving compatibility using WebRTC adapter.js - Web APIs
While the WebRTC specification is relatively stable, not all browsers have fully implemented all of its features. In addition, some browsers still have prefixes on some or all WebRTC APIs. While you can manually code around these issues, there is an easier way. The WebRTC organization provides on GitHub the WebRTC adapter to work around compatibility issues in different browsers' WebRTC implementations. The adapter is a JavaScript shim which lets your code to be written to the specification so that it will "just work" in all browsers with WebRTC support. There's no need to conditionally use prefixed APIs or implement other workarounds. Note: Since there is ongoing fluidity in functionality and naming of API terms in WebRTC and supporting browsers, use of this adapter is generally recommend...
...if it's not present. These are just a couple of examples; there are of course other adjustments made for you by the shim. The WebRTC adapter currently supports Mozilla Firefox, Google Chrome, Apple Safari, and Microsoft Edge. Using adapter.js In order to use adapter.js, you need to include adapter.js on any page that uses WebRTC APIs: Download a copy of the latest version of adapter.js from GitHub. Place it in your site's directory structure (such as in your scripts directory). Include adapter.js in your project: <script src="adapter.js"></script> Write your code, using WebRTC APIs per the specification, knowing that your code should work on all browsers. Keep in mind that even a good shim like this one doesn't mean you don't need to test your code on different browsers (and ideally...
Advanced techniques: Creating and sequencing audio - Web APIs
ng to be looking at a very simple step sequencer: In practice this is easier to do with a library -- the Web Audio API was built to be built upon. If you are about to embark on building something more complex, tone.js would be a good place to start. However, we want to demonstrate how to build such a demo from first principles, as a learning exercise. Note: You can find the source code on GitHub as step-sequencer; see the step-sequencer running live also. The interface consists of master controls, which allow us to play/stop the sequencer, and adjust the BPM (beats per minute) to speed up or slow down the "music". There are four different sounds, or voices, which can be played. Each voice has four buttons, which represent four beats in one bar of music. When they are enabled the no...
...er) { const sampleSource = audioContext.createBufferSource(); sampleSource.buffer = audioBuffer; sampleSource.playbackRate.setValueAtTime(playbackRate, audioCtx.currentTime); sampleSource.connect(audioContext.destination) sampleSource.start(); return sampleSource; } Note: The sound file was sourced from soundbible.com. Playing the audio in time A common problem with digital audio applications is getting the sounds to play in time so that the beat remains consistent, and things do not slip out of time. AudioContext object instances have a currentTime property, which allows us to retrieve the number of seconds after we first created the context. This is what we shall use for timing within our step sequencer -- It's extremely accurate, returning a float value accura...
Web Audio API - Web APIs
ever, it can also be used to create advanced interactive instruments. With that in mind, it is suitable for both developers and musicians alike. We have a simple introductory tutorial for those that are familiar with programming but need a good introduction to some of the terms and structure of the API. There's also a Basic Concepts Behind Web Audio API article, to help you understand the way digital audio works, specifically in the realm of the API. This also includes a good introduction to some of the concepts the API is built upon. Learning coding is like playing cards -- you learn the rules, then you play, then you go back and learn the rules again, then you play again. So if some of the theory doesn't quite fit after the first tutorial and article, there's an advanced tutorial which e...
... Specifications Specification Status Comment Web Audio API Working Draft ...
Using the Web Speech API - Web APIs
nition engine. Your audio is sent to a web service for recognition processing, so it won't work offline. Demo To show simple usage of Web speech recognition, we've written a demo called Speech color changer. When the screen is tapped/clicked, you can say an HTML color keyword, and the app's background color will change to that color. 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. Browser support Support for Web Speech API speech recognition is curently limited to Chrome for Desktop and Android -- Chrome has supported it since around version 33 but with prefixed interfaces, so you need to include prefixed versions o...
...ailable. Demo To show simple usage of Web speech synthesis, we've provided a demo called Speak easy synthesis. This includes a set of form controls for entering text to be synthesised, and setting the pitch, rate, and voice to use when the text is uttered. After you have entered your text, you can press Enter/Return to hear it spoken. 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. Browser support Support for Web Speech API speech synthesis is still getting there across mainstream browsers, and is currently limited to the following: Firefox desktop and mobile support it in Gecko 42+ (Windows)/44+...
WindowOrWorkerGlobalScope.setInterval() - Web APIs
timer events. One approach to solving this problem is to store information about the state of a timer in an object. Following is a minimal example of such an abstraction. The constructor architecture explicitly avoids the use of closures. It also offers an alternative way to pass the this object to the callback function (see The "this" problem for details). The following code is also available on GitHub. For a more complex but still modular version of it (Daemon) see JavaScript Daemons Management. This more complex version is nothing but a big and scalable collection of methods for the Daemon constructor. However, the Daemon constructor itself is nothing but a clone of MiniDaemon with an added support for init and onstart functions declarable during the instantiation of the daemon. So the Mi...
...arable during the instantiation of the daemon. So the MiniDaemon framework remains the recommended way for simple animations, because Daemon without its collection of methods is essentially a clone of it. minidaemon.js /*\ |*| |*| :: MiniDaemon :: |*| |*| Revision #2 - September 26, 2014 |*| |*| /docs/Web/API/Window.setInterval |*| https://developer.mozilla.org/User:fusionchess |*| https://github.com/madmurphy/minidaemon.js |*| |*| This framework is released under the GNU Lesser General Public License, version 3 or later. |*| http://www.gnu.org/licenses/lgpl-3.0.html |*| \*/ function MiniDaemon (oOwner, fTask, nRate, nLen) { if (!(this && this instanceof MiniDaemon)) { return; } if (arguments.length < 2) { throw new TypeError('MiniDaemon - not enough arguments'); } if (oOwner)...
Web Accessibility: Understanding Colors and Luminance - Accessibility
B color space in measuring color output, most calculations in this document are presumed to be in the RGB color space, and very specifically, in the sRGB color space. The sRGB color space The MDN document, <color> notes "The CSS data type represents a color in the sRGB color space." Color has many ways of being defined, including RGB, RGB decimal, RGB percent, HSL, CMYK among others. For digital concerns, much of the technology has historically resided in the RGB color space. This is because the companies behind the evolution of digital technology set the standards, and these standards still retain a powerful presence today. This is evolving, and new methods for measuring color involve measurements using other color spaces, but color measurements in the RGB color space still predomin...
...ithin one color space, such as the RGB color space. For example, variations of the RGB color space include RGB, sRGB, Adobe RGB, Adobe Wide Gamut RGB, and RGBA, among others And, one color within the same color space may be expressed in different ways. Looking at how the RGB color space is used to describe a color "red", you can see that the same color may be expressed in a shorthand, three-digit hex number that converts to a rgb value, as a full six-digit hex number that also converts to the same rgb value, or as a rgba value, expressed in percentages. em { color: #f00; } /* #rgb */ em { color: #ff0000; } /* #rrggbb */ em { color: #ff0000ff; } /* #rrggbbaa */ em { color: rgb(255, 0, 0); } em { color: rgb(100%, 0%, 0%); } em { color: rgb(255, 0, 0, 1); } em...
Operable - Accessibility
eadings and paragraphs. Note: Also see the WCAG description for Guideline 2.4 Navigable: Provide ways to help users navigate, find content, and determine where they are. Guideline 2.5 Input Modalities: Make it easier for users to operate functionality through various inputs beyond keyboard. The conformance criteria under this guideline ensures that users are able to interact with digital technology using different input methods beyond a keyboard or mouse (including touchscreen, voice, device motion, or alternative input devices. Success criteria How to conform to the criteria Practical resource 2.5.1 Pointer Gestures (A) added in 2.1 All functionality that can be operated with a pointer can be operated with single-point actions. Path-based or mu...
... exist. Understanding Motion Actuation 2.5.5 Target Size (AAA) added in 2.1 The size of an actionable item's touch target must be at least 44 CSS pixels in both width and height. Exceptions exist. Understanding Target Size 2.5.6 Concurrent Input Mechanisms (AAA) added in 2.1 Make sure people can use and switch between different modes of input when interacting with digital content including touchscreen, keyboard, mouse, voice commands, or alternative input devices. An essential exception exists. Understanding Concurrent Input Mechanism Note: Also see the WCAG description for Guideline 2.5: Input Modalities: Make it easier for users to operate functionality through various inputs beyond keyboard. See Also WCAG Perceivable Operable ...
:placeholder-shown - CSS: Cascading Style Sheets
code fields with a custom style. ...
... Working Draft Initia...
@media - CSS: Cascading Style Sheets
Web › CSS › @media
ions Specification Comment Feedback Media Queries Level 5The definition of '@media descriptors' in that specification. Reinstates light-level, inverted-colors and Custom Media Queries, which were removed from Level 4. Adds prefers-reduced-motion, prefers-reduced-transparency, prefers-contrast, and prefers-color-scheme media features. CSS Working Group drafts GitHub issues CSS Conditional Rules Module Level 3The definition of '@media' in that specification. Defines the basic syntax of the @media rule. CSS Working Group drafts GitHub issues Media Queries Level 4The definition of '@media' in that specification. Adds scripting, pointer, hover, update, overflow-block, and overflow-inline media features. Deprecates all medi...
... CSS Level 2 (Revision 1)The definition of '@media' in that specification. ...
align-content - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...ign-content property sets the distribution of space between and around content items along a flexbox's cross-axis or a grid's block axis. The interactive example below use Grid Layout to demonstrate some of the values of this property. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. This property has no effect on single line flex containers (i.e. ones with flex-wrap: nowrap). Syntax /* Basic positional alignment */ /* align-content does not take left and right values */ align-content: center; /* Pack items around the center */ align-content: start; /* Pack items from the start */ align-content: end; ...
align-self - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The property doesn't apply to block-level boxes, or to table cells. If a flexbox item's cross-axis margin is auto, then align-self is ignored. ...
... The align-self CSS property overrides a grid or flex item's align-items value. In Grid, it aligns the item inside the grid area. In Flexbox, it aligns the item on the cross axis. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The property doesn't apply to block-level boxes, or to table cells. If a flexbox item's cross-axis margin is auto, then align-self is ignored. Syntax /* Keyword values */ align-self: auto; align-self: normal; /* Positional alignment */ /* align-self does not take left and right values */ align-self: center; /* Put the item around the center */ align-self: start; /* Put the item at the star...
<angle> - CSS: Cascading Style Sheets
Web › CSS › angle
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax The <angle> data type consists of a <number> followed by one of the units listed below. ...
... The <angle> CSS data type represents an angle value expressed in degrees, gradians, radians, or turns. It is used, for example, in <gradient>s and in some transform functions. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax The <angle> data type consists of a <number> followed by one of the units listed below. As with all dimensions, there is no space between the unit literal and the number. The angle unit is optional after the number 0. Optionally, it may be preceded by a single + or - sign. Positive numbers represent clockwise angles, while negative numbers represent counterclockwise angles. For static p...
animation-delay - CSS: Cascading Style Sheets
The animation-delay CSS property specifies the amount of time to wait from applying the animation to an element before beginning to perform the animation. The animation can start later, immediately from its beginning, or immediately and partway through the animation. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. It is often convenient to use the shorthand property animation to set all animation properties at once. Syntax /* Single animation */ animation-delay: 3s; animation-delay: 0s; animation-delay: -1500ms; /* Multiple animations */ animation-delay: 2.1s, 480ms; Values <time> The time offset, from the...
... Examples See CSS animations for examples. Specifications Specification Status Comment CSS AnimationsThe definition of 'animation-delay' in that specification. Working Draft Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetanimation-delayChrome Full support 43 Full support 43 Full support ...
animation-duration - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. It is often convenient to use the shorthand property animation to set all animation properties at once. ...
... It is often convenient to use the shorthand property animation to set all animation properties at once. ...
animation-fill-mode - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. It is often convenient to use the shorthand property animation to set all animation properties at once. ...
... It is often convenient to use the shorthand property animation to set all animation properties at once. ...
animation-name - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. It is often convenient to use the shorthand property animation to set all animation properties at once. ...
... It is often convenient to use the shorthand property animation to set all animation properties at once. ...
animation-timing-function - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. It is often convenient to use the shorthand property animation to set all animation properties at once. ...
... It is often convenient to use the shorthand property animation to set all animation properties at once. ...
background-attachment - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The background-attachment CSS property sets whether a background image's position is fixed within the viewport, or scrolls with its containing block. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Keyword values */ background-attachment: scroll; background-attachment: fixed; background-attachment: local; /* Global values */ background-attachment: inherit; background-attachment: initial; background-attachment: unset; The background-attachment property is specified as one of the keyword values from the list below. Values fixed The background is fixed relative to the viewport. Even if an element ha...
background-clip - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The background-clip CSS property sets whether an element's background extends underneath its border box, padding box, or content box. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. If the element has no background-image or background-color, this property will only have a visual effect when the border has transparent regions or partially opaque regions (due to border-style or border-image); otherwise, the border masks the difference. Note: Because the root element has a different background painting area, the background-clip property has no effect when specified on it. See "The backgrounds of special elements." ...
background-origin - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Note that background-origin is ignored when background-attachment is fixed. ...
... Note that background-origin is ignored when background-attachment is fixed. ...
background-repeat - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The background-repeat CSS property sets how background images are repeated. A background image can be repeated along the horizontal and vertical axes, or not repeated at all. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. By default, the repeated images are clipped to the size of the element, but they can be scaled to fit (using round) or evenly distributed from end to end (using space). Syntax /* Keyword values */ background-repeat: repeat-x; background-repeat: repeat-y; background-repeat: repeat; background-repeat: space; background-repeat: round; background-repeat: no-repeat; /* Two-value syntax: horizontal ...
background - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The background shorthand CSS property sets all background style properties at once, such as color, image, origin and size, or repeat method. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Constituent properties This property is a shorthand for the following CSS properties: background-attachment background-clip background-color background-image background-origin background-position background-repeat background-size Syntax /* Using a <background-color> */ background: green; /* Using a <bg-image> and <repeat-style> */ background: url("test.jpg") repeat-y; /* Using a <box> and <background-color> */ bac...
block-size - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The block-size CSS property defines the horizontal or vertical size of an element's block, depending on its writing mode. It corresponds to either the width or the height property, depending on the value of writing-mode. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <length> values */ block-size: 300px; block-size: 25em; /* <percentage> values */ block-size: 75%; /* Keyword values */ block-size: max-content; block-size: min-content; block-size: fit-content(20em); block-size: auto; /* Global values */ block-size: inherit; block-size: initial; block-size: unset; If the writing mode is vertically or...
border-block-end - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The border-block-end CSS property is a shorthand property for setting the individual logical block-end border property values in a single place in the style sheet. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Constituent properties This property is a shorthand for the following CSS properties: border-block-end-color border-block-end-style border-block-end-width Syntax border-block-end: 1px; border-block-end: 2px dotted; border-block-end: medium dashed blue; border-block-end can be used to set the values for one or more of border-block-end-width, border-block-end-style, and border-block-en...
border-block-start - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The border-block-start CSS property is a shorthand property for setting the individual logical block-start border property values in a single place in the style sheet. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Constituent properties This property is a shorthand for the following CSS properties: border-block-start-color border-block-start-style border-block-start-width Syntax border-block-start: 1px; border-block-start: 2px dotted; border-block-start: medium dashed blue; border-block-start can be used to set the values for one or more of border-block-start-width, border-block-start-styl...
border-bottom-color - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The border-bottom-color CSS property sets the color of an element's bottom border. It can also be set with the shorthand CSS properties border-color or border-bottom. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <color> values */ border-bottom-color: red; border-bottom-color: #ffbb00; border-bottom-color: rgb(255, 0, 0); border-bottom-color: hsla(100%, 50%, 25%, 0.75); border-bottom-color: currentcolor; border-bottom-color: transparent; /* Global values */ border-bottom-color: inherit; border-bottom-color: initial; border-bottom-color: unset; The border-bottom-color property is specified as a singl...
border-bottom-left-radius - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The border-bottom-left-radius CSS property rounds the bottom-left corner of an element by specifying the radius (or the radius of the semi-major and semi-minor axes) of the ellipse defining the curvature of the corner. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The rounding can be a circle or an ellipse, or if one of the value is 0 no rounding is done and the corner is square. A background, being an image or a color, is clipped at the border, even a rounded one; the exact location of the clipping is defined by the value of the background-clip property. Note: If the value of this property is not set in a bo...
border-bottom-right-radius - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The border-bottom-right-radius CSS property rounds the top-left corner of an element by specifying the radius (or the radius of the semi-major and semi-minor axes) of the ellipse defining the curvature of the corner. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The rounding can be a circle or an ellipse, or if one of the value is 0 no rounding is done and the corner is square. A background, being an image or a color, is clipped at the border, even a rounded one; the exact location of the clipping is defined by the value of the background-clip property. Note: If the value of this property is not set in a bord...
border-bottom-style - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Note: The specification doesn't define how borders of different styles connect in the corners. ...
... Note: The specification doesn't define how borders of different styles connect in the corners. ...
border-bottom - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. As with all shorthand properties, border-bottom always sets the values of all of the properties that it can set, even if they are not specified. ...
... The border-bottom shorthand CSS property sets an element's bottom border. It sets the values of border-bottom-width, border-bottom-style and border-bottom-color. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. As with all shorthand properties, border-bottom always sets the values of all of the properties that it can set, even if they are not specified. It sets those that are not specified to their default values. This means that ... border-bottom-style: dotted; border-bottom: thick green; ... is actually the same as ... border-bottom-style: dotted; border-bottom: none thick green; ... and the value of border-...
border-image-repeat - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The border-image-repeat CSS property defines how the edge regions of a source image are adjusted to fit the dimensions of an element's border image. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Keyword value */ border-image-repeat: stretch; border-image-repeat: repeat; border-image-repeat: round; border-image-repeat: space; /* vertical | horizontal */ border-image-repeat: round stretch; /* Global values */ border-image-repeat: inherit; border-image-repeat: initial; border-image-repeat: unset; The border-image-repeat property may be specified using one or two values chosen from the list of values b...
border-image-slice - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The slicing process creates nine regions in total: four corners, four edges, and a middle region. ...
... The border-image-slice CSS property divides the image specified by border-image-source into regions. These regions form the components of an element's border image. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The slicing process creates nine regions in total: four corners, four edges, and a middle region. Four slice lines, set a given distance from their respective sides, control the size of the regions. The above diagram illustrates the location of each region. Zones 1-4 are corner regions. Each one is used a single time to form the corners of the final border image. Zones 5-8 are edge regions. These ar...
border-inline-end - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The border-inline-end CSS property is a shorthand property for setting the individual logical inline-end border property values in a single place in the style sheet. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Constituent properties This property is a shorthand for the following CSS properties: border-inline-end-color border-inline-end-style border-inline-end-width Syntax border-inline-end: 1px; border-inline-end: 2px dashed; border-inline-end: medium dashed blue; The physical border to which border-inline-end maps depends on the element's writing mode, directionality, and text orientation. It corres...
border-inline-start - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The border-inline-start CSS property is a shorthand property for setting the individual logical inline-start border property values in a single place in the style sheet. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Constituent properties This property is a shorthand for the following CSS properties: border-inline-start-color border-inline-start-style border-inline-start-width Syntax border-inline-start: 1px; border-inline-start: 2px dotted; border-inline-start: medium dashed green; The physical border to which border-inline-start maps depends on the element's writing mode, directionality, and text ori...
border-left-color - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The border-left-color CSS property sets the color of an element's left border. It can also be set with the shorthand CSS properties border-color or border-left. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <color> values */ border-left-color: red; border-left-color: #ffbb00; border-left-color: rgb(255, 0, 0); border-left-color: hsla(100%, 50%, 25%, 0.75); border-left-color: currentcolor; border-left-color: transparent; /* Global values */ border-left-color: inherit; border-left-color: initial; border-left-color: unset; The border-left-color property is specified as a single value. Values <color...
border-left-width - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The border-left-width CSS property sets the width of the left border of an element. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Keyword values */ border-left-width: thin; border-left-width: medium; border-left-width: thick; /* <length> values */ border-left-width: 10em; border-left-width: 3vmax; border-left-width: 6px; /* Global keywords */ border-left-width: inherit; border-left-width: initial; border-left-width: unset; Values <line-width> Defines the width of the border, either as an explicit nonnegative <length> or a keyword. If it's a keyword, it must be one of the following values: ...
border-left - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. As with all shorthand properties, border-left always sets the values of all of the properties that it can set, even if they are not specified. It sets those that are not specified to their default values. This means that ... border-left-style: dotted; border-left: thick green; ... is actually the same as ... border-left-style: dotted; border-left: none thick green; ... ...
...el 2 (Revision 1)The definition of 'border-left' in that specification. Recommendation No significant changes. CSS Level 1The definition of 'border-left' in that specification. Recommendation Initial definition Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetborder-leftChrome Full support 1Edge Full support 12Firefox Full support ...
border-radius - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The border-radius CSS property rounds the corners of an element's outer border edge. You can set a single radius to make circular corners, or two radii to make elliptical corners. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The radius applies to the whole background, even if the element has no border; the exact position of the clipping is defined by the background-clip property. The border-radius property does not apply to table elements when border-collapse is collapse. Note: As with any shorthand property, individual sub-properties cannot inherit, such as in border-radius:0 0 inherit inherit, which would pa...
border-right-color - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The border-right-color CSS property sets the color of an element's right border. It can also be set with the shorthand CSS properties border-color or border-right. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <color> values */ border-right-color: red; border-right-color: #ffbb00; border-right-color: rgb(255, 0, 0); border-right-color: hsla(100%, 50%, 25%, 0.75); border-right-color: currentcolor; border-right-color: transparent; /* Global values */ border-right-color: inherit; border-right-color: initial; border-right-color: unset; The border-right-color property is specified as a single value. Val...
border-right-width - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The border-right-width CSS property sets the width of the right border of an element. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Keyword values */ border-right-width: thin; border-right-width: medium; border-right-width: thick; /* <length> values */ border-right-width: 10em; border-right-width: 3vmax; border-right-width: 6px; /* Global keywords */ border-right-width: inherit; border-right-width: initial; border-right-width: unset; Values <line-width> Defines the width of the border, either as an explicit nonnegative <length> or a keyword. If it's a keyword, it must be one of the following va...
border-right - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. As with all shorthand properties, border-right always sets the values of all of the properties that it can set, even if they are not specified. It sets those that are not specified to their default values. This means that ... border-right-style: dotted; border-right: thick green; ... is actually the same as ... ...
... 2 (Revision 1)The definition of 'border-right' in that specification. Recommendation No significant changes. CSS Level 1The definition of 'border-right' in that specification. Recommendation Initial definition Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetborder-rightChrome Full support 1Edge Full support 12Firefox Full support ...
border-spacing - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The border-spacing CSS property sets the distance between the borders of adjacent <table> cells. This property applies only when border-collapse is separate. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The border-spacing value is also used along the outside edge of the table, where the distance between the table's border and the cells in the first/last column or row is the sum of the relevant (horizontal or vertical) border-spacing and the relevant (top, right, bottom, or left) padding on the table. Note: The border-spacing property is equivalent to the deprecated cellspacing <table> attribute, except that it...
border-style - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The border-style shorthand CSS property sets the line style for all four sides of an element's border. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Constituent properties This property is a shorthand for the following CSS properties: border-bottom-style border-left-style border-right-style border-top-style Syntax /* Keyword values */ border-style: none; border-style: hidden; border-style: dotted; border-style: dashed; border-style: solid; border-style: double; border-style: groove; border-style: ridge; border-style: inset; border-style: outset; /* vertical | horizontal */ border-style: dotted solid; ...
border-top-color - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The border-top-color CSS property sets the color of an element's top border. It can also be set with the shorthand CSS properties border-color or border-top. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <color> values */ border-top-color: red; border-top-color: #ffbb00; border-top-color: rgb(255, 0, 0); border-top-color: hsla(100%, 50%, 25%, 0.75); border-top-color: currentcolor; border-top-color: transparent; /* Global values */ border-top-color: inherit; border-top-color: initial; border-top-color: unset; The border-top-color property is specified as a single value. Values <color> The color ...
border-top-left-radius - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The border-top-left-radius CSS property rounds the top-left corner of an element by specifying the radius (or the radius of the semi-major and semi-minor axes) of the ellipse defining the curvature of the corner. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The rounding can be a circle or an ellipse, or if one of the value is 0,no rounding is done and the corner is square. A background, being an image or a color, is clipped at the border, even a rounded one; the exact location of the clipping is defined by the value of the background-clip property. Note: If the value of this property is not set in a border-r...
border-top-right-radius - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The border-top-right-radius CSS property rounds the top-right corner of an element by specifying the radius (or the radius of the semi-major and semi-minor axes) of the ellipse defining the curvature of the corner. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The rounding can be a circle or an ellipse, or if one of the value is 0 no rounding is done and the corner is square. A background, being an image or a color, is clipped at the border, even a rounded one; the exact location of the clipping is defined by the value of the background-clip property. Note: If the value of this property is not set in a border...
border-top-style - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The specification doesn't define how borders of different styles connect in the corners. ...
... The specification doesn't define how borders of different styles connect in the corners. ...
border-top-width - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The border-top-width CSS property sets the width of the top border of an element. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Keyword values */ border-top-width: thin; border-top-width: medium; border-top-width: thick; /* <length> values */ border-top-width: 10em; border-top-width: 3vmax; border-top-width: 6px; /* Global keywords */ border-top-width: inherit; border-top-width: initial; border-top-width: unset; Values <line-width> Defines the width of the border, either as an explicit nonnegative <length> or a keyword. If it's a keyword, it must be one of the following values: thi...
border-top - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. As with all shorthand properties, border-top always sets the values of all of the properties that it can set, even if they are not specified. It sets those that are not specified to their default values. This means that ... border-top-style: dotted; border-top: thick green; ... is actually the same as ... ...
...evel 2 (Revision 1)The definition of 'border-top' in that specification. Recommendation No significant changes. CSS Level 1The definition of 'border-top' in that specification. Recommendation Initial definition Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetborder-topChrome Full support 1Edge Full support 12Firefox Full support ...
border-width - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The border-width shorthand CSS property sets the width of an element's border. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Constituent properties This property is a shorthand for the following CSS properties: border-bottom-width border-left-width border-right-width border-top-width Syntax /* Keyword values */ border-width: thin; border-width: medium; border-width: thick; /* <length> values */ border-width: 4px; border-width: 1.2rem; /* vertical | horizontal */ border-width: 2px 1.5em; /* top | horizontal | bottom */ border-width: 1px 2em 1.5cm; /* top | right | bottom | left */ border-width: 1px 2...
bottom - CSS: Cascading Style Sheets
Web › CSS › bottom
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The bottom CSS property participates in setting the vertical position of a positioned element. It has no effect on non-positioned elements. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The effect of bottom depends on how the element is positioned (i.e., the value of the position property): When position is set to absolute or fixed, the bottom property specifies the distance between the element's bottom edge and the bottom edge of its containing block. When position is set to relative, the bottom property specifies the distance the element's bottom edge is moved above its normal position. When position is se...
box-decoration-break - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The box-decoration-break CSS property specifies how an element's fragments should be rendered when broken across multiple lines, columns, or pages. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The specified value will impact the appearance of the following properties: background border border-image box-shadow clip-path margin padding Syntax /* Keyword values */ box-decoration-break: slice; box-decoration-break: clone; /* Global values */ box-decoration-break: initial; box-decoration-break: inherit; box-decoration-break: unset; The box-decoration-break property is specified as one of the keyword va...
box-shadow - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The box-shadow CSS property adds shadow effects around an element's frame. You can set multiple effects separated by commas. A box shadow is described by X and Y offsets relative to the element, blur and spread radius, and color. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The box-shadow property enables you to cast a drop shadow from the frame of almost any element. If a border-radius is specified on the element with a box shadow, the box shadow takes on the same rounded corners. The z-ordering of multiple box shadows is the same as multiple text shadows (the first specified shadow is on top). Box-shadow gene...
calc() - CSS: Cascading Style Sheets
Web › CSS › calc
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The calc() CSS function lets you perform calculations when specifying CSS property values. It can be used anywhere a <length>, <frequency>, <angle>, <time>, <percentage>, <number>, or <integer> is allowed. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* property: calc(expression) */ width: calc(100% - 80px); The calc() function takes a single expression as its parameter, with the expression's result used as the value. The expression can be any simple expression combining the following operators, using standard operator precedence rules: + Addition. - Subtraction. * Multiplication. At least one o...
clamp() - CSS: Cascading Style Sheets
Web › CSS › clamp
range of values between a defined minimum and maximum. It takes three parameters: a minimum value, a preferred value, and a maximum allowed value. The clamp() function can be used anywhere a <length>, <frequency>, <angle>, <time>, <percentage>, <number>, or <integer> is allowed. clamp(MIN, VAL, MAX) is resolved as max(MIN, min(VAL, MAX)) The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Note that using clamp() for font sizes, as in these examples, allows you to set a font-size that grows with the size of the viewport, but doesn't go below a minimum font-size or above a maximum font-size. It has the same effect as th...
...(1.8rem, 2.5vw, 2.8rem). This means that the font-size will be set at 1.8rem, until the computed value of 2.5vw becomes greater than that of 1.8rem. At this point, font-size will be set at 2.5vw, until 2.5vw's computed value becomes greater than that of 2.8rem. At this point, the font-size will be set at 2.8rem. clamp() allows you to set a minimum and maximum value. You find this example live on GitHub, if you want to play around with it. HTML <h1>Simple responsive test</h1> <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. In orci orci, eleifend id risus nec, mattis rutrum velit. Suspendisse fringilla egestas erat eu convallis. Phasellus eu velit ut magna dapibus elementum cursus at ligula. Ut tempus varius nibh, nec auctor sapien iaculis sit amet. Fusce iaculis, libero quis el...
clip-path - CSS: Cascading Style Sheets
Web › CSS › clip-path
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The clip-path CSS property creates a clipping region that sets what part of an element should be shown. Parts that are inside the region are shown, while those outside are hidden. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Keyword values */ clip-path: none; /* <clip-source> values */ clip-path: url(resources.svg#c1); /* <geometry-box> values */ clip-path: margin-box; clip-path: border-box; clip-path: padding-box; clip-path: content-box; clip-path: fill-box; clip-path: stroke-box; clip-path: view-box; /* <basic-shape> values */ clip-path: inset(100px 50px); clip-path: circle(50px at 0 100px); clip...
color - CSS: Cascading Style Sheets
Web › CSS › color
The color CSS property sets the foreground color value of an element's text and text decorations, and sets the currentcolor value. currentcolor may be used as an indirect value on other properties and is the default for other color properties, such as border-color. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. For an overview of using color in HTML, see Applying color to HTML elements using CSS. Syntax /* Keyword values */ color: currentcolor; /* <named-color> values */ color: red; color: orange; color: tan; color: rebeccapurple; /* <hex-color> values */ color: #090; color: #009900; color: #090a; color: #0099...
...ecifications Specification Status Comment CSS Color Module Level 4The definition of 'color' in that specification. Working Draft Adds commaless syntaxes for the rgb(), rgba(), hsl(), and hsla() functions. Allows alpha values in rgb() and hsl(), turning rgba() and hsla() into (deprecated) aliases for them. Adds color keyword rebeccapurple. Adds 4- and 8-digit hex color values, where the last digit(s) represents the alpha value. Adds hwb(), device-cmyk(), and color() functions. CSS Color Module Level 3The definition of 'color' in that specification. Recommendation Deprecates system-colors. Adds SVG colors. Adds the rgba(), hsl(), and hsla() functions. CSS Level 2 (Revision 1)The definition of 'color' in that specification. ...
<color> - CSS: Cascading Style Sheets
el 4 standard, they accept the same parameters and behave the same way. Hexadecimal notation: #RRGGBB[AA] R (red), G (green), B (blue), and A (alpha) are hexadecimal characters (0-9, A-F). A is optional. For example, #ff0000 is equivalent to #ff0000ff. Hexadecimal notation: #RGB[A] R (red), G (green), B (blue), and A (alpha) are hexadecimal characters (0-9, A-F). A is optional. The three-digit notation (#RGB) is a shorter version of the six-digit form (#RRGGBB). For example, #f09 is the same color as #ff0099. Likewise, the four-digit RGB notation (#RGBA) is a shorter version of the eight-digit form (#RRGGBBAA). For example, #0f38 is the same color as #00ff3388. Functional notation: rgb[a](R, G, B[, A]) R (red), G (green), and B (blue) can be either <number>s or <percentage>s, where t...
... CSS Color Module Level 3The definition of '<color>' in that specification. Recommendation Deprecates system colors. ...
column-count - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Keyword value */ column-count: auto; /* <integer> value */ column-count: 3; /* Global values */ column-count: inherit; column-count: initial; column-count: unset; Values auto The number of columns is determined by other CSS properties, such as column-width. ...
... column-count: 3; } Result Specifications Specification Status Comment CSS Multi-column Layout ModuleThe definition of 'column-count' in that specification. Working Draft Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetcolumn-countChrome Full support 50 Full support 50 Full support ...
column-rule-color - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The column-rule-color CSS property sets the color of the line drawn between columns in a multi-column layout. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <color> values */ column-rule-color: red; column-rule-color: rgb(192, 56, 78); column-rule-color: transparent; column-rule-color: hsla(0, 100%, 50%, 0.6); /* Global values */ column-rule-color: inherit; column-rule-color: initial; column-rule-color: unset; The column-rule-color property is specified as a single <color> value. Values <color> The color of the rule that separates columns. Formal definition Initial valuecurrentcolorApplies tom...
column-rule-style - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The column-rule-style CSS property sets the style of the line drawn between columns in a multi-column layout. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <'border-style'> values */ column-rule-style: none; column-rule-style: hidden; column-rule-style: dotted; column-rule-style: dashed; column-rule-style: solid; column-rule-style: double; column-rule-style: groove; column-rule-style: ridge; column-rule-style: inset; column-rule-style: outset; /* Global values */ column-rule-style: inherit; column-rule-style: initial; column-rule-style: unset; The column-rule-style property is specified as a single ...
column-rule-width - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The column-rule-width CSS property sets the width of the line drawn between columns in a multi-column layout. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Keyword values */ column-rule-width: thin; column-rule-width: medium; column-rule-width: thick; /* <length> values */ column-rule-width: 1px; column-rule-width: 2.5em; /* Global values */ column-rule-width: inherit; column-rule-width: initial; column-rule-width: unset; The column-rule-width property is specified as a single <'border-width'> value. Values <'border-width'> Is a keyword defined by border-width describing the width of the rule.
columns - CSS: Cascading Style Sheets
Web › CSS › columns
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The columns CSS shorthand property sets the number of columns to use when drawing an element's contents, as well as those columns' widths. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Constituent properties This property is a shorthand for the following CSS properties: column-count column-width Syntax /* Column width */ columns: 18em; /* Column count */ columns: auto; columns: 2; /* Both column width and count */ columns: 2 auto; columns: auto 12em; columns: auto auto; /* Global values */ columns: inherit; columns: initial; columns: unset; The columns property may be specified as one or two of the va...
counter-increment - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Note: The counter's value can be reset to an arbitrary number using the counter-reset CSS property. ...
... Note: The counter's value can be reset to an arbitrary number using the counter-reset CSS property. ...
cursor - CSS: Cascading Style Sheets
Web › CSS › cursor
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The cursor CSS property sets the type of mouse cursor, if any, to show when the mouse pointer is over an element. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Keyword value */ cursor: pointer; cursor: auto; /* URL, with a keyword fallback */ cursor: url(hand.cur), pointer; /* URL and coordinates, with a keyword fallback */ cursor: url(cursor1.png) 4 12, auto; cursor: url(cursor2.png) 2 2, pointer; /* Global values */ cursor: inherit; cursor: initial; cursor: unset; The cursor property is specified as zero or more <url> values, separated by commas, followed by a single mandatory keyword value. Eac...
fit-content() - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The fit-content() CSS function clamps a given size to an available size according to the formula min(maximum size, max(minimum size, argument)). The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The function can be used as a track size in CSS Grid properties, where the maximum size is defined by max-content and the minimum size by auto, which is calculated similar to auto (i.e., minmax(auto, max-content)), except that the track size is clamped at argument if it is greater than the auto minimum. The function can also be used as laid out box size for width, height, min-width, min-height, max-width and max-height, wher...
flex-basis - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Note: in case both flex-basis (other than auto) and width (or height in case of flex-direction: column) are set for an element, flex-basis has priority. ...
... The flex-basis CSS property sets the initial main size of a flex item. It sets the size of the content box unless otherwise set with box-sizing. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Note: in case both flex-basis (other than auto) and width (or height in case of flex-direction: column) are set for an element, flex-basis has priority. Syntax /* Specify <'width'> */ flex-basis: 10em; flex-basis: 3px; flex-basis: auto; /* Intrinsic sizing keywords */ flex-basis: fill; flex-basis: max-content; flex-basis: min-content; flex-basis: fit-content; /* Automatically size based on the flex item's content */ fle...
flex-direction - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Note that the values row and row-reverse are affected by the directionality of the flex container. ...
... Note that the values row and row-reverse are affected by the directionality of the flex container. ...
flex-flow - CSS: Cascading Style Sheets
Web › CSS › flex-flow
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The flex-flow CSS shorthand property specifies the direction of a flex container, as well as its wrapping behavior. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Constituent properties This property is a shorthand for the following CSS properties: flex-direction flex-wrap Syntax /* flex-flow: <'flex-direction'> */ flex-flow: row; flex-flow: row-reverse; flex-flow: column; flex-flow: column-reverse; /* flex-flow: <'flex-wrap'> */ flex-flow: nowrap; flex-flow: wrap; flex-flow: wrap-reverse; /* flex-flow: <'flex-direction'> and <'flex-wrap'> */ flex-flow: row nowrap; flex-flow: column wrap; flex-flow: colu...
flex-wrap - CSS: Cascading Style Sheets
Web › CSS › flex-wrap
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. See Using CSS flexible boxes for more properties and information. ...
... The flex-wrap CSS property sets whether flex items are forced onto one line or can wrap onto multiple lines. If wrapping is allowed, it sets the direction that lines are stacked. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. See Using CSS flexible boxes for more properties and information. Syntax flex-wrap: nowrap; /* Default value */ flex-wrap: wrap; flex-wrap: wrap-reverse; /* Global values */ flex-wrap: inherit; flex-wrap: initial; flex-wrap: unset; The flex-wrap property is specified as a single keyword chosen from the list of values below. Values The following values are accepted: nowrap The flex ...
flex - CSS: Cascading Style Sheets
Web › CSS › flex
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The flex CSS shorthand property sets how a flex item will grow or shrink to fit the space available in its flex container. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Constituent properties This property is a shorthand for the following CSS properties: flex-grow flex-shrink flex-basis Syntax /* Keyword values */ flex: auto; flex: initial; flex: none; /* One value, unitless number: flex-grow */ flex: 2; /* One value, width/height: flex-basis */ flex: 10em; flex: 30%; flex: min-content; /* Two values: flex-grow | flex-basis */ flex: 1 30px; /* Two values: flex-grow | flex-shrink */ flex: 2 2; /* Thr...
font-family - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Values are separated by commas to indicate that they are alternatives. The browser will select the first font in the list that is installed or that can be downloaded using a @font-face at-rule. ...
...ng and cursive-style Kai forms. This style is often used for government documents. This is some example fangsong text with the Chinese characters for "fangsong" in traditional and simple forms, respectively: ??? ???. Valid family names Font family names must either be given quoted as strings, or unquoted as a sequence of one or more identifiers. This means that punctuation characters and digits at the start of each token must be escaped in unquoted font family names. For example, the following declarations are valid: font-family: Gill Sans Extrabold, sans-serif; font-family: "Goudy Bookletter 1911", sans-serif; The following declarations are invalid: font-family: Goudy Bookletter 1911, sans-serif; font-family: Red/Black, sans-serif; font-family: "Lucida" Grande, sans-serif; font-fa...
font-feature-settings - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The font-feature-settings CSS property controls advanced typographic features in OpenType fonts. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Use the default settings */ font-feature-settings: normal; /* Set values for OpenType feature tags */ font-feature-settings: "smcp"; font-feature-settings: "smcp" on; font-feature-settings: "swsh" 2; font-feature-settings: "smcp", "swsh" 2; /* Global values */ font-feature-settings: inherit; font-feature-settings: initial; font-feature-settings: unset; Whenever possible, Web authors should instead use the font-variant shorthand property or an associated longh...
font-optical-sizing - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* keyword values */ font-optical-sizing: none; font-optical-sizing: auto; /* default */ /* Global values */ font-optical-sizing: inherit; font-optical-sizing: initial; font-optical-sizing: unset; Values none The browser will not modify the shape of glyphs for optimal viewing. ...
... Specifications Specification Status Comment CSS Fonts Module Level 4The definition of 'font-optical-sizing' in that specification. Working Draft ...
font-size - CSS: Cascading Style Sheets
Web › CSS › font-size
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The font-size CSS property sets the size of the font. Changing the font size also updates the sizes of the font size-relative <length> units, such as em, ex, and so forth. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <absolute-size> values */ font-size: xx-small; font-size: x-small; font-size: small; font-size: medium; font-size: large; font-size: x-large; font-size: xx-large; font-size: xxx-large; /* <relative-size> values */ font-size: smaller; font-size: larger; /* <length> values */ font-size: 12px; font-size: 0.8em; /* <percentage> values */ font-size: 80%; /* Global values */ font-size: inhe...
font-variant-caps - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. When a given font includes capital letter glyphs of multiple different sizes, this property selects the most appropriate ones. If petite capital glyphs are not available, they are rendered using small capital glyphs. If these are not present, the browser synthesizes them from the uppercase glyphs. ...
... italic; } Result Specifications Specification Status Comment CSS Fonts Module Level 3The definition of 'font-variant-caps' in that specification. Candidate Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetfont-variant-capsChrome Full support 52Edge Full support 79Firefox Full suppo...
font-variant-ligatures - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The font-variant-ligatures CSS property controls which ligatures and contextual forms are used in textual content of the elements it applies to. This leads to more harmonized forms in the resulting text. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Keyword values */ font-variant-ligatures: normal; font-variant-ligatures: none; font-variant-ligatures: common-ligatures; /* <common-lig-values> */ font-variant-ligatures: no-common-ligatures; /* <common-lig-values> */ font-variant-ligatures: discretionary-ligatures; /* <discretionary-lig-values> */ font-variant-ligatures: no-discretiona...
font-variant-numeric - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The font-variant-numeric CSS property controls the usage of alternate glyphs for numbers, fractions, and ordinal markers. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax font-variant-numeric: normal; font-variant-numeric: ordinal; font-variant-numeric: slashed-zero; font-variant-numeric: lining-nums; /* <numeric-figure-values> */ font-variant-numeric: oldstyle-nums; /* <numeric-figure-values> */ font-variant-numeric: proportional-nums; /* <numeric-spacing-values> */ font-variant-numeric: tabular-nums; /* <numeric-spacing-values> */ font-variant-numeric: diagonal-fractions; /* <numeri...
font-variation-settings - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The font-variation-settings CSS property provides low-level control over variable font characteristics, by specifying the four letter axis names of the characteristics you want to vary, along with their values. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Use the default settings */ font-variation-settings: normal; /* Set values for variable font axis names */ font-variation-settings: "XHGT" 0.7; /* Global values */ font-variation-settings: inherit; font-variation-settings: initial; font-variation-settings: unset; Values This property's value can take one of two forms: normal Text is laid out...
grid-area - CSS: Cascading Style Sheets
Web › CSS › grid-area
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The grid-area CSS shorthand property specifies a grid item's size and location within a grid by contributing a line, a span, or nothing (automatic) to its grid placement, thereby specifying the edges of its grid area. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. If four <grid-line> values are specified, grid-row-start is set to the first value, grid-column-start is set to the second value, grid-row-end is set to the third value, and grid-column-end is set to the fourth value. When grid-column-end is omitted, if grid-column-start is a <custom-ident>, grid-column-end is set to that <custom-ident>; otherwis...
grid-auto-flow - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The grid-auto-flow CSS property controls how the auto-placement algorithm works, specifying exactly how auto-placed items get flowed into the grid. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Keyword values */ grid-auto-flow: row; grid-auto-flow: column; grid-auto-flow: dense; grid-auto-flow: row dense; grid-auto-flow: column dense; /* Global values */ grid-auto-flow: inherit; grid-auto-flow: initial; grid-auto-flow: unset; This property may take one of two forms: a single keyword: one of row, column, or dense. two keywords: row dense or column dense. Values row Items are placed b...
grid-column-end - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The grid-column-end CSS property specifies a grid item's end position within the grid column by contributing a line, a span, or nothing (automatic) to its grid placement, thereby specifying the block-end edge of its grid area. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Keyword value */ grid-column-end: auto; /* <custom-ident> values */ grid-column-end: somegridarea; /* <integer> + <custom-ident> values */ grid-column-end: 2; grid-column-end: somegridarea 4; /* span + <integer> + <custom-ident> values */ grid-column-end: span 3; grid-column-end: span somegridarea; grid-column-end: 5 somegri...
grid-column-start - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...rid-column-start CSS property specifies a grid item's start position within the grid column by contributing a line, a span, or nothing (automatic) to its grid placement. This start position defines the block-start edge of the grid area. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Keyword value */ grid-column-start: auto; /* <custom-ident> value */ grid-column-start: somegridarea; /* <integer> + <custom-ident> values */ grid-column-start: 2; grid-column-start: somegridarea 4; /* span + <integer> + <custom-ident> values */ grid-column-start: span 3; grid-column-start: span somegridarea; grid-column-s...
grid-row-end - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The grid-row-end CSS property specifies a grid item's end position within the grid row by contributing a line, a span, or nothing (automatic) to its grid placement, thereby specifying the inline-end edge of its grid area. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Keyword value */ grid-row-end: auto; /* <custom-ident> values */ grid-row-end: somegridarea; /* <integer> + <custom-ident> values */ grid-row-end: 2; grid-row-end: somegridarea 4; /* span + <integer> + <custom-ident> values */ grid-row-end: span 3; grid-row-end: span somegridarea; grid-row-end: 5 somegridarea span; /* Global val...
grid-row-start - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The grid-row-start CSS property specifies a grid item's start position within the grid row by contributing a line, a span, or nothing (automatic) to its grid placement, thereby specifying the inline-start edge of its grid area. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Keyword value */ grid-row-start: auto; /* <custom-ident> values */ grid-row-start: somegridarea; /* <integer> + <custom-ident> values */ grid-row-start: 2; grid-row-start: somegridarea 4; /* span + <integer> + <custom-ident> values */ grid-row-start: span 3; grid-row-start: span somegridarea; grid-row-start: 5 somegridarea ...
grid-row - CSS: Cascading Style Sheets
Web › CSS › grid-row
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...CSS shorthand property specifies a grid item's size and location within the grid row by contributing a line, a span, or nothing (automatic) to its grid placement, thereby specifying the inline-start and inline-end edge of its grid area. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. If two <grid-line> values are specified, the grid-row-start longhand is set to the value before the slash, and the grid-row-end longhand is set to the value after the slash. Constituent properties This property is a shorthand for the following CSS properties: grid-row-end grid-row-start Syntax /* Keyword values */ grid-row: aut...
grid-template-columns - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The grid-template-columns CSS property defines the line names and track sizing functions of the grid columns. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Keyword value */ grid-template-columns: none; /* <track-list> values */ grid-template-columns: 100px 1fr; grid-template-columns: [linename] 100px; grid-template-columns: [linename1] 100px [linename2 linename3]; grid-template-columns: minmax(100px, 1fr); grid-template-columns: fit-content(40%); grid-template-columns: repeat(3, 200px); grid-template-columns: subgrid; /* <auto-track-list> values */ grid-template-columns: 200px repeat(auto-fill...
grid-template-rows - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The grid-template-rows CSS property defines the line names and track sizing functions of the grid rows. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Keyword value */ grid-template-rows: none; /* <track-list> values */ grid-template-rows: 100px 1fr; grid-template-rows: [linename] 100px; grid-template-rows: [linename1] 100px [linename2 linename3]; grid-template-rows: minmax(100px, 1fr); grid-template-rows: fit-content(40%); grid-template-rows: repeat(3, 200px); grid-template-rows: subgrid; /* <auto-track-list> values */ grid-template-rows: 200px repeat(auto-fill, 100px) 300px; grid-template-row...
grid-template - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The grid-template CSS property is a shorthand property for defining grid columns, rows, and areas. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Constituent properties This property is a shorthand for the following CSS properties: grid-template-areas grid-template-columns grid-template-rows Syntax /* Keyword value */ grid-template: none; /* grid-template-rows / grid-template-columns values */ grid-template: 100px 1fr / 50px 1fr; grid-template: auto 1fr / auto 1fr auto; grid-template: [linename] 100px / [columnname1] 30% [columnname2] 70%; grid-template: fit-content(100px) / fit-content(40%); /* ...
height - CSS: Cascading Style Sheets
Web › CSS › height
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The min-height and max-height properties override height. ...
... The height CSS property specifies the height of an element. By default, the property defines the height of the content area. If box-sizing is set to border-box, however, it instead determines the height of the border area. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The min-height and max-height properties override height. Syntax /* Keyword value */ height: auto; /* <length> values */ height: 120px; height: 10em; /* <percentage> value */ height: 75%; /* Global values */ height: inherit; height: initial; height: unset; Values <length> Defines the height as an absolute value. <percentage> Defines the...
ident - CSS: Cascading Style Sheets
Web › CSS › ident
The <ident> CSS data type denotes an arbitrary string used as an identifier. Syntax The syntax of <custom-ident> is similar to CSS identifiers (such as property names), except that it is case-sensitive. It consists of one or more characters, where characters can be any of the following: any alphabetical character (A to Z, or a to z), any decimal digit (0 to 9), a hyphen (-), an underscore (_), an escaped character (preceded by a backslash, \), a Unicode character (in the format of a backslash, \, followed by one to six hexadecimal digits, representing its Unicode code point) Note that id1, Id1, iD1 and ID1 are all different identifiers as they are case-sensitive. On the other hand, as there are several ways to escape a character, toto\? and toto\3F are the same identifiers. Ex...
...A mix of alphanumeric characters and a dash -test A dash followed by alphanumeric characters --toto A custom-property like identifier _internal An underscore followed by alphanumeric characters \22 toto A Unicode character followed by a sequence of alphanumeric characters bili\.bob A correctly escaped period Invalid identifiers 34rem It must not start with a decimal digit. -12rad It must not start with a dash followed by a decimal digit. bili.bob Only alphanumeric characters, _, and - needn't be escaped. 'bilibob' This would be a <string>. "bilibob" This would be a <string>. Specifications Specification Status Comment CSS Values and Units Module Level 4The definition of '<ident>' in that specification. Editor's Draft ...
inline-size - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The inline-size CSS property defines the horizontal or vertical size of an element's block, depending on its writing mode. It corresponds to either the width or the height property, depending on the value of writing-mode. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <length> values */ inline-size: 300px; inline-size: 25em; /* <percentage> values */ inline-size: 75%; /* Keyword values */ inline-size: max-content; inline-size: min-content; inline-size: fit-content(20em); inline-size: auto; /* Global values */ inline-size: inherit; inline-size: initial; inline-size: unset; If the writing mode is ver...
<integer> - CSS: Cascading Style Sheets
Web › CSS › integer
There is no unit associated with integers. ...
... Level 2 (Revision 1)The definition of '<integer>' in that specification. Recommendation Explicit definition. CSS Level 1The definition of '<integer>' in that specification. Recommendation Implicit definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet<integer>Chrome Full support 1Edge Full support 12Firefox Full support ...
justify-items - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The effect of this property is dependent of the layout mode we are in: In block-level layouts, it aligns the items inside their containing block on the inline axis. ...
... The CSS justify-items property defines the default justify-self for all items of the box, giving them all a default way of justifying each box along the appropriate axis. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The effect of this property is dependent of the layout mode we are in: In block-level layouts, it aligns the items inside their containing block on the inline axis. For absolutely-positioned elements, it aligns the items inside their containing block on the inline axis, accounting for the offset values of top, left, bottom, and right. In table cell layouts, this property is ignored (more about a...
left - CSS: Cascading Style Sheets
Web › CSS › left
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The left CSS property participates in specifying the horizontal position of a positioned element. It has no effect on non-positioned elements. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <length> values */ left: 3px; left: 2.4em; /* <percentage>s of the width of the containing block */ left: 10%; /* Keyword value */ left: auto; /* Global values */ left: inherit; left: initial; left: unset; Values <length> A negative, null, or positive <length> that represents: for absolutely positioned elements, the distance to the left edge of the containing block. for relatively positioned elements, ...
letter-spacing - CSS: Cascading Style Sheets
The letter-spacing CSS property sets the horizontal spacing behavior between text characters. This value is added to the natural spacing between characters while rendering the text. Positive values of letter-spacing causes characters to spread farther apart, while negative values of letter-spacing bring characters closer together. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Keyword value */ letter-spacing: normal; /* <length> values */ letter-spacing: 0.3em; letter-spacing: 3px; letter-spacing: .3px; /* Global values */ letter-spacing: inherit; letter-spacing: initial; letter-spacing: unset; Valu...
...d Edition)The definition of 'letter-spacing' in that specification. Recommendation Initial SVG definition. CSS Level 1The definition of 'letter-spacing' in that specification. Recommendation Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetletter-spacingChrome Full support 1Edge Full support 12Firefox Full support ...
linear-gradient() - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The linear-gradient() CSS function creates an image consisting of a progressive transition between two or more colors along a straight line. Its result is an object of the <gradient> data type, which is a special kind of <image>. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* A gradient tilted 45 degrees, starting blue and finishing red */ linear-gradient(45deg, blue, red); /* A gradient going from the bottom right to the top left corner, starting blue and finishing red */ linear-gradient(to left top, blue, red); /* Color stop: A gradient going from the bottom to top, starting blue, turning g...
list-style-image - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Note: This property is applied to list items, i.e. elements with display: list-item; by default this includes <li> elements. ...
... Note: This property is applied to list items, i.e. ...
margin-block-end - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The margin-block-end CSS property defines the logical block end margin of an element, which maps to a physical margin depending on the element's writing mode, directionality, and text orientation. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <length> values */ margin-block-end: 10px; /* An absolute length */ margin-block-end: 1em; /* relative to the text size */ margin-block-end: 5%; /* relative to the nearest block container's width */ /* Keyword values */ margin-block-end: auto; /* Global values */ margin-block-end: inherit; margin-block-end: initial; margin-block-end: unset; It correspond...
margin-block-start - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The margin-block-start CSS property defines the logical block start margin of an element, which maps to a physical margin depending on the element's writing mode, directionality, and text orientation. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <length> values */ margin-block-start: 10px; /* An absolute length */ margin-block-start: 1em; /* relative to the text size */ margin-block-start: 5%; /* relative to the nearest block container's width */ /* Keyword values */ margin-block-start: auto; /* Global values */ margin-block-start: inherit; margin-block-start: initial; margin-block-start: unse...
margin-bottom - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. This property has no effect on non-replaced inline elements, such as <span> or <code>. ...
... The margin-bottom CSS property sets the margin area on the bottom of an element. A positive value places it farther from its neighbors, while a negative value places it closer. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. This property has no effect on non-replaced inline elements, such as <span> or <code>. Syntax /* <length> values */ margin-bottom: 10px; /* An absolute length */ margin-bottom: 1em; /* relative to the text size */ margin-bottom: 5%; /* relative to the nearest block container's width */ /* Keyword values */ margin-bottom: auto; /* Global values */ margin-bottom: inherit; margin-botto...
margin-left - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The vertical margins of two adjacent boxes may fuse. This is called margin collapsing. ...
... The vertical margins of two adjacent boxes may fuse. ...
margin-right - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The vertical margins of two adjacent boxes may fuse. This is called margin collapsing. ...
... The margin-right CSS property sets the margin area on the right side of an element. A positive value places it farther from its neighbors, while a negative value places it closer. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The vertical margins of two adjacent boxes may fuse. This is called margin collapsing. Syntax /* <length> values */ margin-right: 20px; /* An absolute length */ margin-right: 1em; /* relative to the text size */ margin-right: 5%; /* relative to the nearest block container's width */ /* Keyword values */ margin-right: auto; /* Global values */ margin-right: inherit; margin-right: in...
margin-top - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. This property has no effect on non-replaced inline elements, such as <span> or <code>. ...
... The margin-top CSS property sets the margin area on the top of an element. A positive value places it farther from its neighbors, while a negative value places it closer. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. This property has no effect on non-replaced inline elements, such as <span> or <code>. Syntax /* <length> values */ margin-top: 10px; /* An absolute length */ margin-top: 1em; /* relative to the text size */ margin-top: 5%; /* relative to the nearest block container's width */ /* Keyword values */ margin-top: auto; /* Global values */ margin-top: inherit; margin-top: initial; margin-top: un...
margin - CSS: Cascading Style Sheets
Web › CSS › margin
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The top and bottom margins have no effect on non-replaced inline elements, such as <span> or <code>. Note: Margins create extra space around an element. ...
... The margin CSS property sets the margin area on all four sides of an element. It is a shorthand for margin-top, margin-right, margin-bottom, and margin-left. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The top and bottom margins have no effect on non-replaced inline elements, such as <span> or <code>. Note: Margins create extra space around an element. In contrast, padding creates extra space within an element. Syntax /* Apply to all four sides */ margin: 1em; margin: -3px; /* vertical | horizontal */ margin: 5% auto; /* top | horizontal | bottom */ margin: 1em auto 2em; /* top | right | bottom | left *...
min-block-size - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...min-block-size CSS property defines the minimum horizontal or vertical size of an element's block, depending on its writing mode. It corresponds to either the min-width or the min-height property, depending on the value of writing-mode. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <length> values */ min-block-size: 100px; min-block-size: 5em; /* <percentage> values */ min-block-size: 10%; /* Keyword values */ min-block-size: max-content; min-block-size: min-content; min-block-size: fit-content(20em); /* Global values */ min-block-size: inherit; min-block-size: initial; min-block-size: unset; If th...
min-height - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The element's height is set to the value of min-height whenever min-height is larger than max-height or height. ...
... The min-height CSS property sets the minimum height of an element. It prevents the used value of the height property from becoming smaller than the value specified for min-height. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The element's height is set to the value of min-height whenever min-height is larger than max-height or height. Syntax /* <length> value */ min-height: 3.5em; /* <percentage> value */ min-height: 10%; /* Keyword values */ min-height: max-content; min-height: min-content; min-height: fit-content(20em); /* Global values */ min-height: inherit; min-height: initial; min-height: unset; Val...
min-inline-size - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...in-inline-size CSS property defines the horizontal or vertical minimal size of an element's block, depending on its writing mode. It corresponds to either the min-width or the min-height property, depending on the value of writing-mode. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <length> values */ min-inline-size: 100px; min-inline-size: 5em; /* <percentage> values */ min-inline-size: 10%; /* Keyword values */ min-inline-size: max-content; min-inline-size: min-content; min-inline-size: fit-content(20em); /* Global values */ min-inline-size: inherit; min-inline-size: initial; min-inline-size: unset...
minmax() - CSS: Cascading Style Sheets
Web › CSS › minmax
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The minmax() CSS function defines a size range greater than or equal to min and less than or equal to max. It is used with CSS Grids. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <inflexible-breadth>, <track-breadth> values */ minmax(200px, 1fr) minmax(400px, 50%) minmax(30%, 300px) minmax(100px, max-content) minmax(min-content, 400px) minmax(max-content, auto) minmax(auto, 300px) minmax(min-content, auto) /* <fixed-breadth>, <track-breadth> values */ minmax(200px, 1fr) minmax(30%, 300px) minmax(400px, 50%) minmax(50%, min-content) minmax(300px, max-content) minmax(200px, auto) /* <inflexible...
<number> - CSS: Cascading Style Sheets
Web › CSS › number
There is no unit associated with numbers. Interpolation When animated, values of the <number> CSS data type are interpolated as real, floating-point numbers. ...
... A raw <integer> is also a <number>. 4.01 Positive fraction -456.8 Negative fraction 0.0 Zero +0.0 Zero, with a leading + -0.0 Zero, with a leading - .60 Fractional number without a leading zero 10e3 Scientific notation -3.4e-2 Complicated scientific notation Invalid numbers 12. Decimal points must be followed by at least one digit. +-12.2 Only one leading +/- is allowed. 12.1.1 Only one decimal point is allowed. Specifications Specification Status Comment CSS Values and Units Module Level 4The definition of '<number>' in that specification. Editor's Draft No significant change. CSS Values and Units Module Level 3The definition of '<number>' in that specification. C...
object-fit - CSS: Cascading Style Sheets
The object-fit CSS property sets how the content of a replaced element, such as an <img> or <video>, should be resized to fit its container. You can alter the alignment of the replaced element's content object within the element's box using the object-position property. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax The object-fit property is specified as a single keyword chosen from the list of values below. Values contain The replaced content is scaled to maintain its aspect ratio while fitting within the element's content box. The entire object is made to fill the box, while preserving its aspect ...
...ages Module Level 4The definition of 'object-fit' in that specification. Working Draft CSS Images Module Level 3The definition of 'object-fit' in that specification. Candidate Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetobject-fitChrome Full support 31Edge Full support 16Notes Full support ...
object-position - CSS: Cascading Style Sheets
e selected replaced element's contents within the element's box. Areas of the box which aren't covered by the replaced element's object will show the element's background. You can adjust how the replaced element's object's intrinsic size (that is, its natural size) is adjusted to fit within the element's box using the object-fit property. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <position> values */ object-position: center top; object-position: 100px 50px; /* Global values */ object-position: inherit; object-position: initial; object-position: unset; Values <position> From one to four value...
...ment's box. Result Specifications Specification Status Comment CSS Images Module Level 3The definition of 'object-position' in that specification. Candidate Recommendation Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetobject-positionChrome Full support 31Edge Full support 16Firefox Full support...
opacity - CSS: Cascading Style Sheets
Web › CSS › opacity
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The opacity CSS property sets the opacity of an element. Opacity is the degree to which content behind an element is hidden, and is the opposite of transparency. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Values <alpha-value> A <number> in the range 0.0 to 1.0, inclusive, or a <percentage> in the range 0% to 100%, inclusive, representing the opacity of the channel (that is, the value of its alpha channel). Any value outside the interval, though valid, is clamped to the nearest limit in the range. Value Meaning 0 The element is fully transparent (that is, invisible).
order - CSS: Cascading Style Sheets
Web › CSS › order
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The order CSS property sets the order to lay out an item in a flex or grid container. Items in a container are sorted by ascending order value and then by their source code order. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <integer> values */ order: 5; order: -5; /* Global values */ order: inherit; order: initial; order: unset; Since order is only meant to affect the visual order of elements and not their logical or tab order. order must not be used on non-visual media such as speech. Values <integer> Represents the ordinal group to be used by the item. Accessibility concerns Using the or...
outline-color - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <color> values */ outline-color: #f92525; outline-color: rgb(30,222,121); outline-color: blue; /* Keyword value */ outline-color: invert; /* Global values */ outline-color: inherit; outline-color: initial; outline-color: unset; The outline-color property is specified as any one of the values listed below. ...
...ule Level 3The definition of 'outline-color' in that specification. Recommendation No change. CSS Level 2 (Revision 1)The definition of 'outline-color' in that specification. Recommendation Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetoutline-colorChrome Full support 1Edge Full support 12Firefox Full support ...
outline-offset - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <length> values */ outline-offset: 3px; outline-offset: 0.2em; /* Global values */ outline-offset: inherit; outline-offset: initial; outline-offset: unset; Values <length> The width of the space between the element and its outline. ...
...: 15px; } Result Specifications Specification Status Comment CSS Basic User Interface Module Level 3The definition of 'outline-offset' in that specification. Recommendation Initial definition Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetoutline-offsetChrome Full support 1Edge Full support 15Firefox Full support ...
outline-style - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. It is often more convenient to use the shorthand property outline when defining the appearance of an outline. ...
... It is often more convenient to use the shorthand property outline when defining the appearance of an outline. ...
outline-width - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. It is often more convenient to use the shorthand property outline when defining the appearance of an outline. ...
... It is often more convenient to use the shorthand property outline when defining the appearance of an outline. ...
outline - CSS: Cascading Style Sheets
Web › CSS › outline
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The outline CSS shorthand property set all the outline properties in a single declaration. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Constituent properties This property is a shorthand for the following CSS properties: outline-color outline-style outline-width Syntax /* style */ outline: solid; /* color | style */ outline: #f66 dashed; /* style | width */ outline: inset thick; /* color | style | width */ outline: green solid 3px; /* Global values */ outline: inherit; outline: initial; outline: unset; The outline property may be specified using one, two, or three of the values listed below. The ...
overflow-wrap - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The overflow-wrap CSS property applies to inline elements, setting whether the browser should insert line breaks within an otherwise unbreakable string to prevent text from overflowing its line box. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Note: In contrast to word-break, overflow-wrap will only create a break if an entire word cannot be placed on its own line without overflowing. The property was originally a nonstandard and unprefixed Microsoft extension called word-wrap, and was implemented by most browsers with the same name. It has since been renamed to overflow-wrap, with word-wrap being an alias. ...
overflow-x - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The overflow-x CSS property sets what shows when content overflows a block-level element's left and right edges. This may be nothing, a scroll bar, or the overflow content. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Keyword values */ overflow-x: visible; overflow-x: hidden; overflow-x: clip; overflow-x: scroll; overflow-x: auto; /* Global values */ overflow-x: inherit; overflow-x: initial; overflow-x: unset; The overflow-x property is specified as a single keyword chosen from the list of values below. Values visible Content is not clipped and may be rendered outside the padding box's left an...
overflow-y - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The overflow-y CSS property sets what shows when content overflows a block-level element's top and bottom edges. This may be nothing, a scroll bar, or the overflow content. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Keyword values */ overflow-y: visible; overflow-y: hidden; overflow-y: clip; overflow-y: scroll; overflow-y: auto; /* Global values */ overflow-y: inherit; overflow-y: initial; overflow-y: unset; The overflow-y property is specified as a single keyword chosen from the list of values below. If overflow-x is hidden, scroll or auto and this property is visible (default) it will implicit...
overflow - CSS: Cascading Style Sheets
Web › CSS › overflow
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The overflow CSS shorthand property sets the desired behavior for an element's overflow -- i.e. when an element's content is too big to fit in its block formatting context -- in both directions. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Constituent properties This property is a shorthand for the following CSS properties: overflow-x overflow-y Syntax /* Keyword values */ overflow: visible; overflow: hidden; overflow: clip; overflow: scroll; overflow: auto; overflow: hidden visible; /* Global values */ overflow: inherit; overflow: initial; overflow: unset; The overflow property is specified as one or...
padding-block-end - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The padding-block-end CSS property defines the logical block end padding of an element, which maps to a physical padding depending on the element's writing mode, directionality, and text orientation. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <length> values */ padding-block-end: 10px; /* An absolute length */ padding-block-end: 1em; /* A length relative to the text size */ /* <percentage> value */ padding-block-end: 5%; /* A padding relative to the block container's width */ /* Global values */ padding-block-end: inherit; padding-block-end: initial; padding-block-end: ...
padding-block-start - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The padding-block-start CSS property defines the logical block start padding of an element, which maps to a physical padding depending on the element's writing mode, directionality, and text orientation. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <length> values */ padding-block-start: 10px; /* An absolute length */ padding-block-start: 1em; /* A length relative to the text size */ /* <percentage> value */ padding-block-start: 5%; /* A padding relative to the block container's width */ /* Global values */ padding-block-start: inherit; padding-block-start: initial; paddi...
padding-inline-end - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The padding-inline-end CSS property defines the logical inline end padding of an element, which maps to a physical padding depending on the element's writing mode, directionality, and text orientation. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <length> values */ padding-inline-end: 10px; /* An absolute length */ padding-inline-end: 1em; /* A length relative to the text size */ /* <percentage> value */ padding-inline-end: 5%; /* A padding relative to the block container's width */ /* Global values */ padding-inline-end: inherit; padding-inline-end: initial; padding-inline-end: u...
padding-inline-start - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The padding-inline-start CSS property defines the logical inline start padding of an element, which maps to a physical padding depending on the element's writing mode, directionality, and text orientation. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <length> values */ padding-inline-start: 10px; /* An absolute length */ padding-inline-start: 1em; /* A length relative to the text size */ /* <percentage> value */ padding-inline-start: 5%; /* A padding relative to the block container's width */ /* Global values */ padding-inline-start: inherit; padding-inline-start: initial; padding...
paint() - CSS: Cascading Style Sheets
Web › CSS › paint
<li>item 4</li> <li>item 5</li> <li>item 6</li> <li>item 7</li> <li>item 8</li> <li>item 9</li> <li>item 10</li> <li>item 11</li> <li>item 12</li> <li>item 13</li> <li>item 14</li> <li>item 15</li> <li>item 16</li> <li>item 17</li> <li>item 18</li> <li>item 19</li> <li>item 20</li> </ul> CSS.paintWorklet.addModule('https://mdn.github.io/houdini-examples/cssPaint/intro/worklets/hilite.js'); li { --boxColor: hsla(55, 90%, 60%, 1.0); background-image: paint(hollowHighlights, stroke, 2px); } li:nth-of-type(3n) { --boxColor: hsla(155, 90%, 60%, 1.0); background-image: paint(hollowHighlights, filled, 3px); } li:nth-of-type(3n+1) { --boxColor: hsla(255, 90%, 60%, 1.0); background-image: paint(hollowHighligh...
...e accessible to the PaintWorklet. Specifications Specification Status Comment CSS Painting API Level 1The definition of 'Paint Notation' in that specification. Working Draft Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetpaint()Chrome Full support 65Edge Full support 79Firefox No support ...
perspective-origin - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The perspective-origin CSS property determines the position at which the viewer is looking. It is used as the vanishing point by the perspective property. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The perspective-origin and perspective properties are attached to the parent of a child transformed in 3-dimensional space, unlike the perspective() transform function which is placed on the element being transformed. Syntax /* One-value syntax */ perspective-origin: x-position; /* Two-value syntax */ perspective-origin: x-position y-position; /* When both x-position and y-position are keywords, the following...
perspective - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The perspective CSS property determines the distance between the z=0 plane and the user in order to give a 3D-positioned element some perspective. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Keyword value */ perspective: none; /* <length> values */ perspective: 20px; perspective: 3.5em; /* Global values */ perspective: inherit; perspective: initial; perspective: unset; Values none Indicates that no perspective transform is to be applied. <length> A <length> giving the distance from the user to the z=0 plane. It is used to apply a perspective transform to the element and its content. If the ...
place-content - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The place-content CSS shorthand property allows you to align content along both the block and inline directions at once (i.e. the align-content and justify-content properties) in a relevant layout system such as Grid or Flexbox. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Constituent properties This property is a shorthand for the following CSS properties: align-content justify-content Syntax /* Positional alignment */ /* align-content does not take left and right values */ place-content: center start; place-content: start center; place-content: end left; place-content: flex-start center; place-content:...
scroll-margin-block - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The scroll-margin-block shorthand property sets the scroll margins of an element in the block dimension. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Constituent properties This property is a shorthand for the following CSS properties: scroll-margin-block-end scroll-margin-block-start Syntax /* <length> values */ scroll-margin-block: 10px; scroll-margin-block: 1em .5em ; /* Global values */ scroll-margin-block: inherit; scroll-margin-block: initial; scroll-margin-block: unset; Values <length> An outset from the corresponding edge of the scroll container. Description The scroll-margin values rep...
scroll-margin - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The scroll-margin shorthand property sets all of the scroll margins of an element at once, assigning values much like the margin property does for margins of an element. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Constituent properties This property is a shorthand for the following CSS properties: scroll-margin-bottom scroll-margin-left scroll-margin-right scroll-margin-top Syntax /* <length> values */ scroll-margin: 10px; scroll-margin: 1em .5em 1em 1em; /* Global values */ scroll-margin: inherit; scroll-margin: initial; scroll-margin: unset; Values <length> An outset from the corresponding e...
shape-image-threshold - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Any pixels whose alpha component's value is greater than the threshold are considered to be part of the shape for the purposes of determining its boundaries. ...
... The shape-image-threshold CSS property sets the alpha channel threshold used to extract the shape using an image as the value for shape-outside. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Any pixels whose alpha component's value is greater than the threshold are considered to be part of the shape for the purposes of determining its boundaries. For example, a value of 0.5 means that the shape will enclose all the pixels that are more than 50% opaque. /* <number> value */ shape-image-threshold: 0.7; /* Global values */ shape-image-threshold: inherit; shape-image-threshold: initial; shape-image-threshold: unset...
text-align-last - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The text-align-last CSS property sets how the last line of a block or a line, right before a forced line break, is aligned. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Keyword values */ text-align-last: auto; text-align-last: start; text-align-last: end; text-align-last: left; text-align-last: right; text-align-last: center; text-align-last: justify; /* Global values */ text-align-last: inherit; text-align-last: initial; text-align-last: unset; Values auto The affected line is aligned per the value of text-align, unless text-align is justify, in which case the effect is the same as setting tex...
text-align - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The text-align CSS property sets the horizontal alignment of a block element or table-cell box. This means it works like vertical-align but in the horizontal direction. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Keyword values */ text-align: left; text-align: right; text-align: center; text-align: justify; text-align: justify-all; text-align: start; text-align: end; text-align: match-parent; /* Character-based alignment in a table column */ text-align: "."; text-align: "." center; /* Block alignment values (Non-standard syntax) */ text-align: -moz-center; text-align: -webkit-center; /* Global val...
text-decoration-line - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. When setting multiple line-decoration properties at once, it may be more convenient to use the text-decoration shorthand property instead. ...
... When setting multiple line-decoration properties at once, it may be more convenient to use the text-decoration shorthand property instead. ...
text-decoration-skip-ink - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. text-decoration-skip-ink is not part of the text-decoration shorthand. ...
... text-decoration-skip-ink is not part of the text-decoration shorthand. ...
text-decoration-style - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The text-decoration-style CSS property sets the style of the lines specified by text-decoration-line. The style applies to all lines that are set with text-decoration-line. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. If the specified decoration has a specific semantic meaning, like a line-through line meaning that some text has been deleted, authors are encouraged to denote this meaning using an HTML tag, like <del> or <s>. As browsers can disable styling in some cases, the semantic meaning won't disappear in such a situation. When setting multiple line-decoration properties at once, it may be more convenient ...
text-decoration - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The text-decoration shorthand CSS property sets the appearance of decorative lines on text. It is a shorthand for text-decoration-line, text-decoration-color, text-decoration-style, and the newer text-decoration-thickness property. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Text decorations are drawn across descendant text elements. This means that if an element specifies a text decoration, then a child element can't remove the decoration. For example, in the markup <p>This text has <em>some emphasized words</em> in it.</p>, the style rule p { text-decoration: underline; } would cause the entire paragraph to b...
text-emphasis - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The text-emphasis property is quite different from text-decoration. ...
... The text-emphasis property is quite different from text-decoration. ...
text-overflow - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The text-overflow property doesn't force an overflow to occur. To make text overflow its container you have to set other CSS properties: overflow and white-space. ...
... The text-overflow property doesn't force an overflow to occur. ...
text-shadow - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... property adds shadows to text. It accepts a comma-separated list of shadows to be applied to the text and any of its decorations. Each shadow is described by some combination of X and Y offsets from the element, blur radius, and color. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* offset-x | offset-y | blur-radius | color */ text-shadow: 1px 1px 2px black; /* color | offset-x | offset-y | blur-radius */ text-shadow: #fc0 1px 0 10px; /* offset-x | offset-y | color */ text-shadow: 5px 5px #558abb; /* color | offset-x | offset-y */ text-shadow: white 2px 5px; /* offset-x | offset-y /* Use defaults for...
text-transform - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The text-transform CSS property specifies how to capitalize an element's text. It can be used to make text appear in all-uppercase or all-lowercase, or with each word capitalized. It also can help improve legibility for ruby. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The text-transform property takes into account language-specific case mapping rules such as the following: In Turkic languages, like Turkish (tr), Azerbaijani (az), Crimean Tatar (crh), Volga Tatar (tt), and Bashkir (ba), there are two kinds of i, with and without the dot, and two case pairings: i/I and i/I. In German (de), the ss bec...
text-underline-position - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The text-underline-position CSS property specifies the position of the underline which is set using the text-decoration property's underline value. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Single keyword */ text-underline-position: auto; text-underline-position: under; text-underline-position: left; text-underline-position: right; /* Multiple keywords */ text-underline-position: under left; text-underline-position: right under; /* Global values */ text-underline-position: inherit; text-underline-position: initial; text-underline-position: unset; Syntax Values auto The user agent uses its ...
top - CSS: Cascading Style Sheets
Web › CSS › top
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The top CSS property participates in specifying the vertical position of a positioned element. It has no effect on non-positioned elements. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The effect of top depends on how the element is positioned (i.e., the value of the position property): When position is set to absolute or fixed, the top property specifies the distance between the element's top edge and the top edge of its containing block. When position is set to relative, the top property specifies the distance the element's top edge is moved below its normal position. When position is set to sticky, the t...
rotate3d() - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. In 3D space, rotations have three degrees of liberty, which together describe a single axis of rotation. ...
... The rotate3d() CSS function defines a transformation that rotates an element around a fixed axis in 3D space, without deforming it. Its result is a <transform-function> data type. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. In 3D space, rotations have three degrees of liberty, which together describe a single axis of rotation. The axis of rotation is defined by an [x, y, z] vector and pass by the origin (as defined by the transform-origin property). If, as specified, the vector is not normalized (i.e., if the sum of the square of its three coordinates is not 1), the user agent will normalize it internally. A no...
rotateX() - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The axis of rotation passes through an origin, defined by the transform-origin CSS property. ...
... The rotateX() CSS function defines a transformation that rotates an element around the abscissa (horizontal axis) without deforming it. Its result is a <transform-function> data type. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The axis of rotation passes through an origin, defined by the transform-origin CSS property. Note: rotateX(a) is equivalent to rotate3d(1, 0, 0, a). Note: Unlike rotations in the 2D plane, the composition of 3D rotations is usually not commutative. In other words, the order in which the rotations are applied impacts the result. Syntax The amount of rotation created by rotateX() is ...
rotateY() - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The axis of rotation passes through an origin, defined by the transform-origin CSS property. Note: rotateY(a) is equivalent to rotate3d(0, 1, 0, a). ...
... The rotateY() CSS function defines a transformation that rotates an element around the ordinate (vertical axis) without deforming it. Its result is a <transform-function> data type. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The axis of rotation passes through an origin, defined by the transform-origin CSS property. Note: rotateY(a) is equivalent to rotate3d(0, 1, 0, a). Note: Unlike rotations in the 2D plane, the composition of 3D rotations is usually not commutative. In other words, the order in which the rotations are applied impacts the result. Syntax The amount of rotation created by rotateY() is sp...
rotateZ() - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The axis of rotation passes through an origin, defined by the transform-origin CSS property. Note: rotateZ(a) is equivalent to rotate(a) or rotate3d(0, 0, 1, a). ...
... The rotateZ() CSS function defines a transformation that rotates an element around the z-axis without deforming it. Its result is a <transform-function> data type. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The axis of rotation passes through an origin, defined by the transform-origin CSS property. Note: rotateZ(a) is equivalent to rotate(a) or rotate3d(0, 0, 1, a). Note: Unlike rotations in the 2D plane, the composition of 3D rotations is usually not commutative. In other words, the order in which the rotations are applied impacts the result. Syntax The amount of rotation created by rotateZ() is specifi...
scale3d() - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...d() CSS function defines a transformation that resizes an element in 3D space. Because the amount of scaling is defined by a vector, it can resize different dimensions at different scales. Its result is a <transform-function> data type. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. This scaling transformation is characterized by a three-dimensional vector. Its coordinates define how much scaling is done in each direction. If all three coordinates are equal, the scaling is uniform (isotropic) and the aspect ratio of the element is preserved (this is a homothetic transformation). When a coordinate value is outside ...
skewX() - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. This transformation is a shear mapping (transvection) that distorts each point within an element by a certain angle in the horizontal direction. ...
... The skewX() CSS function defines a transformation that skews an element in the horizontal direction on the 2D plane. Its result is a <transform-function> data type. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. This transformation is a shear mapping (transvection) that distorts each point within an element by a certain angle in the horizontal direction. The abscissa coordinate of each point is modified by a value proportionate to the specified angle and the distance to the origin; thus, the farther from the origin a point is, the greater will be the value added it. Note: skewX(a) is equivalent to skew(a). Syn...
skewY() - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. This transformation is a shear mapping (transvection) that distorts each point within an element by a certain angle in the vertical direction. ...
... The skewY() CSS function defines a transformation that skews an element in the vertical direction on the 2D plane. Its result is a <transform-function> data type. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. This transformation is a shear mapping (transvection) that distorts each point within an element by a certain angle in the vertical direction. The ordinate coordinate of each point is modified by a value proportionate to the specified angle and the distance to the origin; thus, the farther from the origin a point is, the greater will be the value added it. Syntax skewY(a) Values a Is an <angle> repre...
translateZ() - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. This transformation is defined by a <length> which specifies how far inward or outward the element or elements move. ...
... The translateZ() CSS function repositions an element along the z-axis in 3D space, i.e., closer to or farther away from the viewer. Its result is a <transform-function> data type. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. This transformation is defined by a <length> which specifies how far inward or outward the element or elements move. In the above interactive examples, perspective: 550px; (to create a 3D space) and transform-style: preserve-3d; (so the children, the 6 sides of the cube, are also positioned in the 3D space), have been set on the cube. Note: translateZ(tz) is equivalent to translate3d(0, 0...
transform - CSS: Cascading Style Sheets
Web › CSS › transform
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. If the property has a value different than none, a stacking context will be created. ...
... If the property has a value different than none, a stacking context will be created. ...
transition-duration - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The transition-duration CSS property sets the length of time a transition animation should take to complete. By default, the value is 0s, meaning that no animation will occur. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. You may specify multiple durations; each duration will be applied to the corresponding property as specified by the transition-property property, which acts as a master list. If there are fewer durations specified than in the master list, the user agent repeat the list of durations. If there are more durations, the list is simply truncated to the right size. In both case the CSS declaration stay...
var() - CSS: Cascading Style Sheets
Web › CSS › var
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The var() function cannot be used in property names, selectors or anything else besides property values. ...
... The var() CSS function can be used to insert the value of a custom property (sometimes called a "CSS variable") instead of any part of a value of another property. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The var() function cannot be used in property names, selectors or anything else besides property values. (Doing so usually produces invalid syntax, or else a value whose meaning has no connection to the variable.) Syntax The first argument to the function is the name of the custom property to be substituted. An optional second argument to the function serves as a fallback value. If the custom property ref...
visibility - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. To both hide an element and remove it from the document layout, set the display property to none instead of using visibility. ...
... The visibility CSS property shows or hides an element without changing the layout of a document. The property can also hide rows or columns in a <table>. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. To both hide an element and remove it from the document layout, set the display property to none instead of using visibility. Syntax /* Keyword values */ visibility: visible; visibility: hidden; visibility: collapse; /* Global values */ visibility: inherit; visibility: initial; visibility: unset; The visibility property is specified as one of the keyword values listed below. Values visible The element box i...
width - CSS: Cascading Style Sheets
Web › CSS › width
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The min-width and max-width properties override width. ...
... The min-width and max-width properties override width. ...
word-break - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The word-break CSS property sets whether line breaks appear wherever the text would otherwise overflow its content box. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Keyword values */ word-break: normal; word-break: break-all; word-break: keep-all; word-break: break-word; /* deprecated */ /* Global values */ word-break: inherit; word-break: initial; word-break: unset; The word-break property is specified as a single keyword chosen from the list of values below. Values normal Use the default line break rule. break-all To prevent overflow, word breaks should be inserted between any two characte...
word-spacing - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The word-spacing CSS property sets the length of space between words and between tags. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Keyword value */ word-spacing: normal; /* <length> values */ word-spacing: 3px; word-spacing: 0.3em; /* <percentage> values */ word-spacing: 50%; word-spacing: 200%; /* Global values */ word-spacing: inherit; word-spacing: initial; word-spacing: unset; Values normal The normal inter-word spacing, as defined by the current font and/or the browser. <length> Specifies extra spacing in addition to the intrinsic inter-word spacing defined by the font. <percentage> ...
writing-mode - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...CSS property sets whether lines of text are laid out horizontally or vertically, as well as the direction in which blocks progress. When set for an entire document, it should be set on the root element (html element for HTML documents). The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. This property specifies the block flow direction, which is the direction in which block-level containers are stacked, and the direction in which inline-level content flows within a block container. Thus, it also determines the ordering of block-level content. Syntax /* Keyword values */ writing-mode: horizontal-tb; writing-mode: verti...
z-index - CSS: Cascading Style Sheets
Web › CSS › z-index
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... 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. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. 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. Whether the box establishes a local stacking context. Syntax /* Keyword value */ z-index: auto; /* <integer> values */ z-index: 0; z-index: 3; z-index: 289; z-index: -1; /* Negative values to lower the priority */ /* Global ...
Audio and video manipulation - Developer guides
on a different domain than your code, you'll need to enable CORS (Cross Origin Resource Sharing) on your video server. Video and WebGL WebGL is a powerful API that uses canvas to draw hardware-accelerated 3D or 2D scenes. You can combine WebGL and the <video> element to create video textures, which means you can put video inside 3D scenes. Note: You can find the source code of this demo on GitHub (see it live also). Playback rate We can also adjust the rate that audio and video plays at using an attribute of the <audio> and <video> element called playbackRate. playbackRate is a number that represents a multiple to be applied to the rate of playback, for example 0.5 represents half speed while 2 represents double speed. Note that the playbackRate property works with both <audio> and...
...l elements, all in 3D space as defined using 3D cartesian coordinates. Example var panner = context.createPanner(); panner.coneOuterGain = 0.2; panner.coneOuterAngle = 120; panner.coneInnerAngle = 0; panner.connect(context.destination); source.connect(panner); source.start(0); // Position the listener at the origin. context.listener.setPosition(0, 0, 0); Note: You can find an example on our GitHub repository (see it live also). JavaScript codecs It's also possible to manipulate audio at a low level using JavaScript. This can be useful should you want to create audio codecs. Libraries currently exist for the following formats : AAC: AAC.js ALAC: alac.js FLAC: flac.js MP3: mp3.js Opus: Opus.js Vorbis: vorbis.js Note: At Audiocogs, you can Try out a few demos; Audiocogs also...
Constraint validation - Developer guides
means there is an error and this string is the error message to display to the user. Constraint combining several fields: Postal code validation The postal code format varies from one country to another. Not only do most countries allow an optional prefix with the country code (like D- in Germany, F- in France or Switzerland), but some countries have postal codes with only a fixed number of digits; others, like the UK, have more complex structures, allowing letters at some specific positions. Note: This is not a comprehensive postal code validation library, but rather a demonstration of the key concepts. As an example, we will add a script checking the constraint validation for this simple form: <form> <label for="ZIP">ZIP : </label> <input type="text" id="ZIP"> <label fo...
...on> <option value="nl">The Netherlands</option> </select> <input type="submit" value="Validate"> </form> This displays the following form: First, we write a function checking the constraint itself: function checkZIP() { // For each country, defines the pattern that the ZIP has to follow var constraints = { ch : [ '^(CH-)?\\d{4}$', "Switzerland ZIPs must have exactly 4 digits: e.g. CH-1950 or 1950" ], fr : [ '^(F-)?\\d{5}$' , "France ZIPs must have exactly 5 digits: e.g. F-75012 or 75012" ], de : [ '^(D-)?\\d{5}$' , "Germany ZIPs must have exactly 5 digits: e.g. D-12345 or 12345" ], nl : [ '^(NL-)?\\d{4}\\s*([A-RT-Z][A-Z]|S[BCE-RT-Z])$', "Nederland ZIPs must have exactly 4 digits, followed by 2 letters except SA, SD and SS" ] }; /...
A hybrid approach - Developer guides
comfortably to tablets as well. Examples For Mozilla's Web O' Wonder demo site, we tried out a basic version of the hybrid approach, with positive results. We used some elements of responsive web design to give the site a mobile layout, along with user-agent detection to provide mobile-friendly videos and to re-order the demos if the user is on a phone. Feel free to check out the source code on github. We could also be doing more development involving this approach very soon! In fact, one potential path for the main Mozilla site is roughly outlined in the "The Good" section above: Using user-agent detection, route visitors to a landing page for the Firefox version for their device. Every page on the site should look great at a wide variety of resolutions, being built with responsive de...
...page for the Firefox version for their device. Every page on the site should look great at a wide variety of resolutions, being built with responsive design in mind. Future plans include exploring serving images based on user-agent. So far there is not much to see for mobile, since things are still in the formative stages of development, but you can always watch the new mozilla.org grow up on github. Subscribe to the Mozilla Webdev blog for updates about our progress. Summary No approach is a one-size-fits-all solution. Web applications that want to heavily modify the content or user flow for mobile users should probably go for a separate mobile site. Content-oriented pages that don't need to modify their content for mobile users will be satisfied with responsive design. If you need to ...
The HTML autocomplete attribute - HTML: Hypertext Markup Language
A credit card number or other number identifying a payment method, such as an account number. "cc-exp" A payment method expiration date, typically in the form "MM/YY" or "MM/YYYY". "cc-exp-month" The month in which the payment method expires. "cc-exp-year" The year in which the payment method expires. "cc-csc" The security code for the payment instrument; on credit cards, this is the 3-digit verification number on the back of the card. "cc-type" The type of payment instrument (such as "Visa" or "Master Card"). "transaction-currency" The currency in which the transaction is to take place. "transaction-amount" The amount, given in the currency specified by "transaction-currency", of the transaction, for a payment form. "language" A preferred language, given as a valid BCP 47 la...
...he district. Japan An address in Japan is typically written in one line, in an order from the least-specific to more-specific portions (in reverse order to the United States). There are two or three administrative levels in an address. Additional line can be used to show building names and room numbers. The postal code is separate. For example: ?381-0000 ????????123 "?" and following seven digits shows the postal code. address-level1 is used for prefectures or the Tokyo Metropolis; "???" (Nagano Prefecture) is in this case. address-level2 is typically used for cities, counties, towns and villages; "???" (Nagano City) in this case. "??123" is address-line1 which consists of an area name and a lot number. Specifications Specification Status Comment HTML Livin...
<a>: The Anchor element - HTML: Hypertext Markup Language
Web › HTML › Element › a
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...ment (or anchor element), with its href attribute, creates a hyperlink to web pages, files, email addresses, locations in the same page, or anything else a URL can address. Content within each <a> should indicate the link's destination. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Attributes This element's attributes include the global attributes. downloadHTML5 Prompts the user to save the linked URL instead of navigating to it. Can be used with or without a value: Without a value, the browser will suggest a filename/extension, generated from various sources: The Content-Disposition HTTP header...
<abbr>: The Abbreviation element - HTML: Hypertext Markup Language
Web › HTML › Element › abbr
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... HTML Abbreviation element (<abbr>) represents an abbreviation or acronym; the optional title attribute can provide an expansion or description for the abbreviation. If present, title must contain this full description and nothing else. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, phrasing content, palpable content Permitted content Phrasing content Tag omission None, both the starting and ending tag are mandatory. Permitted parents Any element that accepts phrasing content Implicit ARIA role No corresponding role ...
<address>: The Contact Address element - HTML: Hypertext Markup Language
Web › HTML › Element › address
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The HTML <address> element indicates that the enclosed HTML provides contact information for a person or people, or for an organization. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The contact information provided by an <address> element's contents can take whatever form is appropriate for the context, and may include any type of contact information that is needed, such as a physical address, URL, email address, phone number, social media handle, geographic coordinates, and so forth. The <address> element should include the name of the person, people, or organization to which the contact information refers. <...
<area> - HTML: Hypertext Markup Language
Web › HTML › Element › area
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, phrasing content. Permitted content None, it is an empty element. ...
... Content categories Flow content, phrasing content. ...
<aside>: The Aside element - HTML: Hypertext Markup Language
Web › HTML › Element › aside
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, sectioning content, palpable content. ...
... The HTML <aside> element represents a portion of a document whose content is only indirectly related to the document's main content. Asides are frequently presented as sidebars or call-out boxes. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, sectioning content, palpable content. Permitted content Flow content. Tag omission None, both the starting and ending tag are mandatory. Permitted parents Any element that accepts flow content. Note that an <aside> element must not be a descendant of an <address> element. Implicit ARIA ...
<br>: The Line Break element - HTML: Hypertext Markup Language
Web › HTML › Element › br
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. As you can see from the above example, a <br> element is included at each point where we want the text to break. ...
... The HTML <br> element produces a line break in text (carriage-return). It is useful for writing a poem or an address, where the division of lines is significant. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. As you can see from the above example, a <br> element is included at each point where we want the text to break. The text after the <br> begins again at the start of the next line of the text block. Note: Do not use <br> to create margins between paragraphs; wrap them in <p> elements and use the CSS margin property to control their size. Attributes This element's attributes include the global attributes...
<cite>: The Citation element - HTML: Hypertext Markup Language
Web › HTML › Element › cite
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...n element (<cite>) is used to describe a reference to a cited creative work, and must include the title of that work. The reference may be in an abbreviated form according to context-appropriate conventions related to citation metadata. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, phrasing content, palpable content. Permitted content Phrasing content. Tag omission None, both the starting and ending tag are mandatory. Permitted parents Any element that accepts phrasing content. Implicit ARIA role No corresponding role ...
<code>: The Inline Code element - HTML: Hypertext Markup Language
Web › HTML › Element › code
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The HTML <code> element displays its contents styled in a fashion intended to indicate that the text is a short fragment of computer code. By default, the content text is displayed using the user agent's default monospace font. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, phrasing content, palpable content. Permitted content Phrasing content. Tag omission None, both the starting and ending tag are mandatory. Permitted parents Any element that accepts phrasing content. Implicit ARIA role No corresponding role Per...
<colgroup> - HTML: Hypertext Markup Language
Web › HTML › Element › colgroup
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories None. Permitted content If the span attribute is present: none, it is an empty element. If the attribute is not present: zero or more <col> element Tag omission The start tag may be omitted, if it has a <col> element as its first child and if it is not preceded by a <colgroup> whose end tag has been omitted. ...
...is the total number of the columns in the table and b is the ordinal position of this column in the table. Only after this selector the text-align property can be used. If the table does use a colspan attribute, the effect can be achieved by combining adequate CSS attribute selectors like [colspan=n], though this is not trivial. bgcolor The background color of the table. It is a 6-digit hexadecimal RGB code, prefixed by a '#'. One of the predefined color kewords can also be used. To achieve a similar effect, use the CSS background-color property. char This attribute specifies the alignment of the content in a column group to a character. Typical values for this include a period (.) when attempting to align numbers or monetary values. If align is not set to char, this att...
<data> - HTML: Hypertext Markup Language
Web › HTML › Element › data
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, phrasing content, palpable content. Permitted content Phrasing content. ...
... The HTML <data> element links a given piece of content with a machine-readable translation. If the content is time- or date-related, the <time> element must be used. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, phrasing content, palpable content. Permitted content Phrasing content. Tag omission None, both the starting and ending tag are mandatory. Permitted parents Any element that accepts phrasing content. Implicit ARIA role No corresponding role Permitted ARIA roles Any DOM interface HTMLDataEle...
<datalist>: The HTML Data List element - HTML: Hypertext Markup Language
Web › HTML › Element › datalist
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, phrasing content. Permitted content Either phrasing content or zero or more <option> elements. ...
... Content categories Flow content, phrasing content. ...
<dd>: The Description Details element - HTML: Hypertext Markup Language
Web › HTML › Element › dd
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories None. Permitted content Flow content. Tag omission The start tag is required. ...
... Content categories None. Permitted content Flow content. Tag omission The start tag is required. ...
<dfn>: The Definition element - HTML: Hypertext Markup Language
Web › HTML › Element › dfn
The HTML Definition element (<dfn>) is used to indicate the term being defined within the context of a definition phrase or sentence. The <p> element, the <dt>/<dd> pairing, or the <section> element which is the nearest ancestor of the <dfn> is considered to be the definition of the term. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, phrasing content, palpable content. Permitted content Phrasing content, but no <dfn> element must be a descendant. Tag omission None, both the starting and ending tag are mandatory. Permitted parents Any...
...entence.</p> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Graece donan, Latine voluptatem vocant. Confecta res esset. Duo Reges: constructio interrete. Scrupulum, inquam, abeunti; </p> <p>Negare non possum. Dat enim intervalla et relaxat. Quonam modo? Equidem e Cn. Quid de Pythagora? In schola desinis. </p> <p>Ubi ut eam caperet aut quando? Cur iustitia laudatur? Aperiendum est igitur, quid sit voluptas; Quid enim? Non est igitur voluptas bonum. Urgent tamen et nihil remittunt. Quid enim possumus hoc agere divinius? </p> <p>Because of all of that, we decided to use the <code><a href="#definition-dfn">&lt;dfn&gt;</a></code> element for this project.</p> Here we see the definition -- now with an id attribute, "definition-dfn", which can be used as the target of a link. Later...
<div>: The Content Division element - HTML: Hypertext Markup Language
Web › HTML › Element › div
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. As a "pure" container, the <div> element does not inherently represent anything. ...
... As a "pure" container, the <div> element does not inherently represent anything. ...
<em>: The Emphasis element - HTML: Hypertext Markup Language
Web › HTML › Element › em
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, phrasing content, palpable content. Permitted content Phrasing content. ...
... Content categories Flow content, phrasing content, palpable content. ...
<embed>: The Embed External Content element - HTML: Hypertext Markup Language
Web › HTML › Element › embed
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Note: This topic documents only the element that is defined as part of HTML5. ...
... The HTML <embed> element embeds external content at the specified point in the document. This content is provided by an external application or other source of interactive content such as a browser plug-in. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Note: This topic documents only the element that is defined as part of HTML5. It does not address earlier, non-standardized implementation of the element. Keep in mind that most modern browsers have deprecated and removed support for browser plug-ins, so relying upon <embed> is generally not wise if you want your site to be operable on the average user's browse...
<figcaption>: The Figure Caption element - HTML: Hypertext Markup Language
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories None. Permitted content Flow content. Tag omission None, both the starting and ending tag are mandatory. ...
... Content categories None. Permitted content Flow content. ...
<figure>: The Figure with Optional Caption element - HTML: Hypertext Markup Language
Web › HTML › Element › figure
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...gure With Optional Caption) element represents self-contained content, potentially with an optional caption, which is specified using the (<figcaption>) element. The figure, its caption, and its contents are referenced as a single unit. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, sectioning root, palpable content. Permitted content A <figcaption> element, followed by flow content; or flow content followed by a <figcaption> element; or flow content. Tag omission None, both the starting and ending tag are mandatory. Permitted parents ...
<footer> - HTML: Hypertext Markup Language
Web › HTML › Element › footer
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The HTML <footer> element represents a footer for its nearest sectioning content or sectioning root element. A footer typically contains information about the author of the section, copyright data or links to related documents. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, palpable content. Permitted content Flow content, but with no <footer> or <header> descendants. Tag omission None, both the starting and ending tag are mandatory. Permitted parents Any element that accepts flow content. Note that a <footer> element must not be a d...
<header> - HTML: Hypertext Markup Language
Web › HTML › Element › header
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, palpable content. ...
... The HTML <header> element represents introductory content, typically a group of introductory or navigational aids. It may contain some heading elements but also a logo, a search form, an author name, and other elements. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, palpable content. Permitted content Flow content, but with no <header> or <footer> descendant. Tag omission None, both the starting and ending tag are mandatory. Permitted parents Any element that accepts flow content. Note that a <header> element must not be a descendant...
<hr>: The Thematic Break (Horizontal Rule) element - HTML: Hypertext Markup Language
Web › HTML › Element › hr
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Historically, this has been presented as a horizontal rule or line. ...
... Historically, this has been presented as a horizontal rule or line. ...
<input type="button"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › button
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... <input> elements of type button are rendered as simple push buttons, which can be programmed to control custom functionality anywhere on a webpage as required when assigned an event handler function (typically for the click event). The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Note: While <input> elements of type button are still perfectly valid HTML, the newer <button> element is now the favored way to create buttons. Given that a <button>'s label text is inserted between the opening and closing tags, you can include HTML in the label, even images. Value A DOMString used as the button's label ...
<input type="color"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › color
format with an alpha channel. The element's presentation may vary substantially from one browser and/or platform to another--it might be a simple textual input that automatically validates to ensure that the color information is entered in the proper format, or a platform-standard color picker, or some kind of custom color picker window. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Value A 7-character DOMString specifying a <color> in lower-case hexadecimal notation Events change and input Supported common attributes autocomplete and list IDL attributes list and v...
...ou can update the simple example above to set a default value, so that the color well is pre-filled with the default color and the color picker (if any) will also default to that color: <input type="color" value="#ff0000"> If you don't specify a value, the default is #000000, which is black. The value must be in seven-character hexadecimal notation, meaning the "#" character followed by two digits each representing red, green, and blue, like this: #rrggbb. If you have colors that are in any other format (such as CSS color names or CSS color functions such as rgb() or rgba()), you'll have to convert them to hexadecimal before setting the value. Tracking color changes As is the case with other <input> types, there are two events that can be used to detect changes to the color value: input...
<input type="date"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › date
<input> elements of type="date" create input fields that let the user enter a date, either with a textbox that validates the input or a special date picker interface. The resulting value includes the year, month, and day, but not the time. The time and datetime-local input types support time and date+time input. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The input UI generally varies from browser to browser; see Browser compatibility for further details. In unsupported browsers, the control degrades gracefully to <input type="text">. Among browsers with custom interfaces for selecting dates are Chrome and Op...
...Of course, this doesn't stop people from entering invalid dates, or incorrect formats. So we still have a problem. span { position: relative; } span::after { right: -18px; position: absolute; } input:invalid + span::after { content: '?'; } input:valid + span::after { content: '?'; } At the moment, the best way to deal with dates in forms in a cross-browser way is to...
<input type="image"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › image
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Value None -- the value attribute should not be specified. Events None. ...
... Value None -- the value attribute should not be specified. Events None. ...
<input type="month"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › month
<input> elements of type month create input fields that let the user enter a month and year allowing a month and year to be easily entered. The value is a string whose value is in the format "YYYY-MM", where YYYY is the four-digit year and MM is the month number. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The control's UI varies in general from browser to browser; at the moment support is patchy, with only Chrome/Opera and Edge on desktop -- and most modern mobile browser versions -- having usable implementations. In browsers that don't support month inputs, the control degrades gracefully to a simple <input t...
... Value A DOMString representing a month and year, or empty. Events change and input Supported common attributes autocomplete, list, readonly, and step. IDL attributes value Methods select(), stepDown(), stepUp(). Value A DOMString representing the value of the month and year entered into the input, in the form YYYY-MM (four or more digit year, then a hyphen ("-"), followed by the two-digit month). The format of the month string used by this input type is described in Format of a valid local month string in Date and time formats used in HTML. You can set a default value for the input control by including a month and year inside the value attribute, like so: <label for="bday-month">What month were you born in?</label> <input id=...
<input type="reset"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › reset
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. You should usually avoid including reset buttons in your forms. ...
... You should usually avoid including reset buttons in your forms. ...
<input type="search"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › search
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Value A DOMString representing the value contained in the search field. ...
... <input> elements of type search are text fields designed for the user to enter search queries into. These are functionally identical to text inputs, but may be styled differently by the user agent. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Value A DOMString representing the value contained in the search field. Events change and input Supported Common Attributes autocomplete, list, maxlength, minlength, pattern, placeholder, required, size. IDL attributes value Methods select(), setRangeText(), setSelectionRange(). Value The value attribute c...
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
Web › HTML › Element › input
te interactive controls for web-based forms in order to accept data from the user; a wide variety of types of input data and control widgets are available, depending on the device and user agent. The <input> element is one of the most powerful and complex in all of HTML due to the sheer number of combinations of input types and attributes. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. <input> types How an <input> works varies considerably depending on the value of its type attribute, hence the different types are covered in their own separate reference pages. If this attribute is not specified, the default type a...
...> <option>32</option> <option>64</option> </datalist> <datalist id="fruitsxx"> <option>cherry</option> <option>banana</option> <option>mango</option> <option>orange</option> <option>blueberry</option> </datalist> <datalist id="urlsxx"> <option>https://developer.mozilla.org</option> <option>https://caniuse.com/</option> <option>https://mozilla.com</option> <option>https://mdn.github.io</option> <option>https://www.youtube.com/user/firefoxchannel</option> </datalist> <p><label for="textx">Text</label> <input type="text" list="fruitsxx" id="textx"/></p> <p><label for="colorx">Color</label> <input type="color" list="colorsxx" id="colorx"/></p> <p><label for="rangex">Range</label> <input type="range" min="0" max="64" list="numbersxx" id="rangex"/></p> <p><label for="number...
<ins> - HTML: Hypertext Markup Language
Web › HTML › Element › ins
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Phrasing content or flow content. Permitted content Transparent. ...
... The HTML <ins> element represents a range of text that has been added to a document. You can use the <del> element to similarly represent a range of text that has been deleted from the document. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Phrasing content or flow content. Permitted content Transparent. Tag omission None, both the starting and ending tag are mandatory. Permitted parents Any element that accepts phrasing content. Implicit ARIA role No corresponding role Permitted ARIA roles Any DOM interface HT...
<kbd>: The Keyboard Input element - HTML: Hypertext Markup Language
Web › HTML › Element › kbd
The HTML Keyboard Input element (<kbd>) represents a span of inline text denoting textual user input from a keyboard, voice input, or any other text entry device. By convention, the user agent defaults to rendering the contents of a <kbd> element using its default monospace font, although this is not mandated by the HTML standard. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. <kbd> may be nested in various combinations with the <samp> (Sample Output) element to represent various forms of input or output based on visual cues. Content categories Flow content, phrasing content, palpable content. ...
...cument by pressing <kbd><kbd class="key">Ctrl</kbd>+<kbd class="key">N</kbd></kbd>.</p> Result The result is just what we want! Echoed input Nesting a <kbd> element inside a <samp> element represents input that has been echoed back to the user by the system. <p>If a syntax error occurs, the tool will output the initial command you typed for your review:</p> <blockquote> <samp><kbd>custom-git ad my-new-file.cpp</kbd></samp> </blockquote> Representing onscreen input options Nesting a <samp> element inside a <kbd> element represents input which is based on text presented by the system, such as the names of menus and menu items, or the names of buttons displayed on the screen. For example, you can explain how to choose the "New Document" option in the "File" menu using HTML that loo...
<main> - HTML: Hypertext Markup Language
Web › HTML › Element › main
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... element represents the dominant content of the <body> of a document. The main content area consists of content that is directly related to or expands upon the central topic of a document, or the central functionality of an application. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. A document mustn't have more than one <main> element that doesn't have the hidden attribute specified. Content categories Flow content, palpable content. Permitted content Flow content. Tag omission None; both the starting and ending tags are mandatory. Permitted parents Where flow conte...
<mark>: The Mark Text element - HTML: Hypertext Markup Language
Web › HTML › Element › mark
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, phrasing content, palpable content. ...
... The HTML Mark Text element (<mark>) represents text which is marked or highlighted for reference or notation purposes, due to the marked passage's relevance or importance in the enclosing context. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, phrasing content, palpable content. Permitted content Phrasing content. Tag omission None, both the starting and ending tag are mandatory. Permitted parents Any element that accepts phrasing content. Implicit ARIA role No corresponding role Permitted ARIA roles Any ...
<nav>: The Navigation Section element - HTML: Hypertext Markup Language
Web › HTML › Element › nav
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...HTML <nav> element represents a section of a page whose purpose is to provide navigation links, either within the current document or to other documents. Common examples of navigation sections are menus, tables of contents, and indexes. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, sectioning content, palpable content. Permitted content Flow content. Tag omission None, both the starting and ending tag are mandatory. Permitted parents Any element that accepts flow content. Implicit ARIA role navigation Permitted A...
<object> - HTML: Hypertext Markup Language
Web › HTML › Element › object
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The HTML <object> element represents an external resource, which can be treated as an image, a nested browsing context, or a resource to be handled by a plugin. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content; phrasing content; embedded content, palpable content; if the element has a usemap attribute, interactive content; listed, submittable form-associated element. Permitted content zero or more <param> elements, then transparent. Tag omission None, both the starting and ending tag are mandatory. Permitted parents Any element that acc...
<option>: The HTML Option element - HTML: Hypertext Markup Language
Web › HTML › Element › option
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories None. ...
... The HTML <option> element is used to define an item contained in a <select>, an <optgroup>, or a <datalist> element. As such, <option> can represent menu items in popups and other lists of items in an HTML document. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories None. Permitted content Text, possibly with escaped characters (like &eacute;). Tag omission The start tag is mandatory. The end tag is optional if this element is immediately followed by another <option> element or an <optgroup>, or if the parent element has no more content. Permitted parent...
<pre>: The Preformatted Text element - HTML: Hypertext Markup Language
Web › HTML › Element › pre
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...<pre> element represents preformatted text which is to be presented exactly as written in the HTML file. The text is typically rendered using a non-proportional ("monospace") font. Whitespace inside this element is displayed as written. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, palpable content. Permitted content Phrasing content. Tag omission None, both the starting and ending tag are mandatory. Permitted parents Any element that accepts flow content. Implicit ARIA role No corresponding role Permitted ARIA r...
<rtc>: The Ruby Text Container element - HTML: Hypertext Markup Language
Web › HTML › Element › rtc
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories None. ...
... HTML Ruby Text Container (<rtc>) element embraces semantic annotations of characters presented in a ruby of <rb> elements used inside of <ruby> element. <rb> elements can have both pronunciation (<rt>) and semantic (<rtc>) annotations. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories None. Permitted content Phrasing content or <rt> elements. Tag omission The closing tag can be omitted if it is immediately followed by a <rb>, <rtc> or <rt> element opening tag or by its parent closing tag. Permitted parents A <ruby> element. Permitted ARIA rol...
<samp>: The Sample Output element - HTML: Hypertext Markup Language
Web › HTML › Element › samp
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...ple Element (<samp>) is used to enclose inline text which represents sample (or quoted) output from a computer program. Its contents are typically rendered using the browser's default monospaced font (such as Courier or Lucida Console). The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, phrasing content, palpable content. Permitted content Phrasing content. Tag omission None, both the starting and ending tag are mandatory. Permitted parents Any element that accepts phrasing content. Implicit ARIA role No corresponding role ...
<section>: The Generic Section element - HTML: Hypertext Markup Language
Web › HTML › Element › section
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The HTML <section> element represents a standalone section -- which doesn't have a more specific semantic element to represent it -- contained within an HTML document. Typically, but not always, sections have a heading. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. As an example, a navigation menu should be wrapped in a <nav> element, but a list of search results and a map display and its controls don't have specific elements, and could be put inside a <section>. Note: If the contents of the element would make sense syndicated as a standalone piece, the <article> element may be a better choice. Cont...
<small>: the side comment element - HTML: Hypertext Markup Language
Web › HTML › Element › small
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The HTML <small> element represents side-comments and small print, like copyright and legal text, independent of its styled presentation. By default, it renders text within it one font-size smaller, such as from small to x-small. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, phrasing content Permitted content Phrasing content Tag omission None, must have both a start tag and an end tag. Permitted parents Any element that accepts phrasing content, or any element that accepts flow content. Implicit ARIA role No correspondi...
<strong>: The Strong Importance element - HTML: Hypertext Markup Language
Web › HTML › Element › strong
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, phrasing content, palpable content. Permitted content Phrasing content. ...
... The HTML Strong Importance Element (<strong>) indicates that its contents have strong importance, seriousness, or urgency. Browsers typically render the contents in bold type. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, phrasing content, palpable content. Permitted content Phrasing content. Tag omission None, must have both a start tag and an end tag. Permitted parents Any element that accepts phrasing content, or any element that accepts flow content. Implicit ARIA role No corresponding role Permitted ARIA rol...
<sub>: The Subscript element - HTML: Hypertext Markup Language
Web › HTML › Element › sub
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, phrasing content, palpable content. ...
... The HTML Subscript element (<sub>) specifies inline text which should be displayed as subscript for solely typographical reasons. Subscripts are typically rendered with a lowered baseline using smaller text. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, phrasing content, palpable content. Permitted content Phrasing content. Tag omission None, both the starting and ending tag are mandatory. Permitted parents Any element that accepts phrasing content. Implicit ARIA role No corresponding role Permitted ARIA roles ...
<summary>: The Disclosure Summary element - HTML: Hypertext Markup Language
Web › HTML › Element › summary
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The HTML Disclosure Summary element (<summary>) element specifies a summary, caption, or legend for a <details> element's disclosure box. Clicking the <summary> element toggles the state of the parent <details> element open and closed. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Permitted content Phrasing content or one element of Heading content Tag omission None, both the start tag and the end tag are mandatory. Permitted parents The <details> element. Implicit ARIA role button Permitted ARIA roles No role permitted DOM interface HTMLEle...
<sup>: The Superscript element - HTML: Hypertext Markup Language
Web › HTML › Element › sup
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, phrasing content, palpable content. ...
... The HTML Superscript element (<sup>) specifies inline text which is to be displayed as superscript for solely typographical reasons. Superscripts are usually rendered with a raised baseline using smaller text. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, phrasing content, palpable content. Permitted content Phrasing content. Tag omission None, both the starting and ending tag are mandatory. Permitted parents Any element that accepts phrasing content. Implicit ARIA role No corresponding role Permitted ARIA roles ...
<tbody>: The Table Body element - HTML: Hypertext Markup Language
Web › HTML › Element › tbody
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The <tbody> element, along with its cousins <thead> and <tfoot>, provide useful semantic information that can be used when rendering for either screen or printer as well as for accessibility purposes. ...
... charoff attributes. If this attribute is not set, the left value is assumed. As this attribute is deprecated, use the CSS text-align property instead. Note: The equivalent text-align property for the align="char" is not implemented in any browsers yet. See the text-align's browser compatibility section for the <string> value. bgcolor The background color of the table. It is a 6-digit hexadecimal RGB code, prefixed by a '#'. One of the predefined color kewords can also be used. As this attribute is deprecated, use the CSS background-color property instead. char This attribute is used to set the character to align the cells in a column on. Typical values for this include a period (.) when attempting to align numbers or monetary values. If align is not set to char, thi...
<td>: The Table Data Cell element - HTML: Hypertext Markup Language
Web › HTML › Element › td
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Sectioning root. Permitted content Flow content. Tag omission The start tag is mandatory. The end tag may be omitted, if it is immediately followed by a <th> or <td> element or if there are no more data in its parent element. ...
...to the element. To achieve the same effect as the char value, give the text-align property the same value you would use for the char. Unimplemented in CSS3. axis This attribute contains a list of space-separated strings. Each string is the id of a group of cells that this header applies to. bgcolor This attribute defines the background color of each cell in a column. It is a 6-digit hexadecimal RGB code, prefixed by a '#'. One of the predefined color kewords can also be used. To achieve a similar effect, use the CSS background-color property. char The content in the cell element is aligned to a character. Typical values include a period (.) to align numbers or monetary values. If align is not set to char, this attribute is ignored. charoff This attribute is us...
<tfoot>: The Table Foot element - HTML: Hypertext Markup Language
Web › HTML › Element › tfoot
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories None. Permitted content Zero or more <tr> elements. Tag omission The start tag is mandatory. The end tag may be omitted if there is no more content in the parent <table> element. Permitted parents A <table> element. ...
...n the latest standard. To achieve the same effect as the left, center, right or justify values, use the CSS text-align property on it. To achieve the same effect as the char value, in CSS3, you can use the value of the char as the value of the text-align property Unimplemented. bgcolor This attribute defines the background color of each cell of the column. It is one of the 6-digit hexadecimal code as defined in sRGB, prefixed by a '#'. One of the sixteen predefined color strings may be used: black = "#000000" green = "#008000" silver = "#C0C0C0" lime = "#00FF00" gray = "#808080" olive = "#808000" white = "#FFFFFF" yellow = "#FFFF00" maroon = "#800000" ...
<thead>: The Table Head element - HTML: Hypertext Markup Language
Web › HTML › Element › thead
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories None. Permitted content Zero or more <tr> elements. Tag omission The start tag is mandatory. The end tag may be omitted if the <thead> element is immediately followed by a <tbody> or <tfoot> element. Permitted parents A <table> element. ...
...n the latest standard. To achieve the same effect as the left, center, right or justify values, use the CSS text-align property on it. To achieve the same effect as the char value, in CSS3, you can use the value of the char as the value of the text-align property Unimplemented. bgcolor This attribute defines the background color of each cell of the column. It is one of the 6-digit hexadecimal code as defined in sRGB, prefixed by a '#'. One of the sixteen predefined color strings may be used: black = "#000000" green = "#008000" silver = "#C0C0C0" lime = "#00FF00" gray = "#808080" olive = "#808000" white = "#FFFFFF" yellow = "#FFFF00" maroon = "#800000" ...
<tr>: The Table Row element - HTML: Hypertext Markup Language
Web › HTML › Element › tr
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The HTML <tr> element defines a row of cells in a table. The row's cells can then be established using a mix of <td> (data cell) and <th> (header cell) elements. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. To provide additional control over how cells fit into (or span across) columns, both <th> and <td> support the colspan attribute, which lets you specify how many columns wide the cell should be, with the default being 1. Similarly, you can use the rowspan attribute on cells to indicate they should span more than one table row. This can take a little practice to get right when building your tables. We have s...
<var>: The Variable element - HTML: Hypertext Markup Language
Web › HTML › Element › var
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...Variable element (<var>) represents the name of a variable in a mathematical expression or a programming context. It's typically presented using an italicized version of the current typeface, although that behavior is browser-dependent. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, phrasing content, palpable content. Permitted content Phrasing content. Tag omission None, both the starting and ending tag are mandatory. Permitted parents Any element that accepts phrasing content. Implicit ARIA role No corresponding role ...
<wbr> - HTML: Hypertext Markup Language
Web › HTML › Element › wbr
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, phrasing content. ...
... The HTML <wbr> element represents a word break opportunity--a position within text where the browser may optionally break a line, though its line-breaking rules would not otherwise create a break at that location. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, phrasing content. Permitted content Empty Tag omission It is an empty element; it must have a start tag, but must not have an end tag. Permitted parents Any element that accepts phrasing content. Implicit ARIA role No corresponding role Permitted ARIA roles...
accesskey - HTML: Hypertext Markup Language
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...attribute provides a hint for generating a keyboard shortcut for the current element. The attribute value must consist of a single printable character (which includes accented and other characters that can be generated by the keyboard). The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Note: In the WHATWG spec, it says you can specify multiple space-separated characters, and the browser will use the first one it supports. However, this does not work in most browsers. IE/Edge uses the first one it supports without problems, provided there are no conflicts with other commands. The way to activate the accesskey depend...
contenteditable - HTML: Hypertext Markup Language
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The attribute must take one of the following values: true or an empty string, which indicates that the element is editable. ...
... The contenteditable global attribute is an enumerated attribute indicating if the element should be editable by the user. If so, the browser modifies its widget to allow editing. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The attribute must take one of the following values: true or an empty string, which indicates that the element is editable. false, which indicates that the element is not editable. If the attribute is given without a value, like <label contenteditable>Example Label</label>, its value is treated as an empty string. If this attribute is missing or its value is invalid, its value is inhe...
data-* - HTML: Hypertext Markup Language
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. All such custom data are available via the HTMLElement interface of the element the attribute is set on. ...
... The data-* global attributes form a class of attributes called custom data attributes, that allow proprietary information to be exchanged between the HTML and its DOM representation by scripts. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. All such custom data are available via the HTMLElement interface of the element the attribute is set on. The HTMLElement.dataset property gives access to them. The * may be replaced by any name following the production rule of XML names with the following restrictions: the name must not start with xml, whatever case is used for these letters; the name must not contain any...
dir - HTML: Hypertext Markup Language
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The dir global attribute is an enumerated attribute that indicates the directionality of the element's text. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. It can have the following values: ltr, which means left to right and is to be used for languages that are written from the left to the right (like English); rtl, which means right to left and is to be used for languages that are written from the right to the left (like Arabic); auto, which lets the user agent decide. It uses a basic algorithm as it parses the characters inside the element until it finds a character with a strong directionality, then appli...
tabindex - HTML: Hypertext Markup Language
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The tabindex global attribute indicates that its element can be focused, and where it participates in sequential keyboard navigation (usually with the Tab key, hence the name). The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. It accepts an integer as a value, with different results depending on the integer's value: A negative value (usually tabindex="-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. It's mostly useful to create accessible widgets with JavaScript. A negative value is useful when you h...
title - HTML: Hypertext Markup Language
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The title global attribute contains text representing advisory information related to the element it belongs to. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Some typical uses: Labeling <iframe> elements for assistive technology Providing a programmatically associated label for an <input> element as a fallback for a real <label> Labeling controls in data tables Additional semantics are attached to the title attributes of the <link>, <abbr>, <input>, and <menuitem> elements. Multiline titles The title attribute may contain several lines. Each U+000A LINE FEED (LF) character represents a line break. Some...
Preloading content with rel="preload" - HTML: Hypertext Markup Language
successfully preload cross-origin resources as long as you set a crossorigin attribute on your <link> element. One interesting case where this applies, even if the fetch is not cross-origin, is font files. Because of various reasons, these have to be fetched using anonymous mode CORS (see Font fetching requirements). Let's use this case as an example. You can see the full example source code on GitHub (also see it live): <head> <meta charset="utf-8"> <title>Web font example</title> <link rel="preload" href="fonts/cicle_fina-webfont.woff2" as="font" type="font/woff2" crossorigin> <link rel="preload" href="fonts/zantroke-webfont.woff2" as="font" type="font/woff2" crossorigin> <link href="style.css" rel="stylesheet"> </head> <body> ... </body> Not only are we providing the MIME...
... ... </body> Not only are we providing the MIME type hints in the type attributes, but we are also providing the crossorigin attribute to handle the CORS issue. Including media One nice feature of <link> elements is their ability to accept media attributes. ...
Microformats - HTML: Hypertext Markup Language
><br> <div class="p-location h-card"> <div> <span class="p-name">Mozilla</span> </div> <div> <span class="p-street-address">1120 NW Couch St</span>, <span class="p-locality">Portland</span>, <span class="p-region">Oregon</span>, <span class="p-country">US</span> </div> <data class="p-latitude" value="45.52345"></data> <data class="p-longitude" value="-122.682677"></data> </div> <div class="e-content">Come join us </div> <div> <span class="p-author h-card"><a class="u-url p-name" href="https://aaronparecki.com">Aaron Parecki</a></span> Published this <a href="https://aaronparecki.com/2019/06/29/1/" class="u-url">event </a>on <time class="dt published" datetime="2019-05-25T18:00:00-07:00">May 5th, 2019</time> ...
... "lang": "en" } ], "location": [ { "type": [ "h-card" ], "properties": { "name": [ "Mozilla" ], p-street-address: [ "1120 NW Couch St" ] "locality": [ "Portland" ], "region": [ "Oregon" ], "country": [ "US" ], "latitude": [ "45.52345" ], "longitude": [ "-122.682677" ] }, "lang": "en", "value": "Mozilla" } ] }, "lang": "en" } ], ...
Index - HTTP
Web › HTTP › Headers › Index
-Authenticate header. 91 Public-Key-Pins HPKP, HTTP, Reference, Security, header The HTTP Public-Key-Pins response header associates a specific cryptographic public key with a certain web server to decrease the risk of MITM attacks with forged certificates. If one or several keys are pinned and none of them are used by the server, the browser will not accept the response as legitimate, and will not display it. 92 Public-Key-Pins-Report-Only HPKP, HTTP, Security, header The HTTP Public-Key-Pins-Report-Only response header sends reports of pinning violation to the report-uri specified in the header but, unlike Public-Key-Pins still allows browsers to connect to the server if the pinning is violated. 93 Range HTTP, HTTP Header, Range Reque...
...g The Tk response header indicates the tracking status that applied to the corresponding request. 107 Trailer HTTP, Reference, header The Trailer response header allows the sender to include additional fields at the end of chunked messages in order to supply metadata that might be dynamically generated while the message body is sent, such as a message integrity check, digital signature, or post-processing status. 108 Transfer-Encoding HTTP, Reference, header The Transfer-Encoding header specifies the form of encoding used to safely transfer the entity to the user. 109 Upgrade-Insecure-Requests HTTP, HTTPS, Security, header The HTTP Upgrade-Insecure-Requests request header sends a signal to the server expressing the client's ...
Warning - HTTP
Web › HTTP › Headers › Warning
Note: The Warning header is soon to be deprecated; see Warning (https://github.com/httpwg/http-core/issues/139) and Warning: header & stale-while-revalidate (https://github.com/whatwg/fetch/issues/913) for more details. The Warning general HTTP header contains information about possible problems with the status of the message. More than one Warning header may appear in a response. Warning header fields can in general be applied to any message, however some warn-codes are specific to caches and can only be applied to response messages. ...
... than one Warning header may appear in a response. Warning header fields can in general be applied to any message, however some warn-codes are specific to caches and can only be applied to response messages. Header type General header Forbidden header name no Syntax Warning: <warn-code> <warn-agent> <warn-text> [<warn-date>] Directives <warn-code> A three-digit warning number. The first digit indicates whether the Warning is required to be deleted from a stored response after validation. 1xx warn-codes describe the freshness or validation status of the response and will be deleted by a cache after deletion. 2xx warn-codes describe some aspect of the representation that is not rectified by a validation and won't be deleted by a cache after vali...
Regular expressions - JavaScript
tegory, along with descriptions and examples. Assertions Assertions include boundaries, which indicate the beginnings and endings of lines and words, and other patterns indicating in some way that a match is possible (including look-ahead, look-behind, and conditional expressions). Character classes Distinguish different types of characters. For example, distinguishing between letters and digits. Groups and ranges Indicate groups and ranges of expression characters. Quantifiers Indicate numbers of characters or expressions to match. Unicode property escapes Distinguish based on unicode character properties, for example, upper- and lower-case letters, math symbols, and punctuation. If you want to look at all the special characters that can be used in regular expressions in a sing...
... number is valid (matches the character sequence specified by the regular expression), the script shows a message thanking the user and confirming the number. If the number is invalid, the script informs the user that the phone number is not valid. Within non-capturing parentheses (?: , the regular expression looks for three numeric characters \d{3} OR | a left parenthesis \( followed by three digits \d{3}, followed by a close parenthesis \), (end non-capturing parenthesis )), followed by one dash, forward slash, or decimal point and when found, remember the character ([-\/\.]), followed by three digits \d{3}, followed by the remembered match of a dash, forward slash, or decimal point \1, followed by four digits \d{4}. The Change event activated when the user presses Enter sets the value of...
static - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax static methodName() { ... ...
...he static keyword defines a static method for a class. Static methods aren't called on instances of the class. Instead, they're called on the class itself. These are often utility functions, such as functions to create or clone objects. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax static methodName() { ... } Examples Using static in classes The following example demonstrates several things: How a static method is implemented on a class. That a class with a static member can be sub-classed. How a static method can and cannot be called. class Triple { static triple(n = 1) { return n * 3; }...
RangeError: precision is out of range - JavaScript
The JavaScript exception "precision is out of range" occurs when a number that's outside of the range of 0 and 20 (or 21) was passed into toFixed or toPrecision. ...
...ion is out of range" occurs when a number that's outside of the range of 0 and 20 (or 21) was passed into toFixed or toPrecision. Message RangeError: The number of fractional digits is out of range (Edge) RangeError: The precision is out of range (Edge) RangeError: precision {0} out of range (Firefox) RangeError: toExponential() argument must be between 0 and 20 (Chrome) RangeError: toFixed() digits argument must be between 0 and 20 (Chrome) RangeError: toPrecision() argument must be between 1 and 21 (Chrome) Error type RangeError What went wrong? There was an out of range precision argument in one of these methods: Number.prototype.toExponential() Number.prototype.toFixed() Number.prototype.toPrecision() The allowed range for these methods is usually between 0 and 20 (or 21). H...
Method definitions - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax const obj = { get property() {}, set property(value) {}, property( parameters... ) {}, *generator( parameters... ) {}, async property( parameters... ...
... Starting with ECMAScript 2015, a shorter syntax for method definitions on objects initializers is introduced. It is a shorthand for a function assigned to the method's name. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax const obj = { get property() {}, set property(value) {}, property( parameters... ) {}, *generator( parameters... ) {}, async property( parameters... ) {}, async* generator( parameters... ) {}, // with computed keys get [property]() {}, set [property](value) {}, [property]( parameters... ) {}, *[generator]( parameters... ) {}, async [property]( parameters... ) {}, ...
The arguments object - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Description Note: If you're writing ES6 compatible code, then rest parameters should be preferred. ...
... Description Note: If you're writing ES6 compatible code, then rest parameters should be preferred. ...
Array.prototype.entries() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax array.entries() Return value A new Array iterator object. ...
... Syntax array.entries() Return value A new Array iterator object. ...
Array.prototype.fill() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax arr.fill(value[, start[, end]]) Parameters value Value to fill the array with. ...
... 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). It returns the modified array. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax arr.fill(value[, start[, end]]) Parameters value Value to fill the array with. (Note all elements in the array will be this exact value.) start Optional Start index, default 0. end Optional End index, default arr.length. Return value The modified array, filled with value. Description If start is negative, it is treated as array.length + start. If end is negative, it is trea...
Array.prototype.find() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. If you need the index of the found element in the array, use findIndex(). If you need to find the index of a value, use Array.prototype.indexOf(). ...
... is changed by callback, its value passed to the callback will be the value at the time find visits that element's index. Elements that are deleted are still visited. Polyfill This method has been added to the ECMAScript 2015 specification and may not be available in all JavaScript implementations yet. However, you can polyfill Array.prototype.find with the following snippet: // https://tc39.github.io/ecma262/#sec-array.prototype.find if (!Array.prototype.find) { Object.defineProperty(Array.prototype, 'find', { value: function(predicate) { // 1. Let O be ? ToObject(this value). if (this == null) { throw TypeError('"this" is null or not defined'); } var o = Object(this); // 2. Let len be ? ToLength(? Get(O, "length")). var len = o.length...
Array.prototype.indexOf() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax arr.indexOf(searchElement[, fromIndex]) Parameters searchElement Element to locate in the array. fromIndex Optional The index to start the search at. ...
...eturn -1 // if the value was not found, then return -1 } })(Object, Math.max, Math.min) However, if you are more interested in all the little technical bits defined by the ECMA standard, and are less concerned about performance or conciseness, then you may find this more descriptive polyfill to be more useful. // Production steps of ECMA-262, Edition 5, 15.4.4.14 // Reference: http://es5.github.io/#x15.4.4.14 if (!Array.prototype.indexOf) { Array.prototype.indexOf = function(searchElement, fromIndex) { "use strict"; var k; // 1. Let o be the result of calling ToObject passing // the this value as the argument. if (this == null) { throw new TypeError('"this" is null or not defined'); } var o = Object(this); // 2. Let lenValue be the result...
Array.prototype.keys() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax arr.keys() Return value A new Array iterator object. ...
... Syntax arr.keys() Return value A new Array iterator object. ...
Array.prototype.length - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The length property of an object which is an instance of type Array sets or returns the number of elements in that array. The value is an unsigned, 32-bit integer that is always numerically greater than the highest index in the array. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Description The value of the length property is an integer with a positive sign and a value less than 2 to the 32nd power (232). var namelistA = new Array(4294967296); //2 to the 32nd power = 4294967296 var namelistC = new Array(-100) //negative sign console.log(namelistA.length); //RangeError: Invalid array length console.log(namelis...
Array.prototype.shift() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax arr.shift() Return value The removed element from the array; undefined if the array is empty. ...
... Syntax arr.shift() Return value The removed element from the array; undefined if the array is empty. ...
Array.prototype.slice() - JavaScript
If you'd like to contribute to the interactive demo project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... 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. The original array will not be modified. The source for this interactive demo is stored in a GitHub repository. If you'd like to contribute to the interactive demo project, please clone https://github.com/mdn/interactive-examples and send us a pull request. 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. slice(-2) extracts the last two elements in the sequence. If start is undefined, slice starts from the index 0. If start is greater than the i...
Array.prototype.some() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. 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. ...
...e at the beginning of your scripts, allowing use of some() in implementations which do not natively support it. This algorithm is exactly the one specified in ECMA-262, 5th edition, assuming Object and TypeError have their original values and that fun.call evaluates to the original value of Function.prototype.call(). ...
Array - JavaScript
properties in the same way that toString is a property (to be specific, however, toString() is a method). Nevertheless, trying to access an element of an array as follows throws a syntax error because the property name is not valid: console.log(arr.0) // a syntax error There is nothing special about JavaScript arrays and the properties that cause this. JavaScript properties that begin with a digit cannot be referenced with dot notation and must be accessed using bracket notation. For example, if you had an object with a property named 3d, it can only be referenced using bracket notation. let years = [1950, 1960, 1970, 1980, 1990, 2000, 2010] console.log(years.0) // a syntax error console.log(years[0]) // works properly renderer.3d.setTexture(model, 'character.png') // a syntax e...
... it can only be referenced using bracket notation. let years = [1950, 1960, 1970, 1980, 1990, 2000, 2010] console.log(years.0) // a syntax error console.log(years[0]) // works properly renderer.3d.setTexture(model, 'character.png') // a syntax error renderer['3d'].setTexture(model, 'character.png') // works properly In the 3d example, '3d' had to be quoted (because it begins with a digit). But it's also possible to quote the array indexes as well (e.g., years['2'] instead of years[2]), although it's not necessary. The 2 in years[2] is coerced into a string by the JavaScript engine through an implicit toString conversion. As a result, '2' and '02' would refer to two different slots on the years object, and the following example could be true: console.log(years['2'] != years['02'...
Atomics.add() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The static Atomics.add() method adds a given value at a given position in the array and returns the old value at that position. This atomic operation guarantees that no other write happens until the modified value is written back. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Atomics.add(typedArray, index, value) Parameters typedArray An integer typed array. One of Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, BigInt64Array, or BigUint64Array. index The position in the typedArray to add a value to. value The number to add. Return value The old value at the given pos...
Atomics.and() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
....and() method computes a bitwise AND with a given value at a given position in the array, and returns the old value at that position. This atomic operation guarantees that no other write happens until the modified value is written back. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Atomics.and(typedArray, index, value) Parameters typedArray An integer typed array. One of Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, BigInt64Array, or BigUint64Array. index The position in the typedArray to compute the bitwise AND. value The number to compute the bitwise AND with. Retur...
Atomics.isLockFree() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Atomics.isLockFree(size) Parameters size The size in bytes to check. ...
... The static Atomics.isLockFree() method is used to determine whether to use locks or atomic operations. It returns true, if the given size is one of the BYTES_PER_ELEMENT property of integer TypedArray types. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Atomics.isLockFree(size) Parameters size The size in bytes to check. Return value A Boolean indicating whether the operation is lock free. Examples Using isLockFree Atomics.isLockFree(1); // true Atomics.isLockFree(2); // true Atomics.isLockFree(3); // false Atomics.isLockFree(4); // true Atomics.isLockFree(5); // false Atomics.isLockFree(6); /...
Atomics.or() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...cs.or() method computes a bitwise OR with a given value at a given position in the array, and returns the old value at that position. This atomic operation guarantees that no other write happens until the modified value is written back. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Atomics.or(typedArray, index, value) Parameters typedArray An integer typed array. One of Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, BigInt64Array, or BigUint64Array. index The position in the typedArray to compute the bitwise OR. value The number to compute the bitwise OR with. Return v...
Atomics.sub() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...The static Atomics.sub() method substracts a given value at a given position in the array and returns the old value at that position. This atomic operation guarantees that no other write happens until the modified value is written back. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Atomics.sub(typedArray, index, value) Parameters typedArray An integer typed array. One of Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, BigInt64Array, or BigUint64Array. index The position in the typedArray to subtract a value from. value The number to subtract. Return value The old value...
Atomics.xor() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
....xor() method computes a bitwise XOR with a given value at a given position in the array, and returns the old value at that position. This atomic operation guarantees that no other write happens until the modified value is written back. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Atomics.xor(typedArray, index, value) Parameters typedArray An integer typed array. One of Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, BigInt64Array, or BigUint64Array. index The position in the typedArray to compute the bitwise XOR. value The number to compute the bitwise XOR with. Retur...
Date() constructor - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... Creates a JavaScript Date instance that represents a single moment in time in a platform-independent format. Date objects contain a Number that represents milliseconds since 1 January 1970 UTC. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax new Date() new Date(value) new Date(dateString) new Date(year, monthIndex [, day [, hours [, minutes [, seconds [, milliseconds]]]]]) Note: The only correct way to instantiate a new Date object is by using the new operator. If you simply call the Date object directly, such as now = Date(), the returned value is a string rather than a Date object. Parameters There ...
Date.UTC() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The Date.UTC() method accepts parameters similar to the Date constructor, but treats them as UTC. It returns the number of milliseconds since January 1, 1970, 00:00:00 UTC. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Since ECMAScript 2017: Date.UTC(year[, month[, day[, hour[, minute[, second[, millisecond]]]]]]) ECMAScript 2016 and earlier: (month used to be required) Date.UTC(year, month[, day[, hour[, minute[, second[, millisecond]]]]]) Parameters year A full year. month An integer between 0 (January) and 11 (December) representing the month. (Up through ECMAScript 2016, month was a required...
Date.prototype.getDay() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The getDay() method returns the day of the week for the specified date according to local time, where 0 represents Sunday. For the day of the month, see Date.prototype.getDate(). The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dateObj.getDay() Return value An integer number, between 0 and 6, corresponding to the day of the week for the given date, according to local time: 0 for Sunday, 1 for Monday, 2 for Tuesday, and so on. Examples Using getDay() The second statement below assigns the value 1 to weekday, based on the value of the Date object Xmas95. December 25, 1995, is a Monday. var Xmas95 = new D...
Date.prototype.getFullYear() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dateObj.getFullYear() Return value A number corresponding to the year of the given date, according to local time. Description The value returned by getFullYear() is an absolute number. ...
...ibute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dateObj.getFullYear() Return value A number corresponding to the year of the given date, according to local time. Description The value returned by getFullYear() is an absolute number. For dates between the years 1000 and 9999, getFullYear() returns a four-digit number, for example, 1995. Use this function to make sure a year is compliant with years after 2000. Examples Using getFullYear() The following example assigns the four-digit value of the current year to the variable year. var today = new Date(); var year = today.getFullYear(); Specifications Specification ECMAScript (ECMA-262)The definition of 'Date.prototype.getFullYear...
Date.prototype.getMonth() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dateObj.getMonth() Return value An integer number, between 0 and 11, representing the month in the given date according to local time. ...
... The getMonth() method returns the month in the specified date according to local time, as a zero-based value (where zero indicates the first month of the year). The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dateObj.getMonth() Return value An integer number, between 0 and 11, representing the month in the given date according to local time. 0 corresponds to January, 1 to February, and so on. Examples Using getMonth() The second statement below assigns the value 11 to the variable month, based on the value of the Date object Xmas95. var Xmas95 = new Date('December 25, 1995 23:15:30'); var month = Xmas...
Date.prototype.getUTCFullYear() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dateObj.getUTCFullYear() Return value A number representing the year in the given date according to universal time. Description The value returned by getUTCFullYear() is an absolute number that is compliant with year-2000, for example, 1995. ...
... var today = new Date(); var year = today.getUTCFullYear(); Specifications Specification ECMAScript (ECMA-262)The definition of 'Date.prototype.getUTCFullYear' in that specification. ...
Date.prototype.getUTCMonth() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dateObj.getUTCMonth() Return value An integer number, between 0 and 11, corresponding to the month of the given date according to universal time. ...
... The getUTCMonth() returns the month of the specified date according to universal time, as a zero-based value (where zero indicates the first month of the year). The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dateObj.getUTCMonth() Return value An integer number, between 0 and 11, corresponding to the month of the given date according to universal time. 0 for January, 1 for February, 2 for March, and so on. Examples Using getUTCMonth() The following example assigns the month portion of the current date to the variable month. var today = new Date(); var month = today.getUTCMonth(); Specifications ...
Date.prototype.setHours() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The setHours() method sets the hours for a specified date according to local time, and returns the number of milliseconds since January 1, 1970 00:00:00 UTC until the time represented by the updated Date instance. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dateObj.setHours(hoursValue[, minutesValue[, secondsValue[, msValue]]]) Versions prior to JavaScript 1.3 dateObj.setHours(hoursValue) Parameters hoursValue Ideally, an integer between 0 and 23, representing the hour. If a value greater than 23 is provided, the datetime will be incremented by the extra hours. minutesValue Optional. Ideally, a...
Date.prototype.setUTCHours() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The setUTCHours() method sets the hour for a specified date according to universal time, and returns the number of milliseconds since January 1, 1970 00:00:00 UTC until the time represented by the updated Date instance. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dateObj.setUTCHours(hoursValue[, minutesValue[, secondsValue[, msValue]]]) Parameters hoursValue An integer between 0 and 23, representing the hour. minutesValue Optional. An integer between 0 and 59, representing the minutes. secondsValue Optional. An integer between 0 and 59, representing the seconds. If you specify the secondsValue...
Date.prototype.toLocaleDateString() - JavaScript
te. The new locales and options arguments let applications specify the language whose formatting conventions should be used and allow to customize the behavior of the function. In older implementations, which ignore the locales and options arguments, the locale used and the form of the string returned are entirely implementation dependent. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dateObj.toLocaleDateString([locales [, options]]) Parameters The locales and options arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. In...
...uses day-month-year order console.log(date.toLocaleDateString('en-GB')); // -> "20/12/2012" // Korean uses year-month-day order console.log(date.toLocaleDateString('ko-KR')); // -> "2012. 12. ...
Date.prototype.toLocaleString() - JavaScript
this date. The new locales and options arguments let applications specify the language whose formatting conventions should be used and customize the behavior of the function. In older implementations, which ignore the locales and options arguments, the locale used and the form of the string returned are entirely implementation-dependent. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dateObj.toLocaleString([locales[, options]]) Parameters The locales and options arguments customize the behavior of the function and let applications specify the language whose formatting conventions should be used. In impl...
...ing('en-US')); // -> "12/19/2012, 7:00:00 PM" // British English uses day-month-year order and 24-hour time without AM/PM console.log(date.toLocaleString('en-GB')); // -> "20/12/2012 03:00:00" // Korean uses year-month-day order and 12-hour time with AM/PM console.log(date.toLocaleString('ko-KR')); // -> "2012. 12. 20. ...
Function.prototype.apply() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax func.apply(thisArg, [ argsArray]) Parameters thisArg The value of this provided for the call to func. ...
... Syntax func.apply(thisArg, [ argsArray]) Parameters thisArg The value of this provided for the call to func. ...
Function.name - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... A Function object's read-only name property indicates the function's name as specified when it was created, or it may be rather anonymous or ''(an empty string) for functions created anonymously. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Property attributes of Function.name Writable no Enumerable no Configurable yes Note that in non-standard, pre-ES2015 implementations the configurable attribute was false as well. JavaScript compressors and minifiers Warning: Be careful when using Function.name and source co...
Infinity - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...lobal property Infinity is a numeric value representing infinity. Property attributes of Infinity Writable no Enumerable no Configurable no The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Description Infinity is a property of the global object. In other words, it is a variable in global scope. The initial value of Infinity is Number.POSITIVE_INFINITY. The value Infinity (positive infinity) is greater than any other number. This value behaves slightly differently than mathematical infinity; see Number.POSITIVE_INFINITY...
Intl.Collator.prototype.compare() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax collator.compare(string1, string2) Parameters string1 string2 The strings to compare against each other. ...
... Syntax collator.compare(string1, string2) Parameters string1 string2 The strings to compare against each other. ...
Intl.Collator.prototype.resolvedOptions() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The Intl.Collator.prototype.resolvedOptions() method returns a new object with properties reflecting the locale and collation options computed during initialization of this Collator object. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax collator.resolvedOptions() Return value A new object with properties reflecting the locale and collation options computed during the initialization of the given Collator object. Description The resulting object has the following properties: locale The BCP 47 language tag for the locale actually used. If any Unicode extension values were requested in the input BCP 47...
Intl.Collator.supportedLocalesOf() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The Intl.Collator.supportedLocalesOf() method returns an array containing those of the provided locales that are supported in collation without having to fall back to the runtime's default locale. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Intl.Collator.supportedLocalesOf(locales[, options]) Parameters locales A string with a BCP 47 language tag, or an array of such strings. For the general form of the locales argument, see the Intl page. options Optional. An object that may have the following property: localeMatcher The locale matching algorithm to use. Possible values are "lookup" and...
Intl.DateTimeFormat.prototype.format() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dateTimeFormat.format(date) Parameters date The date to format. ...
... Syntax dateTimeFormat.format(date) Parameters date The date to format. ...
Intl.DateTimeFormat.prototype.formatRangeToParts() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The Intl.DateTimeFormat.prototype.formatRangeToParts() method allows locale-specific tokens representing each part of the formatted date range produced by DateTimeFormat formatters. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Intl.DateTimeFormat.prototype.formatRangeToParts(startDate, endDate) Examples Basic formatRangeToParts usage This method receives two Dates and returns an Array of objects containing the locale-specific tokens representing each part of the formatted date range. let date1 = new Date(Date.UTC(2007, 0, 10, 10, 0, 0)); let date2 = new Date(Date.UTC(2007, 0, 10, 11, 0, 0)); // > 'We...
Intl.DateTimeFormat.prototype.resolvedOptions() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The Intl.DateTimeFormat.prototype.resolvedOptions() method returns a new object with properties reflecting the locale and date and time formatting options computed during initialization of this DateTimeFormat object. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dateTimeFormat.resolvedOptions() Return value A new object with properties reflecting the locale and date and time formatting options computed during the initialization of the given DateTimeFormat object. Description The resulting object has the following properties: locale The BCP 47 language tag for the locale actually used. If any Unico...
Intl.DateTimeFormat.supportedLocalesOf() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The Intl.DateTimeFormat.supportedLocalesOf() method returns an array containing those of the provided locales that are supported in date and time formatting without having to fall back to the runtime's default locale. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Intl.DateTimeFormat.supportedLocalesOf(locales[, options]) Parameters locales A string with a BCP 47 language tag, or an array of such strings. For the general form of the locales argument, see the Intl page. options Optional. An object that may have the following property: localeMatcher The locale matching algorithm to use. Possi...
Intl.DisplayNames.prototype.of() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax displayNames.of(code); Parameters code The code to provide depends on the type: If the type is "region", code should be either an ISO-3166 two letters region code, or a three digits UN M49 Geographic Regions. ...
... If the type is "script", code should be an ISO-15924 four letters script code. ...
Intl.DisplayNames - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Constructor Intl.DisplayNames() Creates a new Intl.DisplayNames object. ...
... Constructor Intl.DisplayNames() Creates a new Intl.DisplayNames object. ...
Intl.NumberFormat.prototype.format() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax numberFormat.format(number) Parameters number A Number or BigInt to format. ...
... Syntax numberFormat.format(number) Parameters number A Number or BigInt to format. ...
Intl.NumberFormat.supportedLocalesOf() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The Intl.NumberFormat.supportedLocalesOf() method returns an array containing those of the provided locales that are supported in number formatting without having to fall back to the runtime's default locale. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Intl.NumberFormat.supportedLocalesOf(locales[, options]) Parameters locales A string with a BCP 47 language tag, or an array of such strings. For the general form of the locales argument, see the Intl page. options Optional. An object that may have the following property: localeMatcher The locale matching algorithm to use. Possible values ...
Intl.RelativeTimeFormat.prototype.format() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax relativeTimeFormat.format(value, unit) Parameters value Numeric value to use in the internationalized relative time message. ...
... The Intl.RelativeTimeFormat.prototype.format() method formats a value and unit according to the locale and formatting options of this RelativeTimeFormat object. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax relativeTimeFormat.format(value, unit) Parameters value Numeric value to use in the internationalized relative time message. unit Unit to use in the relative time internationalized message. Possible values are: "year", "quarter", "month", "week", "day", "hour", "minute", "second". Plural forms are also permitted. Description The function returned by the format getter formats a value and a ...
Intl.RelativeTimeFormat.prototype.formatToParts() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The Intl.RelativeTimeFormat.prototype.formatToParts() method returns an Array of objects representing the relative time format in parts that can be used for custom locale-aware formatting. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax RelativeTimeFormat.formatToParts(value, unit) Parameters value Numeric value to use in the internationalized relative time message. unit Unit to use in the relative time internationalized message. Possible values are: "year", "quarter", "month", "week", "day", "hour", "minute", "second". Plural forms are also permitted. Return value An Array of objects containin...
Intl.RelativeTimeFormat.prototype.resolvedOptions() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The Intl.RelativeTimeFormat.prototype.resolvedOptions() method returns a new object with properties reflecting the locale and relative time formatting options computed during initialization of this RelativeTimeFormat object. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax relativeTimeFormat.resolvedOptions() Return value A new object with properties reflecting the locale and number formatting options computed during the initialization of the given RelativeTimeFormat object. Description The resulting object has the following properties: locale The BCP 47 language tag for the locale actually used. If ...
Intl.RelativeTimeFormat.supportedLocalesOf() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The Intl.RelativeTimeFormat.supportedLocalesOf() method returns an array containing those of the provided locales that are supported in date and time formatting without having to fall back to the runtime's default locale. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Intl.RelativeTimeFormat.supportedLocalesOf(locales[, options]) Parameters locales A string with a BCP 47 language tag, or an array of such strings. For the general form of the locales argument, see the Intl page. options Optional. An object that may have the following property: localeMatcher The locale matching algorithm to us...
Intl.getCanonicalLocales() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Intl.getCanonicalLocales(locales) Parameters locales A list of String values for which to get the canonical locale names. ...
... The Intl.getCanonicalLocales() method returns an array containing the canonical locale names. Duplicates will be omitted and elements will be validated as structurally valid language tags. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Intl.getCanonicalLocales(locales) Parameters locales A list of String values for which to get the canonical locale names. Return value An array containing the canonical locale names. Examples Using getCanonicalLocales Intl.getCanonicalLocales('EN-US'); // ["en-US"] Intl.getCanonicalLocales(['EN-US', 'Fr']); // ["en-US", "fr"] Intl.getCanonicalLocales('EN_US'); //...
JSON.stringify() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The JSON.stringify() method converts a JavaScript object or value to a JSON string, optionally replacing values if a replacer function is specified or optionally including only the specified properties if a replacer array is specified. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax JSON.stringify(value[, replacer[, space]]) Parameters value The value to convert to a JSON string. replacer Optional A function that alters the behavior of the stringification process, or an array of String and Number that serve as an allowlist for selecting/filtering the properties of the value object to be included in t...
Map.prototype[@@iterator]() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax myMap[Symbol.iterator] Return value The map iterator function, which is the entries() function by default. ...
... Syntax myMap[Symbol.iterator] Return value The map iterator function, which is the entries() function by default. ...
Map.prototype[@@toStringTag] - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The Map[@@toStringTag] property has an initial value of "Map". The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Property attributes of Map.prototype[@@toStringTag] Writable no Enumerable no Configurable yes Syntax Map[Symbol.toStringTag] Examples Using toStringTag Object.prototype.toString.call(new Map()) // "[object Map]" Specifications Specification ECMAScript (ECMA-262)The definition of 'Map.prototype[@@toStringTag]' in that specification. ...
Map.prototype.clear() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax myMap.clear(); Return value undefined. ...
... Syntax myMap.clear(); Return value undefined. ...
Map.prototype.entries() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax myMap.entries() Return value A new Map iterator object. ...
... Syntax myMap.entries() Return value A new Map iterator object. ...
Map.prototype.keys() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax myMap.keys() Return value A new Map iterator object. ...
... Syntax myMap.keys() Return value A new Map iterator object. ...
Map.prototype.values() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax myMap.values() Return value A new Map iterator object. ...
... Syntax myMap.values() Return value A new Map iterator object. ...
Math.E - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The Math.E property represents the base of natural logarithms, e, approximately 2.718. Math.E=e?2.718\mathtt{\mi{Math.E}} = e \approx 2.718 The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Property attributes of Math.E Writable no Enumerable no Configurable no Description Because E is a static property of Math, you always use it as Math.E, rather than as a property of a Math object you created (Math is not a constructor). Examples Using Math.E The following function returns e: function getNapier() { return Math.E...
Math.LN10 - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The Math.LN10 property represents the natural logarithm of 10, approximately 2.302: Math.LN10=ln(10)?2.302\mathtt{\mi{Math.LN10}} = \ln(10) \approx 2.302 The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Property attributes of Math.LN10 Writable no Enumerable no Configurable no Description Because LN10 is a static property of Math, you always use it as Math.LN10, rather than as a property of a Math object you created (Math is not a constructor). Examples Using Math.LN10 The following function returns the natural log ...
Math.LN2 - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The Math.LN2 property represents the natural logarithm of 2, approximately 0.693: Math.LN2=ln(2)?0.693\mathtt{\mi{Math.LN2}} = \ln(2) \approx 0.693 The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Property attributes of Math.LN2 Writable no Enumerable no Configurable no Description Because LN2 is a static property of Math, you always use it as Math.LN2, rather than as a property of a Math object you created (Math is not a constructor). Examples Using Math.LN2 The following function returns the natural log of 2: fun...
Math.LOG10E - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The Math.LOG10E property represents the base 10 logarithm of e, approximately 0.434: Math.LOG10E=log10(e)?0.434\mathtt{\mi{Math.LOG10E}} = \log_10(e) \approx 0.434 The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Property attributes of Math.LOG10E Writable no Enumerable no Configurable no Description Because LOG10E is a static property of Math, you always use it as Math.LOG10E, rather than as a property of a Math object you created (Math is not a constructor). Examples Using Math.LOG10E The following function return...
Math.LOG2E - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The Math.LOG2E property represents the base 2 logarithm of e, approximately 1.442: Math.LOG2E=log2(e)?1.442\mathtt{\mi{Math.LOG2E}} = \log_2(e) \approx 1.442 The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Property attributes of Math.LOG2E Writable no Enumerable no Configurable no Description Because LOG2E is a static property of Math, you always use it as Math.LOG2E, rather than as a property of a Math object you created (Math is not a constructor). Examples Using Math.LOG2E The following function returns the base...
Math.PI - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The Math.PI property represents the ratio of the circumference of a circle to its diameter, approximately 3.14159: Math.PI=??3.14159\mathtt{\mi{Math.PI}} = \pi \approx 3.14159 The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Property attributes of Math.PI Writable no Enumerable no Configurable no Description Because PI is a static property of Math, you always use it as Math.PI, rather than as a property of a Math object you created (Math is not a constructor). Examples Using Math.PI The following function uses Math.
Math.SQRT1_2 - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The Math.SQRT1_2 property represents the square root of 1/2 which is approximately 0.707: Math.SQRT1_2=12=12?0.707\mathtt{\mi{Math.SQRT1_2}} = \sqrt{\frac{1}{2}} = \frac{1}{\sqrt{2}} \approx 0.707 The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Property attributes of Math.SQRT1_2 Writable no Enumerable no Configurable no Description Because SQRT1_2 is a static property of Math, you always use it as Math.SQRT1_2, rather than as a property of a Math object you created (Math is not a constructor). Examples Using Math.S...
Math.SQRT2 - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The Math.SQRT2 property represents the square root of 2, approximately 1.414: Math.SQRT2=2?1.414\mathtt{\mi{Math.SQRT2}} = \sqrt{2} \approx 1.414 The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Property attributes of Math.SQRT2 Writable no Enumerable no Configurable no Description Because SQRT2 is a static property of Math, you always use it as Math.SQRT2, rather than as a property of a Math object you created (Math is not a constructor). Examples Using Math.SQRT2 The following function returns the square root of 2...
Math.abs() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...ath.abs() function returns the absolute value of a number, that is Math.abs(x)=|x|={xifx>00ifx=0-xifx<0{\mathtt{\operatorname{Math.abs}(z)}} = {|z|} = \begin{cases} x & \text{if} \quad x \geq 0 \\ x & \text{if} \quad x < 0 \end{cases} The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Math.abs(x) Parameters x A number. Return value The absolute value of the given number. Description Because abs() is a static method of Math, you always use it as Math.abs(), rather than as a method of a Math object you created (Math is not a constructor). Examples Behavior of Math.abs() Passing an empty object, an ...
Math.asin() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Math.asin(x) Parameters x A number. Return value The arcsine (in radians) of the given number if it's between -1 and 1; otherwise, NaN. Description The Math.asin() method returns a numeric value between -?2-\frac{\pi}{2}...
...(x)=arcsin(x)= the unique y?[-?2;?2]such thatsin(y)=x\forall x \in [{-1};1],\;\mathtt{\operatorname{Math.asin}(x)} = \arcsin(x) = \text{ the unique } \; y \in \left[-\frac{\pi}{2}; \frac{\pi}{2}\right] \, \text{such that} \; \sin(y) = x The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Math.asin(x) Parameters x A number. Return value The arcsine (in radians) of the given number if it's between -1 and 1; otherwise, NaN. Description The Math.asin() method returns a numeric value between -?2-\frac{\pi}{2} and ?2\frac{\pi}{2} radians for x between -1 and 1. If the value of x is outside this range, it ret...
Math.atan2() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Math.atan2(y, x) Parameters y The y coordinate of the point. ...
... Syntax Math.atan2(y, x) Parameters y The y coordinate of the point. ...
Math.cbrt() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Math.cbrt(x) Parameters x A number. Return value The cube root of the given number. ...
... The Math.cbrt() function returns the cube root of a number, that is Math.cbrt(x)=x3=the uniqueysuch thaty3=x\mathtt{Math.cbrt(x)} = \sqrt[3]{x} = \text{the unique} \; y \; \text{such that} \; y^3 = x The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Math.cbrt(x) Parameters x A number. Return value The cube root of the given number. Description Because cbrt() is a static method of Math, you always use it as Math.cbrt(), rather than as a method of a Math object you created (Math is not a constructor). Polyfill For all x>=0x \geq 0, have x3=x1/3\sqrt[3]{x} = x^{1/3} so this can be emulated by the fo...
Math.ceil() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Math.ceil(x) Parameters x A number. Return value The smallest integer greater than or equal to the given number. ...
... Syntax Math.ceil(x) Parameters x A number. ...
Math.cos() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Math.cos(x) Parameters x The angle in radians for which to return the cosine. Return value The cosine of the given number. ...
... The Math.cos() static function returns the cosine of the specified angle, which must be specified in radians. This value is length adjacent length hypotenuse . The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Math.cos(x) Parameters x The angle in radians for which to return the cosine. Return value The cosine of the given number. Description The Math.cos() method returns a numeric value between -1 and 1, which represents the cosine of the angle. Because cos() is a static method of Math, you always use it as Math.cos(), rather than as a method of a Math object you created (Ma...
Math.cosh() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Math.cosh(x) Parameters x A number. Return value The hyperbolic cosine of the given number. ...
... The Math.cosh() function returns the hyperbolic cosine of a number, that can be expressed using the constant e: Math.cosh(x)=ex+e-x2\mathtt{\operatorname{Math.cosh(x)}} = \frac{e^x + e^{-x}}{2} The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Math.cosh(x) Parameters x A number. Return value The hyperbolic cosine of the given number. Description Because cosh() is a static method of Math, you always use it as Math.cosh(), rather than as a method of a Math object you created (Math is not a constructor). Polyfill This can be emulated with the help of the Math.exp() function: Math.cosh = Math.cosh |...
Math.exp() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Math.exp(x) Parameters x A number. Return value A number representing ex, where e is Euler's number and x is the argument. ...
... Syntax Math.exp(x) Parameters x A number. ...
Math.fround() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax var singleFloat = Math.fround(doubleFloat); Parameters doubleFloat A Number. If the parameter is of a different type, it will get converted to a number or to NaN if it cannot be converted. Return value The nearest 32-bit single precision float representation of the given number. ...
... but also possible: if (!Math.fround) Math.fround = function(arg) { arg = Number(arg); // Return early for +-0 and NaN. if (!arg) return arg; var sign = arg < 0 ? -1 : 1; if (sign < 0) arg = -arg; // Compute the exponent (8 bits, signed). var exp = Math.floor(Math.log(arg) / Math.LN2); var powexp = Math.pow(2, Math.max(-126, Math.min(exp, 127))); // Handle subnormals: leading digit is zero if exponent bits are all zero. var leading = exp < -127 ? 0 : 1; // Compute 23 bits of mantissa, inverted to round toward zero. var mantissa = Math.round((leading - arg / powexp) * 0x800000); if (mantissa <= -0x800000) return sign * Infinity; return sign * powexp * (leading - mantissa / 0x800000); }; Examples Using Math.fround() The number 1.5 can be precisely represented in ...
Math.log10() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...function returns the base 10 logarithm of a number, that is ?x>0,Math.log10(x)=log10(x)=the uniqueysuch that10y=x\forall x > 0, \mathtt{\operatorname{Math.log10}(x)} = \log_10(x) = \text{the unique} \; y \; \text{such that} \; 10^y = x The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Math.log10(x) Parameters x A number. Return value The base 10 logarithm of the given number. If the number is negative, NaN is returned. Description If the value of x is less than 0, the return value is always NaN. Because log10() is a static method of Math, you always use it as Math.log10(), rather than as a method o...
Math.log2() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...log2() function returns the base 2 logarithm of a number, that is ?x>0,Math.log2(x)=log2(x)=the uniqueysuch that2y=x\forall x > 0, \mathtt{\operatorname{Math.log2}(x)} = \log_2(x) = \text{the unique} \; y \; \text{such that} \; 2^y = x The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Math.log2(x) Parameters x A number. Return value The base 2 logarithm of the given number. If the number is negative, NaN is returned. Description If the value of x is less than 0, the return value is always NaN. Because log2() is a static method of Math, you always use it as Math.log2(), rather than as a method of a ...
Math.sinh() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Math.sinh(x) Parameters x A number. Return value The hyperbolic sine of the given number. ...
... The Math.sinh() function returns the hyperbolic sine of a number, that can be expressed using the constant e: Math.sinh(x)=ex-e-x2\mathtt{\operatorname{Math.sinh(x)}} = \frac{e^x - e^{-x}}{2} The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Math.sinh(x) Parameters x A number. Return value The hyperbolic sine of the given number. Description Because sinh() is a static method of Math, you always use it as Math.sinh(), rather than as a method of a Math object you created (Math is not a constructor). Polyfill This can be emulated with the help of the Math.exp() function: Math.sinh = Math.sinh || f...
Math.sqrt() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Math.sqrt(x) Parameters x A number. ...
... The Math.sqrt() function returns the square root of a number, that is ?x>=0,Math.sqrt(x)=x=the uniquey>=0such thaty2=x\forall x \geq 0, \mathtt{Math.sqrt(x)} = \sqrt{x} = \text{the unique} \; y \geq 0 \; \text{such that} \; y^2 = x The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Math.sqrt(x) Parameters x A number. Return value The square root of the given number. If the number is negative, NaN is returned. Description If the value of x is negative, Math.sqrt() returns NaN. Because sqrt() is a static method of Math, you always use it as Math.sqrt(), rather than as a method of a Math object you cr...
NaN - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Description NaN is a property of the global object. ...
... The global NaN property is a value representing Not-A-Number. Property attributes of NaN Writable no Enumerable no Configurable no The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Description NaN is a property of the global object. In other words, it is a variable in global scope. The initial value of NaN is Not-A-Number -- the same as the value of Number.NaN. In modern browsers, NaN is a non-configurable, non-writable property. Even when this is not the case, avoid overriding it. It is rather rare to use NaN in a pr...
Number.EPSILON - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The Number.EPSILON property represents the difference between 1 and the smallest floating point number greater than 1. You do not have to create a Number object to access this static property (use Number.EPSILON). The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Property attributes of Number.EPSILON Writable no Enumerable no Configurable no Description The EPSILON property has a value of approximately 2.2204460492503130808472633361816E-16, or 2-52. Polyfill if (Number.EPSILON === undefined) { Number.EPSILON = Ma...
Number.MAX_SAFE_INTEGER - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The Number.MAX_SAFE_INTEGER constant represents the maximum safe integer in JavaScript (253 - 1). For larger integers, consider using BigInt. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Property attributes of Number.MAX_SAFE_INTEGER Writable no Enumerable no Configurable no Description The MAX_SAFE_INTEGER constant has a value of 9007199254740991 (9,007,199,254,740,991 or ~9 quadrillion). The reasoning behind that number is that JavaScript uses double-precision floating-point format numbers as specified in IEEE 75...
Number.MIN_SAFE_INTEGER - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The Number.MIN_SAFE_INTEGER constant represents the minimum safe integer in JavaScript (-(253 - 1)). To represent integers smaller than this, consider using BigInt. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Property attributes of Number.MIN_SAFE_INTEGER Writable no Enumerable no Configurable no Description The MIN_SAFE_INTEGER constant has a value of -9007199254740991 (-9,007,199,254,740,991 or about -9 quadrillion). The reasoning behind that number is that JavaScript uses double-precision floating-point format ...
Object.prototype.hasOwnProperty() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax obj.hasOwnProperty(prop) Parameters prop The String name or Symbol of the property to test. ...
... The hasOwnProperty() method returns a boolean indicating whether the object has the specified property as its own property (as opposed to inheriting it). The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax obj.hasOwnProperty(prop) Parameters prop The String name or Symbol of the property to test. Return value A Boolean indicating whether or not the object has the specified property as own property. Description All descendents of Object inherit the hasOwnProperty method. This method can be used to determine whether an object has the specified property as a direct property of that object; unlike the in ...
Object.seal() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The Object.seal() method seals an object, preventing new properties from being added to it and marking all existing properties as non-configurable. Values of present properties can still be changed as long as they are writable. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Object.seal(obj) Parameters obj The object which should be sealed. Return value The object being sealed. Description By default, objects are extensible (new properties can be added to them). Sealing an object prevents new properties from being added and marks all existing properties as non-configurable. This has the effect of ...
Object.prototype.toLocaleString() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax obj.toLocaleString() Return value A string representing the object. Description Object's toLocaleString returns the result of calling toString(). ...
... Syntax obj.toLocaleString() Return value A string representing the object. ...
Object.values() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...ues() method returns an array of a given object's own enumerable property values, in the same order as that provided by a for...in loop. (The only difference is that a for...in loop enumerates properties in the prototype chain as well.) The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Object.values(obj) Parameters obj The object whose enumerable own property values are to be returned. Return value An array containing the given object's own enumerable property values. Description Object.values() returns an array whose elements are the enumerable property values found on the object. The ordering of th...
Promise.race() - JavaScript
If you'd like to contribute to the interactive demo project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Promise.race(iterable); Parameters iterable An iterable object, such as an Array. See iterable. ...
... The Promise.race() method returns a promise that fulfills or rejects as soon as one of the promises in an iterable fulfills or rejects, with the value or reason from that promise. The source for this interactive demo is stored in a GitHub repository. If you'd like to contribute to the interactive demo project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Promise.race(iterable); Parameters iterable An iterable object, such as an Array. See iterable. Return value A pending Promise that asynchronously yields the value of the first promise in the given iterable to fulfill or reject. Description The race function returns a Promise that is settled the same way (and takes the same value) as the first promise that settles amongst the prom...
Promise.prototype.then() - JavaScript
If you'd like to contribute to the interactive demo project, please clone https://github.com/mdn/interactive-examples and send us a pull request. If one or both arguments are omitted or are provided non-functions, then then will be missing the handler(s), but will not generate any errors. ...
... If one or both arguments are omitted or are provided non-functions, then then will be missing the handler(s), but will not generate any errors. ...
handler.construct() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...) method is a trap for the new operator. In order for the new operation to be valid on the resulting Proxy object, the target used to initialize the proxy must itself have a [[Construct]] internal method (i.e. new target must be valid). The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax const p = new Proxy(target, { construct: function(target, argumentsList, newTarget) { } }); Parameters The following parameters are passed to the construct() method. this is bound to the handler. target The target object. argumentsList The list of arguments for the constructor. newTarget The constructor that was o...
Reflect.construct() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Reflect.construct(target, argumentsList[, newTarget]) Parameters target The target function to call. ...
... The static Reflect.construct() method acts like the new operator, but as a function. It is equivalent to calling new target(...args). It gives also the added option to specify a different prototype. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Reflect.construct(target, argumentsList[, newTarget]) Parameters target The target function to call. argumentsList An array-like object specifying the arguments with which target should be called. newTarget Optional The constructor whose prototype should be used. See also the new.target operator. If newTarget is not present, its value defaults to target. ...
Reflect.getOwnPropertyDescriptor() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The static Reflect.getOwnPropertyDescriptor() method is similar to Object.getOwnPropertyDescriptor(). It returns a property descriptor of the given property if it exists on the object, undefined otherwise. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Reflect.getOwnPropertyDescriptor(target, propertyKey) Parameters target The target object in which to look for the property. propertyKey The name of the property to get an own property descriptor for. Return value A property descriptor object if the property exists in target object; otherwise, undefined. Exceptions A TypeError, if target is not ...
Reflect.getPrototypeOf() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The static Reflect.getPrototypeOf() method is almost the same method as Object.getPrototypeOf(). It returns the prototype (i.e. the value of the internal [[Prototype]] property) of the specified object. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Reflect.getPrototypeOf(target) Parameters target The target object of which to get the prototype. Return value The prototype of the given object. If there are no inherited properties, null is returned. Exceptions A TypeError, if target is not an Object. Description The Reflect.getPrototypeOf method returns the prototype (i.e. the value of the inter...
Reflect.isExtensible() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Reflect.isExtensible(target) Parameters target The target object which to check if it is extensible. ...
... The static Reflect.isExtensible() method determines if an object is extensible (whether it can have new properties added to it). It is similar to Object.isExtensible(), but with some differences. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Reflect.isExtensible(target) Parameters target The target object which to check if it is extensible. Return value A Boolean indicating whether or not the target is extensible. Exceptions A TypeError, if target is not an Object. Description The Reflect.isExtensible method allows you determine if an object is extensible (whether it can have new properties a...
Reflect.preventExtensions() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The static Reflect.preventExtensions() method prevents new properties from ever being added to an object (i.e., prevents future extensions to the object). It is similar to Object.preventExtensions(), but with some differences. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Reflect.preventExtensions(target) Parameters target The target object on which to prevent extensions. Return value A Boolean indicating whether or not the target was successfully set to prevent extensions. Exceptions A TypeError, if target is not an Object. Description The Reflect.preventExtensions() method allows you to pre...
RegExp.prototype[@@replace]() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The [@@replace]() method replaces some or all matches of a this pattern in a string by a replacement, and returns the result of the replacement as a new string. The replacement can be a string or a function to be called for each match. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax regexp[Symbol.replace](str, newSubStr|function) Parameters str A String that is a target of the replacement. newSubStr (replacement) The String that replaces the substring. A number of special replacement patterns are supported; see the Specifying a string as a parameter section in String.prototype.replace() page. functi...
RegExp() constructor - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The RegExp constructor creates a regular expression object for matching text with a pattern. For an introduction to regular expressions, read the Regular Expressions chapter in the JavaScript Guide. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Literal, constructor, and factory notations are possible: /pattern/flags new RegExp(pattern[, flags]) RegExp(pattern[, flags]) Parameters pattern The text of the regular expression. As of ES5, this can also be another RegExp object or literal (for the two RegExp constructor notations only). Patterns may include special characters to match a wider range of ...
RegExp.prototype.global - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The global property indicates whether or not the "g" flag is used with the regular expression. global is a read-only property of an individual regular expression instance. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Property attributes of RegExp.prototype.global Writable no Enumerable no Configurable yes Description The value of global is a Boolean and true if the "g" flag was used; otherwise, false. The "g" flag indicates that the regular expression should be tested against all possible matches in a string. A regu...
RegExp.prototype.ignoreCase - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The ignoreCase property indicates whether or not the "i" flag is used with the regular expression. ignoreCase is a read-only property of an individual regular expression instance. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Property attributes of RegExp.prototype.ignoreCase Writable no Enumerable no Configurable yes Description The value of ignoreCase is a Boolean and true if the "i" flag was used; otherwise, false. The "i" flag indicates that case should be ignored while attempting a match in a string. You cannot...
RegExp.prototype.multiline - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The multiline property indicates whether or not the "m" flag is used with the regular expression. multiline is a read-only property of an individual regular expression instance. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Property attributes of RegExp.prototype.multiline Writable no Enumerable no Configurable yes Description The value of multiline is a Boolean and is true if the "m" flag was used; otherwise, false. The "m" flag indicates that a multiline input string should be treated as multiple lines. For example...
RegExp.prototype.source - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The source property returns a String containing the source text of the regexp object, and it doesn't contain the two forward slashes on both sides and any flags. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Property attributes of RegExp.prototype.source Writable no Enumerable no Configurable yes Examples Using source var regex = /fooBar/ig; console.log(regex.source); // "fooBar", doesn't contain /.../ and "ig". Empty regular expressions and escaping Starting with ECMAScript 5, the source property no longer retu...
RegExp.prototype.sticky - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...y property reflects whether or not the search is sticky (searches in strings only from the index indicated by the lastIndex property of this regular expression). sticky is a read-only property of an individual regular expression object. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Property attributes of RegExp.prototype.sticky Writable no Enumerable no Configurable yes Description The value of sticky is a Boolean and true if the "y" flag was used; otherwise, false. The "y" flag indicates that it matches only from the...
RegExp.prototype.unicode - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The unicode property indicates whether or not the "u" flag is used with a regular expression. unicode is a read-only property of an individual regular expression instance. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Property attributes of RegExp.prototype.unicode Writable no Enumerable no Configurable yes Description The value of unicode is a Boolean and true if the "u" flag was used; otherwise false. The "u" flag enables various Unicode-related features. With the "u" flag, any Unicode code point escapes will be in...
Set.prototype[@@iterator]() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax mySet[Symbol.iterator] Return value The Set iterator function, which is the values() function by default. ...
... Syntax mySet[Symbol.iterator] Return value The Set iterator function, which is the values() function by default. ...
Set.prototype.clear() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax mySet.clear(); Return value undefined. ...
... Syntax mySet.clear(); Return value undefined. ...
String.prototype[@@iterator]() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax str[Symbol.iterator] Return value A new Iterator object. ...
... Syntax str[Symbol.iterator] Return value A new Iterator object. ...
String.prototype.charAt() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax let character = str.charAt(index) Parameters index An integer between 0 and str.length - 1. ...
... Syntax let character = str.charAt(index) Parameters index An integer between 0 and str.length - 1. ...
String.prototype.charCodeAt() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The UTF-16 code unit matches the Unicode code point for code points which can be represented in a single UTF-16 code unit. ...
... The UTF-16 code unit matches the Unicode code point for code points which can be represented in a single UTF-16 code unit. ...
String.fromCharCode() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax String.fromCharCode(num1[, ...[, numN]]) Parameters num1, ..., numN A sequence of numbers that are UTF-16 code units. The range is between 0 and 65535 (0xFFFF). Numbers greater than 0xFFFF are truncated. No validity checks are performed. ...
...entary characters based on their actual code point value. For example, String.fromCodePoint(0x1F303) returns code point U+1F303 "Night with Stars". Examples Using fromCharCode() BMP characters, in UTF-16, use a single code unit: String.fromCharCode(65, 66, 67); // returns "ABC" String.fromCharCode(0x2014); // returns "--" String.fromCharCode(0x12014); // also returns "--"; the digit 1 is truncated and ignored String.fromCharCode(8212); // also returns "--"; 8212 is the decimal form of 0x2014 Complete UTF 16 Table. Supplementary characters, in UTF-16, require two code units (i.e. a surrogate pair): String.fromCharCode(0xD83C, 0xDF03); // Code Point U+1F303 "Night with String.fromCharCode(55356, 57091); // Stars" == "\uD83C\uDF03" String.fromCharCode(0xD834, 0xD...
String.prototype.indexOf() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Note: For the Array method, see Array.prototype.indexOf(). ...
... The indexOf() method returns the index within the calling String object of the first occurrence of the specified value, starting the search at fromIndex. Returns -1 if the value is not found. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Note: For the Array method, see Array.prototype.indexOf(). Syntax str.indexOf(searchValue [, fromIndex]) Parameters searchValue The string value to search for. If no string is explicitly provided, searchValue will be coerced to "undefined", and this value will be searched for in str. So, for example: 'undefined'.indexOf() will return 0, as undefined is found at posi...
String.prototype.lastIndexOf() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The lastIndexOf() method returns the index within the calling String object of the last occurrence of the specified value, searching backwards from fromIndex. Returns -1 if the value is not found. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax str.lastIndexOf(searchValue[, fromIndex]) Parameters searchValue A string representing the value to search for. If searchValue is an empty string, then fromIndex is returned. fromIndex Optional The index of the last character in the string to be considered as the beginning of a match. The default value is +Infinity. If fromIndex >= str.length, the whole string...
String.prototype.localeCompare() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The new locales and options arguments let applications specify the language whose sort order should be used and customize the behavior of the function. ...
... The localeCompare() method returns a number indicating whether a reference string comes before, or after, or is the same as the given string in sort order. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The new locales and options arguments let applications specify the language whose sort order should be used and customize the behavior of the function. In older implementations, which ignore the locales and options arguments, the locale and sort order used are entirely implementation-dependent. Syntax referenceStr.localeCompare(compareString[, locales[, options]]) Parameters compareString The string against ...
String.prototype.padEnd() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The padEnd() method pads the current string with a given string (repeated, if needed) so that the resulting string reaches a given length. The padding is applied from the end of the current string. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax str.padEnd(targetLength [, padString]) Parameters targetLength The length of the resulting string once the current str has been padded. If the value is lower than str.length, the current string will be returned as-is. padString Optional The string to pad the current str with. If padString is too long to stay within targetLength, it will be truncated: for left...
String.prototype.padStart() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The padStart() method pads the current string with another string (multiple times, if needed) until the resulting string reaches the given length. The padding is applied from the start of the current string. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax str.padStart(targetLength [, padString]) Parameters targetLength The length of the resulting string once the current str has been padded. If the value is less than str.length, then str is returned as-is. padString Optional The string to pad the current str with. If padString is too long to stay within the targetLength, it will be truncated from the ...
String.prototype.repeat() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax str.repeat(count) Parameters count An integer between 0 and +Infinity, indicating the number of times to repeat the string. ...
... The repeat() method constructs and returns a new string which contains the specified number of copies of the string on which it was called, concatenated together. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax str.repeat(count) Parameters count An integer between 0 and +Infinity, indicating the number of times to repeat the string. Return value A new string containing the specified number of copies of the given string. Exceptions RangeError: repeat count must be non-negative. RangeError: repeat count must be less than infinity and not overflow maximum string size. Polyfill This method has ...
String.prototype.replace() - JavaScript
The replace() method returns a new string with some or all matches of a pattern replaced by a replacement. The pattern can be a string or a RegExp, and the replacement can be a string or a function to be called for each match. If pattern is a string, only the first occurrence will be replaced. The original string is left unchanged. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax const newStr = str.replace(regexp|substr, newSubstr|function) Parameters regexp (pattern) A RegExp object or literal. The match or matches are replaced with newSubstr or the value returned by the specified function. substr A...
...se keys are the used group names, and whose values are the matched portions (undefined if not matched). (The exact number of arguments depends on whether the first argument is a RegExp object--and, if so, how many parenthesized submatches it specifies.) The following example will set newString to 'abc - 12345 - #$*%': function replacer(match, p1, p2, p3, offset, string) { // p1 is nondigits, p2 digits, and p3 non-alphanumerics return [p1, p2, p3].join(' - '); } let newString = 'abc12345#$*%'.replace(/([^\d]*)(\d*)([^\w]*)/, replacer); console.log(newString); // abc - 12345 - #$*% Examples Defining the regular expression in replace() In the following example, the regular expression is defined in replace() and includes the ignore case flag. let str = 'Twas the night before Xm...
String.prototype.toLocaleLowerCase() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The toLocaleLowerCase() method returns the calling string value converted to lower case, according to any locale-specific case mappings. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax str.toLocaleLowerCase() str.toLocaleLowerCase(locale) str.toLocaleLowerCase([locale, locale, ...]) Parameters locale Optional The locale parameter indicates the locale to be used to convert to lower case according to any locale-specific case mappings. If multiple locales are given in an Array, the best available locale is used. The default locale is the host environment's current locale. Return value A new string rep...
String.prototype.toLocaleUpperCase() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The toLocaleUpperCase() method returns the calling string value converted to upper case, according to any locale-specific case mappings. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax str.toLocaleUpperCase() str.toLocaleUpperCase(locale) str.toLocaleUpperCase([locale, locale, ...]) Parameters locale Optional The locale parameter indicates the locale to be used to convert to upper case according to any locale-specific case mappings. If multiple locales are given in an Array, the best available locale is used. The default locale is the host environment's current locale. Return value A new string rep...
String.prototype.trim() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The trim() method removes whitespace from both ends of a string. Whitespace in this context is all the whitespace characters (space, tab, no-break space, etc.) and all the line terminator characters (LF, CR, etc.). The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax str.trim() Return value A new string representing the str stripped of whitespace from both ends. Description The trim() method returns the string stripped of whitespace from both ends. trim() does not affect the value of the str itself. Polyfill Running the following code before any other code will create trim() if it's not natively available.
String.prototype.trimStart() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax str.trimStart(); str.trimLeft(); Return value A new string representing the calling string stripped of whitespace from its beginning (left end). Description The trimStart() / trimLeft() methods return the string stripped of whitespace from its left end. ...
... of whitespace from its left end. trimLeft() or trimStart() do not affect the value of the string itself. Aliasing For consistency with functions like String.prototype.padStart the standard method name is trimStart. However, for web compatibility reasons, trimLeft remains as an alias to trimStart. ...
Symbol.asyncIterator - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Description The Symbol.asyncIterator symbol is a builtin symbol that is used to access an object's @@asyncIterator method. ...
... The Symbol.asyncIterator well-known symbol specifies the default AsyncIterator for an object. If this property is set on an object, it is an async iterable and can be used in a for await...of loop. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Description The Symbol.asyncIterator symbol is a builtin symbol that is used to access an object's @@asyncIterator method. In order for an object to be async iterable, it must have a Symbol.asyncIterator key. Property attributes of Symbol.asyncIterator Writable no Enumerable no Configurable ...
Symbol.for() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Symbol.for(key); Parameters key String, required. ...
... The Symbol.for(key) method searches for existing symbols in a runtime-wide symbol registry with the given key and returns it if found. Otherwise a new symbol gets created in the global symbol registry with this key. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Symbol.for(key); Parameters key String, required. The key for the symbol (and also used for the description of the symbol). Return value An existing symbol with the given key if found; otherwise, a new symbol is created and returned. Description In contrast to Symbol(), the Symbol.for() function creates a symbol available in a global symb...
Symbol.hasInstance - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The Symbol.hasInstance well-known symbol is used to determine if a constructor object recognizes an object as its instance. The instanceof operator's behavior can be customized by this symbol. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Property attributes of Symbol.hasInstance Writable no Enumerable no Configurable no Examples Custom instanceof behavior You could implement your custom instanceof behavior like this, for example: class MyArray { static [Symbol.hasInstance](instance) { return Array.isArray(in...
Symbol.isConcatSpreadable - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Description The @@isConcatSpreadable symbol (Symbol.isConcatSpreadable) can be defined as an own or inherited property and its value is a boolean. ...
... The Symbol.isConcatSpreadable well-known symbol is used to configure if an object should be flattened to its array elements when using the Array.prototype.concat() method. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Description The @@isConcatSpreadable symbol (Symbol.isConcatSpreadable) can be defined as an own or inherited property and its value is a boolean. It can control behavior for arrays and array-like objects: For array objects, the default behavior is to spread (flatten) elements. Symbol.isConcatSpreadable can avoid flattening in these cases. For array-like objects, the default behavior is no spre...
Symbol.match - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Description This function is also used to identify if objects have the behavior of regular expressions. ...
... The Symbol.match well-known symbol specifies the matching of a regular expression against a string. This function is called by the String.prototype.match() method. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Description This function is also used to identify if objects have the behavior of regular expressions. For example, the methods String.prototype.startsWith(), String.prototype.endsWith() and String.prototype.includes(), check if their first argument is a regular expression and will throw a TypeError if they are. Now, if the match symbol is set to false (or a Falsy value), it indicates that the object is n...
Symbol.matchAll - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Description This Symbol is used for String.prototype.matchAll() and specifically in RegExp.prototype[@@matchAll](). ...
... The Symbol.matchAll well-known symbol returns an iterator, that yields matches of the regular expression against a string. This function is called by the String.prototype.matchAll() method. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Description This Symbol is used for String.prototype.matchAll() and specifically in RegExp.prototype[@@matchAll](). The following two examples return same result: 'abc'.matchAll(/a/); /a/[Symbol.matchAll]('abc'); This method exists for customizing match behavior within RegExp subclasses. Property attributes of Symbol.matchAll Writable ...
Symbol.replace - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...l-known symbol specifies the method that replaces matched substrings of a string. This function is called by the String.prototype.replace() method. For more information, see RegExp.prototype[@@replace]() and String.prototype.replace(). The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Property attributes of Symbol.replace Writable no Enumerable no Configurable no Examples Using Symbol.replace class CustomReplacer { constructor(value) { this.value = value; } [Symbol.replace](string) { return string.replace(...
Symbol.species - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Description The species accessor property allows subclasses to override the default constructor for objects. ...
... Description The species accessor property allows subclasses to override the default constructor for objects. ...
Symbol.toPrimitive - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Description With the help of the Symbol.toPrimitive property (used as a function value), an object can be converted to a primitive value. ...
... The Symbol.toPrimitive is a symbol that specifies a function valued property that is called to convert an object to a corresponding primitive value. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Description With the help of the Symbol.toPrimitive property (used as a function value), an object can be converted to a primitive value. The function is called with a string argument hint, which specifies the preferred type of the result primitive value. The hint argument can be one of "number", "string", and "default". Property attributes of Symbol.toPrimitive Writable no ...
Symbol.toStringTag - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The Symbol.toStringTag well-known symbol is a string valued property that is used in the creation of the default string description of an object. It is accessed internally by the Object.prototype.toString() method. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Property attributes of Symbol.toStringTag Writable no Enumerable no Configurable no Examples Default tags Object.prototype.toString.call('foo'); // "[object String]" Object.prototype.toString.call([1, 2]); // "[object Array]" Object.prototype.toString.c...
Symbol.unscopables - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The Symbol.unscopables well-known symbol is used to specify an object value of whose own and inherited property names are excluded from the with environment bindings of the associated object. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Description The @@unscopables symbol (Symbol.unscopables) can be defined on any object to exclude property names from being exposed as lexical variables in with with environment bindings. Note that if using Strict mode, with statements are not available and will likely also not need this symbol. Setting a property to true in an unscopables object will make it unscopable and the...
TypedArray.BYTES_PER_ELEMENT - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The TypedArray.BYTES_PER_ELEMENT property represents the size in bytes of each element in an typed array. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Property attributes of TypedArray.BYTES_PER_ELEMENT Writable no Enumerable no Configurable no Description TypedArray objects differ from each other in the number of bytes per element and in the way the bytes are interpreted. The BYTES_PER_ELEMENT constant contains the number of bytes each element in the given TypedArray has. Examples Using BYTES_PER_ELEMENT Int8Arr...
TypedArray.prototype.entries() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax arr.entries() Return value A new Array Iterator object. ...
... Syntax arr.entries() Return value A new Array Iterator object. ...
TypedArray.prototype.every() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The every() method tests whether all elements in the typed array pass the test implemented by the provided function. This method has the same algorithm as Array.prototype.every(). TypedArray is one of the typed array types here. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax typedarray.every(callback[, thisArg]) Parameters callback Function to test for each element, taking three arguments: currentValue The current element being processed in the typed array. index The index of the current element being processed in the typed array. array The typed array every was called upon. thisArg...
TypedArray.prototype.filter() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The filter() method creates a new typed array with all elements that pass the test implemented by the provided function. This method has the same algorithm as Array.prototype.filter(). TypedArray is one of the typed array types here. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax typedarray.filter(callback[, thisArg]) Parameters callback Function to test each element of the typed array. Invoked with arguments (element, index, typedarray). Return true to keep the element, false otherwise. thisArg Optional Value to use as this when executing callback. Return value A new typed array with the element...
TypedArray.from() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The TypedArray.from() method creates a new typed array from an array-like or iterable object. This method is nearly the same as Array.from(). The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax TypedArray.from(source[, mapFn[, thisArg]]) Where TypedArray is one of: Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array BigInt64Array BigUint64Array Parameters source An array-like or iterable object to convert to a typed array. mapFn Optional Map function to call on every element of the typed array. thisArg Optional Value to use ...
TypedArray.prototype.includes() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...he includes() method determines whether a typed array includes a certain element, returning true or false as appropriate. This method has the same algorithm as Array.prototype.includes(). TypedArray is one of the typed array types here. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax typedarray.includes(searchElement[, fromIndex]); Parameters searchElement The element to search for. fromIndex Optional. The position in this array at which to begin searching for searchElement; defaults to 0. Return value A Boolean. Examples Using includes var uint8 = new Uint8Array([1,2,3]); uint8.includes(2); ...
TypedArray.prototype.indexOf() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...xOf() 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(). TypedArray is one of the typed array types here. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax typedarray.indexOf(searchElement[, fromIndex = 0]) Parameters searchElement Element to locate in the typed array. fromIndex The index to start the search at. If the index is greater than or equal to the typed array's length, -1 is returned, which means the typed array will not be searched. If the provided index value is a...
TypedArray.prototype.keys() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax arr.keys() Return value A new Array Iterator object. ...
... Syntax arr.keys() Return value A new Array Iterator object. ...
TypedArray.prototype.map() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...e map() method creates a new typed array with the results of calling a provided function on every element in this typed array. This method has the same algorithm as Array.prototype.map(). TypedArray is one of the typed array types here. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax typedArray.map(mapFn[, thisArg]) Parameters mapFn A callback function that produces an element of the new typed array, taking three arguments: currentValue The current element being processed in the typed array. index Optional The index of the current element being processed in the typed array. array Optional...
TypedArray.of() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The TypedArray.of() method creates a new typed array from a variable number of arguments. This method is nearly the same as Array.of(). The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax TypedArray.of(element0[, element1[, ...[, elementN]]]) where TypedArray is one of: Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array BigInt64Array BigUint64Array Parameters elementN Elements of which to create the typed array. Return value A new TypedArray instance. Description Some subtle distinctions between Array.of() and TypedArray.of(): If the t...
TypedArray.prototype.reverse() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...e() method reverses a typed array in place. The first typed array element becomes the last and the last becomes the first. This method has the same algorithm as Array.prototype.reverse(). TypedArray is one of the typed array types here. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax typedarray.reverse(); Return value The reversed array. Examples Using reverse var uint8 = new Uint8Array([1, 2, 3]); uint8.reverse(); console.log(uint8); // Uint8Array [3, 2, 1] Specifications Specification ECMAScript (ECMA-262)The definition of 'TypedArray.prototype.reverse' in that specification.
TypedArray.prototype.slice() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The slice() method returns a shallow copy of a portion of a typed array into a new typed array object. This method has the same algorithm as Array.prototype.slice(). TypedArray is one of the typed array types here. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. 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. slice(-2) extracts the last two elements in the sequence. If begin is undefined, slice begins from index 0. end Optional Zero-based index before which to e...
TypedArray.prototype.subarray() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...ay() method returns a new TypedArray on the same ArrayBuffer store and with the same element types as for this TypedArray object. The begin offset is inclusive and the end offset is exclusive. TypedArray is one of the typed array types. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax typedarray.subarray([begin [,end]]) Parameters begin Optional Element to begin at. The offset is inclusive. The whole array will be included in the new view if this value is not specified. end Optional Element to end at. The offset is exclusive. If not specified, all elements from the one specified by begin to the end of...
TypedArray.prototype.toString() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax typedarray.toString() Return value A string representing the elements of the typed array. ...
... The toString() method returns a string representing the specified array and its elements. This method has the same algorithm as Array.prototype.toString(). TypedArray is one of the typed array types here. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax typedarray.toString() Return value A string representing the elements of the typed array. Examples The TypedArray objects override the toString method of Object. For TypedArray objects, the toString method joins the array and returns one string containing each typed array element separated by commas. For example, the following code creates a typed array a...
TypedArray.prototype.values() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax arr.values() Return value A new Array Iterator object. ...
... Syntax arr.values() Return value A new Array Iterator object. ...
TypedArray - JavaScript
y, nor is there a directly visible TypedArray constructor. Instead, there are a number of different global properties, whose values are typed array constructors for specific element types, listed below. On the following pages you will find common properties and methods that can be used with any typed array containing elements of any type. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Description ECMAScript 2015 defines a TypedArray constructor that serves as the [[Prototype]] of all TypedArray constructors. This constructor is not directly exposed: there is no global %TypedArray% or TypedArray property. It ...
...y 0 to 65535 2 16-bit unsigned integer unsigned short uint16_t Int32Array -2147483648 to 2147483647 4 32-bit two's complement signed integer long int32_t Uint32Array 0 to 4294967295 4 32-bit unsigned integer unsigned long uint32_t Float32Array 1.2x10-38 to 3.4x1038 4 32-bit IEEE floating point number (7 significant digits e.g., 1.1234567) unrestricted float float Float64Array 5.0x10-324 to 1.8x10308 8 64-bit IEEE floating point number (16 significant digits e.g., 1.123...15) unrestricted double double BigInt64Array -263 to 263-1 8 64-bit two's complement signed integer bigint int64_t (signed long long) BigUint64Array 0 to 264-1 8 64-bit unsig...
WebAssembly.Global() constructor - JavaScript
Specifications Specification WebAssembly JavaScript InterfaceThe definition of 'WebAssembly.Global() constructor' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and...
...an see the example running live on GitHub; see also the source code. Specifications Specification WebAssembly JavaScript InterfaceThe definition of 'WebAssembly.Global() constructor' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileServerChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.jsGlobal() constructorChrome Full support 69Edge No support NoFirefox ...
WebAssembly.Global - JavaScript
Specifications Specification WebAssembly JavaScript InterfaceThe definition of 'WebAssembly.Global()' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a p...
... Note: You can see the example running live on GitHub; see also the source code. Specifications Specification WebAssembly JavaScript InterfaceThe definition of 'WebAssembly.Global()' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileServerChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.jsGlobalChrome Full support 69Edge No support NoFirefox Full suppo...
WebAssembly.Memory() constructor - JavaScript
following example creates a new WebAssembly Memory instance with an initial size of 10 pages (640KiB), and a maximum size of 100 pages (6.4MiB). Its buffer property will return an ArrayBuffer. var memory = new WebAssembly.Memory({initial:10, maximum:100}); The second way to get a WebAssembly.Memory object is to have it exported by a WebAssembly module. The following example (see memory.html on GitHub, and view it live also) fetches and instantiates the loaded memory.wasm byte code using the WebAssembly.instantiateStreaming() method, while importing the memory created in the line above. It then stores some values in that memory, then exports a function and uses it to sum some values. WebAssembly.instantiateStreaming(fetch('memory.wasm'), { js: { mem: memory } }) .then(obj => { var i32 = ...
...10, maximum:100, shared:true}); This memory's buffer property will return a SharedArrayBuffer. Specifications Specification WebAssembly JavaScript InterfaceThe definition of 'Memory' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileServerChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.jsMemory() constructorChrome Full support 57Edge Full support 16Firefox ...
WebAssembly.Memory.prototype.buffer - JavaScript
It then stores some values in that memory, then exports a function and uses it to sum some values. ...
... i32[i] = i; } var sum = obj.instance.exports.accumulate(0, 10); console.log(sum); }); Specifications Specification WebAssembly JavaScript InterfaceThe definition of 'buffer' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileServerChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.jsbufferChrome Full support 57Edge Full support 16Firefox Full sup...
WebAssembly.Memory - JavaScript
following example creates a new WebAssembly Memory instance with an initial size of 10 pages (640KiB), and a maximum size of 100 pages (6.4MiB). Its buffer property will return an ArrayBuffer. var memory = new WebAssembly.Memory({initial:10, maximum:100}); The second way to get a WebAssembly.Memory object is to have it exported by a WebAssembly module. The following example (see memory.html on GitHub, and view it live also) fetches and instantiates the loaded memory.wasm byte code using the WebAssembly.instantiateStreaming() method, while importing the memory created in the line above. It then stores some values in that memory, then exports a function and uses it to sum some values. WebAssembly.instantiateStreaming(fetch('memory.wasm'), { js: { mem: memory } }) .then(obj => { var i32 = ...
...0, maximum:100, shared: true}); This memory's buffer property will return a SharedArrayBuffer. Specifications Specification WebAssembly JavaScript InterfaceThe definition of 'Memory' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileServerChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.jsMemoryChrome Full support 57Edge Full support 16Firefox Full sup...
WebAssembly.Module.exports() - JavaScript
ports of the given Module. Syntax WebAssembly.Module.exports(module); Parameters module A WebAssembly.Module object. Return value An array containing objects representing the exported functions of the given module. Exceptions If module is not a WebAssembly.Module object instance, a TypeError is thrown. Examples Using exports 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(). var worker = new Worker("wasm_worker.js"); WebAssembly.compileStreaming(fetch('simple.wasm')) .then(mod => worker.postMessage(mod) ); In the worker (see wasm_worker.js) we define an import object for the module to use, then se...
...0]); }; The exports[0] output looks like this: { name: "exported_func", kind: "function" } Specifications Specification WebAssembly JavaScript InterfaceThe definition of 'exports()' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileServerChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.jsexportsChrome Full support 57Edge Full support 16Firefox Full su...
WebAssembly.Module - JavaScript
ustom sections in the module with the given string name. WebAssembly.Module.exports() Given a Module, returns an array containing descriptions of all the declared exports. WebAssembly.Module.imports() Given a Module, returns an array containing descriptions of all the declared imports. Examples Sending a compiled module to a worker 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 the resulting Module instance to a worker using postMessage(). var worker = new Worker("wasm_worker.js"); WebAssembly.compileStreaming(fetch('simple.wasm')) .then(mod => worker.postMessage(mod) ); In the worker (see wasm_worker.js) we define an import object for...
...tObject).then(function(instance) { instance.exports.exported_func(); }); }; Specifications Specification WebAssembly JavaScript InterfaceThe definition of 'WebAssembly.Module()' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileServerChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.jsModuleChrome Full support 57Edge Full support 16Firefox Full sup...
WebAssembly.Table.prototype.get() - JavaScript
ax table.get(index); Parameters index The index of the function reference you want to retrieve. Return value A function reference -- this is an exported WebAssembly function, a JavaScript wrapper for an underlying wasm function. Exceptions If index is greater than or equal to Table.prototype.length, a RangeError is thrown. Examples Using get The following example (see table.html on GitHub, and view it live also) compiles and instantiates the loaded table.wasm byte code using the WebAssembly.instantiateStreaming() method. It then retrieves the references stored in the exported table. WebAssembly.instantiateStreaming(fetch('table.wasm')) .then(function(obj) { var tbl = obj.instance.exports.tbl; console.log(tbl.get(0)()); // 13 console.log(tbl.get(1)()); // 42 }); Note h...
...the reference (e.g. get(0)() rather than get(0)) -- it is a function rather than a simple value. Specifications Specification WebAssembly JavaScript InterfaceThe definition of 'get()' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileServerChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.jsgetChrome Full support 57Edge Full support 16Firefox Full suppor...
WebAssembly.compileStreaming() - JavaScript
of a .wasm module you want to stream and compile. Return value A Promise that resolves to a WebAssembly.Module object representing the compiled module. Exceptions If bufferSource is not a typed array, a TypeError is thrown. If compilation fails, the promise rejects with a WebAssembly.CompileError. Examples Compile streaming The following example (see our compile-streaming.html demo on GitHub, and view it live also) directly streams a .wasm module from an underlying source then compiles it to a WebAssembly.Module object. Because the compileStreaming() function accepts a promise for a Response object, you can directly pass it a WindowOrWorkerGlobalScope.fetch() call, and it will pass the response into the function when it fulfills. var importObject = { imports: { imported_func: ar...
...tantiated using WebAssembly.instantiate(), and the exported function invoked. Specifications Specification WebAssembly features for web embeddingThe definition of 'compileStreaming()' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileServerChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.jscompileStreamingChrome Full support 61Edge Full support 16Firefox ...
WebAssembly.instantiate() - JavaScript
mbly function that is exported by the Instance. 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(). var worker = new Worker("wasm_worker.js"); WebAssembly.compileStreaming(fetch('simple.wasm')) .then(mod => worker.
...d, importObject).then(function(instance) { instance.exports.exported_func(); }); }; Specifications Specification WebAssembly JavaScript InterfaceThe definition of 'instantiate()' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileServerChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.jsinstantiateChrome Full support 57Edge Full support 16Firefox Ful...
WebAssembly.instantiateStreaming() - JavaScript
ssembly functions. Exceptions If either of the parameters are not of the correct type or structure, a TypeError is thrown. If the operation fails, the promise rejects with a WebAssembly.CompileError, WebAssembly.LinkError, or WebAssembly.RuntimeError, depending on the cause of the failure. Examples Instantiating streaming The following example (see our instantiate-streaming.html demo on GitHub, and view it live also) directly streams a .wasm module from an underlying source then compiles and instantiates it, the promise fulfilling with a ResultObject. Because the instantiateStreaming() function accepts a promise for a Response object, you can directly pass it a WindowOrWorkerGlobalScope.fetch() call, and it will pass the response into the function when it fulfills. var importObjec...
...les should be returned with an application/wasm MIME type by the server. Specifications Specification WebAssembly features for web embeddingThe definition of 'instantiateStreaming()' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileServerChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.jsinstantiateStreamingChrome Full support 61Edge Full support 16Firefox ...
WebAssembly - JavaScript
WebAssembly.Module directly from a streamed underlying source, leaving instantiation as a separate step. WebAssembly.validate() Validates a given typed array of WebAssembly binary code, returning whether the bytes are valid WebAssembly code (true) or not (false). Examples Stream a .wasm module then compile and instantiate it The following example (see our instantiate-streaming.html demo on GitHub, and view it live also) directly streams a .wasm module from an underlying source then compiles and instantiates it, the promise fulfilling with a ResultObject. Because the instantiateStreaming() function accepts a promise for a Response object, you can directly pass it a WindowOrWorkerGlobalScope.fetch() call, and it will pass the response into the function when it fulfills. var importObjec...
...ultObject's instance member is then accessed, and the contained exported function invoked. Specifications Specification WebAssembly JavaScript InterfaceThe definition of 'WebAssembly' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileServerChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.jsWebAssemblyChrome Full support 57Edge Full support 16Firefox Ful...
decodeURIComponent() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax decodeURIComponent(encodedURI) Parameters encodedURI An encoded component of a Uniform Resource Identifier. ...
... The decodeURIComponent() function decodes a Uniform Resource Identifier (URI) component previously created by encodeURIComponent or by a similar routine. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax decodeURIComponent(encodedURI) Parameters encodedURI An encoded component of a Uniform Resource Identifier. Return value A new string representing the decoded version of the given encoded Uniform Resource Identifier (URI) component. Exceptions Throws an URIError ("malformed URI sequence") exception when used wrongly. Description Replaces each escape sequence in the encoded URI component with the c...
escape() - JavaScript
me the existence of these features and behaviours when writing new ECMAScript code. ... The escape() function computes a new string in which certain characters have been replaced by a hexadecimal escape sequence. Note: This function was used mostly for URL queries (the part of a URL following ?)--not for escaping ordinary String literals, which use the format "\xHH". (HH are two hexadecimal digits, and the form \xHH\xHH is used for higher-plane Unicode characters.) Escaped characters in String literals can be expanded by replacing the \x with %, then using the decodeURIComponent() function. Syntax escape(str) Parameters str A string to be encoded. Return value A new string in which certain characters have been escaped. Description The escape function is a property of the glo...
...ng the decodeURIComponent() function. Syntax escape(str) Parameters str A string to be encoded. Return value A new string in which certain characters have been escaped. Description The escape function is a property of the global object. Special characters are encoded with the exception of: @*_+-./ The hexadecimal form for characters, whose code unit value is 0xFF or less, is a two-digit escape sequence: %xx. For characters with a greater code unit, the four-digit format %uxxxx is used. Examples Using escape escape('abc123'); // "abc123" escape('aou'); // "%E4%F6%FC" escape('c'); // "%u0107" // special characters escape('@*_+-./'); // "@*_+-./" Specifications Specification ECMAScript (ECMA-262)The definition of 'escape' in that s...
eval() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... JavaScript from a string is an enormous security risk. It is far too easy for a bad actor to run arbitrary code when you use eval(). See Never use eval()!, below. The eval() function evaluates JavaScript code represented as a string. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax eval(string) Parameters string A string representing a JavaScript expression, statement, or sequence of statements. The expression can include variables and properties of existing objects. Return value The completion value of evaluating the given code. If the completion value is empty, undefined is returned. Description...
null - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax null Description The value null is written with a literal: null. null is not an identifier for a property of the global object, like undefined can be. ...
... Syntax null Description The value null is written with a literal: null. ...
parseFloat() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax parseFloat(string) Parameters string The value to parse. If this argument is not a string, then it is converted to one using the ToString abstract operation. Leading whitespace in this argument is ignored. ...
... parseFloat will parse non-string objects if they have a toString or valueOf method. The returned value is the same as if parseFloat had been called on the result of those methods. ...
Addition (+) - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The addition operator (+) produces the sum of numeric operands or string concatenation. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Operator: x + y Examples Numeric addition // Number + Number -> addition 1 + 2 // 3 // Boolean + Number -> addition true + 1 // 2 // Boolean + Boolean -> addition false + false // 0 String concatenation // String + String -> concatenation 'foo' + 'bar' // "foobar" // Number + String -> concatenation 5 + 'foo' // "5foo" // String + Boolean -> concatenation 'foo' + false // "foofalse" Specifications Specification ECMAScript (ECMA-262)The defin...
Addition assignment (+=) - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...t operator (+=) adds the value of the right operand to a variable and assigns the result to the variable. The types of the two operands determine the behavior of the addition assignment operator. Addition or concatenation is possible. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Operator: x += y Meaning: x = x + y Examples Using addition assignment // Assuming the following variables // foo = 'foo' // bar = 5 // baz = true // Number + Number -> addition bar += 2 // 7 // Boolean + Number -> addition baz += 1 // 2 // Boolean + Boolean -> addition baz += false // 1 // Number + String -> concate...
Assignment (=) - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...The simple assignment operator (=) is used to assign a value to a variable. The assignment operation evaluates to the assigned value. Chaining the assignment operator is possible in order to assign a single value to multiple variables The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Operator: x = y Examples Simple assignment and chaining // Assuming the following variables // x = 5 // y = 10 // z = 25 x = y // x is 10 x = y = z // x, y and z are all 25 Specifications Specification ECMAScript (ECMA-262)The definition of 'Assignment operators' in that specification. ...
Bitwise AND assignment (&=) - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The bitwise AND assignment operator (&=) uses the binary representation of both operands, does a bitwise AND operation on them and assigns the result to the variable. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Operator: x &= y Meaning: x = x & y Examples Using bitwise AND assignment let a = 5; // 5: 00000000000000000000000000000101 // 2: 00000000000000000000000000000010 a &= 2; // 0 Specifications Specification ECMAScript (ECMA-262)The definition of 'Assignment operators' in that specification. ...
Bitwise OR assignment (|=) - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The bitwise OR assignment operator (|=) uses the binary representation of both operands, does a bitwise OR operation on them and assigns the result to the variable. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Operator: x |= y Meaning: x = x | y Examples Using bitwise OR assignment let a = 5; a |= 2; // 7 // 5: 00000000000000000000000000000101 // 2: 00000000000000000000000000000010 // ----------------------------------- // 7: 00000000000000000000000000000111 Specifications Specification ECMAScript (ECMA-262)The definition of 'Assignment operators' in that specification. ...
Bitwise XOR assignment (^=) - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The bitwise XOR assignment operator (^=) uses the binary representation of both operands, does a bitwise XOR operation on them and assigns the result to the variable. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Operator: x ^= y Meaning: x = x ^ y Examples Using bitwise XOR assignment let a = 5; // 00000000000000000000000000000101 a ^= 3; // 00000000000000000000000000000011 console.log(a); // 00000000000000000000000000000110 // 6 let b = 5; // 00000000000000000000000000000101 b ^= 0; // 00000000000000000000000000000000 console.log(b); // 0000000000000000000000000000010...
Destructuring assignment - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The destructuring assignment syntax is a JavaScript expression that makes it possible to unpack values from arrays, or properties from objects, into distinct variables. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax let a, b, rest; [a, b] = [10, 20]; console.log(a); // 10 console.log(b); // 20 [a, b, ...rest] = [10, 20, 30, 40, 50]; console.log(a); // 10 console.log(b); // 20 console.log(rest); // [30, 40, 50] ({ a, b } = { a: 10, b: 20 }); console.log(a); // 10 console.log(b); // 20 // Stage 4(finished) proposal ({a, b, ...rest} = {a: 10, b: 20, c: 30, d: 40}); console.log(a); // 10 console.log(b); //...
Division (/) - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The division operator (/) produces the quotient of its operands where the left operand is the dividend and the right operand is the divisor. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Operator: x / y Examples Basic division 1 / 2 // 0.5 Math.floor(3 / 2) // 1 1.0 / 2.0 // 0.5 Division by zero 2.0 / 0 // Infinity 2.0 / 0.0 // Infinity, because 0.0 === 0 2.0 / -0.0 // -Infinity Specifications Specification ECMAScript (ECMA-262)The definition of 'Division operator' in that specification. ...
Division assignment (/=) - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The division assignment operator (/=) divides a variable by the value of the right operand and assigns the result to the variable. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Operator: x /= y Meaning: x = x / y Examples Using division assignment // Assuming the following variable // bar = 5 bar /= 2 // 2.5 bar /= 'foo' // NaN bar /= 0 // Infinity Specifications Specification ECMAScript (ECMA-262)The definition of 'Assignment operators' in that specification. ...
Equality (==) - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The equality operator (==) checks whether its two operands are equal, returning a Boolean result. Unlike the strict equality operator, it attempts to convert and compare operands that are of different types. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax x == y Description The equality operators (== and !=) use the Abstract Equality Comparison Algorithm to compare two operands. This can be roughly summarised as follows: If the operands are both objects, return true only if both operands reference the same object. If one operand is null and the other is undefined, return true. If the operands are of...
Exponentiation (**) - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Operator: var1 ** var2 Description The exponentiation operator is right-associative: a ** b ** c is equal to a ** (b ** c). ...
... The exponentiation operator (**) returns the result of raising the first operand to the power of the second operand. It is equivalent to Math.pow, except it also accepts BigInts as operands. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Operator: var1 ** var2 Description The exponentiation operator is right-associative: a ** b ** c is equal to a ** (b ** c). In most languages, such as PHP, Python, and others that have an exponentiation operator (**), the exponentiation operator is defined to have a higher precedence than unary operators, such as unary + and unary -, but there are a few exceptions. For...
Exponentiation assignment (**=) - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The exponentiation assignment operator (**=) raises the value of a variable to the power of the right operand. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Operator: x **= y Meaning: x = x ** y Examples Using exponentiation assignment // Assuming the following variable // bar = 5 bar **= 2 // 25 bar **= 'foo' // NaN Specifications Specification ECMAScript (ECMA-262)The definition of 'Assignment operators' in that specification. ...
Inequality (!=) - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The inequality operator (!=) checks whether its two operands are not equal, returning a Boolean result. Unlike the strict inequality operator, it attempts to convert and compare operands that are of different types. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax x != y Description The inequality operator checks whether its operands are not equal. It is the negation of the equality operator so the following two lines will always give the same result: x != y !(x == y) For details of the comparison algorithm, see the page for the equality operator. Like the equality operator, the inequality operator wil...
Left shift (<<) - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax a << b Description This operator shifts the first operand the specified number of bits to the left. ...
... The left shift operator (<<) shifts the first operand the specified number of bits to the left. Excess bits shifted off to the left are discarded. Zero bits are shifted in from the right. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax a << b Description This operator shifts the first operand the specified number of bits to the left. Excess bits shifted off to the left are discarded. Zero bits are shifted in from the right. For example, 9 << 2 yields 36: . 9 (base 10): 00000000000000000000000000001001 (base 2) -------------------------------- 9 << 2 (base 10): 000000000000000000000...
Left shift assignment (<<=) - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The left shift assignment operator (<<=) moves the specified amount of bits to the left and assigns the result to the variable. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Operator: x <<= y Meaning: x = x << y Examples Using left shift assignment let a = 5; // 00000000000000000000000000000101 bar <<= 2; // 20 // 00000000000000000000000000010100 Specifications Specification ECMAScript (ECMA-262)The definition of 'Assignment operators' in that specification. ...
Logical AND assignment (&&=) - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The logical AND assignment (x &&= y) operator only assigns if x is truthy. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax expr1 &&= expr2 Description Short-circuit evaluation The logical AND operator is evaluated left to right, it is tested for possible short-circuit evaluation using the following rule: (some falsy expression) && expr is short-circuit evaluated to the falsy expression; Short circuit means that the expr part above is not evaluated, hence any side effects of doing so do not take effect (e.g., if expr is a function call, the calling never takes place). Logical AND assignment short-circ...
Logical nullish assignment (??=) - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The logical nullish assignment (x ??= y) operator only assigns if x is nullish (null or undefined). The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax expr1 ??= expr2 Description Short-circuit evaluation The nullish coalescing operator is evaluated left to right, it is tested for possible short-circuit evaluation using the following rule: (some expression that is neither null nor undefined) ?? expr is short-circuit evaluated to the left-hand side expression if the left-hand side proves to be neither null nor undefined. Short circuit means that the expr part above is not evaluated, hence any side effects ...
Multiplication (*) - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The multiplication operator (*) produces the product of the operands. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Operator: x * y Examples Multiplication using numbers 2 * 2 // 4 -2 * 2 // -4 Multiplication with Infinity Infinity * 0 // NaN Infinity * Infinity // Infinity Multiplication with non-numbers 'foo' * 2 // NaN Specifications Specification ECMAScript (ECMA-262)The definition of 'Multiplication operator' in that specification. ...
Multiplication assignment (*=) - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The multiplication assignment operator (*=) multiplies a variable by the value of the right operand and assigns the result to the variable. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Operator: x *= y Meaning: x = x * y Examples Using multiplication assignment // Assuming the following variable // bar = 5 bar *= 2 // 10 bar *= 'foo' // NaN Specifications Specification ECMAScript (ECMA-262)The definition of 'Assignment operators' in that specification. ...
Operator precedence - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Precedence And Associativity Consider an expression describable by the representation below. Note that both OP1 and OP2 are fill-in-the-blanks for OPerators. ...
... Operator precedence determines how operators are parsed concerning each other. Operators with higher precedence become the operands of operators with lower precedence. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Precedence And Associativity Consider an expression describable by the representation below. Note that both OP1 and OP2 are fill-in-the-blanks for OPerators. a OP1 b OP2 c If OP1 and OP2 have different precedence levels (see the table below), the operator with the highest precedence goes first and associativity does not matter. Observe how multiplication has higher precedence than addition and execut...
Remainder (%) - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The remainder operator (%) returns the remainder left over when one operand is divided by a second operand. It always takes the sign of the dividend. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Operator: var1 % var2 Examples Remainder with positive dividend 12 % 5 // 2 1 % -2 // 1 1 % 2 // 1 2 % 3 // 2 5.5 % 2 // 1.5 Remainder with negative dividend -12 % 5 // -2 -1 % 2 // -1 -4 % 2 // -0 Remainder with NaN NaN % 2 // NaN Specifications Specification ECMAScript (ECMA-262)The definition of 'Remainder operator' in that specification. ...
Remainder assignment (%=) - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The remainder assignment operator (%=) divides a variable by the value of the right operand and assigns the remainder to the variable. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Operator: x %= y Meaning: x = x % y Examples Using remainder assignment // Assuming the following variable // bar = 5 bar %= 2 // 1 bar %= 'foo' // NaN bar %= 0 // NaN Specifications Specification ECMAScript (ECMA-262)The definition of 'Assignment operators' in that specification. ...
Right shift assignment (>>=) - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The right shift assignment operator (>>=) moves the specified amount of bits to the right and assigns the result to the variable. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Operator: x >>= y Meaning: x = x >> y Examples Using right shift assignment let a = 5; // (00000000000000000000000000000101) a >>= 2; // 1 (00000000000000000000000000000001) let b = -5; // (-00000000000000000000000000000101) b >>= 2; // -2 (-00000000000000000000000000000010) Specifications Specification ECMAScript (ECMA-262)The definition of 'Assignment operators' in that specification. ...
Strict equality (===) - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The strict equality operator (===) checks whether its two operands are equal, returning a Boolean result. Unlike the equality operator, the strict equality operator always considers operands of different types to be different. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax x === y Description The strict equality operators (=== and !==) use the Strict Equality Comparison Algorithm to compare two operands. If the operands are of different types, return false. If both operands are objects, return true only if they refer to the same object. If both operands are null or both operands are undefined, retur...
Strict inequality (!==) - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...The strict inequality operator (!==) checks whether its two operands are not equal, returning a Boolean result. Unlike the inequality operator, the strict inequality operator always considers operands of different types to be different. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax x !== y Description The strict inequality operator checks whether its operands are not equal. It is the negation of the strict equality operator so the following two lines will always give the same result: x !== y !(x === y) For details of the comparison algorithm, see the page for the strict equality operator. Like the st...
Subtraction (-) - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The subtraction operator (-) subtracts the two operands, producing their difference. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Operator: x - y Examples Subtraction with numbers 5 - 3 // 2 3 - 5 // -2 Subtraction with non-numbers 'foo' - 3 // NaN Specifications Specification ECMAScript (ECMA-262)The definition of 'Subtraction operator' in that specification. ...
Subtraction assignment (-=) - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The subtraction assignment operator (-=) subtracts the value of the right operand from a variable and assigns the result to the variable. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Operator: x -= y Meaning: x = x - y Examples Using subtraction assignment // Assuming the following variable // bar = 5 bar -= 2 // 3 bar -= 'foo' // NaN Specifications Specification ECMAScript (ECMA-262)The definition of 'Assignment operators' in that specification. ...
Unary plus (+) - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The unary plus operator (+) precedes its operand and evaluates to its operand but attempts to convert it into a number, if it isn't already. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Operator: +x Description Although unary negation (-) also can convert non-numbers, unary plus is the fastest and preferred way of converting something into a number, because it does not perform any other operations on the number. It can convert string representations of integers and floats, as well as the non-string values true, false, and null. Integers in both decimal and hexadecimal (0x-prefixed) formats are support...
Unsigned right shift assignment (>>>=) - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The unsigned right shift assignment operator (>>>=) moves the specified amount of bits to the right and assigns the result to the variable. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Operator: x >>>= y Meaning: x = x >>> y Examples Using unsigned right shift assignment let a = 5; // (00000000000000000000000000000101) a >>>= 2; // 1 (00000000000000000000000000000001) let b = -5; // (-00000000000000000000000000000101) b >>>= 2; // 1073741822 (00111111111111111111111111111110) Specifications Specification ECMAScript (ECMA-262)The definition of 'Assignment operators' in t...
delete operator - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The JavaScript delete operator removes a property from an object; if no more references to the same property are held, it is eventually released automatically. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax delete expression Where expression should evaluate to a property reference, e.g.: delete object.property delete object['property'] Parameters object The name of an object, or an expression evaluating to an object. property The property to delete. Return value true for all cases except when the property is an own non-configurable property, in which case, false is returned in non-strict mode...
Function expression - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax The expression is not allowed at the start of a statement. ...
... Syntax The expression is not allowed at the start of a statement. ...
instanceof - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax object instanceof constructor Parameters object The object to test. ...
... The instanceof operator tests to see if the prototype property of a constructor appears anywhere in the prototype chain of an object. The return value is a boolean value. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax object instanceof constructor Parameters object The object to test. constructor Function to test against Description The instanceof operator tests the presence of constructor.prototype in object's prototype chain. // defining constructors function C() {} function D() {} let o = new C() // true, because: Object.getPrototypeOf(o) === C.prototype o instanceof C // false, becaus...
block - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... A block statement (or compound statement in other languages) is used to group zero or more statements. The block is delimited by a pair of braces ("curly brackets") and may optionally be labelled: The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Block Statement { StatementList } Labelled Block Statement LabelIdentifier: { StatementList } StatementList Statements grouped within the block statement. LabelIdentifier An optional label for visual identification or as a target for break. Description The block statement is often called compound statement in other languages. It allows you to use mu...
break - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax break [label]; label Optional Identifier associated with the label of the statement. If the statement is not a loop or switch, this is required. ...
... The break statement terminates the current loop, switch, or label statement and transfers program control to the statement following the terminated statement. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax break [label]; label Optional Identifier associated with the label of the statement. If the statement is not a loop or switch, this is required. Description The break statement includes an optional label that allows the program to break out of a labeled statement. The break statement needs to be nested within the referenced label. The labeled statement can be any block statement; it does not have ...
const - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax const name1 = value1 [, name2 = value2 [, ... [, nameN = valueN]]]; nameN The constant's name, which can be any legal identifier. valueN The constant's value. ...
... Syntax const name1 = value1 [, name2 = value2 [, ... ...
continue - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax continue [label]; label Identifier associated with the label of the statement. ...
... The continue statement terminates execution of the statements in the current iteration of the current or labeled loop, and continues execution of the loop with the next iteration. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax continue [label]; label Identifier associated with the label of the statement. Description In contrast to the break statement, continue does not terminate the execution of the loop entirely: instead, In a while loop, it jumps back to the condition. In a for loop, it jumps to the update expression. The continue statement can include an optional label that allows the pr...
do...while - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...do...while statement creates a loop that executes a specified statement until the test condition evaluates to false. The condition is evaluated after executing the statement, resulting in the specified statement executing at least once. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax do statement while (condition); statement A statement that is executed at least once and is re-executed each time the condition evaluates to true. To execute multiple statements within the loop, use a block statement ({ ... }) to group those statements. condition An expression evaluated after each pass through the l...
for...in - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax for (variable in object) statement variable A different property name is assigned to variable on each iteration. ...
... The for...in statement iterates over all enumerable properties of an object that are keyed by strings (ignoring ones keyed by Symbols), including inherited enumerable properties. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax for (variable in object) statement variable A different property name is assigned to variable on each iteration. object Object whose non-Symbol enumerable properties are iterated over. Description A for...in loop only iterates over enumerable, non-Symbol properties. Objects created from built-in constructors like Array and Object have inherited non-enumerable properties fro...
for - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The for statement creates a loop that consists of three optional expressions, enclosed in parentheses and separated by semicolons, followed by a statement (usually a block statement) to be executed in the loop. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax for ([initialization]; [condition]; [final-expression]) statement initialization An expression (including assignment expressions) or variable declaration evaluated once before the loop begins. Typically used to initialize a counter variable. This expression may optionally declare new variables with var or let keywords. Variables declared with var...
function declaration - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax function name([param[, param,[..., param]]]) { [statements] } name The function name. ...
... The function declaration (function statement) defines a function with the specified parameters. You can also define functions using the Function constructor and a function expression. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax function name([param[, param,[..., param]]]) { [statements] } name The function name. param Optional The name of an argument to be passed to the function. Maximum number of arguments varies in different engines. statements Optional The statements which comprise the body of the function. Description A function created with a function declaration is a Function...
switch - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... The switch statement evaluates an expression, matching the expression's value to a case clause, and executes statements associated with that case, as well as statements in cases that follow the matching case. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax switch (expression) { case value1: //Statements executed when the //result of expression matches value1 [break;] case value2: //Statements executed when the //result of expression matches value2 [break;] ... case valueN: //Statements executed when the //result of expression matches valueN [break;] [default: ...
while - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax while (condition) statement condition An expression evaluated before each pass through the loop. ...
... The while statement creates a loop that executes a specified statement as long as the test condition evaluates to true. The condition is evaluated before executing the statement. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax while (condition) statement condition An expression evaluated before each pass through the loop. If this condition evaluates to true, statement is executed. When condition evaluates to false, execution continues with the statement after the while loop. statement An optional statement that is executed as long as the condition evaluates to true. To execute multiple statements w...
Media container formats (file types) - Web media technologies
MPEG/MPEG-2 The MPEG-1 and MPEG-2 file formats are essentially identical. Created by the Moving Picture Experts Group (MPEG), these formats are widely used in physical media, including as the format of the video on DVD media. On the internet, perhaps the most common use of the MPEG file format is to contain Layer_III/MP3 sound data; the resulting files are the wildly popular MP3 file used by digital music devices around the world. Otherwise, MPEG-1 and MPEG-2 are not widely used in Web content. The main differences between MPEG-1 and MPEG-2 take place in the media data formats rather than the container format. MPEG-1 was introduced in 1992; MPEG-2 was introduced in 1996. MPEG-1 and MPEG-2 media MIME types Audio Video audio/mpeg video/mpeg Video codec...
... elements within the <video> element, one for each version of the video you offer. This can be used to offer various versions of a video that can be selected depending on bandwidth availability, but in our case, we'll use it to offer format options. In the example shown here, a video is offered to the browser in two formats: WebM and MP4. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The video is offered first in WebM format (with the type attribute set to video/webm). If the user agent can't play that, it moves on to the next option, whose type is specified as video/mp4. If neither of those can be played, the t...
Web video codec guide - Web media technologies
AVC (H.264) The MPEG-4 specification suite's Advanced Video Coding (AVC) standard is specified by the identical ITU H.264 specification and the MPEG-4 Part 10 specifi...
...d today for all sorts of media, including broadcast television, RTP videoconferencing, and as the video codec for Blu-Ray discs. AVC is highly flexible, with a number of profiles with varying capabilities; for example, the Constrained Baseline Profile is designed for use in videoconferencing and mobile scenarios, using less bandwidth than the Main Profile (which is used for standard definition digital TV in some regions) or the High Profile (used for Blu-Ray Disc video). Most of the profiles use 8-bit color components and 4:2:0 chroma subsampling; The High 10 Profile adds support for 10-bit color, and advanced forms of High 10 add 4:2:2 and 4:4:4 chroma subsampling. AVC also has special features such as support for multiple views of the same scene (Multiview Video Coding), which allows, amo...
Media type and format guide: image, audio, and video content - Web media technologies
Web › Media › Formats
of the type string. This guide describes the format and possible values of the codecs parameter for the common media types. Codecs used by WebRTC WebRTC doesn't use a container, but instead streams the encoded media itself from peer to peer using MediaStreamTrack objects to represent each audio or video track. This guide discusses the codecs commonly used with WebRTC. ...
...s of the codecs parameter for the common media types. Codecs used by WebRTC WebRTC doesn't use a container, but instead streams the encoded media itself from peer to peer using MediaStreamTrack objects to represent each audio or video track. This guide discusses the codecs commonly used with WebRTC. Guides Concepts Digital audio concepts An introduction to how audio is converted into digital form and stored for use by computers. It explains basic concepts about how audio is sampled, as well as concepts such as sample rate, audio frames, and audio compression. Digital video concepts A guide to fundamental concepts involved with digital video as used on the web, including basics about color formats, chroma subsampling, how human perception influences video coding, and so forth. T...
How to make PWAs re-engageable using Notifications and Push - Progressive web apps (PWAs)
er file: self.addEventListener('push', function(e) { /* ... */ }); The data can be retrieved and then shown as a notification to the user immediately. This, for example, can be used to remind the user about something, or let them know about new content being available in the app. Push example Push needs the server part to work, so we're not able to include it in the js13kPWA example hosted on GitHub Pages, as it offers hosting of static files only. It is all explained in the Service Worker Cookbook -- see the Push Payload Demo. 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 T...
...There's a big collection of working examples showing general use, but also web push, caching strategies, performance, working offline, and more. Previous Overview: Progressive Next ...
Mobile first - Progressive web apps (PWAs)
ices can receive an optimal experience without having to shoulder the burden of many resources that they don't need. See below for more details. A simple example To demonstrate the concepts, I wanted to cover in this article, I created a very simple app containing a nav menu, heading and single column of text. You can see my mobile first example running live, or grab the code to play with it on Github. To make my simple example I created a sample app structure from a Mozilla Mortar template. I installed the Volo automation tool by running the following on the command line sudo npm install -g volo (You'll also need to get Node.js too if you don't already have it) I then created my sample project using volo create myapp mozilla/mortar-app-stub This creates a sample project inside a direc...
... build base=www-built: runs the built version through the server instead of the development version. Built-in features of the Mortar template Mortar templates contain a number of built-in features. In this sample app, I have used a couple of the built-in features to: Include an install button that works for Firefox OS, Firefox Aurora, Chrome and iOS app installs (as explained on the Install GitHub page). To make the install button work, all you have to do is put a <button> on the page with an ID of install-btn. Magic! Selectively include JavaScript libraries according to media query and feature tests (require.js is built in, which is helpful and very easy to use.) HTML structure For this example app, the HTML structure is going to be very simple: I am just including a heading, navig...
Web security
sible only in a secure context. The primary goal of secure contexts is to prevent man-in-the-middle attackers from accessing powerful APIs that could further compromise the victim of an attack. Features restricted to secure contexts This reference lists the web platform features available only in secure contexts. Weak signature algorithms The strength of the hash algorithm used in signing a digital certificate is a critical element of the security of the certificate. This article provides some information about signature algorithms known to be weak, so you can avoid them when appropriate. Redirection with 301 and 302 response codes to be written Data security Using HTTP Cookies An HTTP cookie (web cookie, browser cookie) is a small piece of data that a server sends to the user's w...
...ossary terms Block cipher mode of operation Certificate authority Challenge-response authentication Cipher Cipher suite Ciphertext CORS CORS-safelisted request header CORS-safelisted response header Cross-site scripting Cryptanalysis Cryptographic hash function Cryptography CSP CSRF Decryption Digital certificate DTLS Encryption Forbidden header name Forbidden response header name Hash HMAC HPKP HSTS HTTPS Key MitM OWASP Preflight request Public-key cryptography Reporting directive Robots.txt Same-origin policy Session hijacking SQL injection Symmetric-key cryptography ...
<xsl:decimal-format> - XSLT: Extensible Stylesheet Language Transformations
LT functions, XPath functions, XPath axes The <xsl:decimal-format> element defines the characters and symbols that are to be used in converting numbers into strings using theformat-number( ) function. Syntax <xsl:decimal-format name=NAME decimal-separator=CHARACTER grouping-separator=CHARACTER infinity=STRING minus-sign=CHARACTER NaN=STRING percent=CHARACTER per-mille=CHARATER zero-digit=CHARACTER digit=CHARACTER pattern-separator=CHARACTER /> Required Attributes None. Optional Attributes name Specifies a name for this format. decimal-separator Specifies the decimal point character. The default is (.). grouping-separator Specifies the thousands separator character. The default is (,). infinity Specifies the string used to represent infinity. The default is...
... represent infinity. The default is the string "Infinity". minus-sign Specifies the minus sign character. The default is the hyphen (-). NaN Specifies the string used when the value is not a number. The default is the string "NaN". percent Specifies the percentage sign character. The default is (%). per-mille Specifies the per thousand character. The default is (?). zero-digit Specifies the digit zero character. The default is (0). digit Specifies the character used in the format pattern to stand for a digit. The default is (#). pattern-separator Specifies the character separating positive and negative subpatterns in a format pattern. The default is the semi-colon (;). Type Top-level, must be the child of <xsl:stylesheet> or <xsl:transform>. Defined XSL...
Content Scripts - Archive of obsolete content
h this content. In many ways these are like content scripts, but they're not the focus of this article. To learn about how to interact with the content for a given user interface module, please see the module-specific documentation: panel, sidebar, frame. Almost all the examples presented in this guide are available as complete, but minimal, add-ons in the addon-sdk-content-scripts repository on GitHub. Loading content scripts You can load a single script by assigning a string to either the contentScript or the contentScriptFile option. The contentScript option treats the string itself as a script: // main.js var pageMod = require("sdk/page-mod"); var contentScriptValue = 'document.body.innerHTML = ' + ' "<h1>Page matches ruleset</h1>";'; pageMod.PageMod({ in...
Getting Started - Archive of obsolete content
Learn how to contribute to the Add-on SDK. This page is now maintained alongside the SDK code itself: https://github.com/mozilla/gecko-dev/blob/master/addon-sdk/source/CONTRIBUTING.md. ...
Testing the Add-on SDK - Archive of obsolete content
filter <addon_example_folder_name> gulp test:addons --filter <addon_folder_name> gulp test:modules --filter <file_name>:<test_name> or run all of the tests with gulp test. With Travis If you merely make a pull request for the mozilla/addon-sdk then all of the jpm tests mentioned above will be run on Travis-CI automatically and you will see the pass/fail results with a link to the log in the github pull request. Only on a linux machine at the moment. From Mozilla-Central repository With a checkout of the mozilla-central source code, one can always cd addon-sdk/source and use any of the methods described above, but in addtion to that there are a couple of mach commands available, and ofcourse there is the try server if you have access to that. With Mach There are two commands: .
io/file - Archive of obsolete content
e file is opened in read-only mode. "w" opens the file in write-only mode. "b" opens the file in binary mode. If "b" is not present, the file is opened in text mode, and its contents are assumed to be UTF-8. If mode is not given, "r" is assumed, and the file is opened in read-only text mode. Apart from these options, this API always passes the following options: CREATE_FILE, TRUNCATE (see //github.com/RealityRipple/UXP/blob/master/nsprpub/pr/include/prio.h#550). This means that: if the file does not exist it is created if the file exists, its length is truncated to zero it is not possible to open the file in append mode. Returns stream : If the file is opened in text read-only mode, a TextReader is returned, and if text write-only mode, a TextWriter is returned. See text-streams...
jpmignore - Archive of obsolete content
By using this file you can let jpm know which files and directories you would like it to ignore when building a .xpi file with jpm xpi. Here is an example: # Ignore .DS_Store files created by mac .DS_Store # Ignore any zip or xpi files *.zip *.xpi # Ignore specific directory # You can start patterns with a forward slash (/) to avoid recursivity. ...
Getting started (cfx) - Archive of obsolete content
se to implement your add-on are built into Firefox. When you run or package an add-on using cfx run or cfx xpi, the add-on will use the versions of the modules in the version of Firefox that hosts it. As an add-on developer, this is usually what you want. But if you're developing the SDK modules themselves, of course, it isn't. In this case it's assumed that you have checked out the SDK from its GitHub repo and will have run the bin/activate script from the root of your checkout. Then when you invoke cfx run or cfx xpi, you pass the "-o" option: cfx run -o This instructs cfx to use the local copies of the SDK modules, not the ones in Firefox. Developing without cfx run Because cfx run restarts the browser each time you invoke it, it can be a little cumbersome if you are making frequent...
Using third-party modules (jpm) - Archive of obsolete content
that you use to initialize, run, test, and package add-ons. The current tool is called jpm, and is based on Node.js. It replaces the old cfx tool. You can use jpm from Firefox 38 onwards. This article describes how you can use third-party modules with jpm. To follow this tutorial you'll need to have installed jpm and learned the basic jpm commands. To install menuitem you'll need to have git command. If you have error related to git, check you have latest git command installed. The Add-on SDK is extensible by design: you can use the modules that ship inside Firefox, but you can also create your own modules and make them available for anyone else to use. Before the jpm tool was available, there wasn't any package manager for these community-developed modules, so it wasn't obvious wh...
Finding window handles - Archive of obsolete content
indow_madeIntoXID = gdk_x11_drawable_get_xid(browserWindow_madeIntoGdkDrawable); console.info('browserWindow_madeIntoXID:', browserWindow_madeIntoXID, browserWindow_madeIntoXID.toString(), uneval(browserWindow_madeIntoXID)); // the code to focus the window is soon to come, its long and messy it needs to be made into a simple readable good for example. to see the messy code see here: https://gist.github.com/Noitidart/60aab0a96f060240614f#file-_ff-addon-snippet-x11_focusmostrecentwindowofpid-js-L354 gdk.close(); x11.close(); See Also js-ctypes - How to use C from Javascript Standard OS Libraries - Specifics of js-ctypes per OS ...
Examples and demos from articles - Archive of obsolete content
bjects and then to create a constructor for such class of objects in order to standardize and simplify the instantiation of them. Convert relative paths to absolute This example show how to translate relative paths to absolute paths. A shortcut to massively modify the DOM This example shows how to create a framework able to modify many properties of DOM objects at the same time. Filter the digitation into a form field, Capture the digitation of a hidden word This example shows the use of the onkeypress event during a digitation into a form field. AJAX - Submitting forms and uploading files This paragraph shows how to submit forms in pure-AJAX. Multipage AJAX navigation example This article provides a working (minimalist) example of a pure-AJAX web site composed only of three pages. ...
Miscellaneous - Archive of obsolete content
implied; i.e., window.content.getSelection() or: getBrowserSelection(); // |window| object is implied; i.e., window.getBrowserSelection() This final option massages the selection to remove leading and trailing whitespace. It also collapses consecutive whitespaces into a single whitespace, and returns at most 150 characters, making it ideal to display text in context menus. It is defined at //github.com/RealityRipple/Pale-Moon/blob/master/palemoon/base/content/browser.js#L5113. Note that it returns the empty string (""), not false, when nothing is selected. getBrowserSelection() is not implemented on some platforms, such as Thunderbird and Songbird. See also http://mxr.mozilla.org/seamonkey/source/browser/base/content/browser.js#4674 Discovering which element in the loaded document has ...
Preferences - Archive of obsolete content
This example also uses a technique to trigger an onChange function that can be defined per preference and has the old value and along with the new value of the preference. It also uses a technique so you can just do...
Rosetta - Archive of obsolete content
for showing a full compiler written in ECMAScript. We can show, however, a possible way to start from. The following code is nothing but the base for an extensible collection of compilers. But by default, no compilers are loaded. It relies on the fact that unrecognized MIME types will be simply ignored: this allows us to manually parse them. For a fast overview on the code proposed here you can git clone https://github.com/madmurphy/rosetta.js, or, at your choice, directly download this .zip file. rosetta.js: Library "use strict"; /*\ |*| |*| :: rosetta.js :: |*| |*| A possible, extensible collection of compilers to native ECMAScript. |*| |*| November 12, 2014 |*| |*| https://developer.mozilla.org/Add-ons/Code_snippets/Rosetta |*| https://developer.mozilla.org/User:fusionchess |*|...
Sidebar - Archive of obsolete content
tter's hidden attribute, you need to reset it to a safe value when your sidebar is closed, or replaced by another sidebar. For example, use this in your sidebar's Unload event handler: mainWindow.document.getElementById("sidebar-splitter").hidden = mainWindow.document.getElementById("sidebar-box").hidden; See Also Bootstrap demo addon that creates a sidebar with HTML content: https://gist.github.com/Noitidart/8728393 ...
JavaScript Daemons Management - Archive of obsolete content
.js (the core) daemon-safe.js (an extension of the core which adds a replacement of setInterval with a recursive invocation of setTimeout) daemon-methods.js (a wide and highly scalable collection of methods) The only independent module is daemon.js: both the daemon-safe.js module and the daemon-methods.js module require daemon.js to work. For a fast overview on the code proposed here you can git clone https://github.com/madmurphy/daemon.js.git. or, at your choice, directly download this .zip file. About the "callback arguments" polyfill In order to make this framework compatible with Internet Explorer (which doesn't support sending additional parameters to timers' callback function, neither with setTimeout() or setInterval()) we included the IE-specific compatibility code (commented co...
How to convert an overlay extension to restartless - Archive of obsolete content
Another example of using firebug.sdk xul.js to construct ui. ...
Setting Up a Development Environment - Archive of obsolete content
on system similar to the one in Firefox, and there are some Komodo extensions that provide additional help in extension development. That is more than what you can get with most other editors, so we recommend you to give it a try. All of our examples are handled with Komodo Edit, so if you see a .kpf or .komodoproject file in an example you download, this is a Komodo project file. We recommend Git and GitHub for source control, but any decent software configuration management system will do. To package XPI files, we use make. We chose make because this is the same system used by Mozilla to build Firefox, and it is available for all operating systems. make is a default tool in most UNIX-based systems. It can be installed on Mac OS X as part of the XCode Tools package, and on Windows with c...
Setting up an extension development environment - Archive of obsolete content
fault, and are therefore not listed by default. You will have to create new (boolean) entries for them. For more information about Mozilla preferences, refer to the mozillaZine article on "about:config". Tip: You can install either the Developer Profile or DevPrefs add-ons to handle setting these preferences automatically, and skip the rest of this section. DevPrefs can now be found at https://github.com/Noitidart/DevPrefs. maxVersion needs to be set in install.rdf javascript.options.showInConsole = true. Logs errors in chrome files to the Error Console. nglayout.debug.disable_xul_cache = true. Disables the XUL cache so that changes to windows and dialogs do not require a restart. This assumes you're using directories rather than JARs. Changes to XUL overlays will still require reload...
Signing an XPI - Archive of obsolete content
Firefox and get this information from the Issued By Common Name (Unizeto Certum's free certificate CA is Certum Level III CA). Download the Root CA and any intermediate certificates used to sign your certificate from the Issuer; their web site will have a link somewhere to their root CAs and public certificates. (Certum public key page). I downloaded the Certum Root CA and Certum Level III CA Digital ID for web and SSL/TLS Servers, copied the text and saved them to the files C:\Projects\CodeSigning\Certum Root CA.cer and C:\Projects\CodeSigning\Certum Level III CA.cer. Open a command prompt (ensure the paths to the NSS tools are set as described above) in the CodeSigning folder, install the Issuer CA certificates, and check they have been added correctly. C:\Projects\CodeSigning> certutil...
Signing an extension - Archive of obsolete content
The following instructions also apply to a theme and other XPI files. These instructions assume you're working on Mac and you've already got a valid certificate from CA. Get the signing tool We use NSS to sign an extension. This can be easily installed with MacPorts. ...
Adding preferences to an extension - Archive of obsolete content
he display. The rest of the options call the StockWatcher.watchStock() function to start watching a different stock. For a more detailed tutorial on creating popup menus, see XUL Tutorial:Popup Menus. << PreviousNext >> override chrome://myaddon/content/options.xul chrome://myaddon/content/oldOptions.xul application={ec8030f7-c20a-464f-9b0e-13a3a9e97384} appversion<=6.* Examples GitHub - Gist :: _ff-addon-template-bootstrapPrefsSkeleton - This Gist here is a fully working example of a fully funcitonal preferences skeleton, it uses the observer example from above. This example also uses a technique to trigger an onChange function that can be defined per preference and has the old value and along with the new value of the preference. It also uses a technique so you can just do...
Index of archived content - Archive of obsolete content
NP_Port NP_Shutdown Samples and Test Cases Shipping a plugin as a Toolkit bundle Supporting private browsing in plugins The First Install Problem Writing a plugin for Mac OS X XEmbed Extension for Mozilla Plugins SAX Security Digital Signatures Encryption and Decryption Introduction to Public-Key Cryptography Introduction to SSL NSPR Release Engineering Guide SSL and TLS Solaris 10 Build Prerequisites Sunbird Theme Tutorial Table Reflow Internals Tamarin Tracing Build Documentation The Basics of Web Services ...
JXON - Archive of obsolete content
implementation dependent. Appendix: a complete, bidirectional, JXON library Now we can create a more complete, bidirectional, JXON library based on all our algorithms (see: #1, #2, #3, #4, reverse). Its usage is modeled on the JSON native object. Before implementing it in a working environment, please read the note about the const statement compatibility. The following code is also available on GitHub. "use strict"; /*\ |*| |*| JXON framework - Copyleft 2011 by Mozilla Developer Network |*| |*| Revision #3 - October 31th, 2016 |*| |*| https://developer.mozilla.org/docs/JXON |*| https://developer.mozilla.org/User:fusionchess |*| https://github.com/madmurphy/jxon.js |*| |*| This framework is released under the GNU Public License, version 3 or later. |*| http://www.gnu.org/licenses/gp...
Chromeless - Archive of obsolete content
The aim is to enable developers to create full blown desktop applications using only Web technologies. Chromeless apps have access to a collection of JavaScript APIs that provide them with deep desktop integration. One of the core capabilities of the Chromeless platform is the ability to safely embed untrusted Web applications inside these applications. Chromeless vs Prism/WebRunner Prism (an ex-Mozilla Labs project, now discontinued but kept going independently of Mozilla under the [now discontinued] WebRunner name) was/is a way to make Web pages superficially appear to be native applications. ...
Documentation for BiDi Mozilla - Archive of obsolete content
aring and testing the available open-source implementations. As far as we could discover, ICU is the only one which is 100% compatible with UBA, including support for explicit directional controls (LRO, RLO, etc, and their HTML equivalents). Bidi processing for a given HTML document will only take place if one of the following is true: The page includes a Hebrew or Arabic character or a Hindi digit. This is determined in nsTextFragment::SetTo The page includes a element with the attribute dir=rtl, either explicitly (nsGenericHTMLElement::MapCommonAttributesInto), or as a consequence of a style rule (MapDeclarationTextInto in nsCSSStyleRule.cpp) All these cases use nsDocument::EnableBidi to set the flag mBidiEnabled. In a Bidi-enabled document, the following things happen: During a reflow,...
Using microformats - Archive of obsolete content
ded the microformats API, you can manage microformats using the methods listed here; for information about parsing microformats, see Parsing microformats in JavaScript. Predefined microformats Firefox 3 provides definitions implementing several common microformats: adr Represents an address (such as a street or mailing address). geo Represents a geographical location using latitude and longitude. hCard Represents contact information for a person. hCalendar Represents a calendar appointment entry. tag Used to add tags to other microformats. Methods add() Adds a new microformat to the microformat module. Note: If a microformat by the specified name already exists, it is replaced by the new one. add(name, definition); Parameters name The name of the microformat to add t...
importUserCertificates - Archive of obsolete content
instead. resultString = crypto.importUserCertificates("nicknameString","certString",forceBackup); Argument Description "nicknameString" This is the nickname that will be used to describe the certificate in the client's certificate management UI. It should serve to uniquely identify the certificate to the user. For example, "John Smith's VeriSign Class 3 Digital ID" or "John Smith's Ford ID Certificate". However, if this certificate has the same DN as one or more certificates that already exist in the user's certificate store, the nickname associated with the certificate(s) of the same DN in the certificate store is used, and the <tt>"nicknameString"</tt> parameter is ignored. If the string is null and no certificate with the same DN exists in the user...
Remote debugging - Archive of obsolete content
a developer's computer, a last-resort strategy is to debug it on the community member's computer. The crash victim should at least know how to run a debugger, if not how to use it, and should have a debug build of Firefox handy. This requires quite a bit of trust, in both directions. The developer trusts that his time is not being wasted: the crash is a real bug in Firefox. (That is, there's a legitimate reason it happens only on some computers, but that reason just hasn't been discovered.) The crash victim, in turn, trusts the developer with full access to his computer. A good place to start is a detailed stack (in gdb, use bt followed by bt full). There give more information about the stack than a Breakpad crash report: not only the names of the functions on the stack, but also the values...
Abc Assembler Tests - Archive of obsolete content
actual:*):void - Compare the results of a testcase where name is the testcase name COMPARE_TYPEERROR(name:String, expected:*, actual:*):void - Special function for comparing TypeErrors (RuntimeErrors) - Will only compare the first 22 chars of expected and actual so that test can be run in Release and ReleaseDebugger configurations. COMPARE_NUMBEREQ(name:String, expected:*, actual:*, fractionDigits:int=-1):void - Compare 2 Numbers up to FractionDigits This is to be used for high precision numbers that may vary slightly due to platform differences. Sample abcasm test /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compl...
The new nsString class implementation (1999) - Archive of obsolete content
teroperate with code that assumes UCS2 strings. This assumption is nearly always wrong -- and will seriously hinder our ability to localize the source base. It is recognized that (ASCII) nsCString's are useful in the following contexts: Whenever calling libraries that expect a char* variant Whenever maximum memory efficiency is essential I would argue that only the first case is normatively legitimate. The i18n folks will tell you it's better to use a wide string and convert to 1-byte forms for this purpose even though there is a performance penalty for doing so. Since I have to acknowledge the idiom, I have made nsCString available but note that it should be used sparingly. Memory Management A principal enhancement of the new architecture is pluggable memory allocators. All nsString subc...
URIs and URLs - Archive of obsolete content
global segments like path and prehost for example. Necko provides pre written urlparsers for schemes based on hierachical naming systems. Escaping To be able to parse an URL safely it is sometimes necessary to "escape" certain characters, to hide them from the parser. An escaped character is encoded as a character triplet, consisting of the percent character "%" followed by the two hexadecimal digits representing the octet code. For example, "%20" is the escaped encoding for the US-ASCII space character. Another quote from RFC 2396: A URI is always in an "escaped" form, since escaping or unescaping a completed URI might change its semantics. Normally, the only time escape encodings can safely be made is when the URI is being created from its component parts; each component may have its own...
Getting File Information - Archive of obsolete content
for most purposes. However, you can also use the permissions (nsIFile.Attributes) attribute to get the UNIX-style permission flags for a file. This attribute is also necessary if you need to modify the permissions. file.permissions = 0640; It is common to use an octal number (a number in base 8 beginning with 0) for permissions as it can make the value easier to read. In this case, the first digit is the permissions for the owner of the file, the second digit is the permissions for the group of the file and the third digit is the permissions for everyone else. The value is a sum of three values, 4 for readable, 2 for writable and 1 for executable. The default permissions for files when created through an output stream is 0644, which means that the file is readable and writable by the owne...
Adding Properties to XBL-defined Elements - Archive of obsolete content
The example below shows this: <property name="number"> <getter> return this.getAttribute('number'); </getter> <setter> var v = parseInt(val,10); if (!isNaN(v)) { this.setAttribute('number', '' + v); } </setter> </property> The property in this example will only be able to hold integer values. If other characters are entered, they are stripped off. If there are no digits, the value is not changed. This is done in the code inside the setter element. The real value of the property is stored in the number attribute. You can use either syntax for creating get and set handlers. Readonly Attribute You can make a field or property read-only by adding a readonly attribute to the field tag or property tag and setting it to true. Attempting to set the value of a read-only...
Input Controls - Archive of obsolete content
same attributes as buttons: label The label on the check box or radio button. disabled Set this to either true or false to disable or enable the check box or radio button. accesskey The shortcut key that can be used to select the element. The letter specified is usually drawn underlined in the label. to view XUL, you need e.g. seamonkey or waterfox and remote-xul-manager from https://github.com/jvillalobos/Remote-XUL-Manager Find files example so far : Source View In the next section, we will look at some elements for entering and selecting numbers. << PreviousNext >> Looking for a guide to using input controls and forms on the Web? See Forms in HTML. ...
Numeric Controls - Archive of obsolete content
ons. The user may also increment or decrement the value using this increment by using the up and down cursor keys while the textbox is focused. The decimalplaces attribute indicates how many decimal places to show. The default value is 0, which means show integers only. However a different value may be used to show decimal values. <textbox type="number" decimalplaces="2"/> In this example, two digits right of the decimal point are shown. Values with additional fractional digits are rounded to two digits. Scales A scale element may also be used to select from a range of values. Instead of a textbox however, a sliding scale is used. The user may drag the thumb of the scale to adjust the value. Many of the same attributes as a numeric textbox may be used with a scale: value, min, max and in...
XUL Structure - Archive of obsolete content
locally and registering the installed files as part of its chrome system. This allows a special URL form, called a chrome:// URL, to be used. By accessing a file using a chrome URL, the files receive elevated privileges to access local files, access preferences and bookmarks and perform other privileged operations. Obviously, web pages do not get these privileges, unless they are signed with a digital certificate and the user has granted permission to perform these operations. This chrome package registration is the way Firefox extensions are able to add features to the browser. The extensions are small packages of XUL files, JavaScript, style sheets and images packed together into a single file. These packaged files can be created by using a ZIP utility. When the user downloads the zipped ...
XUL accessibility guidelines - Archive of obsolete content
ctedly can confuse or disorient users. A common example of this occurrence in the US is with phone number form fields. US phone numbers are often displayed on the web in two main formats XXX-XXX-XXXX or (XXX) XXX-XXXX. To enforce this pattern some forms provide three form fields. The problem occurs when a developer decides to add functionality that jumps the user to the second form field once 3 digits have been entered into the first form field. This behavior is then repeated for the next form field. Users who are used to navigating form fields themselves often end up repeating the jump operation and thereby skipping ahead one form field. Initial dialog focus The initial focus in a XUL dialog (i.e., the focus when the dialog is first opened) should always be on a specific control, not on th...
window - Archive of obsolete content
--> <window id="rootWnd" title="Register Online!" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <vbox> <hbox> <image src="application_form.png"/> <description>Register Online!</description> </hbox> <groupbox align="start"> <caption label="Your Informa...
Debugging a XULRunner Application - Archive of obsolete content
ump.enabled", true) is enabled. To output dump calls instead to a file, set browser.dom.window.dump.file to the file destination where the log should be created and restart the application. If you would like the console messages to appear in the console you used to launch the application, you can use the Gecko Console Redirector. Precompiled binaries are available in the zipped archive https://github.com/matthewkastor/Redirector/archive/master.zip under Redirector-master\Gecko\Console Redirector\bin\Release Copy all the dll's and the exe to wherever you want. Then run Console Redirector.exe /? JavaScript Console To enable the JS console, start XULRunner with the -jsconsole argument. Note: If you are not using the stub executable to launch the application, the -jsconsole argument is aft...
Getting started with XULRunner - Archive of obsolete content
the application folder structure Time to start a simple, bare bones application shell. Call it a XUL "Hello World" if you want. All of what you see below can be found in the XULRunner documentation here on MDN in much more detail. Hint: Skip ahead and download the sample application, you can experiment with it while following this tutorial. You can download the sample application from https://github.com/matthewkastor/XULRunner-Examples. Please continue reading to learn the "what", "why" and "how" parts of building a XULRunner application. On Windows, I created the root in a new c:\program files\myapp folder, but you can create it wherever you like, using whatever OS you like. The same application structure is used on Windows, Mac and Linux. Here is the subfolder structure: + myapp/ | +...
Mozprocess - Archive of obsolete content
es the brunt of the process management. Basic usage: process = ProcessHandler(['command', '-line', 'arguments'], cwd=None, # working directory for cmd; defaults to None env={}, # environment to use for the process; defaults to os.environ ) exit_code = process.waitForFinish(timeout=60) # seconds See an example in https://github.com/mozilla/mozbase/b...profilepath.py ProcessHandler may be subclassed to handle process timeouts (by overriding the onTimeout() method), process completion (by overriding onFinish()), and to process the command output (by overriding processOutputLine()). TODO Document improvements over subprocess.Popen.kill ...
Mozprofile - Archive of obsolete content
ferences myprefs.json using a .ini file: mozprofile --preferences myprefs.ini via the command line: mozprofile --pref key:value --pref key:value [...] When setting preferences from an .ini file or the --pref switch, the value will be interpolated as an integer or a boolean (true/false) if possible. Setting Permissions mozprofile also takes care of adding permissions to the profile. See https://github.com/mozilla/mozbase/b...permissions.py Resources Other Mozilla programs offer additional and overlapping functionality for profiles. There is also substantive documentation on profiles and their management. ProfileManager : XULRunner application for managing profiles. Has a GUI and CLI. python-profilemanager : python CLI interface similar to ProfileManager profile documentation : http://su...
nsIContentPolicy - Archive of obsolete content
our shouldLoad() implementation, expect unpredictable behavior, possibly including crashes, content not showing up, content showing up doubled, etc. If you need to do any of the things above, do them off timeout or event. Note: When multiple content policies are used (for example through several extensions), if one of them rejects a request, the rest of the policies are not called. Reference: //github.com/RealityRipple/UXP/blob/master/dom/base/nsContentPolicy.cpp#L129. Note: The order of content policies in the above case depends on the precedence of installation. short shouldLoad( in unsigned long aContentType, in nsIURI aContentLocation, in nsIURI aRequestOrigin, in nsISupports aContext, in ACString aMimeTypeGuess, in nsISupports aExtra, in nsIPrincipal aRequestPrincipa...
Archived Mozilla and build documentation - Archive of obsolete content
modify, and delete items. Implementing a calICalendarViewController allows for these actions to be performed in a manner consistent with the rest of the application in which the calICalendarView is included. calIFileType The calIFileType interface provides information about a specific file type. Chromeless [This project may not be active -- check Github https://github.com/mozilla/chromeless] Creating a Firefox sidebar extension This article describes how to create a registered sidebar for Firefox 2 or greater. See the references section for information on creating extension in earlier browsers. Creating a hybrid CD Creating a Microsummary A microsummary generator is a set of instructi...
Mozilla release FAQ - Archive of obsolete content
sh in many common circumstances if compiled with optimization on. What platforms have had successful builds so far? This list will be updated with time, but (according to netscape.public.mozilla.general) the following platforms have been built successfully: Solaris 2.4, 2.5, 2.6 FreeBSD 2.2, 3.0 Linux/Intel and Alpha 2.0, 2.1 MacOS WinNT 4.0 IRIX 5.3, 6.2, 6.3, 6.4 Win95, Win98 Digital Unix 4.0 NetBSD OpenBSD BSDI HP/UX 9.05, 10.20, 11.0 (see 2.7) Hurd .03 DG/UX Mac OS X I'm *still* having problems getting Mozilla to build on my platform! If it's NSPR that's failing to build, take a look at config/your_platform.mk, as NSPR still uses the classic build system. If it's in Mozilla and you're checking out from CVS, check tinderbox to see if the tree is on fire. If ...
The First Install Problem - Archive of obsolete content
y (see below), but that key doesn't link suffixes to a particular mimetype. Example: [HKEY_LOCAL_MACHINE\Software\MozillaPlugins\]\@mycompany.com/MyApplication,version=5.01\MimeTypes\application/x-myapp] Suffixes=app Suffixes -- a subkey containing string values (REG_SZ) representing all the suffixes (3 digit extensions) supported by this module. Example: [HKEY_LOCAL_MACHINE\Software\MozillaPlugins\]\@mycompany.com/MyApplication,version=5.01\Suffixes] Inside this subkey, string values might look like: app typ avi Note that these string values (REG_SZ) don't actually have values affiliated with them. "Description" -- string va...
Proposal - Archive of obsolete content
still working on it and trying to come up with a draft. Those labeled with "Draft Exists" can be implemented, but be warned that they could radically change. Name Description Status Easy News Topics Easy News Topics (ENT) is intended to be a very simple standard for describing how topic information can be introduced into an RSS2.0 news feed. Draft Exists ICBM Let's you add latitude and longitude info to an item. Spec Exists iTunes RSS iTunes Extension Modules used for IPradio/podcasting. Spec Exists Media RSS RSS Extension Module used for IPTV and IPradio/podcasting. Spec Exists Newsgator Feed Extension Created to make RSS feeds work better with Newsgator software. Lets you specify an image, up to 277x78 pixels. And lets you specifies a specific rendering transform (XSLT) to be ...
Confidentiality, Integrity, and Availability - Archive of obsolete content
affic to a different website. In this case, the site you are directed to is not genuine. Availability Availability means that information is accessible by authorized users. If an attacker is not able to compromise the first two elements of information security (see above) they may try to execute attacks like denial of service that would bring down the server, making the website unavailable to legitimate users due to lack of availability. Original Document Information Author(s): Karen Scarfone, Wayne Jansen, and Miles Tracy Title: NIST Special Publication 800-123, Guide to General Server Security Last Updated Date: July 2008 Copyright Information: This document is not subject to copyright. ...
Encryption and Decryption - Archive of obsolete content
Figure 2 also works: data encrypted with your private key can be decrypted only with your public key. This would not be a desirable way to encrypt sensitive data, however, because it means that anyone with your public key, which is by definition published, could decrypt the data. Nevertheless, private-key encryption is useful, because it means you can use your private key to sign data with your digital signature-an important requirement for electronic commerce and other commercial applications of cryptography. Client software such as Firefox can then use your public key to confirm that the message was signed with your private key and that it hasn't been tampered with since being signed. "Digital Signatures" describes how this confirmation process works. Key Length and Encryption Strength Br...
Vulnerabilities - Archive of obsolete content
, so using the most secure settings could make the software useless or unusable. Second, many security settings have both positive and negative consequences for security. An example is the number of consecutive failed authentication attempts to permit before locking out a user account. Setting this to 1 would be the most secure setting against password guessing attacks, but it would also cause legitimate users to be locked out after mistyping a password once, and it would also permit attackers to perform denial-of-service attacks against users more easily by generating a single failed login attempt for each user account. Because of the number of vulnerabilities inherent in security configuration settings and software feature misuse possibilities, plus the number of software flaw vulnerabili...
ECMAScript 2016 to ES.Next support in Mozilla - Archive of obsolete content
fers to new features of the ECMA-262 standard (commonly referred to as JavaScript) introduced after ECMAScript 2015. New versions of ECMAScript specifications are released yearly. So far, ES2016, ES2017, and ES2018 have been released. This year, the ES2019 specification will be released and ES2020 is the current ECMAScript draft specification. You can see the latest proposals on the tc39/ecma262 GitHub repository. A channel for feedback on ECMAScript standards is es-discuss. Below is a list of features in ES2016+ and what version of Firefox they were implemented in. ECMAScript 2016 Array.prototype.includes() (Firefox 43) TypedArray.prototype.includes() (Firefox 43) Exponentiation Operator (Firefox 52) ECMAScript 2017 Object.values() (Firefox 47) Object.entries() (Firefox 47) S...
Sharp variables in JavaScript - Archive of obsolete content
jects that have cyclic references or multiple references to the same object. Warning: Sharp variables was a non-standard syntax for creating or serializing cyclic data graphs that used to be supported only by Mozilla's SpiderMonkey JS engine. This feature has been removed in bug 566700, Firefox 12. Form Sharp variables have the form of a sharp sign (#) immediately followed by one or more digits. The number represented by the digits serves as the variable's unique identifier, but leading 0s are ignored. Scope Sharp variables are only in scope in the statement in which they are defined. Usage To create a sharp variable, simply assign an object to it in a line of code using an equal sign. You cannot assign primitives (including strings) to sharp variables. Make sure you don't put in a...
forEach - Archive of obsolete content
Feel free to alter the text as English is not my mother tongue and I'm more concerned with the code quality that the English grammar ;-S dotnetCarpenter 30 June 2012 <hr> The Compatibility section goes to extraordinary lengths in providing a forEach implementation. A much more sane approach would be to count on the implementation to throw errors if wrong arguments are provided and implement this in fewer lines of code. ...
Archived open Web documentation - Archive of obsolete content
E4X Tutorial This tutorial walks you through the basic syntax of E4X (ECMAScript for XML). With E4X, programmers can manipulate an XML document with a syntax more familiar to JavaScript programming. Talk:Array.forEach() Ok, in the end I didn't remove the old code as it isn't hosted anywhere (I thought the github reference contained the code) but inserted a faster implementation above while retaining the rest of the document. Iterator The Iterator function returns an object which implements legacy iterator protocol and iterates over enumerable properties of an object. LiveConnect (Please update or remove as needed.) MSX...
Windows Media in Netscape - Archive of obsolete content
Windows Media Player 6x and later. It is important to note that in Netscape 7.1, only the classid for Windows Media Player is supported, and no other control can be created. The various param elements that can be used and the functionalities behind them is best described by the Windows Media 9 Series SDK. In Netscape 7.1, the codebase attribute of the object element cannot be used to initiate a digitally signed download of the Windows Media control, if it is not present on the machine. The section below on scripting the control covers more on how to detect if the Windows Media Player has not been successfully created. Scripting the Windows Media Player Control The number of methods and properties that are exposed by the Windows Media Player, including the events that the player throws for ha...
Examples - Game development
map showing planes taking off and landing at airports, along with flight path patterns. Animation Physics 3D rendering of terrain and cars, using ammo.js for the physics calculations. Volumetric Particle Flow Physics simulation of flowing liquid. Explosion and chain reaction Exploding particles that set off other explosions. Canvas generated planet A planet with orbiting asteriod belt. Digital Fireworks Animated firework effects rendered on canvas. Autumn Falling autumn leaves, with light source shining through. Created using Three.js. Fire walk with me Billowing fire cloud effect. Rainbow Firestorm Rainbow-coloured particles, falling like rain, bouncing around on a terrain of orbs. Crowd Simulation Simulation of a bustling crowd of people all trying to reach their opposite ...
Index - Game development
points for every brick a user hits, and keep count of the total score. 70 2D maze game with device orientation Canvas, Device Orientation API, Game Development, HTML5, Phaser, Vibration API I hope this tutorial will help you dive into 2D game development and inspire you to create awesome games on your own. You can play the demo game Cyber Orb and check out its source code on GitHub. 71 Touch Event Horizon NeedsContent, NeedsExample This tutorial shows how to use Touch Events to create a game on a <canvas>. This is a multi-player game relying on the Tap and Drag gestures. 72 Visual JS GE Canvas, JavaScript, Server, game engine Visual-js GameEngine is a small but comprehensive canvas/websocket-based game engine with GUI source edit...
Game monetization - Game development
ious endeavour on the path to becoming an independent game developer able to make a living, read on and see what your options are. The technology is mature enough; now it's just about chosing the right approach. Paid games The first, most obvious choice that may come to your mind might be selling the games the way it is done for huge AAA titles -- with a fixed, up front price. Even though the digital market is key and you don't need to print covers and put your game in a physical store in boxes, to earn decent money on selling your games for a fixed price you have to invest your time and money in marketing. Only the best games will break even or earn more than they cost to make, and you still need a lot of luck for that. How much you charge for your game depends on the market, quality of y...
Building up a basic demo with PlayCanvas - Game development
The online editor is free for public projects with up to two team members, but there are also paid plans if you'd like to run a commercial private project with more developers. Games and demos PlayCanvas has a few well-known demos published that showcase its possibilities. Tanx is a multiplayer tank game where you can drive your tank around, shooting at other players as you go. ...
WebVR — Virtual Reality for the Web - Game development
on.z > 0.01) { zPos = -posState.position.z; } else { zPos = 0.01; } } ... } For a full explanation and more details of the demo this is taken from, see Using the WebVR API. Tools and techniques The first WebVR experiments and demos used Three.js as it's probably the most popular 3D engine for the web. See the VREffect and VRControls functions available on the Three.js github to help you implement and handle WebVR with Three.js. Boris Smus has written about the concept of Responsive WebVR, where a single web game can be played on various devices like laptops without VR hardware, PCs with Oculus Rift, or smartphones inside Google Cardboard and still deliver a unique and valuable experience across all of them. It's like responsive design, but applied to the VR wor...
Desktop mouse and keyboard controls - Game development
; That way instead of using the codes to compare the input in the handler functions we could do something like this, which is arguably easier to remember: if(event.keyCode == KeyboardHelper.left) { leftPressed = true; } Note: You can also find a list if the different keycodes and what keys they relate to in the keyCode reference page. You can see this example in action online at end3r.github.io/JavaScript-Game-Controls and the full source code can be found at github.com/end3r/JavaScript-Game-Controls. Phaser approach As I mentioned before you can write everything on your own, but you can also take the advantage of built-in functions in frameworks like Phaser -- these will make your life easier and development a lot faster. All the edge cases, differences between browser implemen...
Mobile touch controls - Game development
ey move the finger on the screen while touching it touchend is fired when the user stops touching the screen touchcancel is fired when a touch is cancelled, for example when the user moves their finger outside of the screen. Note: The touch events reference article provides more examples and information. Pure JavaScript demo Let's implement the mobile support in a little demo available on GitHub, so we can move the player's ship by touching the screen on a mobile device. We will use two events: touchstart and,touchmove both handled by one function. Why? The function touchHandler will assign proper variables to the ship's position so that we can use it for both cases: when the player touches the screen but doesn't move it (touchstart), and when the finger is moved on the screen (touch...
Implementing game control mechanisms - Game development
gainst the input's isDown boolean variable on every frame of the game. That should give you some understanding of the project structure. We'll be playing mostly with the MainMenu.js and Game.js files, and we'll explain the code inside the create() and update() methods in much more detail in later articles. Pure JavaScript demo There's also a small online demo with full source code available on GitHub where the basic support for the control mechanisms described in the articles is implemented in pure JavaScript. It will be explained in the given articles themselves below, but you can play with it already, and use the code however you want for learning purposes. The articles JavaScript is the perfect choice for mobile gaming because of HTML5 being truly multiplatform; all of the following a...
Crisp pixel art look with image-rendering - Game development
// get canvas context var ctx = document.getElementById('game').getContext('2d'); // load image var image = new Image(); image.onload = function () { // draw the image into the canvas ctx.drawImage(image, 0, 0); } image.src = 'https://udn.realityripple.com/samples/11/a2954fe197.png'; This code used together produces the following result: Note: You can check out the original code on Github (and a live example.) ...
2D breakout game using pure JavaScript - Game development
ction, control mechanisms, and winning and losing states. To get the most out of this series of articles you should already have basic to intermediate JavaScript knowledge. After working through this tutorial you should be able to build your own simple Web games. Lesson details All the lessons -- and the different versions of the MDN Breakout game we are building together -- are available on GitHub: Create the Canvas and draw on it Move the ball Bounce off the walls Paddle and keyboard controls Game over Build the brick field Collision detection Track the score and win Mouse controls Finishing up Starting with pure JavaScript is the best way to get a solid knowledge of web game development. After that, you can pick any framework you like and use it for your projects. Framew...
Animations and tweens - Game development
use animations and tweens. This will result in a better, more entertaining experience. Let's explore how to implement Phaser animations and tweens in our game. Animations In Phaser, animations, involve taking a spritesheet from an external source and displaying the sprites sequentially. As an example, we will make the ball wobble when it hits something. First of all, grab the spritesheet from Github and save it in your /img directory. Next, we will load the spritesheet -- put the following line at the bottom of your preload() function: game.load.spritesheet('ball', 'img/wobble.png', 20, 20); Instead of loading a single image of the ball we can load the whole spritesheet -- a collection of different images. We will show the sprites sequentially to create the illusion of animation. The ...
Build the brick field - Game development
reate a group, newBrick will be a new object added to the group on every iteration of the loop, and brickInfo will store all the data we need. Rendering the brick image Next, let's load the image of the brick -- add the following load.image() call just below the others: function preload() { // ... game.load.image('brick', 'img/brick.png'); } You also need to grab the brick image from Github and save it in your /img directory. Drawing the bricks We will place all the code for drawing the bricks inside an initBricks function to keep it separated from the rest of the code. Add a call to initBricks at the end of the create() function: function create(){ // ... initBricks(); } Now onto the function itself. Add the initBricks() function at the end of our games code, just b...
Buttons - Game development
ions: var playing = false; var startButton; Loading the button spritesheet We can load the button spritesheet the same way we loaded the ball's wobble animation. Add the following to the bottom of the preload() function: game.load.spritesheet('button', 'img/button.png', 120, 40); A single button frame is 120 pixels wide and 40 pixels high. You also need to grab the button spritesheet from Github, and save it in your /img directory. Adding the button to the game Adding the new button to the game is done by using the add.button method. Add the following lines to the bottom of your create() function: startButton = game.add.button(game.world.width*0.5, game.world.height*0.5, 'button', startGame, this, 1, 0, 2); startButton.anchor.set(0.5); The button() method's parameters are as foll...
Load the assets and print them on screen - Game development
all variable name -- so we need to make sure it is the same. The second parameter is the relative path to the graphic asset. In our case, we will load the image for our ball. (Note that the file name does not also have to be the same, but we'd recommend it, as it makes everything easier to follow.) Of course, to load the image, it must be available in our code directory. Grab the ball image from Github, and save it inside an /img directory in the same place as your index.html file. Now, to show it on the screen we will use another Phaser method called add.sprite(); add the following new code line inside the create() function as shown: function create() { ball = game.add.sprite(50, 50, 'ball'); } This will add the ball to the game and render it on the screen. The first two parameters...
Player paddle and controls - Game development
ing in our game, right after the ball variable: var paddle; Then, in the preload function, load the paddle image by adding the following new load.image() call: function preload() { // ... game.load.image('ball', 'img/ball.png'); game.load.image('paddle', 'img/paddle.png'); } Adding the paddle graphic Just so we don't forget, at this point you should grab the paddle graphic from Github, and save it in your /img folder. Rendering the paddle, with physics Next up, we will init our paddle by adding the following add.sprite() call inside the create() function -- add it right at the bottom: paddle = game.add.sprite(game.world.width*0.5, game.world.height-5, 'paddle'); We can use the world.width and world.height values to position the paddle exactly where we want it: game.wor...
2D breakout game using Phaser - Game development
s and tweens, and winning and losing states. To get the most out of this series of articles you should already have basic to intermediate JavaScript knowledge. After working through this tutorial, you should be able to build your own simple Web games with Phaser. ...
Touch Event Horizon - Game development
This is a multi-player game relying on the Tap and Drag gestures. ...
Gecko FAQ - Gecko Redirect 1
ful formatting system and object model at their disposal, and "write once, view anywhere." Gecko's robust support for these standards makes Gecko the platform of choice for web content and web application developers worldwide. Are Gecko's APIs based on ActiveX? COM? JavaBeans? Gecko is reusable on all platforms thanks to XPCOM, a subset of COM that works across platforms. COM, developed by Digital and later adopted by Microsoft, is the de facto standard for modular interfaces on Windows platforms. Additionally, on the Windows platform, Gecko's XPCOM interfaces are wrapped in an ActiveX control that VB developers can utilize (ActiveX wrappers are not available on other platforms because ActiveX is a Windows-only technology). A JavaBean wrapper is not currently under development, but the...
ASCII - MDN Web Docs Glossary: Definitions of Web-related terms
Since 2007, UTF-8 superseded it on the Web. Learn more General knowledge ASCII on Wikipedia ...
Base64 - MDN Web Docs Glossary: Definitions of Web-related terms
ring("atob" should be read as "ASCII to binary"). The algorithm used by atob() and btoa() is specified in RFC 4648, section 4. Note that btoa() expects to be passed binary data, and will throw an exception if the given string contains any characters whose UTF-16 representation occupies more than one byte. For more details, see the documentation for btoa(). Encoded size increase Each Base64 digit represents exactly 6 bits of data. So, three 8-bits bytes of the input string/binary file (3x8 bits = 24 bits) can be represented by four 6-bit Base64 digits (4x6 = 24 bits). This means that the Base64 version of a string or file will be at most 133% the size of its source (a ~33% increase). The increase may be larger if the encoded data is small. For example, the string "a" with length === 1 ge...
Certificate authority - MDN Web Docs Glossary: Definitions of Web-related terms
A certificate authority (CA) is an organization that signs digital certificates and their associated public keys. This certifies that an organization that requested a digital certificate (e.g., Mozilla Corporation) is authorized to request a certificate for the subject named in the certificate (e.g., mozilla.org). Web browsers come preloaded with a list of certificate authorities trusted to issue digital certificates. Learn more Certificate authority on Wikipedia Mozilla Included CA Certificate List ...
Certified - MDN Web Docs Glossary: Definitions of Web-related terms
Learn more General knowledge Information security tutorial Certification on Wikipedia ...
Cryptographic hash function - MDN Web Docs Glossary: Definitions of Web-related terms
A cryptographic hash function, also sometimes called a digest function, is a cryptographic primitive transforming a message of arbitrary size into a message of fixed size, called a digest. Cryptographic hash functions are used for authentication, digital signatures, and message authentication codes. To be used for cryptography, a hash function must have these qualities: quick to compute (because they are generated frequently) not invertible (each digest could come from a very large number of messages, and only brute-force can generate a message that leads to a given digest) tamper-resistant (any change to a message leads to a different digest) collision-resistant (it should be impossible to find two different messages that produce the same digest) Cryptographic hash functions...
DTMF (Dual-Tone Multi-Frequency signaling) - MDN Web Docs Glossary: Definitions of Web-related terms
Dual-Tone Multi-Frequency (DTMF) signaling is a system by which audible tones are used to represent buttons being pressed on a keypad. Frequently referred to in the United States as "touch tone" (after the Touch-Tone trademark used when the transition from pulse dialing to DTMF began), DTMF makes it possible to signal the digits 0-9 as well as the letters "A" through "D" and the symbols "#" and "*". Few telephone keypads include the letters, which are typically used for control signaling by the telephone network. Computers may make use of DTMF when dialing a modem, or when sending commands to a menu system for teleconferencing or other purposes. Learn moreEdit General knowledge Dual-tone multi-frequency signaling on Wikipedia Pulse dialing on Wikipedia ...
FTP - MDN Web Docs Glossary: Definitions of Web-related terms
FTP (File Transfer Protocol) was the standard protocol for many years for transferring files from one host to another over the Internet. Increasingly, though, teams and hosting accounts don't allow FTP and instead rely on a version control system like Git. You will still find it used on older hosting accounts, but it is safe to say that FTP is no longer considered best practice. Learn more General knowledge Beginner's guide to uploading files via FTP FTP on Wikipedia ...
Fork - MDN Web Docs Glossary: Definitions of Web-related terms
py of an existing software project at some point to add someone's own modifications to the project. Basically, if the license of the original software allows, you can copy the code to develop your own version of it, with your own additions, which will be a "fork". Forks are often seen in free and open source software development. This is now a more popular term thanks to contribution model using Git (and/or the GitHub platform). Learn more Various "well-known" forks Linux distributions Node.js and io.js (which have been merged together back) LibreOffice, a fork of OpenOffice ...
Modem - MDN Web Docs Glossary: Definitions of Web-related terms
Different kinds are used for different networks: DSL modems for telephone wires, WiFi modems for short-range wireless radio signals, 3G modems for cellular data towers, and so on. Modems are different from routers, but many companies sell modems combined with routers. ...
PDF - MDN Web Docs Glossary: Definitions of Web-related terms
Learn more General Knowledge PDF on Wikipedia ...
Public-key cryptography - MDN Web Docs Glossary: Definitions of Web-related terms
This means that anyone can verify a signature, but only the owner of the corresponding private key could have generated it. ...
Quality values - MDN Web Docs Glossary: Definitions of Web-related terms
When not present, the default value is 1. ...
Repo - MDN Web Docs Glossary: Definitions of Web-related terms
"repository") is a place that hosts an application's code source, together with various metadata. ...
SCM - MDN Web Docs Glossary: Definitions of Web-related terms
SCM (Source Control Management) is a system for managing source code. Usually it refers to the use of software to handle versioning of source files. A programmer can modify source code files without being afraid of editing out useful stuff, because a SCM keeps track of how the source code has changed and who made the changes. Some SCM systems include CVS, SVN, GIT. Learn more General knowledge Revision control on Wikipedia ...
Signature - MDN Web Docs Glossary: Definitions of Web-related terms
The term signature can have several meanings depending on the context. It may refer to: Signature (functions) A function signature (or type signature, or method signature) defines input and output of functions or methods. Signature (security) A signature, or digital signature, is a protocol showing that a message is authentic. Learn more Signature on Wikipedia ...
Transport Layer Security (TLS) - MDN Web Docs Glossary: Definitions of Web-related terms
owsing, messaging, and other protocols. Both SSL and TLS are client / server protocols that ensure communication privacy by using cryptographic protocols to provide security over a network. When a server and client communicate using TLS, it ensures that no third party can eavesdrop or tamper with any message. All modern browsers support the TLS protocol, requiring the server to provide a valid digital certificate confirming its identity in order to establish a secure connection. It is possible for both the client and server to mutually authenticate each other, if both parties provide their own individual digital certificates. Note: TLS 1.0 and 1.1 support will be removed from all major browsers in early 2020; you'll need to make sure your web server supports TLS 1.2 or 1.3 going forward. F...
VoIP - MDN Web Docs Glossary: Definitions of Web-related terms
It is also known as IP telephony, or broadband telephony. The main reason for using VoIP technology is because of cost. VoIP allows you to make a call directly from a computer, a special VoIP phone, or a traditional phone connected to a special adapter. A high speed internet connection is required for VoIP. ...
Brotli - MDN Web Docs Glossary: Definitions of Web-related terms
available general-purpose compression methods. ...
JPEG - MDN Web Docs Glossary: Definitions of Web-related terms
JPEG compression is composed of three compression techniques applied in successive layers, including chrominance subsampling, discrete cosine transformation and quantization, and run-length Delta & Huffman encoding. Chroma subsampling involves implementing less resolution for chroma information than for luma information, taking advantage of the human visual system's lower acuity for color differences than for luminance. ...
CSS and JavaScript accessibility best practices - Learn web development
box using absolute positioning rather than another method such as visibility or display, because it doesn't interfere with the screen reader being able to read content from it. Real form validation would be much more complex than this -- you'd want to check that the entered name actually looks like a name, the entered age is actually a number and is realistic (e.g. nonnegative and less than 4 digits). Here we've just implemented a simple check that a value has been filled in to each input field (if(testItem.input.value === '')). When the validation has been performed, if the tests pass then the form is submitted. If there are errors (if(errorList.innerHTML !== '')) then we stop the form submitting (using preventDefault()), and display any error messages that have been created (see below). ...
HTML: A good basis for accessibility - Learn web development
rge head with lots of sharp teeth.</p> The first image, when viewed by a screen reader, doesn't really offer the user much help -- VoiceOver for example reads out "/dinosaur.png, image". It reads out the filename to try to provide some help. In this example the user will at least know it is a dinosaur of some kind, but often files may be uploaded with machine-generated file names (e.g. from a digital camera) and these file names would likely provide no context to the image's content. Note: This is why you should never include text content inside an image -- screen readers simply can't access it. There are other disadvantages too -- you can't select it and copy/paste it. Just don't do it! When a screen reader encounters the second image, it reads out the full alt attribute -- "A red Tyra...
HTML: A good basis for accessibility - Learn web development
rge head with lots of sharp teeth.</p> The first image, when viewed by a screen reader, doesn't really offer the user much help -- VoiceOver for example reads out "/dinosaur.png, image". It reads out the filename to try to provide some help. In this example the user will at least know it is a dinosaur of some kind, but often files may be uploaded with machine-generated file names (e.g. from a digital camera) and these file names would likely provide no context to the image's content. Note: This is why you should never include text content inside an image -- screen readers simply can't access it. There are other disadvantages too -- you can't select it and copy/paste it. Just don't do it! When a screen reader encounters the second image, it reads out the full alt attribute -- "A red Tyra...
Accessible multimedia - Learn web development
ideo controls> <source src="example.mp4" type="video/mp4"> <source src="example.webm" type="video/webm"> <track kind="subtitles" src="subtitles_en.vtt" srclang="en"> </video> This will result in a video that has subtitles displayed, kind of like this: For more details, please read Adding captions and subtitles to HTML5 video. You can find the example that goes along with this article on Github, written by Ian Devlin (see the source code too.) This example uses some JavaScript to allow users to choose between different subtitles. Note that to turn the subtitles on, you need to press the "CC" button and select an option -- English, Deutsch, or Espanol. Note: Text tracks and transcriptions also help you with SEO, since search engines especially thrive on text. Text tracks even allow ...
WAI-ARIA basics - Learn web development
<section aria-live="assertive"> This will cause a screenreader to read out the content as it is updated. Note: Most browsers will throw a security exception if you try to do an XMLHttpRequest call from a file:// URL, e.g. if you just load the file by loading it directly into the browser (via double clicking, etc.). To get it to run, you will need to upload it to a web server, for example using GitHub, or a local web server like Python's SimpleHTTPServer. There is an additional consideration here -- only the bit of text that updates is read out. It might be nice if we always read out the heading too, so the user can remember what is being read out. To do this, we can add the aria-atomic property to the section. Update your <section> tag again, like so: <section aria-live="assertive" aria...
What is accessibility? - Learn web development
People with visual impairments People with visual impairments include people with blindness, low-level vision, and color blindness. Many people with visual impairments use screen magnifiers that are either physical magnifiers or software zoom capabilities. Most browsers and operating systems these days have zoom capabilities. Some users will rely on screen readers, which is software that reads digital text aloud. Some screen reader examples include: Some are paid commercial products, like JAWS (Windows) and Dolphin Screen Reader (Windows). Some are free products, like NVDA (Windows), ChromeVox (Chrome, Windows and Mac OS X), and Orca (Linux). Some are built into the operating system, like VoiceOver (macOS, iPadOS, iOS), Narrator (Microsoft Windows), ChromeVox (on Chrome OS), and TalkBac...
Cascade and inheritance - Learn web development
itten by a class. Essentially a value in points is awarded to different types of selectors, and adding these up gives you the weight of that particular selector, which can then be assessed against other potential matches. The amount of specificity a selector has is measured using four different values (or components), which can be thought of as thousands, hundreds, tens and ones -- four single digits in four columns: Thousands: Score one in this column if the declaration is inside a style attribute, aka inline styles. Such declarations don't have selectors, so their specificity is always simply 1000. Hundreds: Score one in this column for each ID selector contained inside the overall selector. Tens: Score one in this column for each class selector, attribute selector, or pseudo-class co...
CSS values and units - Learn web development
color scheme. Again, try changing the values to see how the colors vary. RGB and RGBA values The third scheme we'll talk about here is RGB. An RGB value is a function -- rgb() -- which is given three parameters that represent the red, green, and blue channel values of the colors, in much the same way as hex values. The difference with RGB is that each channel is represented not by two hex digits, but by a decimal number between 0 and 255 -- somewhat easier to understand. Let's rewrite our last example to use RGB colors: You can also use RGBA colors -- these work in exactly the same way as RGB colors, and so you can use any RGB values, however there is a fourth value that represents the alpha channel of the color, which controls opacity. If you set this value to 0 it will make the c...
Flexbox - Learn web development
n if they contain a different amount of content. As you'll see in subsequent sections, flexbox makes a lot of layout tasks much easier. Let's dig in! Introducing a simple example In this article we are going to get you to work through a series of exercises to help you understand how flexbox works. To get started, you should make a local copy of the first starter file -- flexbox0.html from our github repo -- load it in a modern browser (like Firefox or Chrome), and have a look at the code in your code editor. You can see it live here also. You'll see that we have a <header> element with a top level heading inside it, and a <section> element containing three <article>s. We are going to use these to create a fairly standard three column layout. Specifying what elements to lay out as flex...
Positioning - Learn web development
. This article explains the different position values, and how to use them. Prerequisites: HTML basics (study Introduction to HTML), and an idea of How CSS works (study Introduction to CSS.) Objective: To learn how CSS positioning works. We'd like you to follow along with the exercises on your local computer, if possible -- grab a copy of 0_basic-flow.html from our GitHub repo (source code here) and use that as a starting point. Introducing positioning The whole idea of positioning is to allow us to override the basic document flow behavior described above, to produce interesting effects. What if you want to slightly alter the position of some boxes inside a layout from their default layout flow position, to give a slightly quirky, distressed feel? Positionin...
Responsive design - Learn web development
nding it, even though you would not build a modern site using a float-based flexible grid. The following example demonstrates a simple responsive design using Media Queries and a flexible grid. On narrow screens the layout displays the boxes stacked on top of one another: On wider screens they move to two columns: Note: You can find the live example and source code for this example on GitHub. Modern layout technologies Modern layout methods such as Multiple-column layout, Flexbox, and Grid are responsive by default. They all assume that you are trying to create a flexible grid and give you easier ways to do so. Multicol The oldest of these layout methods is multicol -- when you specify a column-count, this indicates how many columns you want your content to be split into. The...
Fundamental text and font styling - Learn web development
d back to clear whatever foreign matter may have nestled its way into his mighty throat. Many a fat alley rat had met its demise while staring point blank down the cavernous barrel of this awesome prowling machine. Truly a wonder of nature this urban predator -- Tommy the cat had many a story to tell. But it was a rare occasion such as this that he did.</p> You can find the finished example on GitHub (see also the source code.) Color The color property sets the color of the foreground content of the selected elements (which is usually the text, but can also include a couple of other things, such as an underline or overline placed on text using the text-decoration property). color can accept any CSS color unit, for example: p { color: red; } This will cause the paragraphs to become r...
What text editors are available? - Learn web development
editor for free. Here are some popular editors: Editor Licence Price OS Support Doc. ...
How much does it cost to do something on the Web? - Learn web development
). For audio files, you can find free software (Audacity, Wavosaur), or paying up to a few hundred dollars (Sony Sound Forge, Adobe Audition). Likewise, video-editing software can be free (PiTiVi, OpenShot for Linux, iMovie for Mac), less than $100 (Adobe Premiere Elements), or several hundred dollars (Adobe Premiere Pro, Avid Media Composer, Final Cut Pro). The software you received with your digital camera may cover all your needs. Publishing tools You also need a way to upload files: from your hard drive to a distant web server. To do that you should use a publishing tool such as an (S)FTP client, RSync, or Git/GitHub. Each operating system includes an (S)FTP client, as part of its file manager. Windows Explorer, Nautilus (a common Linux file manager), and the Mac Finder all include th...
What is a Domain Name? - Learn web development
ic institutions. TLDs can contain special as well as latin characters. A TLD's maximum length is 63 characters, although most are around 2-3. The full list of TLDs is maintained by ICANN. Label (or component) The labels are what follow the TLD. A label is a case-insensitive character sequence anywhere from one to sixty-three characters in length, containing only the letters A through Z, digits 0 through 9, and the - character (which may not be the first or last character in the label). a, 97, and hello-strange-person-16-how-are-you are all examples of valid labels. The label located right before the TLD is also called a Secondary Level Domain (SLD). A domain name can have many labels (or components). It is not mandatory nor necessary to have 3 labels to form a domain name. For insta...
What software do I need to build a website? - Learn web development
s (see How much does it cost to do something on the web?). Once you settle on which provider to use, the provider will email you the access information, usually in the form of an SFTP URL, username, password, and other information needed to connect to their server. Bear in mind that (S)FTP is now somewhat old-fashioned, and other uploading systems are starting to become popular, such as RSync and Git/GitHub. Note: FTP is inherently insecure. You should make sure your hosting provider allows use of a secure connection, e.g. SFTP or RSync over SSH. Uploading files to a web server is a very important step while creating a website, so we cover it in detail in a separate article. For now, here's a short list of free basic (S)FTP clients: Operating system FTP software ...
How do you set up a local testing server? - Learn web development
n a browser -- this can be done by double clicking the HTML file, dragging and dropping it into the browser window, or choosing File > Open... and navigating to the HTML file. There are many ways to achieve this. If the web address path starts with file:// followed by the path to the file on your local hard drive, a local file is being used. In contrast, if you view one of our examples hosted on GitHub (or an example on some other remote server), the web address will start with http:// or https://, to show that the file has been received via HTTP. The problem with testing local files Some examples won't run if you open them as local files. This can be due to a variety of reasons, the most likely being: They feature asynchronous requests. Some browsers (including Chrome) will not run asy...
Common questions - Learn web development
How do you set up a local testing server? This article explains how to set up a simple local testing server on your machine, and the basics of how to use it. How do you upload files to a Web server? This article shows how to publish your site online with FTP tools -- one of the most common ways to get a website online so others can access it from their computers. How do I use GitHub Pages? This article provides a basic guide to publishing content using GitHub's gh-pages feature. How do you host your website on Google App Engine? Looking for a place to host your website? Here's a step-by-step guide to hosting your website on Google App Engine. What tools are available to debug and improve website performance? This set of articles shows you how to use the Dev...
Styling web forms - Learn web development
Test your skills! You've reached the end of this article, but can you remember the most important information? You can find some further tests to verify that you've retained this information before you move on -- see Test your skills: Styling basics. Summary As you can see, as long as we want to build forms with just text fields and butto...
Test your skills: Form validation - Learn web development
ser names in our application consist of a single letter, followed by a dot, followed by three or more letters or numbers. All letters should be lowercase. All of the email addresses for our users consist of one or more letters (lower or upper case) or numbers, followed by "@bigcorp.eu". Remove the length validation from the phone number field if it is present, and set it so that it accepts 10 digits -- either 10 digits in a row, or a pattern of three digits, three digits, then four digits, separated by either spaces, dashes, or dots. Note: Regular expressions are really challenging if you are new to them, but don't despair -- have a go and see where you get to; there is no shame in asking for some help. You can find everything you need to answer these questions at our regular expression ...
Your first form - Learn web development
*/ height: 5em; } .button { /* Align buttons with the text fields */ padding-left: 90px; /* same size as the label elements */ } button { /* This extra margin represent roughly the same space as the space between the labels and their text fields */ margin-left: .5em; } Save and reload, and you'll see that your form should look much less ugly. Note: You can find our version on GitHub at first-form-styled.html (also see it live). Sending form data to your web server The last part, and perhaps the trickiest, is to handle form data on the server side. The <form> element defines where and how to send the data thanks to the action and method attributes. We provide a name to each form control. The names are important on both the client- and server-side; they tell the browser...
CSS basics - Learn web development
t. It will make more sense as you continue your study of CSS. You can find more information about different display values on MDN's display reference page. Conclusion If you followed all the instructions in this article, you should have a page that looks similar to this one: (You can view our version here.) If you get stuck, you can always compare your work with our finished example code on GitHub. In this exercise, we have just scratched the surface of CSS. To go further, see Learning to style HTML using CSS. Previous Overview: Getting started with the web Next In this module Installing basic software What will your website look like? Dealing with files HTML basics CSS basics JavaScript basics Publishing your website How the web works ...
HTML basics - Learn web development
u are having trouble remembering it, remember that it stands for hypertext reference. Add a link to your page now, if you haven't already done so. Conclusion If you have followed all the instructions in this article, you should end up with a page that looks like the one below (you can also view it here): If you get stuck, you can always compare your work with our finished example code on GitHub. Here, we have only really scratched the surface of HTML. To find out more, go to our Learning HTML topic. Previous Overview: Getting started with the web Next In this module Installing basic software What will your website look like? Dealing with files HTML basics CSS basics JavaScript basics Publishing your website How the web works ...
Installing basic software - Learn web development
as IE 8-10.) Lynx, a text-based terminal web browser, is great for seeing how your site is experienced by visually-impaired users. A graphics editor, like GIMP, Figma, Paint.NET, Photoshop, or XD, to make images or graphics for your web pages. A version control system, to manage files on servers, collaborate on a project with a team, share code and assets and avoid editing conflicts. Right now, Git is the most popular version control system along with the GitHub or GitLab hosting service. An FTP program, used on older web hosting accounts to manage files on servers (Git is increasingly replacing FTP for this purpose). There are loads of (S)FTP programs available including Cyberduck, Fetch and FileZilla. An automation system, like Webpack, Grunt, or Gulp to automatically perform repetitive...
JavaScript basics - Learn web development
he start. If it does have a value (if the above statement is not true), then store the value in localStorage and set it as the heading's text. Conclusion If you have followed all the instructions in this article, you should end up with a page that looks something like the image below. You can also view our version. If you get stuck, you can compare your work with our finished example code on GitHub. We have just scratched the surface of JavaScript. If you enjoyed playing, and wish to go further, take advantage of the resources listed below. ...
The web and web standards - Learn web development
this sound hard? Don't worry -- we aim to give you everything you need to know to get started, and things will get easier. Once you embrace the constant change and uncertainty of the web, you'll start to enjoy yourself. As a part of the web community, you'll have an entire web of contacts and useful material to help you, and you'll start to enjoy the creative possibilities it brings. You're a digital creative now. Enjoy the experience, and the potential for earning a living. Overview of modern web technologies There are a number of technologies to learn if you want to be a front-end web developer. In this section we will describe them briefly. For a more detailed explanation of how some of them work together, read our article How the web works. Browsers You are probably reading these wo...
What will your website look like? - Learn web development
Sketching out your design Next, grab pen and paper and sketch out roughly how you want your site to look. For your first simple webpage, there's not much to sketch out, but you should get in the habit of doing this now. It really helps -- you don't have to be Van Gogh! Note: Even on real, complex websites, the design teams usually start out with rough sketches on paper and later on build digital mockups using a graphics editor or web technologies. Web teams often include both a graphic designer and a user experience (UX) designer. Graphic designers put together the visuals of the website. UX designers have a somewhat more abstract role in addressing how users will experience and interact with the website. Choosing your assets At this point, it's good to start putting together the c...
Getting started with HTML - Learn web development
tracks, or whatever else. Active learning: Adding some features to an HTML document If you want to experiment with writing some HTML on your local computer, you can: Copy the HTML page example listed above. Create a new file in your text editor. Paste the code into the new text file. Save the file as index.html. Note: You can also find this basic HTML template on the MDN Learning Area Github repo. You can now open this file in a web browser to see what the rendered code looks like. Edit the code and refresh the browser to see what the result is. Initially the page looks like this: In this exercise, you can edit the code locally on your computer, as described previously, or you can edit it in the sample window below (the editable sample window represents just the contents of the...
HTML text fundamentals - Learn web development
Nesting lists It is perfectly ok to nest one list inside another one. You might want to have some sub-bullets sitting below a top-level bullet. Let's take the second list from our recipe example: <ol> <li>Remove the skin from the garlic, and chop coarsely.</li> <li>Remove all the seeds and stalk from the pepper, and chop coarsely.</li> <li>Add all the ingredients into a food pro...
Adding vector graphics to the Web - Learn web development
ctor images are defined using algorithms -- a vector image file contains shape and path definitions that the computer can use to work out what the image should look like when rendered on the screen. The SVG format allows us to create powerful vector graphics for use on the Web. To give you an idea of the difference between the two, let's look at an example. You can find this example live on our Github repo as vector-versus-raster.html -- it shows two seemingly identical images side by side, of a red star with a black drop shadow. The difference is that the left one is a PNG, and the right one is an SVG image. The difference becomes apparent when you zoom in the page -- the PNG image becomes pixellated as you zoom in because it contains information on where each pixel should be (and what c...
Images in HTML - Learn web development
ith something embarrassing. Our above code would give us the following result: Note: Elements like <img> and <video> are sometimes referred to as replaced elements. This is because the element's content and size are defined by an external resource (like an image or video file), not by the contents of the element itself. Note: You can find the finished example from this section running on Github (see the source code too.) Alternative text The next attribute we'll look at is alt. Its value is supposed to be a textual description of the image, for use in situations where the image cannot be seen/displayed or takes a long time to render because of a slow internet connection. For example, our above code could be modified like so: <img src="images/dinosaur.jpg" alt="The head and t...
Making asynchronous programming easier with async and await - Learn web development
t.createElement('img'); image.src = objectURL; document.body.appendChild(image); }) .catch((e) => console.log(e) ); This is because the .catch() block will catch errors occurring in both the async function call and the promise chain. If you used the try/catch block here, you might still get unhandled errors in the myFetch() function when it's called. You can find both of these examples on GitHub: simple-fetch-async-await-try-catch.html (see source code) simple-fetch-async-await-promise-catch.html (see source code) Awaiting a Promise.all() async/await is built on top of promises, so it's compatible with all the features offered by promises. This includes Promise.all() -- you can quite happily await a Promise.all() call to get all the results returned into a variable in a way tha...
Introducing asynchronous JavaScript - Learn web development
cally like a modern, more efficient version of XMLHttpRequest. Let's look at a quick example, from our Fetching data from the server article: fetch('products.json').then(function(response) { return response.json(); }).then(function(json) { products = json; initialize(); }).catch(function(err) { console.log('Fetch problem: ' + err.message); }); Note: You can find the finished version on GitHub (see the source here, and also see it running live). Here we see fetch() taking a single parameter -- the URL of a resource you want to fetch from the network -- and returning a promise. The promise is an object representing the completion or failure of the async operation. It represents an intermediate state, as it were. In essence, it's the browser's way of saying "I promise to get back to...
Functions — reusable blocks of code - Learn web development
n greeting() { alert('Our company is called ' + name + '.'); } Both functions you want to call are called greeting(), but you can only ever access the first.js file's greeting() function (the second one is ignored). In addition, attempting to declare the name variable a second time with the let keyword in the second.js file results in an error. Note: You can see this example running live on GitHub (see also the source code). Keeping parts of your code locked away in functions avoids such problems, and is considered the best practice. It is a bit like a zoo. The lions, zebras, tigers, and penguins are kept in their own enclosures, and only have access to the things inside their enclosures -- in the same manner as the function scopes. If they were able to get into other enclosures, pro...
Manipulating documents - Learn web development
t -- you might as well just write it into your HTML and not use JavaScript. It is more complex than HTML, and creating your content with JavaScript also has other issues attached to it (such as not being readable by search engines). In the next couple of sections we will look at a couple of more practical uses of DOM APIs. Note: You can find our finished version of the dom-example.html demo on GitHub (see it live also). Active learning: Getting useful information from the Window object So far we've only really looked at using Node and Document features to manipulate documents, but there is no reason why you can't get data from other sources and use it in your UI. You just have to make sure your data is in the right format; JavaScript makes it easier than many other languages, being weak...
Third-party APIs - Learn web development
g that pageNumber is not already zero before decrementing it -- if the fetch request runs with a minus page URL parameter, it could cause errors. If the pageNumber is already 0, we simply return out of the function, to avoid wasting processing power (If we are already at the first page, we don't need to load the same results again). Note: You can find our finished nytimes API example code on GitHub (also see it running live here). YouTube example We also built another example for you to study and learn from -- see our YouTube video search example. This uses two related APIs: The YouTube Data API to search for YouTube videos and return results. The YouTube IFrame Player API to display the returned video examples inside IFrame video players so you can watch them. This example is i...
What went wrong? Troubleshooting JavaScript - Learn web development
, so it's not quite that simple -- there are some other differentiators as you drill down deeper. But the above classifications will do at this early stage in your career. We'll look at both of these types going forward. An erroneous example To get started, let's return to our number guessing game -- except this time we'll be exploring a version that has some deliberate errors introduced. Go to Github and make yourself a local copy of number-game-errors.html (see it running live here). To get started, open the local copy inside your favorite text editor, and your browser. Try playing the game -- you'll notice that when you press the "Submit guess" button, it doesn't work! Note: You might well have your own version of the game example that doesn't work, which you might want to fix! We...
Object-oriented JavaScript for beginners - Learn web development
u work out how to fix this in the class definition (constructor)? You can put any code you like inside a constructor (you'll probably need a few conditionals and a loop). Think about how the sentences should be structured differently depending on gender, and depending on whether the number of listed interests is 1, 2, or more than 2. Note: If you get stuck, we have provided an answer inside our GitHub repo (see it live) -- try writing it yourself first though! Other ways to create object instances So far we've seen two different ways to create an object instance -- declaring an object literal, and using a constructor function (see above). These make sense, but there are other ways -- we want to make you familiar with these in case you come across them in your travels around the Web. Th...
Test your skills: JSON - Learn web development
our code into the live code window above. The example won't work locally, or in an environment like CodePen or JSFiddle, because of something called cross-origin security. This basically means that you can't request a file from one origin using code on a different origin. In the live code editor above, both the JavaScript code and the requested JSON file are on the same origin (the code sits on a GitHub repo, and is embedded here in an <iframe>). If you put your code on CodePen for example, it would fail because the JSON it is requesting is not on the same origin. You can get around these restrictions using CORS, but this is beyond the scope of what we are teaching here. Assessment or further help You can practice these examples in the Interactive Editor above. If you would like your work...
Web performance resources - Learn web development
improve performance. Lighthouse can give you a detailed breakdown of many aspects of your site including performance, SEO and accessibility. ...
Server-side web frameworks - Learn web development
om templates and formatting data as JSON or XML. It similarly encourages the use of design patterns like DRY ("dont repeat yourself" -- write code only once if at all possible), MVC (model-view-controller) and a number of others. There are of course many differences due to specific design decisions and the nature of the languages. Rails has been used for high profile sites, including: Basecamp, GitHub, Shopify, Airbnb, Twitch, SoundCloud, Hulu, Zendesk, Square, Highrise. Laravel (PHP) Laravel is a web application framework with expressive, elegant syntax. Laravel attempts to take the pain out of development by easing common tasks used in the majority of web projects, such as: Simple, fast routing engine. Powerful dependency injection container. Multiple back-ends for session and cach...
Accessibility in React - Learn web development
Look out for opportunities to practice them more, because doing so will allow you to create inclusive experiences for users. Remember: our app would have been inaccessible to keyboard users without them! Note: If you need to check your code against our version, you can find a finished version of the sample React app code in our todo-react repository. For a running live version, see https://mdn.github.io/todo-react-build/. In the very last article we'll present you with a list of React resources that you can use to go further in your learning. Previous Overview: Client-side JavaScript frameworks Next In this module Introduction to client-side frameworks Framework main features React Getting started with React Beginning our React todo list Componentizing our Reac...
Beginning our React todo list - Learn web development
ithout deleting them. This article will walk you through putting the basic App component structure and styling in place, ready for individual component definition and interactivity, which we'll add later. Note: If you need to check your code against our version, you can find a finished version of the sample React app code in our todo-react repository. For a running live version, see https://mdn.github.io/todo-react-build/. Prerequisites: Familiarity with the core HTML, CSS, and JavaScript languages, knowledge of the terminal/command line. Objective: To introduce our todo list case study, and get the basic App structure and styling in place. Our app's user stories In software development, a user story is an actionable goal from the perspective of th...
Creating our first Vue component - Learn web development
nt to represent each item in the todo list. Along the way, we'll learn about a few important concepts such as calling components inside other components, passing data to them via props, and saving data state. Note: If you need to check your code against our version, you can find a finished version of the sample Vue app code in our todo-vue repository. For a running live version, see https://mdn.github.io/todo-vue/dist/. Prerequisites: Familiarity with the core HTML, CSS, and JavaScript languages, knowledge of the terminal/command line. Vue components are written as a combination of JavaScript objects that manage the app's data and an HTML-based template syntax that maps to the underlying DOM structure. For installation, and to use some of the more advanced features o...
Vue resources - Learn web development
h node + npm installed. Objective: To learn where to go to find further information on Vue, to continue your learning. Further resources Here's where you should go to learn more about Vue: Vue Docs -- The main Vue site. Contains comprehensive documentation, including examples, cookbooks, and reference material. This is the best place to start learning Vue in depth. Vue Github Repo -- The Vue code itself. This is where you can report issues and/or contribute directly to the Vue codebase. Studying the Vue source code can help you better understand how the framework works, and write better code. Vue Forum -- The official forum for getting help with Vue. Vue CLI Docs -- Documentation for the Vue CLI. This contains information on customizing and extending the output y...
Introduction to automated testing - Learn web development
a Sauce Labs Trial. Create a Sauce Labs trial account. Sign in. This should happen automatically after you verify your e-mail address. The basics: Manual tests The Sauce Labs dashboard has a lot of options available on it. For now, make sure you are on the Manual Tests tab. Click Start a new manual session. In the next screen, type in the URL of a page you want to test (use http://mdn.github.io/learning-area/javascript/building-blocks/events/show-video-box-fixed.html, for example), then choose a browser/OS combination you want to test by using the different buttons and lists. There is a lot of choice, as you'll see! When you click Start session, a loading screen will then appear, which spins up a virtual machine running the combination you chose. When loading has finished, you c...
Implementing feature detection - Learn web development
page, then click the blue Get a Key button and follow the instructions. ...
Understanding client-side web development tools - Learn web development
ing transformation tools in place to actually deploying your app on Netlify. In this article we'll introduce the case study, set up our development environment, and set up our code transformation tools. 5. Deploying our app In the final article in our series, we take the example toolchain we built up in the previous article and add to it so that we can deploy our sample app. We push the code to GitHub, deploy it using Netlify, and even show you how to add a simple test into the process. ...
Adding a new word to the en-US dictionary
This article describes the process for adding a word to the dictionary. The process is pretty straight-forward: Get a clone of UXP, if you don't already have one, and make sure you can build it successfully. Get into the dictionary sources directory using this command: cd extensions/spellcheck/locales/hunspell/dictionary-sources There's a special script used for editing dictionaries. ...
Creating a Firefox sidebar
, the addPanel and addPersistentPanel functions have been removed from the deprecated, Netscape-derived window.sidebar object. That means the ability to add a traditional sidebar panel is no longer available from Web content. The new Social API or an extension can be used instead as described above. See Also Bootstrap addon demo which adds a sidebar with browser for HTML content: https://gist.github.com/Noitidart/8728393 ...
Configuring Build Options
...
ESLint
mach eslint --setup Running ESLint Eslint can be run via: ./mach lint -l eslint You can limit running it to a specific directory with: ./mach lint -l eslint browser/components Or work directory changes: ./mach lint -l eslint -w Or outgoing commits only: ./mach lint -l eslint -o See ./mach eslint --help for more options when running eslint. VCS Hooks Hooks are available for Mercurial & Git, see using a vcs hook for more details. Editor Integration It is highly recommended that you integrate eslint into your editor. This lets you see errors in real time, and can help you fix issues before you compile or run tests, reducing the time to develop patches. See the ESLint user guide for which plugins to install in your editor. Prior to Firefox 55 the location for the eslint binary us...
Gecko Logging
mpler to share a log module across multiple translation units. LazyLogLodule provides a conversion operator to LogModule* and is suitable for passing into the logging macros detailed below. Note: Log module names can only contain specific characters. The first character must be a lowercase or uppercase ASCII char, underscore, dash, or dot. Subsequent characters may be any of those, or an ASCII digit. #include "mozilla/Logging.h" static mozilla::LazyLogModule sFooLog("foo"); Logging interface A basic interface is provided in the form of 2 macros and an enum class. Mozilla Logging Macros MOZ_LOG(module, level, message) Outputs the given message if the module has the given log level enabled. module - The log module to use. level - The log level of the mess...
Reviewer Checklist
of computing and recording log output. [Fennec: Checking for log levels is expensive unless you're using Logger.] Style Follow the style guide for the language and module in question. Follow local style for the surrounding code, even if that local style isn't formally documented. New files have license declarations and modelines. New JS files should use strict mode. Trailing whitespace (git diff and splinter view both highlight this, as does hg with the color extension enabled). Whitespace can be fixed easily in Mercurial using the CheckFiles extension. In git, you can use git rebase --whitespace=fix. Security issues There should be no writing to arbitrary files outside the profile folder. Be careful when reading user input, network input, or files on disk. Assume that inputs ...
Linux compatibility matrix
current versions of Firefox. ...
Using the Browser API
Mozilla › Gecko › Chrome › API › Browser API › Using
s a "browser iframe". We'll be using this term throughout the current article, and other parts of the documentation. Demo To demonstrate basic usage of this API, we have created a simple Browser API demo that provides buttons allowing you to (re)load web pages, stop loading, move forward and back in history, and zoom in and out of the page. To run the demo, the best approach is to clone the GitHub repo locally (or just download it directly if you don't do GitHub), open WebIDE, open the repo as a Packaged App, then run it either on a simulator or a real device if you have one. In any case, you should at least download the repo and refer to the code as you read the sections below. The HTML An <iframe> is turned into a browser iframe by setting the mozbrowser attribute on it: <iframe s...
Chrome-only API reference
Mozilla › Gecko › Chrome › API
loping privileged code, and would like to create a worker that can use js-ctypes to perform calls to native code, you can do so by using ChromeWorker instead of the standard Worker object. It works exactly like a standard Worker, except that it has access to js-ctypes via a global ctypes object available in the global scope of the worker. Examples of ChromeWorker's using js-ctypes are availabe on Github and are linked to from the See Also section below. To use a postMessage with callback version of ChromeWorker that features promises, see PromiseWorker. ...
Getting from Content to Layout
Gecko maintains two separate representations of a document in memory: the content tree and the frame tree. Changes to a document originate in the content tree (from DOM modification by scripting, insertion of elements from the parser, etc.) and are propogated to the layout tree through magic that primarily resides in //github.com/RealityRipple/UXP/blob/master/layout/base/nsCSSFrameConstructor.cpp The frame constructor implements nsIMutationObserver which allows it to "watch" the content tree. nsCSSFrameConstructor gets notified from the document's PresShell (which implements nsIDocumentObserver and observes the document) about all nodes in the document. The frame constructor takes these notifications and does the following: Dispatches "restyle events" which trigger the reproces...
How test harnesses work
tentially sets up an HTTP server for test data (mozhttpd) invokes the binary (mozrunner) it is the job of the shim extension to shut down the browser logging (mozlog, in theory) (run tests, accrue results) cleanup: shutdown the browser check for crashes (mozcrash) reporting (moztest) Marionette Tests List of Testing Extensions pageloader (talos) mochitest: //github.com/RealityRipple/UXP/blob/master/testing/mochitest/install.rdf (mochitest) ...
CustomizableUI.jsm
toolbaritem.appendChild(image); return toolbaritem; } }); When you want to remove this widget run this code: CustomizableUI.destroyWidget('navigator-throbber-id-within-CustomizableUI-object'); Custom Type - Involved The browser uses type custom for its zoom controls and edit controls in the Panel. The code is more advanced. It can be found summarized at this gist: https://gist.github.com/Noitidart/10902477 ...
Following the Android Toasts Tutorial from a JNI Perspective
It will use the JNI.jsm module that is available in Firefox for Android since version 17. This article teaches developers how to port Java code to JNI by reading the Java and Android documentation. Toast description A toast provides simple feedback about an operation in a small popup. It only fills the amount of space required for the message, and the current activity remains visible and interactive. For example, navigating away from an email before you send it triggers a "Draft saved" toast to let you know that you can continue editing later. ...
Using JavaScript code modules
Unloading code modules Requires Gecko 7.0(Firefox 7.0 / Thunderbird 7.0 / SeaMonkey 2.4) Components.utils.unload() allows you to unload a previously imported code module. Once this method has been called, references to the module will continue to work but any subsequent import of the module will reload it and give a new reference. Examples A template to download and edit is seen here on GitHub - Gists - _template-BootstrapJSM.xpi Extending resource: URLs Prior to Gecko 2.0, the most common way to load code modules was using resource: URLs. The basic syntax of a resource URL is as follows: resource://<alias>/<relative-path>/<file.js|jsm> The <alias> is an alias to a location, usually a physical location relative to the application or XUL runtime. There are multiple pre-defined ...
Application Translation with Mercurial
tory of changes). Now go in the file system to the file and open it in your favorite text editor. Windows users can use e.g. Notepad++. Paste the following content into the file: [ui] username = Firstname Lastname <mynick@example.com> merge = internal:merge [alias] qexport = export -g -r qtip qexportall = diff -r qparent [defaults] commit = -v diff = -p -U 8 qdiff = -p -U 8 qnew = -U [diff] git = 1 showfunc = 1 unified = 8 [extensions] hgext.mq = progress = [hooks] Put in your name and email address which later will be public on the internet after your translation patch got accepted and uploaded. Save the file and close it. Enabling Mercurial queues (revertable patches) Some time will pass between the moment in which you start the localization, finish it, test it, improve it, upl...
Bootstrapping a new locale
To learn how to bootstrap a new locale for Mozilla projects, please see those documents. In Mozilla, we use the the Mercurial version control system (Hg) to help manage our localizations. When a localization team is registered and your Hg repository is set up for a locale, you can then clone the existing Mozilla release branch (i.e. ...
Mozilla Content Localized in Your Language
rder of Year, Month and Day? Reference material can be find here Calendar Calendar view: which date is considered the first day of the week, Sunday or Monday? Is Lunar calendar observed? Other regional calendar observed? Time Format How is time expressed in your language? including 0-24 hr expression, hour, minute and second. Percentages How are percentages expressed in your language? Digit groups How are digit groups expressed in your language? Example: 1.23 (decimal separator) or 1,000 (thousand separator) using comma or period. Acronyms Do you translate widely accepted acronyms such as CD, DVD, MB? If translated, is there an equavilent acronym and widely accepted in the language? Gender Are there exceptions to standard gender conventions within your language? If so, what ...
Localizing with Mercurial
n use it successfully. Your Mercurial configuration is contained within a config file which you must create yourself. Your config file is called either ~/.hgrc (UNIX systems) or Mercurial.ini (Windows), depending on your operating system. Your config file should have the following settings: [ui] username = Your Real Name <user@example.com> merge = internal:merge [defaults] commit = -v [diff] git = 1 showfunc = 1 unified = 8 To configure Hg, follow these steps: Create a new file in your favorite text editor. Copy the settings above and paste them into your new file. Save the file as either .hgrc (UNIX systems) or Mercurial.ini (Windows) and save it in either $HOME/ or C:\mozilla-build\hg\ or C:\Program Files\Mercurial\. Now that you've installed and configured Mercurial, here are ...
Localizing with Pontoon
little to no technical skill to use in the l10n workflow. Here we'll discuss how to use Pontoon to localize projects, from first sign-in to finalizing your contributions. Along the way, we'll point out some sweet features that will make you more efficient and make your l10n contributions easier. Are you a developer? Read about implementing Pontoon in your project or learn how to get involved on GitHub. First steps Pontoon's home page is very easy to use. To begin localizing the project, click on the Persona icon and sign in. Next, simply select the project you want to work on and your locale from the dropdown menus. Pontoon will automatically open that locale's project for you to get started. Note that for our purposes here, we'll be using Firefox Affiliates website to demo Pontoon's fun...
Localization at Mozilla
s of translating software user interfaces from one language to another and adapting it to suit a foreign culture. These resources are for anyone with an interest in the technical aspects involved in localization. They are for developers and all contributors. The documentation here is no longer being maintained and is inaccurate. L10n documentation has moved to https://mozilla-l10n.github.io/localizer-documentation/ . To learn how to bootstrap a new locale for Mozilla projects, please see those documents ...
Investigating leaks using DMD heap scan mode
etCurrentThreadName. This will keep the watch dog from killing the browser when shut down takes multiple minutes. Secondly, you may need to comment out the call to MOZ_CRASH("NSS_Shutdown failed"); in xpcom/build/XPCOMInit.cpp, as this also seems to trigger when shutdown is extremely slow. You need the cycle collector analysis script find_roots.py, which can be downloaded as part of this repo on Github. Generating Logs The next step is to generate a number of log files. You need to get a shutdown CC log and a DMD log, for a single run. Definitions I'll write $objdir for the object directory for your Firefox DMD build, $srcdir for the top level of the Firefox source directory, and $heapgraph for the location of the heapgraph repo, and $logdir for the location you want logs to go to. $logd...
GC and CC logs
and you should see download links. To set the environment variable, find the buildBrowserEnv method in the Python file for the test suite you are interested in, and add something like this code to the file: browserEnv["MOZ_CC_LOG_DIRECTORY"] = os.environ["MOZ_UPLOAD_DIR"] browserEnv["MOZ_CC_LOG_SHUTDOWN"] = "1" Analyzing GC and CC logs There are numerous scripts that analyze GC and CC logs on GitHub. To find out why an object is being kept alive, the relevant scripts are find_roots.py and parse_cc_graph.py (which is called by find_roots.py). Calling find_roots.py on a CC log with a specific object or kind of object will produce paths from rooting objects to the specified objects. Most big leaks include an nsGlobalWindow, so that's a good class to try if you don't have any better idea. T...
Profiling with Concurrency Visualizer - Performance
Concurrency Visualizer is an excellent alternative to xperf. ...
Profiling with the Firefox Profiler
display list after each refresh with the texture data. This can be used to debug correctness problems. Contribute Source is located in tools/profiler. The Bugzilla components are Core::Gecko Profile for the profiler backend, and DevTools::Performance Tools (Profiler/Timeline) for the toolbar button and about:profiling. The (now obsolete) profiler add-on repository can be found here: https://github.com/firefox-devtools/Gecko-Profiler-Addon. The profiler.firefox.com code and issue repository can be found here: https://github.com/firefox-devtools/profiler/. ...
McCoy
ign that something probably is not working, and indeed, is not. McCoy is an application that allows add-on authors to provide secure updates to their users. Applications periodically look for and install updates to their add-ons. It's important that the update information retrieved has not been tampered with since being written by the add-on author. Specifically, it focuses on the process of digitally signing update manifests so the applications can verify the integrity of a manifest retrieved over normally insecure channels. If you want to learn about the technical details of McCoy then visit the project wiki. Installing McCoy To use McCoy you need to download and install it. McCoy is provided in the standard package for your operating system, just extract it where you like and run it.
PR_cnvtf
Converts a floating point number to a string. Syntax #include <prdtoa.h> void PR_cnvtf ( char *buf, PRIntn bufsz, PRIntn prcsn, PRFloat64 fval); Parameters The function has these parameters: buf The address of the buffer in which to store the result. bufsz The size of the buffer provided to hold the result. prcsn The number of digits of precision to which to generate the floating point value. fval The double-precision floating point number to be converted. Description PR_cnvtf is a simpler interface to convert a floating point number to a string. It conforms to the ECMA standard of Javascript (ECMAScript). On return, the result is written to the buffer pointed to by buf of size bufsz. ...
An overview of NSS Internals
from a memory dump. NSS uses many C data structures. Often NSS has multiple implementations for the same or similar concepts. For example, there are multiple presentations of certificates, and the NSS internals (and sometimes even the application using NSS) might have to convert between them. Key responsibilites of NSS are verification of signatures and certificates. In order to verify a digital signature, we have to look at the application data (e.g., a document that was signed), the signature data block (the digital signature), and a public key (as found in a certificate that is believed to be the signer, e.g., identified by metadata received together with the signature). The signature is verified if it can be shown that the signature data block must have been produced by the owner o...
Getting Started With NSS
ion on NSS sources, building, and testing to get started making your patch. When you're satisfied with it, you'll need code review. Code Review http://phabricator.services.mozilla.com/ is our code review tool, which uses your Bugzilla account. Use our Phabricator user instructions to upload patches for review. Some items that will be evaluated during code review are listed in checklist form on Github. After passing review, your patch can be landed by a member of the NSS team. You can find us on Mozilla IRC in channel #nss. Note that we don't land code that isn't both reviewed and tested. Code only works when it has tests, and tests only work when they're part of the automation. ...
JSS Provider Notes
ng the NSS libraries. Contents Signed JAR file Installing the Provider Specifying the CryptoToken Supported Classes What's Not Supported Signed JAR file JSS 3.2 implements several JCE (Java Cryptography Extension) algorithms. These algorithms have at various times been export-controlled by the US government. Sun therefore requires that JAR files implementing JCE algorithms be digitally signed by an approved organization. Netscape has this approval and signs the official builds of jss32.jar. At runtime, the JRE automatically verifies this signature whenever a JSS class is loaded that implements a JCE algorithm. The verification is transparent to the application (unless it fails and throws an exception). If you are curious, you can verify the signature on the JAR file using t...
Mozilla-JSS JCA Provider notes
native code using the NSS libraries. Contents Signed JAR file Installing the Provider Specifying the CryptoToken Supported Classes What's Not Supported Signed JAR file JSS implements several JCE (Java Cryptography Extension) algorithms. These algorithms have at various times been export-controlled by the US government. JRE therefore requires that JAR files implementing JCE algorithms be digitally signed by an approved organization. The maintainers of JSS, Sun, Red Hat, and Mozilla, have this approval and signs the official builds of jss4.jar. At runtime, the JRE automatically verifies this signature whenever a JSS class is loaded that implements a JCE algorithm. The verification is transparent to the application (unless it fails and throws an exception). If you are curious, you can ve...
JSS
Mozilla › Projects › NSS › JSS
The JSS project has been relocated! As of April 6, 2018, JSS has been migrated from Mercurial on Mozilla to Git on Github. JSS source should now be checked out from the Github: git clone git@github.com:dogtagpki/jss.git -- OR -- git clone https://github.com/dogtagpki/jss.git All future upstream enquiries to JSS should now use the Pagure Issue Tracker system: https://pagure.io/jss/issues Documentation regarding the JSS project should now be viewed at: http://www.dogtagpki.org/wiki/JSS NOTE: As much of the JSS documentation is sorely out-of-date, updated information will be a work in progress, and many portions of any legacy documentation will be re-written over the course of time. Stay tuned! Legacy JSS information can still be found at: SOURCE: https://hg.m...
NSS 3.50 release notes
Bug 1547639 - Update zlib in NSS to 1.2.11 Bug 1609181 - Detect ARM (32-bit) CPU features on FreeBSD Bug 1602386 - Fix build on FreeBSD/powe...
NSS API Guidelines
struct SECMyOpaqueDataStr { unsigned long myPrivateData1; unsigned long myPrivateData2; char *myName; }; the second task is to determine if individual data fields, within the data structure, are part of the API. One example may be the peerCert field, in an SSL data structure. Accessor functions, for these data elements, should be added to the API. There can be legitimate exceptions to this 'make everything opaque' rule. For example, in container structures, such as SECItem, or maybe linked list data structures. These data structures need to be examined on a case by case basis, to determine if They are truly stable and will not change in future release It is necessary for the callers of the API to know the size of these structures, as they may allocate ne...
Overview of NSS
SSL. PKCS #1. RSA standard that governs implementation of public-key cryptography based on the RSA algorithm. PKCS #3. RSA standard that governs implementation of Diffie-Hellman key agreement. PKCS #5. RSA standard that governs password-based cryptography, for example to encrypt private keys for storage. PKCS #7. RSA standard that governs the application of cryptography to data, for example digital signatures and digital envelopes. PKCS #8. RSA standard that governs the storage and encryption of private keys. PKCS #9. RSA standard that governs selected attribute types, including those used with PKCS #7, PKCS #8, and PKCS #10. PKCS #10. RSA standard that governs the syntax for certificate requests. PKCS #11. RSA standard that governs communication with cryptographic tokens (such as har...
Python binding for NSS
de nss.set_ocsp_timeout nss.clear_ocsp_cache nss.set_ocsp_default_responder nss.enable_ocsp_default_responder nss.disable_ocsp_default_responder The following files were added: src/py_traceback.h doc/examples/verify_cert.py test/test_misc.py The following constants were added: nss.KU_DIGITAL_SIGNATURE nss.KU_NON_REPUDIATION nss.KU_KEY_ENCIPHERMENT nss.KU_DATA_ENCIPHERMENT nss.KU_KEY_AGREEMENT nss.KU_KEY_CERT_SIGN nss.KU_CRL_SIGN nss.KU_ENCIPHER_ONLY nss.KU_ALL nss.KU_DIGITAL_SIGNATURE_OR_NON_REPUDIATION nss.KU_KEY_AGREEMENT_OR_ENCIPHERMENT nss.KU_NS_GOVT_APPROVED nss.PK11CertListUnique nss.PK...
NSS tools : certutil
to use hardware-generated seed values or manually create a value from the keyboard. The minimum file size is 20 bytes. -0 SSO_password Set a site security officer password on a token. -1 | --keyUsage keyword,keyword Set a Netscape Certificate Type Extension in the certificate. There are several available keywords: + digital signature + nonRepudiation + keyEncipherment + dataEncipherment + keyAgreement + certSigning + crlSigning + critical -2 Add a basic constraint extension to a certificate that is being created or added to a database. This extension supports the certificate chain verification proces...
NSS reference
Encryption/decryption Hashing Key generation Generate keys, key pairs, and domain parameters. Random number generation This API consists of the two routines used for pseudorandom number generation -- PK11_GenerateRandomOnSlot and PK11_GenerateRandom -...
sslerr.html
memory, or errors returned by PKCS#11 routines that did not provide meaningful error codes of their own. These should rarely be seen. ...
NSS Tools
of PKCS11 modules (secmod.db). Add modules and modify the properties of existing modules (such as whether a module is the default provider of some crypto service). Source, Documentation, Tasks/Plans pk12util 1.0 Import and export keys and certificates between the cert/key databases and files in PKCS12 format. Source, Documentation, Tasks/Plans signtool 1.3 Create digitally-signed jar archives containing files and/or code. Source, Documentation, signver 1.1 Verify signatures on digitally-signed objects. Source, Documentation, Tasks/Plans sslstrength SSL Strength Documentation ssltap 3.2 Proxy requests for an SSL server and display the contents of the messages exchanged between the client and server. The ssl...
NSS_3.12.3_release_notes.html
Bug 472319: Vfychain validates chain even if revoked certificate. Bug 472749: Softoken per...
certutil
to use hardware-generated seed values or manually create a value from the keyboard. The minimum file size is 20 bytes. -0 SSO_password Set a site security officer password on a token. -1 | --keyUsage keyword,keyword Set a Netscape Certificate Type Extension in the certificate. There are several available keywords: o digital signature o nonRepudiation o keyEncipherment o dataEncipherment o keyAgreement o certSigning o crlSigning o critical -2 Add a basic constraint extension to a certificate that is being created or added to a database. This extension supports the certificat...
Rhino community
but the old one may be of historical interest. The mozilla.dev.tech.js-engine newsgroup answers questions about the C implementation of JavaScript, and was also used for answering questions about Rhino until September 27, 2007. To view archived messages earlier than September 27, 2007, try Google group for the earlier newsgroup. Bug System The best way to enter Rhino bugs to enter an issue in GitHub. If you have the inclination to fix it, you are also encouraged to fix it and submit a pull request. Many older Rhino issues were logged in Bugzilla. There may be some bugs there of historical interest. Note that Rhino has its own product category. ...
Download Rhino
s rhino1.7.12.zip To download older Rhino versions, see the Rhino downloads archive. License Rhino is open source. As of release 1.7R4 Rhino is available under MPL 2.0. Previous versions were released under MPL 1.1/GPL 2.0 license. See Rhino license for further information. Source In addition to getting the source from the zip files above, the source code for Rhino can be found in github at https://github.com/mozilla/rhino. To get the source, use the command git clone https://github.com/mozilla/rhino.git Rhino uses Gradle as its build system. Running the ./gradlew tasks command at the top directory of the Rhino distribution will print the list of available build targets. ...
Rhino Examples
Sample Scripts The unique.js script allows printing unique lines from a file. The liveConnect.js script shows a sample usage of LiveConnect (Java-to-JavaScript connectivity). The jsdoc.js script is a JavaScript analog to Java's javadoc. It makes heavy use of regular expressions. The checkParam.js script is a useful tool to check that @param tags in Java documentation comments match the parameters in the corresponding Java method. ...
Creating JavaScript jstest reftests
nsufficiently covered by Test262. At the time of this writing, Mozilla imports Test262 tests in to the directory js/src/tests/test262. When importing Test262, the test file's in-file metadata is translated from Test262 format to a format readibly by the jstest harness. If you are contributing directly to Test262, you must submit the tests in the Test262 format, which you can see in the Test262 git repository and read about here. An update script exists in the js/src/tests directories to fetch and reformat the Test262 suite, see test262-update.py. Writing a new test file Please read the high level advice for test writing in the parent article here. jstests has a special requirement: The call to reportCompare in every jstest is required by the test harness. Except in old tests or s...
FOSS
or ByteArray, ByteString, CGI, POSIX Signals, FFI, and more. ...
Zest runtimes
As Zest is written in JSON it requires a runtime in order to be evaluated. The following runtimes are available: Java https://github.com/mozilla/zest - this is the reference implementation The following runtimes are planned or an an early stage of implementation: https://github.com/mozilla/zest/tree/master/js Javascript https://github.com/darkowlzz/zest-runner https://github.com/darkowlzz/zest-cli - this is the zest-cli of js based runner. Python No code available yet If you are interested in working on an existing or new Zest runtime then please get in touch via the Zest group. Related links Zest Overview ...
Zest
rules Deep integration with security tools Runtimes The runtime environments that support Zest Tools The tools that include support Zest Implementation The state of Zest development Videos Simon demoed Zest at AppSec USA in November 2013, and the full video of my talk is available on YouTube. The Zest part of the talk starts at 23:47. More details https://github.com/mozilla/zest - the code on github http://groups.google.com/group/mozilla-zest - the group used for discussing Zest ...
Mozilla Projects
working, and indeed, is not. McCoy is an application that allows add-on authors to provide secure updates to their users. Applications periodically look for and install updates to their add-ons. It's important that the update information retrieved has not been tampered with since being written by the add-on author. Specifically, it focuses on the process of digitally signing update manifests so the applications can verify the integrity of a manifest retrieved over normally insecure channels. Midas Midas is the code name for Gecko's built-in rich text editor. Midas can be enabled via JavaScript on an HTML document. When Midas is enabled, the document becomes editable by the user. Scripting for Mida...
Generating GUIDs
ryone involved. Don't have a domain name? Do you have a blog on a subdomain? Use that. If all else fails, using extensionname@yourusername.addons.mozilla.org should be fine; no one will care. Remember, these are identifiers, not e-mail addresses, and they're never resolved. Canonical form The common form of a GUID is xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, where each x stands for a hexadecimal digit. There are a number of tools that can be used to generate a GUID in the canonical form. Note: If you do choose to use an email-style ID for your add-on, you probably don't want it to be a real email address, since it might attract spam. Online tools Generate GUID Online UUID (GUID) Generator on the WEB UUID Generator for Mozilla Code (both IDL and C++.h forms) You can get a GUID from on...
Index
Mozilla › Tech › XPCOM › Index
ble, XPCOM, XPCOM API Reference, thunderbird The nsIAbCard interface is used to represent and manipulate cards in the addressbook. Following a huge refactoring of the address book code, most of the documentation below is out of date. Properties aren't stored anymore on the card, except for a handful of them. Complex properties are expected to be accessed through a call to getProperty. See //github.com/RealityRipple/UXP/blob/master//mailnews/addrbook/public/nsIAbCard.idl for more details. 229 nsIAboutModule Interfaces, Interfaces:Scriptable, NeedsContent, XPCOM Interface Reference A method to get the flags that apply to a given about: URI. The URI passed in is guaranteed to be one of the URIs that this module registered to deal with. 230 nsIAbstractWorker ...
XPCshell Test Manifest Expressions
XPCShell unit tests are run by specifying them in a manifest file. You can add conditions to tests in order to control when tests get run. The conditions accept a simple boolean expression syntax, described here. Operators In order of decreasing precedence: () == != && || Literal Values Booleans: the literal strings true and false. Integers: A series of contiguous digits. Only decimal integers are supported. Strings: any series of characters enclosed in double quotes " or single quotes '. No escape sequences are supported. Variables Variables are supported as a series of letters, digits or underscores beginning with a letter or an underscore. There are a fixed set of variables provided by the test harness via mozinfo.py, with many of the values initial...
imgICache
rvice in order to obtain it will yield incorrect results. Use the following snippet to obtain a relevant image cache for a given document or channel (where relevantDocument is a Document object that contains images you care about, or relevantChannel is an nsIChannel that is used for fetching images): var tools = Components.classes["@mozilla.org/image/tools;1"].getService(Components.interfaces.imgITools); var cache = tools.getImgCacheForDocument(relevantDocument); // alternatively, tools.getImgCacheForChannel(relevantChannel) If there is no relevant document or channel, null may be passed, but this will cause any image cache requests to use the permanent storage cache (ie. any images from windows in private browsing mode will not be present in the cache returned from a call with a null pa...
mozIStorageConnection
ll be able to inform you if you erroneously attempt to execute it synchronously. createTable() This method creates a table with the given table name and schema. void createTable( in string aTableName, in string aTableSchema ); Parameters aTableName The name of the table to create; table names may consist of the letters A-Z in either upper or lower case, the underscore, and the digits 0-9. The first character must be a letter. aTableSchema The table's schema. This should be specified using the same syntax the CREATE TABLE statement uses. For example: "foo INTEGER, bar STRING". Exceptions thrown NS_ERROR_FAILURE Table already exists or the requested table couldn't be created. executeAsync() Asynchronously executes an array of queries created with this connection, us...
nsIAbCard
The nsIAbCard interface is used to represent and manipulate cards in the addressbook. Following a huge refactoring of the address book code, most of the documentation below is out of date. Properties aren't stored anymore on the card, except for a handful of them. Complex properties are expected to be accessed through a call to getProperty. See //github.com/RealityRipple/UXP/blob/master//mailnews/addrbook/public/nsIAbCard.idl for more details. Inherits from: nsISupports Method overview AString getCardValue(in string name) void setCardValue(in string attrname, in AString value) void copy(in nsIAbCard srcCard) boolean equals(in nsIAbCard card) string convertToBase64EncodedXML() AString convertToXMLPrintData() string conve...
nsIDOMGeoPositionCoords
e describes a geographical location. dom/interfaces/geolocation/nsIDOMGeoPositionCoords.idlScriptable Please add a summary to this article. Last changed in Gecko 1.9.1 (Firefox 3.5 / Thunderbird 3.0 / SeaMonkey 2.0) Inherits from: nsISupports Attributes Attribute Type Description latitude double The user's current latitude, in degrees. Read only. longitude double The user's current longitude, in degrees. Read only. altitude double The user's current altitude, in meters. Zero if the device doesn't support altitude detection. Read only. accuracy double The accuracy of position information, in meters. Read only. altitudeAccuracy double The accuracy of altitude information, in meters. Zero if the de...
nsIHttpServer
An example : https://github.com/laurentj/slimerjs/blob/master/src/modules/webserver.jsm var EXPORTED_SYMBOLS = ["create"]; Components.utils.import("resource://gre/modules/Services.jsm"); function create() { var server = Components.classes["@mozilla.org/server/jshttp;1"] .createInstance(Components.interfaces.nsIHttpServer); return { get objectName () { return "WebServer"; }, /** * @param integer|string port port or "host:port" * @param object opt optional options. (not supported) * @param function callback optional callback */ listen: function(port, opt, callback) { if (arguments.length == 2 && "function" == typeof opt) { ...
nsIMsgAccountManagerExtension
"chrome://extension@example.org/content/am-devmo.xul" and a property file in "chrome://extension@example.org/locale/am-devmo.properties" containing a property named "prefPanel-devmo". You have to register any new Account Manager Extensions via the the category manager at start up. Simply add a new Entry with the Contact ID of the component to the "mailnews-accountmanager-extensions" category. //github.com/RealityRipple/UXP/blob/master/mailnews/base/public/nsIMsgAccountManager.idlScriptable Please add a summary to this article. Last changed in Gecko ??? Inherits from: nsISupports Method overview boolean showPanel(in nsIMsgIncomingServer server); Attributes Attribute Type Description name ACString name of the account manager extension. It has to be unique and defines the f...
nsIMsgFolder
isSpecialFolder and such). ...
nsIPropertyBag
this is not helpful to differentiate between Windows XP, Vista, 7, etc. To do this use nsIPropertyBag: Services.sysinfo.getProperty("version"); //output 5.1 Services.sysinfo.getProperty("name"); //output Windows_NT Services.sysinfo.getProperty("arch"); //output x86 Services.sysinfo.getProperty("hasWindowsTouchInterface"); //outputs false or true if windows touch is there Consult the UXP Repo (//github.com/RealityRipple/UXP/blob/master/xpcom/base/nsSystemInfo.cpp) for the properties supported. Also pay attention to their platform-specific meaning (e.g. on Android there is version and kernel_version). ...
nsIXMLHttpRequest
it. nsIXMLHttpRequest along with nsIJSXMLHttpRequest and nsIXMLHttpRequestEventTarget are Mozilla's implementation details of the DOM XMLHttpRequest object. Note: If you're a web developer or a Mozilla add-on developer, please refer to the XMLHttpRequest documentation instead. This page contains documentation, specific to Mozilla application and add-on developers. The interface definition: //github.com/RealityRipple/UXP/blob/master/dom/xhr/nsIXMLHttpRequest.idl Elevated Privileges As mentioned in the "Non-Standard Properties" the property of channel was read-only. When using the XPCOM interface, as seen below in Example 2, we can get access to this. The most obvious benefit is that we can set nsiRequest - Constants in the xhr.channel.loadFlags. For instance, as done in Example 2, the f...
Thunderbird extensions
be out of date, but they still provide valuable information on the codebase. ...
Working with data
You can always get a pointer to the C value using the CData object's address() method. Objects can share memory It's important to keep in mind that two (or more) CData objects can share the same memory block for their contents. This will happen, for example, when type casting. ...
ctypes.open
e C functions within can be used from js-ctypes. ...
Int64
ng representation of the object's numeric value. String toString( [radix] ); Parameters radix Optional The radix (base) to use when constructing the string. If you don't specify a radix, base 10 is used. Return value A string representation of the value in the specified radix. This string consists of a leading minus sign, if the value was negative, followed by one or more lower-case digits in the specified radix. See Also ctypes UInt64 ...
Library
is an exported data symbol rather than a function. Return value A FunctionType CData object representing the declared API. Exceptions thrown ctypes CType FunctionType ABI TypeError The return type was specified as an array. Alternative Syntax Another use for ctypes.declare is to get non-function/non-methods from libraries. The syntax for this is seen in Firefox codebase here: //github.com/RealityRipple/UXP/blob/master/js/src/ctypes/Library.cpp?offset=0#271 This shows that we can also supply only two arguments to the declare function. The first being the same as in the above example, name, which is the name of the symbol to export. And in place of the abi argument, we will pass in the type of this export. For example, from the Objective-C library we can export the symbol wh...
UInt64
ng representation of the object's numeric value. String toString( [radix] ); Parameters radix Optional The radix (base) to use when constructing the string. If you don't specify a radix, base 10 is used. Return value A string representation of the value in the specified radix. This string consists of a leading minus sign, if the value was negative, followed by one or more lower-case digits in the specified radix. Arithmetic Operations const UInt64 = ctypes.UInt64; const Int64 = ctypes.Int64; function ensureUInt64(aArr) { // makes elements in aArr a UInt64 if it can be made, else throws for (var i=0; i<aArr.length; i++) { var cCon = aArr[i].constructor.name; if (cCon != 'UInt64') { if (['String', 'Number'].index...
js-ctypes
Library UInt64 View All... Examples Add to iPhoto A Firefox extension that uses js-ctypes to call Carbon and Core Foundation framework routines on Mac OS X to implement an "Add image to iPhoto" feature in Firefox. Using C structs and pointers Using COM from js-ctypes Using Objective-C from js-ctypes Github :: ochameau / jscpptypes A mangling library to use C++ from js-ctypes Community View Mozilla forums... Mailing list Newsgroup RSS feed Stackoverflow - jsctypes Related Topics XPCOM in Gecko 2 - Binary Components ...
PKCS #11 Netscape Trust Objects - Network Security Services
tection purpose. CKA_TRUST_IPSEC_END_SYSTEM CK_TRUST Level of trust for IPSec end system purpose. CKA_TRUST_IPSEC_TUNNEL CK_TRUST Level of trust for IPSec tunnel purpose. CKA_TRUST_IPSEC_USER CK_TRUST Level of trust for IPSec user purpose. CKA_TRUST_TIME_STAMPING CK_TRUST Level of trust for time stamping purpose. CKA_TRUST_DIGITAL_SIGNATURE CK_TRUST Level of trust for digital signature key usage purpose. CKA_TRUST_NON_REPUDIATION CK_TRUST Level of trust for non-repudiation key usage purpose. CKA_TRUST_KEY_ENCIPHERMENT CK_TRUST Level of trust for key-encipherment key usage purpose. CKA_TRUST_KEY_AGREEMENT CK_TRUST Level of trust for key-agreement key usage purpose. ...
Blocking By Domain - Plugins
operly without plugins, but still prompt users for activation. In order to improve site performance and reduce the number of plugin prompts that users see, popular sites that show unnecessary plugin prompts or slow the browser down with unnecessary plugins will be added to the plugin block list. List Contents and Updates The plugin block lists are freely-licensed lists maintained by Mozilla in github. The initial contents of the third-party plugin block list are based on Disconnect's open source blocklist. Subsequent updates to the list will be made using telemetry from Firefox experiments. In general, sites will not be removed from the list unless there is an error that renders a site in a seriously defective manner. Any concerns or questions about the plugin block lists should be direct...
Use a source map - Firefox Developer Tools
to reconstruct the original source and present the reconstructed original in the debugger. To enable the debugger to work with a source map, you must: generate the source map include a comment in the transformed file, that points to the source map. The comment's syntax is like this: //# sourceMappingURL=http://example.com/path/to/your/sourcemap.map In the video above we load https://mdn.github.io/devtools-examples/sourcemaps-in-console/index.html. This page loads a source called "main.js" that was originally written in CoffeeScript and compiled to JavaScript. The compiled source contains a comment like this, that points to a source map: //# sourceMappingURL=main.js.map In the Debugger's source list pane, the original CoffeeScript source now appears as "main.coffee", and we can deb...
Aggregate view - Firefox Developer Tools
the exact place your code made those allocations. It's easier to explain this with reference to a simple example. For this we'll use the DOM allocation example. This page simply runs a script that creates a large number of DOM nodes (200 HTMLDivElement objects and 4000 HTMLSpanElement objects). Let's get an allocation trace: open the Memory tool check "Record call stacks" load https://mdn.github.io/performance-scenarios/dom-allocs/alloc.html take a snapshot select "View/Aggregate" select "Group by/Call Stack" You should see something like this: This is telling us that 93% of the total heap snapshot was allocated in functions called from "alloc.js", line 35 (our initial createToolbars() call). We can use the disclosure arrow to expand the tree to find out exactly where we're...
DOM allocation example - Firefox Developer Tools
This article describes a very simple web page that we'll use to illustrate some features of the Memory tool. You can try out the site at https://mdn.github.io/performance-scenarios/dom-allocs/alloc.html. It just contains a script that creates a large number of DOM nodes: var toolbarButtonCount = 20; var toolbarCount = 200; function getRandomInt(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; } function createToolbarButton() { var toolbarButton = document.createElement("span"); toolbarButton.classList.add("toolbarbutton"); // stop Spidermonkey from sharing instances toolbarButton[getRandomInt(0,5000)] = "foo"; return toolbarButton; } function createToolbar() { var toolbar = document.createElement("div"); // stop Spidermonkey from sharing in...
Monster example - Firefox Developer Tools
This article describes a very simple web page that we'll use to illustrate some features of the Memory tool. You can try the site at https://mdn.github.io/performance-scenarios/js-allocs/alloc.html. Here's the code: var MONSTER_COUNT = 5000; var MIN_NAME_LENGTH = 2; var MAX_NAME_LENGTH = 48; function Monster() { function randomInt(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; } function randomName() { var chars = "abcdefghijklmnopqrstuvwxyz"; var nameLength = randomInt(MIN_NAME_LENGTH, MAX_NAME_LENGTH); var name = ""; for (var j = 0; j &lt; nameLength; j++) { name += chars[randomInt(0, chars.length-1)]; } return name; } this.name = randomName(); this.eyeCount = randomInt(0, 25); this.tentacleCount = rand...
Examine and edit HTML - Firefox Developer Tools
and height. Then you will find strange gaps between elements, even if you haven't set any margin or padding on them. Since Firefox 52, the Inspector displays these whitespace nodes, so you can see where the gaps in your markup come from. Whitespace nodes are represented with a dot: and you get an explanatory tooltip when you hover over them: To see this in action, see the demo at https://mdn.github.io/devtools-examples/whitespace-only-demo/index.html. Shadow roots Any shadow roots present in the DOM are exposed in the HTML page in the same manner as the regular DOM. The shadow root is signified by a node named #shadow-root -- you can click its expansion arrow to see the full contents of the shadow DOM, and then manipulate the contained nodes in a similar way to other part of the page's...
Sorting algorithms comparison - Firefox Developer Tools
You can try out the example program here and clone the code here (be sure to check out the gh-pages branch). You can also download the specific profile we discuss - just import it to the Performance tool if you want to follow along. Of course, you can generate your own profile, too, but the numbers will be a little...
Responsive Design Mode - Firefox Developer Tools
is set to the same value. The devices listed in the drop-down are just a subset of the devices that can be selected. At the end of the drop-down, there is an item labeled Edit list. Select this to see a panel containing all the choices, which enables you to check the devices you want to see in the drop-down. The set of devices, and the values associated with each device, are taken from https://github.com/mozilla/simulated-devices. You can also define a custom device, as described below. Creating custom devices You can create and save custom devices in Responsive Design Mode by clicking the Add Custom Device button. Each device can have its own: Name Size DevicePixelRatio User Agent String Touch Screen Also, you can preview the properties of existing devices by hovering over the ...
AbortController.AbortController() - Web APIs
.addEventListener('click', function() { controller.abort(); console.log('Download aborted'); }); function fetchVideo() { ... fetch(url, {signal}).then(function(response) { ... }).catch(function(e) { reports.textContent = 'Download error: ' + e.message; }) } Note: When abort() is called, the fetch() promise rejects with an AbortError. You can find a full working example on GitHub -- see abort-api (see it running live also). Specifications Specification Status Comment DOMThe definition of 'AbortController()' in that specification. Living Standard Initial definition ...
AbortController.abort() - Web APIs
.addEventListener('click', function() { controller.abort(); console.log('Download aborted'); }); function fetchVideo() { ... fetch(url, {signal}).then(function(response) { ... }).catch(function(e) { reports.textContent = 'Download error: ' + e.message; }) } Note: When abort() is called, the fetch() promise rejects with an AbortError. You can find a full working example on GitHub -- see abort-api (see it running live also). Specifications Specification Status Comment DOMThe definition of 'abort()' in that specification. Living Standard Initial definition ...
AbortController.signal - Web APIs
.addEventListener('click', function() { controller.abort(); console.log('Download aborted'); }); function fetchVideo() { ... fetch(url, {signal}).then(function(response) { ... }).catch(function(e) { reports.textContent = 'Download error: ' + e.message; }) } Note: When abort() is called, the fetch() promise rejects with an AbortError. You can find a full working example on GitHub -- see abort-api (see it running live also). Specifications Specification Status Comment DOMThe definition of 'signal' in that specification. Living Standard Initial definition ...
AbortController - Web APIs
'click', function() { controller.abort(); console.log('Download aborted'); }); function fetchVideo() { ... fetch(url, {signal}).then(function(response) { ... }).catch(function(e) { reports.textContent = 'Download error: ' + e.message; }) } Note: When abort() is called, the fetch() promise rejects with a DOMException named AbortError. You can find a full working example on GitHub -- see abort-api (see it running live also). Specifications Specification Status Comment DOMThe definition of 'AbortController' in that specification. Living Standard Initial definition ...
AbortSignal - Web APIs
e.log('Download aborted'); }); function fetchVideo() { ... fetch(url, {signal}).then(function(response) { ... }).catch(function(e) { reports.textContent = 'Download error: ' + e.message; }) } Note: When abort() is called, the fetch() promise rejects with an AbortError. Current version of Firefox rejects the promise with a DOMException You can find a full working example on GitHub -- see abort-api (see it running live also). Specifications Specification Status Comment DOMThe definition of 'AbortSignal' in that specification. Living Standard Initial definition ...
AbstractWorker - Web APIs
st.value, second.value]); console.log('Message posted to worker'); } The worker's code is loaded from the file "worker.js". This code assumes that there's an <input> element represented by first; an event handler for the change event is established so that when the user changes the value of first, a message is posted to the worker to let it know. You can find more examples on the MDN Web Docs GitHub repository: Basic dedicated worker example (run dedicated worker). Basic shared worker example (run shared worker). Specifications Specification Status Comment HTML Living StandardThe definition of 'AbstractWorker' in that specification. Living Standard No change from Unknown. ...
AddressErrors.organization - Web APIs
ect's organization property could not be validated, this property contains a DOMString offering a human-readable explanation of the validation error and offers suggestions for correcting it. For example, if validation simply ensures that only permitted characters are included in the organization's name, this might return a string such as "The organization name may only contain the letters A-Z, digits, spaces, and commas." If the organization value was validated successfully, this property is not included in the AddressErrors object. Specifications Specification Status Comment Payment Request APIThe definition of 'AddressErrors.organization' in that specification. Candidate Recommendation Initial definition. ...
AnalyserNode.AnalyserNode() - Web APIs
A new AnalyserNode object instance. Specifications Specification Status Comment Web Audio APIThe definition of 'AnalyserNode() constructor' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetAnalyserNode() constructorChrome Full support 55Edge Full support <=79Firefox ...
AudioBuffer() - Web APIs
n't enough memory available to allocate the buffer. Specifications Specification Status Comment Web Audio APIThe definition of 'AudioBuffer' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetAudioBuffer() constructorChrome Full support 55Notes Full support 55Notes Notes The context ...
AudioBufferSourceNode.AudioBufferSourceNode() - Web APIs
w AudioBufferSourceNode object instance. Specifications Specification Status Comment Web Audio APIThe definition of 'AudioBufferSourceNode()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetAudioBufferSourceNode() constructorChrome Full support 55Notes Full support 55Notes Notes Be...
AudioContext.baseLatency - Web APIs
ck' }); console.log(audioCtx2.baseLatency); // 0.15 Specifications Specification Status Comment Web Audio APIThe definition of 'baseLatency' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetbaseLatency ExperimentalChrome Full support 58Edge Full support <=79Firefox F...
AudioContext.createMediaStreamDestination() - Web APIs
an array chunks.push(evt.data); }; mediaRecorder.onstop = function(evt) { // Make blob out of our blobs, and open it. var blob = new Blob(chunks, { 'type' : 'audio/ogg; codecs=opus' }); document.querySelector("audio").src = URL.createObjectURL(blob); }; </script> </body> </html> Note: You can view this example live, or study the source code, on Github. Specifications Specification Status Comment Web Audio APIThe definition of 'createMediaStreamDestination()' in that specification. Working Draft ...
AudioContext.getOutputTimestamp() - Web APIs
requestAnimationFrame(outputTimestamps); } Specifications Specification Status Comment Web Audio APIThe definition of 'getOutputTimestamp()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetgetOutputTimestamp ExperimentalChrome Full support 57Edge Full support <=79Firefox ...
AudioParam.cancelAndHoldAtTime() - Web APIs
erence to the AudioParam it was called on. Specifications Specification Status Comment Web Audio APIThe definition of 'cancelAndHoldAtTime()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetcancelAndHoldAtTimeChrome Full support 57 Full support 57 No support ...
AudioProcessingEvent - Web APIs
tinationNode. For each channel and each sample frame, the scriptNode.onaudioprocess function takes the associated audioProcessingEvent and uses it to loop through each channel of the input buffer, and each sample in each channel, and add a small amount of white noise, before setting that result to be the output sample in each case. ...
AudioScheduledSourceNode: ended event - Web APIs
Specifications Specification Status Comment Web Audio APIThe definition of 'onended' in that specification. Working Draft Initial specification. ...
BaseAudioContext.createConstantSource() - Web APIs
Returns A ConstantSourceNode instance. Specifications Specification Status Comment Web Audio APIThe definition of 'createConstantSource()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetcreateConstantSourceChrome Full support 56Edge Full support <=79Firefox Full ...
BaseAudioContext.createScriptProcessor() - Web APIs
tinationNode. For each channel and each sample frame, the scriptNode.onaudioprocess function takes the associated audioProcessingEvent and uses it to loop through each channel of the input buffer, and each sample in each channel, and add a small amount of white noise, before setting that result to be the output sample in each case. ...
BaseAudioContext.destination - Web APIs
ination property of the BaseAudioContext interface returns an AudioDestinationNode representing the final destination of all audio in the context. It often represents an actual audio-rendering device such as your device's speakers. Syntax baseAudioContext.destination; Value An AudioDestinationNode. Example Note: for a full example implementation, see one of our Web Audio Demos on the MDN Github repo, like voice-change-o-matic. var AudioContext = window.AudioContext || window.webkitAudioContext; var audioCtx = new AudioContext(); // Older webkit/blink browsers require a prefix var oscillatorNode = audioCtx.createOscillator(); var gainNode = audioCtx.createGain(); oscillatorNode.connect(gainNode); gainNode.connect(audioCtx.destination); Specifications Specification S...
BaseAudioContext.sampleRate - Web APIs
senting the sample rate, in samples per second, used by all nodes in this audio context. This limitation means that sample-rate converters are not supported. Syntax baseAudioContext.sampleRate; Value A floating point number indicating the audio context's sample rate, in samples per second. Example Note: for a full Web Audio example implementation, see one of our Web Audio Demos on the MDN Github repo, like panner-node. Try entering audioCtx.sampleRate into your browser console. var AudioContext = window.AudioContext || window.webkitAudioContext; var audioCtx = new AudioContext(); // Older webkit/blink browsers require a prefix ... console.log(audioCtx.sampleRate); Specifications Specification Status Comment Web Audio APIThe definition of 'sampleRate' in ...
BasicCardRequest.supportedNetworks - Web APIs
supportedInstruments, details, options); Specifications Specification Status Comment Basic Card PaymentThe definition of 'supportedNetworks' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetsupportedNetworksChrome No support NoEdge No support <=18 -- 79Firefox Full support ...
BasicCardResponse.billingAddress - Web APIs
ing address is a PaymentAddress object } } Specifications Specification Status Comment Basic Card PaymentThe definition of 'billingAddress' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetbillingAddressChrome No support NoEdge No support <=18 -- 79Firefox Full support ...
BasicCardResponse.cardNumber - Web APIs
billing address is a PaymentAddress object } } Specifications Specification Status Comment Basic Card PaymentThe definition of 'cardNumber' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetcardNumberChrome No support NoEdge No support <=18 -- 79Firefox Full support ...
BasicCardResponse.cardSecurityCode - Web APIs
g address is a PaymentAddress object } } Specifications Specification Status Comment Basic Card PaymentThe definition of 'cardSecurityCode' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetcardSecurityCodeChrome No support NoEdge No support <=18 -- 79Firefox Full support ...
BasicCardResponse.cardholderName - Web APIs
ing address is a PaymentAddress object } } Specifications Specification Status Comment Basic Card PaymentThe definition of 'cardholderName' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetcardholderNameChrome No support NoEdge No support <=18 -- 79Firefox Full support ...
BasicCardResponse - Web APIs
address is a PaymentAddress object } } Specifications Specification Status Comment Basic Card PaymentThe definition of 'BasicCardResponse' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetBasicCardResponseChrome No support NoEdge No support <=18 -- 79Firefox Full support ...
BiquadFilterNode() - Web APIs
value A new BiquadFilterNode object instance. Specifications Specification Status Comment Web Audio APIThe definition of 'BiquadFilterNode()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetBiquadFilterNode() constructorChrome Full support 55Notes Full support 55Notes Notes Before ...
BlobEvent.timecode - Web APIs
obEvent.timecode Value A DOMHighResTimeStamp. Specifications Specification Status Comment MediaStream RecordingThe definition of 'timecode' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internettimecode ExperimentalChrome Full support 57Edge Full support <=79Firefox ? ...
BluetoothCharacteristicProperties - Web APIs
haracteristic.startNotifications(); } Specifications Specification Status Comment Web BluetoothThe definition of 'BluetoothCharacteristicProperties' in that specification. Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetBluetoothCharacteristicProperties ExperimentalChrome Full support 56Notes Full support 56Not...
characteristic - Web APIs
turns An instance of BluetoothRemoteGATTCharacteristic. Specifications Specification Status Comment Web BluetoothThe definition of 'characteristic' in that specification. Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetcharacteristic ExperimentalChrome Full support 57Notes Full support 57Notes Notes macOS only...
readValue() - Web APIs
... }) Returns A Promise that resolves to an ArrayBuffer. Specifications Specification Status Comment Web BluetoothThe definition of 'readValue()' in that specification. Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetreadValue ExperimentalChrome Full support 57Notes Full support 57Notes Notes macOS only. ...
uuid - Web APIs
ax var uuid = BluetoothRemoteGATTDescriptor.uuid Returns A UUID. Specifications Specification Status Comment Web BluetoothThe definition of 'uuid' in that specification. Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetuuid ExperimentalChrome Full support 57Notes Full support 57Notes Notes macOS only. ...
value - Web APIs
toothRemoteGATTDescriptor.characteristic Returns An ArrayBuffer. Specifications Specification Status Comment Web BluetoothThe definition of 'value' in that specification. Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetvalue ExperimentalChrome Full support 57Notes Full support 57Notes Notes macOS only. ...
writeValue() - Web APIs
ith the bytes contained in the array. Returns A Promise. Specifications Specification Status Comment Web BluetoothThe definition of 'writeValue()' in that specification. Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetwriteValue ExperimentalChrome Full support 57Notes Full support 57Notes Notes macOS only. ...
BluetoothRemoteGATTDescriptor - Web APIs
d in an ArrayBuffer and returns a Promise. Specifications Specification Status Comment Web BluetoothThe definition of 'BluetoothRemoteGATTDescriptor' in that specification. Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetBluetoothRemoteGATTDescriptor ExperimentalChrome Full support 57Notes Full support 57Notes N...
BudgetService.getBudget() - Web APIs
e expected state of the budget at times in the future. Syntax var aPromise = BudgetService.getBudget(); aPromise.then(function(budgetState[]){ ... }); Parameters None. Returns A Promise that resolves to an instance of BudgetState. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetgetBudget ExperimentalDeprecatedNon-standardChrome Full support 55Edge Full support <=79Firef...
BudgetService.getCost() - Web APIs
of the provided background operation. Syntax var aPromise = BudgetService.getCost(operation); aPromise.then(function(someDouble){ ... }); Parameters operation Must be "silent-push". Returns A Promise that resolves to a number. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetgetCost ExperimentalDeprecatedNon-standardChrome Full support 55Edge Full support <=79Firefox...
BudgetService.reserve() - Web APIs
g whether the requested budget operation can be reserved. Syntax var aPromise = BudgetService.reserve(operation); aPromise.then(function(boolean){ ... }); Parameters operation desc Returns A Promise that resolves to a boolean. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetreserve ExperimentalDeprecatedNon-standardChrome Full support 55Edge Full support <=79Firefox...
BudgetService - Web APIs
rray of BudgetState objects, indicating the expected state of the budget at times in the future. BudgetService.reserve() Returns a Promise that resolves to a boolean, indicating whether the requested budget operation can be reserved. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetBudgetService ExperimentalDeprecatedNon-standardChrome Full support 55Edge Full support <=79F...
BudgetState.budgetAt - Web APIs
The budgetAt read-only property of the BudgetState interface returns the anticipated processing budget at the specified time. Syntax var budget = BudgetState.budgetAt Value A double. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetbudgetAt ExperimentalDeprecatedNon-standardChrome Full support 60Edge Full support <=79Firefox ? IE ...
BudgetState.time - Web APIs
Web › API › BudgetState › time
The time read-only property of the BudgetState interface returns a timestamp at which the budgetAt value is valid. Syntax var time = BudgetState.time Value A timestamp. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internettime ExperimentalDeprecatedNon-standardChrome Full support 60Edge Full support <=79Firefox ? IE ? ...
BudgetState - Web APIs
essing budget at a specific point in time. Properties BudgetState.budgetAt Returns the anticipated processing budget at a specific time. BudgetState.time Returns a timestamp at which the budgetAt value is valid. Methods None. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetBudgetState ExperimentalDeprecatedNon-standardChrome Full support 60Edge Full support <=79Fir...
ByteLengthQueuingStrategy - Web APIs
var size = queueingStrategy.size(chunk); Specifications Specification Status Comment StreamsThe definition of 'ByteLengthQueuingStrategy' in that specification. Living Standard Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetByteLengthQueuingStrategy ExperimentalChrome Full support 59Edge Full support 16Firefox ...
CSSStyleRule.selectorText - Web APIs
cannot be parsed, a SyntaxError is thrown. Specifications Specification Status Comment CSS Object Model (CSSOM)The definition of 'CSSStyleRule.selectorText' in that specification. Working Draft Browser Compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetselectorTextChrome Full support 1Edge Full support 12Firefox Full support ...
CSS Painting API - Web APIs
<li>item 4</li> <li>item 5</li> <li>item 6</li> <li>item 7</li> <li>item 8</li> <li>item 9</li> <li>item 10</li> <li>item 11</li> <li>item 12</li> <li>item 13</li> <li>item 14</li> <li>item 15</li> <li>item 16</li> <li>item 17</li> <li>item 18</li> <li>item 19</li> <li>item 20</li> </ul> CSS.paintWorklet.addModule('https://mdn.github.io/houdini-examples/cssPaint/intro/worklets/hilite.js'); Then we can use the <image> with the CSS paint() function: li { --boxColor: hsla(55, 90%, 60%, 1.0); background-image: paint(hollowHighlights, stroke, 2px); } li:nth-of-type(3n) { --boxColor: hsla(155, 90%, 60%, 1.0); background-image: paint(hollowHighlights, filled, 3px); } li:nth-of-type(3n+1) { --boxColor: hsla(25...
CanvasRenderingContext2D.addHitRegion() - Web APIs
...
CanvasRenderingContext2D.clearHitRegions() - Web APIs
...
CanvasRenderingContext2D.removeHitRegion() - Web APIs
...
A basic ray-caster - Web APIs
updated, and the rays are cast out. As the rays intersect walls, then they render a vertical sliver of canvas in the color of the wall they've hit, blended with a darker version of the color according to the distance to the wall. The height of the sliver is also modulated by the distance from the camera to the wall, and is drawn centered over the horizon line. The code I ended up with is a regurgitated amalgam of the raycaster chapters from an old Andre LaMotheTricks of the Game Programming Gurus book (ISBN: 0672305070), and a java raycaster I found online, filtered through my compulsion to rename everything so it makes sense to me, and all the tinkering that had to be done to make things work well. Results The canvas in Safari 2.0.1 performed surprisingly well. With the blockiness factor...
Using channel messaging - Web APIs
one another, and how the messages are passed. Message channels on the other hand can provide a secure channel that allows you to pass data between different browsing contexts. Note: For more information and ideas, the Ports as the basis of an object-capability model on the Web section of the spec is a useful read. Simple examples To get your started, we have published a couple of demos on Github. First up, check out our channel messaging basic demo (run it live too), which shows a really simple single message transfer between a page and an embedded <iframe>. Secondly, have a look at our multimessaging demo (run this live), which shows a slightly more complex setup that can send multiple messages between the main page and an IFrame. We'll be focusing on the latter example in this art...
Channel Messaging API - Web APIs
a new message channel to send messages across. MessagePort Controls the ports on the message channel, allowing sending of messages from one port and listening out for them arriving at the other. PortCollection An array of MessagePorts; an experimental solution to allow broadcasting of a message to multiple ports simultaneously. Examples We have published a channel messaging basic demo on Github (run it live too), which shows a really simple single message transfer between a page and an embedded <iframe>. You can also see a multimessaging demo (run this live), which shows a slightly more complex setup that can send multiple messages between main page and IFrame. Specifications Specification Status Comment HTML Living StandardThe definition of 'Channel messa...
ChildNode.remove() - Web APIs
Web › API › ChildNode › remove
d('div-02'); el.remove(); // Removes the div with the 'div-02' id ChildNode.remove() is unscopable The remove() method is not scoped into the with statement. See Symbol.unscopables for more information. ...
ChildNode - Web APIs
Web › API › ChildNode
on the latter. ...
ConvolverNode() - Web APIs
ample rate to the associated AudioContext. Specifications Specification Status Comment Web Audio APIThe definition of 'ConvolverNode()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetConvolverNode() constructorChrome Full support 55Edge Full support <=79Firefox ...
CountQueuingStrategy - Web APIs
trategy); var size = queueingStrategy.size(); Specifications Specification Status Comment StreamsThe definition of 'CountQueuingStrategy' in that specification. Living Standard Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetCountQueuingStrategy ExperimentalChrome Full support 59Edge Full support 16Firefox ...
DOMException() - Web APIs
. Example TBD Specifications Specification Status Comment Web IDLThe definition of 'DOMException()' in that specification. Candidate Recommendation Adds the constructor for the DOMException class. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetDOMException() constructorChrome Full support YesEdge Full support 79Firefox ...
DOMException.code - Web APIs
Web › API › DOMException › code
domExceptionCode = domExceptionInstance.code; Value A short number. Specifications Specification Status Comment Web IDLThe definition of 'code' in that specification. Candidate Recommendation Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetcodeChrome Full support YesEdge Full support 12Firefox Full support ...
DOMException.message - Web APIs
eptionMessage = domExceptionInstance.message; Value A DOMString. Specifications Specification Status Comment Web IDLThe definition of 'message' in that specification. Candidate Recommendation Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetmessageChrome Full support YesEdge Full support 12Firefox Full support ...
DOMHighResTimeStamp - Web APIs
eStamp' in that specification. Recommendation Stricter definitions of interfaces and types. High Resolution TimeThe definition of 'DOMHighResTimeStamp' in that specification. Recommendation Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetDOMHighResTimestampChrome Full support 6Edge Full support 12Firefox Full supp...
DOMParser - Web APIs
Web › API › DOMParser
ent, which also is a Document. parser = new DOMParser(); doc = parser.parseFromString(stringContainingHTMLSource, "text/html") // returns an HTMLDocument, which also is a Document. DOMParser HTML extension /* * DOMParser HTML extension * 2012-09-04 * * By Eli Grey, http://eligrey.com * Public domain. * NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. ...
DOMRectReadOnly.fromRect() - Web APIs
instance of DOMRect. Specifications Specification Status Comment Geometry Interfaces Module Level 1The definition of 'fromRect()' in that specification. Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetfromRect() static functionChrome Full support 57Edge Full support 79Firefox F...
DOMTokenList.forEach() - Web APIs
sArg, this[i], i, this); } }; } Specifications Specification Status Comment DOMThe definition of 'forEach() (as iterable<Node>)' in that specification. Living Standard Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetforEachChrome Full support 45Edge Full support 16Firefox Full support ...
DataTransferItem.webkitGetAsEntry() - Web APIs
Specification Status Comment File and Directory Entries APIThe definition of 'webkitGetAsEntry()' in that specification. Draft Initial specification. This API has no official W3C or WHATWG specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetwebkitGetAsEntryChrome Full support 13Edge Full support 14Firefox Full suppor...
DelayNode() - Web APIs
audioCtx, { delayTime: 0.5, maxDelayTime: 2, }); Specifications Specification Status Comment Web Audio APIThe definition of 'DelayNode()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetDelayNode() constructorChrome Full support 55Notes Full support 55Notes Notes Before version...
DirectoryReaderSync - Web APIs
tory does not exist. INVALID_STATE_ERR The directory has been modified since the first call to readEntries was processed. SECURITY_ERR The browser determined that it was not safe to look up the metadata. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetDirectoryReaderSync Non-standardChrome Full support 13Prefixed Full support 13Prefixed Prefi...
Document.evaluate() - Web APIs
Web › API › Document › evaluate
Specifications Specification Status Comment Document Object Model (DOM) Level 3 XPath SpecificationThe definition of 'Document.evaluate' in that specification. Recommendation Initial specification Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetevaluateChrome Full support 1Edge Full support 12Firefox Full support ...
Document.fonts - Web APIs
Web › API › Document › fonts
nished loading can go here. }); Specifications Specification Status Comment CSS Font Loading Module Level 3The definition of 'FontFaceSet' in that specification. Working Draft Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetfontsChrome Full support 60Edge Full support 79Firefox Full support ...
Document.forms - Web APIs
Web › API › Document › forms
finition of 'Document.forms' in that specification. Living Standard Document Object Model (DOM) Level 2 HTML SpecificationThe definition of 'Document.forms' in that specification. Obsolete Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetformsChrome Full support 1Edge Full support 12Firefox Full support ...
Document.open() - Web APIs
Web › API › Document › open
the stack. As a result, you can no longer call document.write() into an untrusted document from chrome, even using wrappedJSObject. See Security check basics for more about principals. Three-argument document.open() There is a lesser-known and little-used three-argument version of document.open() , which is an alias of Window.open() (see its page for full details). This call, for example opens github.com in a new window, with its opener set to null: document.open('https://www.github.com','', 'noopener=true') Two-argument document.open() Browsers used to support a two-argument document.open(), with the following signature: document.open(type, replace) Where type specified the MIME type of the data you are writing (e.g. text/html) and replace if set (i.e. a string of "replace") specifie...
Document: pointerdown event - Web APIs
The pointerdown event is fired when a pointer becomes active. For mouse, it is fired when the device transitions from no buttons depressed to at least one button depressed. For touch, it is fired when physical contact is made with the digitizer. For pen, it is fired when the stylus makes physical contact with the digitizer. Bubbles Yes Cancelable Yes Interface PointerEvent Event handler property onpointerdown Examples Using addEventListener(): document.addEventListener('pointerdown', (event) => { console.log('Pointer down event'); }); Using the onpointerdown event handler property: document.onpointerdown = (event) => { console.log('Pointer down event'); }; Specifications Specification Status Pointer Ev...
Document: pointerleave event - Web APIs
The pointerleave event is fired when a pointing device is moved out of the hit test boundaries of an element. For pen devices, this event is fired when the stylus leaves the hover range detectable by the digitizer. Bubbles No Cancelable No Interface PointerEvent Event handler property onpointerleave Examples Using addEventListener(): document.addEventListener('pointerleave', (event) => { console.log('Pointer left element'); }); Using the onpointerleave event handler property: document.onpointerleave = (event) => { console.log('Pointer left element'); }; Specifications Specification Status Pointer Events Obsolete ...
Document: pointerout event - Web APIs
The pointerout event is fired for several reasons including: pointing device is moved out of the hit test boundaries of an element; firing the pointerup event for a device that does not support hover (see pointerup); after firing the pointercancel event (see pointercancel); when a pen stylus leaves the hover range detectable by the digitizer. Bubbles Yes Cancelable Yes Interface PointerEvent Event handler property onpointerout Examples Using addEventListener(): document.addEventListener('pointerout', (event) => { console.log('Pointer moved out'); }); Using the onpointerout event handler property: document.onpointerout = (event) => { console.log('Pointer moved out'); }; Specifications Specification Status ...
DocumentFragment.querySelector() - Web APIs
nt.querySelector' in that specification. Obsolete No change from Selectors API Level 1 Selectors API Level 1The definition of 'DocumentFragment.querySelector' in that specification. Obsolete Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetquerySelectorChrome Full support 1Edge Full support 12Firefox Full support ...
DocumentOrShadowRoot.getSelection() - Web APIs
Document.activeElement returns the focused element. Specifications Specification Status Comment Shadow DOMThe definition of 'DocumentOrShadowRoot' in that specification. Obsolete Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetgetSelection ExperimentalChrome Full support 53Edge Full support 12Firefox Fu...
DynamicsCompressorNode() - Web APIs
e. Its nominal range is [-100, 0]. Specifications Specification Status Comment Web Audio APIThe definition of 'DynamicsCompressorNode()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetDynamicsCompressorNode() constructorChrome Full support 55Notes Full support 55Notes Notes B...
EffectTiming.easing - Web APIs
middle. Equivalent to cubic-bezier(0.42, 0, 0.58, 1). frames(<integer>) Specifies a frames timing function, which breaks the animation down into a number of equal time intervals but also displays the start (0%) and end (100%) states for an equal amount of time to the other intervals. The browser flips to a different static frame when each interval is reached, rather than animating smoothly. See GitHub for a simple example that illustrates the difference between steps() and frames(). steps(<integer>[, [ start | end ] ]?) Specifies a step timing function, which breaks the animation down into a number of equal time intervals. The browser flips to a different static frame when each interval is reached, rather than animating smoothly. The first parameter specifies the number of intervals in ...
Element: MozMousePixelScroll event - Web APIs
...
Element: auxclick event - Web APIs
his can be done by preventing the default behavior of the contextmenu event. Examples In this example we define functions for two event handlers -- onclick and onauxclick. The former changes the color of the button background, while the latter changes the button foreground (text) color. You also can see the two functions in action by trying the demo out with a multi-button mouse (see it live on GitHub; also see the source code). JavaScript let button = document.querySelector('button'); let html = document.querySelector('html'); function random(number) { return Math.floor(Math.random() * number); } function randomColor() { return `rgb(${random(255)}, ${random(255)}, ${random(255)})`; } button.onclick = function() { button.style.backgroundColor = randomColor(); }; button.onauxcl...
Element.currentStyle - Web APIs
totype)) { Object.defineProperty(Element.prototype, "currentStyle", { get: function() { return window.getComputedStyle(this); } }); } Specification Not part of any specification. Microsoft had a description on MSDN. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetcurrentStyle Non-standardChrome No support NoEdge No support NoFirefox No sup...
Element: gesturechange event - Web APIs
It is a proprietary event specific to WebKit. ...
Element.insertAdjacentElement() - Web APIs
When one is clicked, it becomes selected and you can then press the Insert before and Insert after buttons to insert new divs before or after the selected element using insertAdjacentElement(). Specification Specification Status Comment DOMThe definition of 'insertAdjacentElem...
Element.insertAdjacentText() - Web APIs
terend --> Note: The beforebegin and afterend positions work only if the node is in a tree and has an element parent. Example beforeBtn.addEventListener('click', function() { para.insertAdjacentText('afterbegin',textInput.value); }); afterBtn.addEventListener('click', function() { para.insertAdjacentText('beforeend',textInput.value); }); Have a look at our insertAdjacentText.html demo on GitHub (see the source code too.) Here we have a simple paragraph. You can enter some text into the form element, then press the Insert before and Insert after buttons to insert it before or after the existing paragraph text using insertAdjacentText(). Note that the existing text node is not added to -- further text nodes are created containing the new additions. Polyfill You can polyfill the inser...
Element.runtimeStyle - Web APIs
ve higher precedence and modification. It does not modify the style content attribute. It is available in old versions of Microsoft Internet Explorer. Specification Not a part of any specification. Microsoft had a description on MSDN. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetruntimeStyle Non-standardChrome No support NoEdge No support NoFirefox No sup...
Element.scroll() - Web APIs
Web › API › Element › scroll
: 'smooth' }); Specification Specification Status Comment CSS Object Model (CSSOM) View ModuleThe definition of 'element.scroll()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetscrollChrome Full support 45Edge Full support 79Firefox Full support ...
Element.scrollHeight - Web APIs
iquet erat eleifend sit amet sollicitudin felis tempus. Aliquam congue cursus venenatis. Maecenas luctus pellentesque placerat. Mauris nisl odio, condimentum sed fringilla a, consectetur id ligula. Praesent sem sem, aliquet non faucibus vitae, iaculis nec elit. Nullam volutpat, lectus et blandit bibendum, nulla lorem congue turpis, ac pretium tortor sem ut nibh. Donec vel mi in ligula hendrerit sagittis. Donec faucibus viverra fermentum. Fusce in arcu arcu. Nullam at dignissim massa. Cras nibh est, pretium sit amet faucibus eget, sollicitudin in ligula. Vivamus vitae urna mauris, eget euismod nunc. Aenean semper gravida enim non feugiat. In hac habitasse platea dictumst. Cras eleifend nisl volutpat ante condimentum convallis. Donec varius dolor malesuada erat consequat congue. Donec eu lacus ...
Element.scrollLeftMax - Web APIs
he Element.scrollLeftMax read-only property returns a Number representing the maximum left scroll offset possible for the element. Syntax var pxl = element.scrollLeftMax; Specifications This property is not part of any specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetscrollLeftMax Non-standardChrome No support NoEdge No support NoFirefox Full ...
Element.scrollTo() - Web APIs
Web › API › Element › scrollTo
avior: 'smooth' }); Specifications Specification Status Comment CSS Object Model (CSSOM) View ModuleThe definition of 'element.scrollTo()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetscrollToChrome Full support 45Edge Full support 79Firefox Full support ...
Element.slot - Web APIs
Web › API › Element › slot
t.querySelector('my-paragraph span') console.log(slottedSpan.slot); // logs 'my-text' Specifications Specification Status Comment DOMThe definition of 'slot' in that specification. Living Standard Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetslotChrome Full support 53Edge Full support <=79Firefox Full support ...
Encrypted Media Extensions API - Web APIs
Interfaces MediaKeyMessageEvent Contains the content and related data when the content decryption module (CDM) generates a message for the session. MediaKeys Represents a set of keys that an associated HTMLMediaElement can use for decryption of media data during playback. MediaKeySession Represents a context for message exchange with a content decryption module (CDM). MediaKeyStatusMap Is a read-only map of media key statuses by key IDs. ...
Event.initEvent() - Web APIs
Web › API › Event › initEvent
Events Specification, deprecated it, superseded by event constructors. Document Object Model (DOM) Level 2 Events SpecificationThe definition of 'Event.initEvent()' in that specification. Obsolete Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetinitEvent DeprecatedChrome Full support YesEdge Full support 12Firefox Full s...
EventSource() - Web APIs
, defaulting to false, indicating if CORS should be set to include credentials. Examples var evtSource = new EventSource('sse.php'); var eventList = document.querySelector('ul'); evtSource.onmessage = function(e) { var newElement = document.createElement("li"); newElement.textContent = "message: " + e.data; eventList.appendChild(newElement); } Note: You can find a full example on GitHub -- see Simple SSE demo using PHP. Specifications Specification Status Comment HTML Living StandardThe definition of 'EventSource()' in that specification. Living Standard Initial definition ...
EventSource.close() - Web APIs
Web › API › EventSource › close
e attribute to 2 (closed). Note: If the connection is already closed, the method does nothing. Syntax eventSource.close(); Parameters None. Return value Void. Examples var button = document.querySelector('button'); var evtSource = new EventSource('sse.php'); button.onclick = function() { console.log('Connection closed'); evtSource.close(); } Note: You can find a full example on GitHub -- see Simple SSE demo using PHP. Specifications Specification Status Comment HTML Living StandardThe definition of 'close()' in that specification. Living Standard Initial definition ...
EventSource.onerror - Web APIs
The onerror property of the EventSource interface is an EventHandler called when an error occurs and the error event is dispatched on an EventSource object. Syntax eventSource.onerror = function Examples evtSource.onerror = function() { console.log("EventSource failed."); }; Note: You can find a full example on GitHub -- see Simple SSE demo using PHP. Specifications Specification Status Comment HTML Living StandardThe definition of 'onerror' in that specification. Living Standard Initial definition ...
EventSource.onmessage - Web APIs
nt is received, that is when a message is coming from the source. Event objects of onmessage event handers are of type MessageEvent. Syntax eventSource.onmessage = function Examples evtSource.onmessage = function(e) { var newElement = document.createElement("li"); newElement.textContent = "message: " + e.data; eventList.appendChild(newElement); } Note: You can find a full example on GitHub -- see Simple SSE demo using PHP. Specifications Specification Status Comment HTML Living StandardThe definition of 'onmessage' in that specification. Living Standard Initial definition ...
EventSource.onopen - Web APIs
The onopen property of the EventSource interface is an EventHandler called when an open event is received, that is when the connection was just opened. Syntax eventSource.onopen = function Examples evtSource.onopen = function() { console.log("Connection to server opened."); }; Note: You can find a full example on GitHub -- see Simple SSE demo using PHP. Specifications Specification Status Comment HTML Living StandardThe definition of 'onopen' in that specification. Living Standard Initial definition ...
EventSource.readyState - Web APIs
operty of the EventSource interface returns a number representing the state of the connection. Syntax var myReadyState = eventSource.readyState; Value A number representing the state of the connection. Possible values are: 0 -- connecting 1 -- open 2 -- closed Examples var evtSource = new EventSource('sse.php'); console.log(evtSource.readyState); Note: You can find a full example on GitHub -- see Simple SSE demo using PHP. Specifications Specification Status Comment HTML Living StandardThe definition of 'readyState' in that specification. Living Standard Initial definition ...
EventSource.url - Web APIs
Web › API › EventSource › url
The url read-only property of the EventSource interface returns a DOMString representing the URL of the source. Syntax var myUrl = eventSource.url; Value A DOMString representing the URL of the source. Examples var evtSource = new EventSource('sse.php'); console.log(evtSource.url); Note: You can find a full example on GitHub -- see Simple SSE demo using PHP. Specifications Specification Status Comment HTML Living StandardThe definition of 'url' in that specification. Living Standard Initial definition ...
EventSource.withCredentials - Web APIs
EventSource object was instantiated with CORS credentials set. Syntax var myWithCredentials = eventSource.withCredentials; Value A Boolean indicating whether the EventSource object was instantiated with CORS credentials set (true), or not (false, the default). Examples var evtSource = new EventSource('sse.php'); console.log(evtSource.withCredentials); Note: You can find a full example on GitHub -- see Simple SSE demo using PHP. Specifications Specification Status Comment HTML Living StandardThe definition of 'withCredentials' in that specification. Living Standard Initial definition ...
EventSource - Web APIs
document.createElement("li"); newElement.textContent = "message: " + e.data; eventList.appendChild(newElement); } Each received event causes our EventSource object's onmessage event handler to be run. It, in turn, creates a new <li> element and writes the message's data into it, then appends the new element to the list element already in the document. Note: You can find a full example on GitHub -- see Simple SSE demo using PHP. To listen to named events, you'll require a listener for each type of event sent. const sse = new EventSource('/api/v1/sse'); /* This will listen only for events * similar to the following: * * event: notice * data: useful data * id: someid * */ sse.addEventListener("notice", function(e) { console.log(e.data) }) /* Simil...
EventTarget.dispatchEvent() - Web APIs
events. Specifications Specification Status Comment DOMThe definition of 'EventTarget.dispatchEvent()' in that specification. Living Standard Initial definition in the DOM 2 Events specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetdispatchEventChrome Full support 4Edge Full support 12Firefox Full support ...
FederatedCredential - Web APIs
init Options are: provider: A USVString; identifying the credential provider. Specifications Specification Status Comment Credential Management Level 1 Working Draft Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetFederatedCredential() constructor Non-standardChrome Full support 51Edge Full support <=79Fir...
FederatedCredential.protocol - Web APIs
. openidconnect). Examples // TBD Specifications Specification Status Comments Credential Management Level 1The definition of 'protocol' in that specification. Working Draft Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetprotocol ExperimentalChrome Full support 51Edge Full support <=79Firefox ? ...
FederatedCredential.provider - Web APIs
e A USVString containing a credential's federated identity provider. Example // TBD Specifications Specification Status Comments Credential Management Level 1 Working Draft Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetprovider ExperimentalChrome Full support 51Edge Full support <=79Firefox ? ...
FederatedCredential - Web APIs
Store it navigator.credentials.store(cred) .then(function() { // Do something else. }); Specifications Specification Status Comment Credential Management Level 1 Working Draft Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetFederatedCredential ExperimentalChrome Full support 51Edge Full support <=79Firefox ...
FetchEvent.client - Web APIs
Web › API › FetchEvent › client
The FetchEvent.client read-only property returns the Client that the current service worker is controlling. Note: This feature has been deprecated, with its functionality replaced by FetchEvent.clientId and Clients.get(). See this Github issue for discussion/background. Syntax var myClient = FetchEvent.client; Value A Client object. Example self.addEventListener('fetch', function(event) { console.log(event.client); }); ...
FetchEvent.navigationPreload - Web APIs
return fetch(event.request); }()); }); Specifications Specification Status Comment Service WorkersThe definition of 'navigationPreload' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetnavigationPreload ExperimentalChrome Full support 59Edge Full support <=79Firefox ...
File.webkitRelativePath - Web APIs
Specification Status Comment File and Directory Entries APIThe definition of 'webkitRelativePath' in that specification. Draft Initial specification. This API has no official W3C or WHATWG specification. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetwebkitRelativePathChrome Full support 13Prefixed Full support 13Prefixed Prefixed Implemente...
FileEntrySync - Web APIs
eption with the following codes: Exception Description NOT_FOUND_ERR The file does not exist. INVALID_STATE_ERR The file is no longer valid for some reason other than it having been deleted. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetFileEntrySync Non-standardChrome Full support 13Prefixed Full support 13Prefixed Prefixed Im...
FileException - Web APIs
TYPE_MISMATCH_ERR 11 The user has attempted to look up a file or directory, but the Entry found is of the wrong type. For example, the app is accessing a DirectoryEntry when the user is requesting a FileEntry. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetFileException DeprecatedNon-standardChrome No support 13 -- 29Prefixed No support 13 -- 29Prefixed Prefixed Implemented with the v...
FileList - Web APIs
Web › API › FileList
tion Status Comment File APIThe definition of 'FileList' in that specification. Working Draft HTML Living StandardThe definition of 'selected files' in that specification. Living Standard Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetFileListChrome Full support 1Edge Full support 12Firefox Full support ...
FileReaderSync.readAsArrayBuffer() - Web APIs
ceed the limit length defined by each browser. Specifications Specification Status Comment File APIThe definition of 'readAsArrayBufferSync' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetreadAsArrayBufferChrome Full support YesEdge Full support 12Firefox Full supp...
FileReaderSync.readAsBinaryString() - Web APIs
eed the limit length defined by each browser. Specifications Specification Status Comment File APIThe definition of 'readAsBinaryStringSync' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetreadAsBinaryStringChrome Full support YesEdge Full support 12Firefox Full sup...
FileReaderSync.readAsDataURL() - Web APIs
L and exceed the limit length defined by each browser. Specifications Specification Status Comment File APIThe definition of 'readAsDataURL' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetreadAsDataURLChrome Full support YesEdge Full support 12Firefox Full support ...
FileReaderSync.readAsText() - Web APIs
URL and exceed the limit length defined by each browser. Specifications Specification Status Comment File APIThe definition of 'readAsText' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetreadAsTextChrome Full support YesEdge Full support 12Firefox Full support ...
FileReaderSync - Web APIs
DOMString representing the input data as a data URL. Specifications Specification Status Comment File APIThe definition of 'FileReaderSync' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetFileReaderSyncChrome Full support YesEdge Full support 12Firefox Full support...
FileSystem.name - Web APIs
Web › API › FileSystem › name
ng the file system's name. Example // tbd Specifications Specification Status Comment File and Directory Entries APIThe definition of 'name' in that specification. Draft Initial specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetnameChrome Full support 7Edge Full support <=18Firefox Full support ...
FileSystem.root - Web APIs
Web › API › FileSystem › root
e system's root directory. Example // tbd Specifications Specification Status Comment File and Directory Entries APIThe definition of 'root' in that specification. Draft Initial specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetrootChrome Full support 7Edge Full support <=18Firefox Full support ...
FileSystem - Web APIs
ain access to all files and directories in the file system. Specifications Specification Status Comment File and Directory Entries APIThe definition of 'FileSystem' in that specification. Draft Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetFileSystemChrome Full support 7Alternate Name Full support 7Alternate Name Alternate Name Us...
FileSystemDirectoryEntry.createReader() - Web APIs
e array is returned to the caller. Specifications Specification Status Comment File and Directory Entries APIThe definition of 'createReader()' in that specification. Draft Initial specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetcreateReader ExperimentalChrome Full support 13Edge Full support 79Firefox Fu...
FileSystemDirectoryEntry.getDirectory() - Web APIs
stituted into a JavaScript object. Specifications Specification Status Comment File and Directory Entries APIThe definition of 'getDirectory()' in that specification. Draft Initial specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetgetDirectory ExperimentalChrome Full support 8Edge Full support 79Firefox Ful...
FileSystemDirectoryEntry.getFile() - Web APIs
reconstituted into a JavaScript object. Specifications Specification Status Comment File and Directory Entries APIThe definition of 'getFile()' in that specification. Draft Initial specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetgetFile ExperimentalChrome Full support 8Edge Full support 79Firefox Full sup...
FileSystemDirectoryEntry.removeRecursively() - Web APIs
Callback to watch for and handle this, perhaps by trying again. Example directory.removeRecursively(function() { /* The directory was removed successfully */ }, function() { /* an error occurred while removing the directory */ }); Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetremoveRecursively DeprecatedNon-standardChrome Full support 8Edge Full support 79Firefox ...
FileSystemDirectoryEntry - Web APIs
ctories. This has been removed from the spec. Specifications Specification Status Comment File and Directory Entries APIThe definition of 'FileSystemDirectoryEntry' in that specification. Draft Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetFileSystemDirectoryEntry ExperimentalChrome Full support 8Alternate Name Full support 8Alter...
FileSystemDirectoryReader.readEntries() - Web APIs
ake a look at the resulting output. Specifications Specification Status Comment File and Directory Entries API Draft Draft of proposed API This API has no official W3C or WHATWG specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetreadEntries DeprecatedNon-standardChrome Full support 8Edge ? Firefox Full support ...
FileSystemDirectoryReader - Web APIs
leEntry or FileSystemDirectoryEntry. Specifications Specification Status Comment File and Directory Entries API Draft Draft of proposed API This API has no official W3C or WHATWG specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetFileSystemDirectoryReader DeprecatedNon-standardChrome Full support 8Alternate Name Full support ...
FileSystemEntry.copyTo() - Web APIs
into a more permanent "log" directory. workingDirectory.getFile("tmp/log.txt", {}, function(fileEntry) { workingDirectory.getDirectory("log", {}, function(dirEntry) { fileEntry.copyTo(dirEntry); }, handleError); }, handleError); Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetcopyTo ExperimentalDeprecatedNon-standardChrome Full support 8Edge Full support 79Firefox ...
FileSystemEntry.filesystem - Web APIs
DirEntry = fileEntry.filesystem.root; Specifications Specification Status Comment File and Directory Entries APIThe definition of 'filesystem' in that specification. Draft Initial specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetfilesystem ExperimentalChrome Full support 8Edge Full support 79Firefox Full ...
FileSystemEntry.fullPath - Web APIs
s Specification Status Comment File and Directory Entries APIThe definition of 'fullPath' in that specification. Draft Initial specification. This API has no official W3C or WHATWG specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetfullPath ExperimentalChrome Full support 8Edge Full support 79Firefox Full su...
FileSystemEntry.getMetadata() - Web APIs
{ fileEntry.getMetadata(function(metadata) { if (metadata.size > 1048576) { workingDirectory.getDirectory("log", {}, function(dirEntry) { fileEntry.moveTo(dirEntry); }, handleError); } }); }, handleError); Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetgetMetadata ExperimentalDeprecatedNon-standardChrome Full support 8Edge Full support 79Firefo...
FileSystemEntry.getParent() - Web APIs
n the File and Directory Entries API. Specifications Specification Status Comment File and Directory Entries APIThe definition of 'getParent()' in that specification. Draft Initial specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetgetParent ExperimentalChrome Full support 8Edge Full support 79Firefox No sup...
FileSystemEntry.isDirectory - Web APIs
ed file system entry specified."); } Specifications Specification Status Comment File and Directory Entries APIThe definition of 'isDirectory' in that specification. Draft Initial specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetisDirectory ExperimentalChrome Full support 8Edge Full support 79Firefox Full...
FileSystemEntry.isFile - Web APIs
pported file system entry specified."); } Specifications Specification Status Comment File and Directory Entries APIThe definition of 'isFile' in that specification. Draft Initial specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetisFile ExperimentalChrome Full support 8Edge Full support 79Firefox Full supp...
FileSystemEntry.moveTo() - Web APIs
{ fileEntry.getMetadata(function(metadata) { if (metadata.size > 1048576) { workingDirectory.getDirectory("log", {}, function(dirEntry) { fileEntry.moveTo(dirEntry); }, handleError); } }); }, handleError); Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetmoveTo ExperimentalDeprecatedNon-standardChrome Full support 8Edge Full support 79Firefox ...
FileSystemEntry.name - Web APIs
&& entry.name.endsWith("." + extension)); } Specifications Specification Status Comment File and Directory Entries APIThe definition of 'name' in that specification. Draft Initial specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetname ExperimentalChrome Full support 8Edge Full support 79Firefox Full suppor...
FileSystemEntry.remove() - Web APIs
resources. Example This example deletes a temporary work file. workingDirectory.getFile("tmp/workfile.json", {}, function(fileEntry) { fileEntry.remove(function() { /* the file was removed successfully */ }); }, handleError); Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetremove ExperimentalDeprecatedNon-standardChrome Full support 8Edge Full support 79Firefox ...
FileSystemEntry.toURL() - Web APIs
ppendChild(img); Assuming the scenario mentioned before the code, the result would be HTML that looks like this being appended to the end of the document: <img src="filesystem:http://my-awesome-website.woot/temporary/awesomesauce.jpg"> Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternettoURL ExperimentalDeprecatedNon-standardChrome Full support 8Edge Full support 79Firefox ...
FileSystemEntry - Web APIs
uses the URL scheme "filesystem:". Specifications Specification Status Comment File and Directory Entries API Draft Draft of proposed API This API has no official W3C or WHATWG specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetFileSystemEntry ExperimentalChrome Full support 8Alternate Name Full support 8Alternate Name...
FileSystemFileEntry.createWriter() - Web APIs
text which was passed in and creates a new Blob object of type text/plain that contains the passed text. This blob is then output to the FileWriter object to be written to the file. This API has no official W3C or WHATWG specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetcreateWriter DeprecatedNon-standardChrome Full support 8Edge Full support 79Firefox ...
FileSystemFileEntry.file() - Web APIs
et up to call the errorCallback specified. Specifications Specification Status Comment File and Directory Entries APIThe definition of 'file()' in that specification. Draft Initial specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetfileChrome Full support 8Edge Full support 79Firefox Full support ...
FileSystemFileEntry - Web APIs
1024, onInitFs, errorHandler); Specifications Specification Status Comment File and Directory Entries APIThe definition of 'FileSystemFileEntry' in that specification. Draft Draft of proposed API Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetFileSystemFileEntryChrome Full support 8Alternate Name Full support 8Alternate Name Alternat...
FileSystemFlags.create - Web APIs
lusive is irrelevant and ignored. Specifications Specification Status Comment File and Directory Entries APIThe definition of 'FileSystemFlags' in that specification. Draft Initial specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetcreate ExperimentalChrome Full support 13Prefixed Full support 13Prefixed Prefixed Implement...
FileSystemFlags.exclusive - Web APIs
lusive is irrelevant and ignored. Specifications Specification Status Comment File and Directory Entries APIThe definition of 'FileSystemFlags' in that specification. Draft Initial specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetexclusive ExperimentalChrome Full support 13Prefixed Full support 13Prefixed Prefixed Implem...
FileSystemFlags - Web APIs
lusive is irrelevant and ignored. Specifications Specification Status Comment File and Directory Entries APIThe definition of 'FileSystemFlags' in that specification. Draft Initial specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetFileSystemFlags ExperimentalChrome Full support 13Prefixed Full support 13Prefixed Prefixed ...
FileSystemSync - Web APIs
Description name readonly DOMString Name of the file system. The name must be unique across the list of exposed file systems. root readonly DirectoryEntry The root directory of the file system. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetFileSystemSync Non-standardChrome Full support 13Prefixed Full support 13Prefixed Prefixed I...
FontFace.display - Web APIs
Web › API › FontFace › display
orking Draft Initial definition. CSS Fonts Module Level 4The definition of 'font-display' in that specification. Working Draft Defines the values for the display property. (They are the same as for font-display.) Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetdisplay ExperimentalChrome Full support 60Edge Full support 79Firefox Full su...
FontFaceSetLoadEvent.FontFaceSetLoadEvent() - Web APIs
ontFace instances. Specifications Specification Status Comment CSS Font Loading Module Level 3The definition of 'FontFaceSetLoadEvent()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetFontFaceSetLoadEvent() constructor ExperimentalChrome Full support 57Edge Full support <=79Fi...
FontFaceSetLoadEvent.fontfaces - Web APIs
alue An array of FontFace instance. Specifications Specification Status Comment CSS Font Loading Module Level 3The definition of 'fontfaces' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetfontfaces ExperimentalChrome Full support 35Edge Full support <=79Firefox Ful...
FontFaceSetLoadEvent - Web APIs
ts a single usable font. Specifications Specification Status Comment CSS Font Loading Module Level 3The definition of 'FontFaceSetLoadEvent' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetFontFaceSetLoadEvent ExperimentalChrome Full support 35Edge Full support <=79Firefox ...
GainNode() - Web APIs
Web › API › GainNode › GainNode
. Return value A new GainNode object instance. Specifications Specification Status Comment Web Audio APIThe definition of 'GainNode()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetGainNode() constructorChrome Full support 55Notes Full support 55Notes Notes Before Chrome 5...
Gamepad.buttons - Web APIs
Web › API › Gamepad › buttons
g buttons, such as the triggers on many modern gamepads. The values are normalized to the range 0.0 - 1.0, with 0.0 representing a button that is not pressed, and 1.0 representing a button that is fully pressed. ...
Gamepad.id - Web APIs
Web › API › Gamepad › id
For example, a PS2 controller returned 810-3-USB Gamepad. ...
GamepadButton - Web APIs
normalized to the range 0.0 --1.0, with 0.0 representing a button that is not pressed, and 1.0 representing a button that is fully pressed. GamepadButton.pressed Read only A Boolean value indicating whether the button is currently pressed (true) or unpressed (false). ...
Geolocation.getCurrentPosition() - Web APIs
meout: integer (milliseconds) - amount of time before the error callback is invoked, if 0 it will never invoke. enableHighAccuracy: false | true Examples var options = { enableHighAccuracy: true, timeout: 5000, maximumAge: 0 }; function success(pos) { var crd = pos.coords; console.log('Your current position is:'); console.log(`Latitude : ${crd.latitude}`); console.log(`Longitude: ${crd.longitude}`); console.log(`More or less ${crd.accuracy} meters.`); } function error(err) { console.warn(`ERROR(${err.code}): ${err.message}`); } navigator.geolocation.getCurrentPosition(success, error, options); Specifications Specification Status Comment Geolocation API Recommendation Initial specification. ...
GeolocationCoordinates.accuracy - Web APIs
The GeolocationCoordinates.accuracy read-only property is a strictly positive double representing the accuracy, with a 95% confidence level, of the GeolocationCoordinates.latitude and GeolocationCoordinates.longitude properties expressed in meters. Syntax let acc = geolocationCoordinatesInstance.accuracy Value A positive double representing the accuracy, with a 95% confidence level, of the GeolocationCoordinates.latitude and GeolocationCoordinates.longitude properties expressed in meters. Specifications Specification Status Comment Geolocation APIThe definition of 'Coordinates.accuracy' in that specification. Recommendation Initial definition ...
GeolocationPosition.coords - Web APIs
It also contains accuracy information about these values. Syntax let coord = geolocationPositionInstance.coords Value A GeolocationCoordinates object instance. ...
GlobalEventHandlers.onauxclick - Web APIs
o use the EventTarget.addEventListener() method instead, since it's more flexible. Example In this example we define functions for two event handlers -- onclick and onauxclick. The former changes the color of the button background, while the latter changes the button foreground (text) color. You can see the two functions in action by trying the demo out with a multi-button mouse (see it live on GitHub; also see the source code). var button = document.querySelector('button'); var html = document.querySelector('html'); function random(number) { return Math.floor(Math.random() * number); } button.onclick = function() { var rndCol = 'rgb(' + random(255) + ',' + random(255) + ',' + random(255) + ')'; button.style.backgroundColor = rndCol; }; button.onauxclick = function() { var rndCo...
GlobalEventHandlers.onkeypress - Web APIs
Specifications Specification Status Comment HTML Living StandardThe definition of 'onkeypress' in that specification. Living Standard ...
HTMLAnchorElement.referrerPolicy - Web APIs
header. Specifications Specification Status Comment Referrer PolicyThe definition of 'referrerPolicy attribute' in that specification. Candidate Recommendation Added the referrerPolicy property. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetreferrerPolicyChrome Full support 51Edge Full support 79Firefox Full support ...
HTMLAreaElement.referrerPolicy - Web APIs
header. Specifications Specification Status Comment Referrer PolicyThe definition of 'referrerpolicy attribute' in that specification. Candidate Recommendation Added the referrerPolicy property. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetreferrerPolicyChrome Full support 51Edge Full support 79Firefox Full support ...
HTMLDialogElement.close() - Web APIs
Specifications Specification Status Comment HTML Living StandardThe definition of 'close()' in that specification. Living Standard HTML 5.1The definition of 'close()' in that specification. Recommendation ...
HTMLDialogElement.open - Web APIs
Specifications Specification Status Comment HTML Living StandardThe definition of 'open' in that specification. Living Standard HTML 5.1The definition of 'open' in that specification. Recommendation ...
HTMLDialogElement.returnValue - Web APIs
Specifications Specification Status Comment HTML Living StandardThe definition of 'returnvalue' in that specification. Living Standard HTML 5.1The definition of 'returnvalue' in that specification. Recommendation ...
HTMLDialogElement.showModal() - Web APIs
Specifications Specification Status Comment HTML Living StandardThe definition of 'showModal()' in that specification. Living Standard HTML 5.1The definition of 'showModal()' in that specification. Recommendation ...
HTMLDialogElement - Web APIs
Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLDialogElement' in that specification. Living Standard HTML 5.2The definition of '<dialog>' in that specification. Recommendation Initial definition ...
HTMLElement.offsetParent - Web APIs
ment in which the current element is offset. Specification Specification Status Comment CSS Object Model (CSSOM) View ModuleThe definition of 'offsetParent' in that specification. Working Draft Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetoffsetParentChrome Full support 1Edge Full support 12Firefox Full support ...
HTMLElement.offsetTop - Web APIs
fset more // than 10 pixels from its parent } Specification Specification Status Comment CSS Object Model (CSSOM) View ModuleThe definition of 'offsetTop' in that specification. Working Draft Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetoffsetTopChrome Full support 1Edge Full support 12Firefox Full support ...
HTMLElement: pointerdown event - Web APIs
The pointerdown event is fired when a pointer becomes active. For mouse, it is fired when the device transitions from no buttons depressed to at least one button depressed. For touch, it is fired when physical contact is made with the digitizer. For pen, it is fired when the stylus makes physical contact with the digitizer. Bubbles Yes Cancelable Yes Interface PointerEvent Event handler property onpointerdown Examples Using addEventListener(): const para = document.querySelector('p'); para.addEventListener('pointerdown', (event) => { console.log('Pointer down event'); }); Using the onpointerdown event handler property: const para = document.querySelector('p'); para.onpointerdown = (event) => { console.log('Pointer down event')...
HTMLElement: pointerleave event - Web APIs
The pointerleave event is fired when a pointing device is moved out of the hit test boundaries of an element. For pen devices, this event is fired when the stylus leaves the hover range detectable by the digitizer. Bubbles No Cancelable No Interface PointerEvent Event handler property onpointerleave Examples Using addEventListener(): const para = document.querySelector('p'); para.addEventListener('pointerleave', (event) => { console.log('Pointer left element'); }); Using the onpointerleave event handler property: const para = document.querySelector('p'); para.onpointerleave = (event) => { console.log('Pointer left element'); }; Specifications Specification Status Pointer Events Obsolete ...
HTMLElement: pointerout event - Web APIs
The pointerout event is fired for several reasons including: pointing device is moved out of the hit test boundaries of an element; firing the pointerup event for a device that does not support hover (see pointerup); after firing the pointercancel event (see pointercancel); when a pen stylus leaves the hover range detectable by the digitizer. Bubbles Yes Cancelable Yes Interface PointerEvent Event handler property onpointerout Examples Using addEventListener(): const para = document.querySelector('p'); para.addEventListener('pointerout', (event) => { console.log('Pointer moved out'); }); Using the onpointerout event handler property: const para = document.querySelector('p'); para.onpointerout = (event) => { console.log('Pointe...
HTMLIFrameElement.allowPaymentRequest - Web APIs
quest' in that specification. Candidate Recommendation Adds allowPaymentRequest property. HTML Living StandardThe definition of 'HTMLIFrameElement: allowPaymentRequest' in that specification. Living Standard Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetallowPaymentRequest ExperimentalChrome Full support 60Disabled Full support 60Disabled Disab...
HTMLIFrameElement.csp - Web APIs
A content security policy. Specifications Specification Status Comment Content Security Policy: Embedded EnforcementThe definition of 'csp' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetcsp ExperimentalChrome Full support 61Edge Full support <=79Firefox ? ...
HTMLIFrameElement.referrerPolicy - Web APIs
attribute' in that specification. Candidate Recommendation Added the referrerPolicy attribute. HTML Living StandardThe definition of 'HTMLIFrameElement: referrerPolicy' in that specification. Living Standard Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetreferrerPolicyChrome Full support 51Edge Full support 79Firefox Full support ...
HTMLIFrameElement.src - Web APIs
he image using the complete URL as the referrer Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLIFrameElement: src' in that specification. Living Standard Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetsrcChrome Full support 43Edge Full support 12Firefox Full support ...
HTMLImageElement.align - Web APIs
HTML Living StandardThe definition of 'HTMLImageElement.align' in that specification. Living Standard HTML 4.01 SpecificationThe definition of 'HTMLImageElement.align' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetalignChrome Full support 1Edge Full support 12Firefox Full support ...
HTMLImageElement.alt - Web APIs
literally have its alt attribute set to "A yellow teapot". Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLImageElement.alt' in that specification. Unknown Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetaltChrome Full support 1Edge Full support 12Firefox Full support ...
HTMLImageElement.border - Web APIs
HTML Living StandardThe definition of 'HTMLImageElement.border' in that specification. Living Standard HTML 4.01 SpecificationThe definition of 'HTMLImageElement.border' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetborderChrome Full support 1Edge Full support 12Firefox Full support ...
HTMLImageElement.complete - Web APIs
doing this until the image is fully loaded */ } } Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLImageElement.complete' in that specification. Unknown Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetcompleteChrome Full support 1Edge Full support 12Firefox Full support ...
HTMLImageElement.crossOrigin - Web APIs
ily: Courier, monospace; width: 95%; } Result Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLImageElement.crossOrigin' in that specification. Unknown Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetcrossOriginChrome Full support 13Edge Full support 12Firefox Full support ...
HTMLImageElement.currentSrc - Web APIs
} document.body.appendChild(p); Result Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLImageElement.currentSrc' in that specification. Living Standard Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetcurrentSrc ExperimentalChrome Full support 45Edge Full support 13Firefox Full...
HTMLImageElement.decoding - Web APIs
new Image(); img.decoding = 'sync'; img.src = 'img/logo.png'; Specifications Specification Status Comment HTML Living StandardThe definition of 'decoding' in that specification. Living Standard Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetdecodingChrome Full support 65Edge Full support <=79Firefox Full support ...
HTMLImageElement.height - Web APIs
ple may be easier to try out in its own window. Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLImageElement.height' in that specification. Living Standard Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetheightChrome Full support 1Edge Full support 12Firefox Full support ...
HTMLImageElement.hspace - Web APIs
that specification. Living Standard HTML 4.01 SpecificationThe definition of 'HTMLImageElement.hspace' in that specification. Recommendation Provides additional details not present in the newer specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternethspaceChrome Full support 1Edge Full support 12Firefox Full support ...
HTMLImageElement.isMap - Web APIs
<img> element to adopt interactive content mode. Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLImageElement.isMap' in that specification. Living Standard Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetisMapChrome Full support 1Edge Full support 12Firefox Full support ...
HTMLImageElement.longDesc - Web APIs
tus Comment HTML 4.01 SpecificationThe definition of 'HTMLImageElement.longDesc' in that specification. Recommendation Provides an actual description of this property; the HTML5 spec only says it's deprecated. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetlongDescChrome Full support 1Edge Full support 12Firefox Full support ...
HTMLImageElement.lowSrc - Web APIs
d and balanced for appearance versus size. Usage notes lowSrc is a strange case. It was never technically part of the HTML specification (it was a Mozilla extension to HTML); however, HTML 5 does list it among the obsolete attributes. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetlowSrcChrome Full support 1Edge Full support <=18Firefox Full support ...
HTMLImageElement.name - Web APIs
ement.name' in that specification. Living Standard HTML 4.01 SpecificationThe definition of 'HTMLImageElement.name' in that specification. Recommendation Provides additional details not available in the HTML 5 Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetnameChrome Full support 1Edge Full support 12Firefox Full support ...
HTMLImageElement.naturalHeight - Web APIs
examine its width and height. Result Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLImageElement.naturalheight' in that specification. Living Standard Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetnaturalHeightChrome Full support 1Edge Full support 12Firefox Full support ...
HTMLImageElement.naturalWidth - Web APIs
o examine its width and height. Result Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLImageElement.naturalWidth' in that specification. Living Standard Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetnaturalWidthChrome Full support 1Edge Full support 12Firefox Full support ...
HTMLImageElement.referrerPolicy - Web APIs
eferrer Specifications Specification Status Comment Referrer PolicyThe definition of 'referrerPolicy attribute' in that specification. Candidate Recommendation Added the referrerPolicy property. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetreferrerPolicyChrome Full support 51Edge Full support 79Firefox Full support ...
HTMLImageElement.sizes - Web APIs
his result may be viewed in its own window here. Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLImageElement.sizes' in that specification. Living Standard Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetsizes ExperimentalChrome Full support 45Edge Full support 13Firefox Full supp...
HTMLImageElement.src - Web APIs
n will ignore src in this situation. HTML Result Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLImageElement.src' in that specification. Living Standard Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetsrcChrome Full support 1Edge Full support 12Firefox Full support ...
HTMLImageElement.srcset - Web APIs
l examples, see our guide to responsive images. Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLImageElement.srcset' in that specification. Living Standard Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetsrcset ExperimentalChrome Full support 34Edge Full support 12Firefox Full sup...
HTMLImageElement.vspace - Web APIs
nt.vspace' in that specification. Living Standard HTML 4.01 SpecificationThe definition of 'HTMLImageElement.vspace' in that specification. Recommendation The HTML 4.01 specification offers additional details. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetvspaceChrome Full support 1Edge Full support 12Firefox Full support ...
HTMLImageElement.width - Web APIs
mple may be easier to try out in its own window. Specifications Specification Status Comment HTML Living StandardThe definition of 'HTMLImageElement.width' in that specification. Living Standard Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetwidthChrome Full support 1Edge Full support 12Firefox Full support ...
HTMLImageElement.x - Web APIs
The resulting table looks like this: Specifications Specification Status Comment CSS Object Model (CSSOM) View ModuleThe definition of 'HTMLImageElement.x' in that specification. Working Draft Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetxChrome Full support 1Edge Full support 12Firefox Full support ...
HTMLImageElement.y - Web APIs
The resulting table looks like this: Specifications Specification Status Comment CSS Object Model (CSSOM) View ModuleThe definition of 'HTMLImageElement.y' in that specification. Working Draft Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetyChrome Full support 1Edge Full support 12Firefox Full support ...
HTMLInputElement.webkitEntries - Web APIs
Specification Status Comment File and Directory Entries APIThe definition of 'webkitEntries' in that specification. Draft Initial specification. This API has no official W3C or WHATWG specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetwebkitEntries Non-standardChrome Full support 13Edge Full support <=18Firefox ...
HTMLInputElement.webkitdirectory - Web APIs
Specification Status Comment File and Directory Entries APIThe definition of 'webkitdirectory' in that specification. Draft Initial specification. This API has no official W3C or WHATWG specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetwebkitdirectory Non-standardChrome Full support 13Edge Full support 13Firefox ...
HTMLLinkElement.as - Web APIs
kElement.as HTMLLinkElement.as = as Value A DOMString. Specifications Specification Status Comment PreloadThe definition of 'as' in that specification. Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetas ExperimentalChrome Full support 50Edge Full support 17Firefox Full support...
HTMLMediaElement.controlsList - Web APIs
screen, and noremoteplayback. Syntax var domTokenList = HTMLMediaElement.controlsList; Value A DOMTokenList. Specifications Specification Status Comment Controls List API: Solution outline Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetcontrolsListChrome Full support 58Edge Full support <=79Firefox ? ...
HTMLMediaElement.onencrypted - Web APIs
crypted = function(encrypted) { ... } Specifications Specification Status Comment Encrypted Media ExtensionsThe definition of 'onencrypted' in that specification. Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetonencryptedChrome Full support YesEdge Full support 13Firefox Full support ...
HTMLMediaElement.onwaitingforkey - Web APIs
= function(waitingforkey) { ... } Specifications Specification Status Comment Encrypted Media ExtensionsThe definition of 'onwaitingforkey' in that specification. Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetonwaitingforkeyChrome Full support 55Edge Full support 79Firefox Full support...
HTMLMediaElement.setMediaKeys() - Web APIs
o the passed instance of MediaKeys. Specifications Specification Status Comment Encrypted Media ExtensionsThe definition of 'setMediaKeys()' in that specification. Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetsetMediaKeysChrome Full support YesEdge Full support 13Firefox Full support ...
HTMLOrForeignElement.nonce - Web APIs
tent attributes like this: script[nonce~=whatever] { background: url("https://evil.com/nonce?whatever"); } Specifications Specification HTML Living StandardThe definition of 'nonce' in that specification. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetnonceChrome Full support 61Edge Full support 79Firefox Full support ...
HTMLScriptElement.referrerPolicy - Web APIs
attribute' in that specification. Candidate Recommendation Added the referrerPolicy attribute. HTML Living StandardThe definition of 'HTMLScriptElement: referrerPolicy' in that specification. Living Standard Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetreferrerPolicyChrome Full support 70Edge Full support <=79Firefox Full suppor...
HTMLSlotElement.assignedElements() - Web APIs
ements = slots.assignedElements({flatten: true}); Specifications Specification Status Comment HTML Living StandardThe definition of 'assignedElements()' in that specification. Living Standard Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetassignedElements ExperimentalChrome Full support 65Edge Full support 79Firefox ...
HTMLSlotElement.name - Web APIs
ng which slot has changed, and what the new node inside the slot is. Specifications Specification Status Comment HTML Living StandardThe definition of 'name' in that specification. Living Standard Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetname ExperimentalChrome Full support 53Edge Full support 79Firefox Full suppo...
HTMLTextAreaElement - Web APIs
ertMetachars(' :-)');">smile</span> | etc. etc.&nbsp;]</p> <p><textarea name="myTxtArea" rows="10" cols="50">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut facilisis, arcu vitae adipiscing placerat, nisl lectus accumsan nisi, vitae iaculis sem neque vel lectus. Praesent tristique commodo lorem quis fringilla. Sed ac tellus eros. Sed consectetur eleifend felis vitae luctus. Praesent sagittis, est eget bibendum tincidunt, ligula diam tincidunt augue, a fermentum odio velit eget mi. Phasellus mattis, elit id fringilla semper, orci magna cursus ligula, non venenatis lacus augue sit amet dui. Pellentesque lacinia odio id nisi pulvinar commodo tempus at odio. Ut consectetur eros porttitor nunc mollis ultrices. Aenean porttitor, purus sollicitudin viverra auctor, neque erat blandit sapi...
HTMLTimeElement.dateTime - Web APIs
-HHMM -HH:MM Z +0200 +04:30 -0300 -08:00 Valid global date and time string Any combination of a valid local date and time string followed by a valid time-zone offset string 2013-12-25 11:12+0200 1972-07-25 13:43:07+04:30 1941-03-15 07:06:23.678Z 2013-12-25T11:12-08:00 Valid week string YYYY-WWW 2013-W46 Four or more ASCII digits YYYY 2013, 0001 Valid duration string PdDThHmMsS PdDThHmMs.XS PdDThHmMs.XXS PdDThHmMs.XXXS PThHmMsS PThHmMs.XS PThHmMs.XXS PThHmMs.XXXS ww dd hh mm ss P12DT7H12M13S P12DT7H12M13.3S P12DT7H12M13.45S P12DT7H12M13.455S PT7H12M13S PT7H12M13.2S PT7H12M13.56S PT7H12M13.999S 7d 5h 24m 13s Syntax dateTimeString ...
HashChangeEvent - Web APIs
Basically, those scripts check the location.hash at a regular interval. Here is a version that allows only one handler to be bound to the onhashchange property: ;(function(window) { // Exit if the browser implements that event if ( "onhashchange" in window.document.body ) { return; } var location = window.location, oldURL = location.href, oldHash = location.hash; ...
History.back() - Web APIs
Web › API › History › back
L Living StandardThe definition of 'History.back()' in that specification. Living Standard No change from HTML5. HTML5The definition of 'History.back()' in that specification. Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetbackChrome Full support YesEdge Full support 12Firefox Full support ...
History.forward() - Web APIs
Web › API › History › forward
t HTML Living StandardThe definition of 'History' in that specification. Living Standard No change from HTML5. HTML5The definition of 'History' in that specification. Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetforwardChrome Full support YesEdge Full support 12Firefox Full support ...
History.scrollRestoration - Web APIs
definition of 'scroll restoration mode' in that specification. Living Standard No change from HTML5. HTML5The definition of 'History.scrollRestoration' in that specification. Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetscrollRestorationChrome Full support 46Edge Full support 79Firefox Full suppo...
Ajax navigation example - Web APIs
This is an example of an AJAX website composed only of three pages (first_page.php, second_page.php and third_page.php). To see how it works, please create the following files (or git clone https://github.com/giabao/mdn-ajax-nav-example.git ): Note: For fully integrating the <form> elements within this mechanism, please take a look at the paragraph Submitting forms and uploading files. first_page.php: <?php $page_title = "First page"; $as_json = false; if (isset($_GET["view_as"]) && $_GET["view_as"] == "json") { $as_json = true; ob_start(); } else { ?> <!doctype html> <html> <head> <?php include "include/header.php"; echo "<title>" . $page_title . "</title>"; ?> </head> <body> <?php include "include/before_content.php"; ?> <p>Th...
IDBCursor.advance() - Web APIs
Web › API › IDBCursor › advance
Comment Indexed Database API 2.0The definition of 'advance()' in that specification. Recommendation Indexed Database API DraftThe definition of 'advance()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetadvanceChrome Full support 24 Full support 24 No support 23 -- 24Pr...
IDBCursor.continue() - Web APIs
Comment Indexed Database API 2.0The definition of 'continue()' in that specification. Recommendation Indexed Database API DraftThe definition of 'continue()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetcontinueChrome Full support 24 Full support 24 No support 23 -- 24P...
IDBCursor.delete() - Web APIs
Web › API › IDBCursor › delete
us Comment Indexed Database API 2.0The definition of 'delete()' in that specification. Recommendation Indexed Database API DraftThe definition of 'delete()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetdeleteChrome Full support 24 Full support 24 No support 23 -- 24Pre...
IDBCursor.direction - Web APIs
s Comment Indexed Database API 2.0The definition of 'direction' in that specification. Recommendation Indexed Database API DraftThe definition of 'direction' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetdirectionChrome Full support 24 Full support 24 No support 23 -- 24...
IDBCursor.key - Web APIs
Web › API › IDBCursor › key
Status Comment Indexed Database API 2.0The definition of 'key' in that specification. Recommendation Indexed Database API DraftThe definition of 'key' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetkeyChrome Full support 24 Full support 24 No support 23 -- 24Prefix...
IDBCursor.primaryKey - Web APIs
Comment Indexed Database API 2.0The definition of 'primaryKey' in that specification. Recommendation Indexed Database API DraftThe definition of 'primaryKey' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetprimaryKeyChrome Full support 24 Full support 24 No support 23 -- 2...
IDBCursor.request - Web APIs
Web › API › IDBCursor › request
('Entries all displayed.'); } }; }; Specification Specification Status Comment Indexed Database API DraftThe definition of 'request' in that specification. Recommendation Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetrequestChrome Full support 76Edge Full support 79Firefox Full support ...
IDBCursor.source - Web APIs
Web › API › IDBCursor › source
atus Comment Indexed Database API 2.0The definition of 'source' in that specification. Recommendation Indexed Database API DraftThe definition of 'source' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetsourceChrome Full support 24 Full support 24 No support 23 -- 24Pre...
IDBCursor.update() - Web APIs
Web › API › IDBCursor › update
Comment Indexed Database API 2.0The definition of 'update()' in that specification. Recommendation Indexed Database API DraftThe definition of 'update()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetupdateChrome Full support 24 Full support 24 No support 23 -- 24Pre...
IDBCursorWithValue.value - Web APIs
Comment Indexed Database API 2.0The definition of 'source' in that specification. Recommendation Indexed Database API DraftThe definition of 'IDBDatabase' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetvalueChrome Full support 24 Full support 24 No support 23 -- 24Pref...
IDBCursorWithValue - Web APIs
Indexed Database API 2.0The definition of 'IDBCursorWithValue' in that specification. Recommendation Indexed Database API DraftThe definition of 'IDBCursorWithValue' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetIDBCursorWithValueChrome Full support 24 Full support 24 No support ...
IDBDatabase.close() - Web APIs
Web › API › IDBDatabase › close
tus Comment Indexed Database API 2.0The definition of 'close()' in that specification. Recommendation Indexed Database API DraftThe definition of 'close()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetcloseChrome Full support 24 Full support 24 No support 23 -- 24Pref...
IDBDatabase.createObjectStore() - Web APIs
Indexed Database API 2.0The definition of 'createObjectStore()' in that specification. Recommendation Indexed Database API DraftThe definition of 'createObjectStore()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetcreateObjectStoreChrome Full support 24 Full support 24 No support ...
IDBDatabase.deleteObjectStore() - Web APIs
Indexed Database API 2.0The definition of 'deleteObjectStore()' in that specification. Recommendation Indexed Database API DraftThe definition of 'deleteObjectStore()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetdeleteObjectStoreChrome Full support 24 Full support 24 No support ...
IDBDatabase.name - Web APIs
Web › API › IDBDatabase › name
Status Comment Indexed Database API 2.0The definition of 'name' in that specification. Recommendation Indexed Database API DraftThe definition of 'name' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetnameChrome Full support 24 Full support 24 No support 23 -- 24Prefi...
IDBDatabase.objectStoreNames - Web APIs
Indexed Database API 2.0The definition of 'objectStoreNames' in that specification. Recommendation Indexed Database API DraftThe definition of 'objectStoreNames' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetobjectStoreNamesChrome Full support 24 Full support 24 No support 2...
IDBDatabase.onabort - Web APIs
tus Comment Indexed Database API 2.0The definition of 'onabort' in that specification. Recommendation Indexed Database API DraftThe definition of 'onabort' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetonabortChrome Full support 24 Full support 24 No support 23 -- 24Pr...
IDBDatabase.onclose - Web APIs
he database "' + db.name + '" has unexpectedly closed.'); }; Specifications Specification Status Comment Indexed Database API DraftThe definition of 'onclose' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetoncloseChrome Full support 31Notes Full support 31Notes Notes approxEdge Ful...
IDBDatabase.onerror - Web APIs
tus Comment Indexed Database API 2.0The definition of 'onerror' in that specification. Recommendation Indexed Database API DraftThe definition of 'onerror' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetonerrorChrome Full support 24 Full support 24 No support 23 -- 24Pr...
IDBDatabase.onversionchange - Web APIs
Indexed Database API 2.0The definition of 'onversionchange' in that specification. Recommendation Indexed Database API DraftThe definition of 'onversionchange' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetonversionchangeChrome Full support 24 Full support 24 No support 23...
IDBDatabase.transaction() - Web APIs
ment Indexed Database API 2.0The definition of 'transaction()' in that specification. Recommendation Indexed Database API DraftThe definition of 'transaction()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternettransactionChrome Full support 24 Full support 24 No support 23 -- ...
IDBDatabase.version - Web APIs
tus Comment Indexed Database API 2.0The definition of 'version' in that specification. Recommendation Indexed Database API DraftThe definition of 'version' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetversionChrome Full support 24 Full support 24 No support 23 -- 24Pr...
IDBDatabase - Web APIs
Indexed Database API 2.0The definition of 'IDBDatabase' in that specification. Recommendation Initial version Indexed Database API DraftThe definition of 'IDBDatabase' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetIDBDatabaseChrome Full support 24 Full support 24 No support 23 -- ...
IDBDatabaseException - Web APIs
not covered by any other error code--for example, a failure due to disk IO errors. VER_ERR 12 A request to open a database with a version lower than the one it already has. This can only happen with IDBOpenDBRequest. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetIDBDatabaseException DeprecatedNon-standardChrome Full support 12Prefixed Full support 12Pre...
IDBEnvironment - Web APIs
ich 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; }; } Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetIDBEnvironment DeprecatedNon-standardChrome Full support 24 Full support 24 No ...
IDBFactory.cmp() - Web APIs
Web › API › IDBFactory › cmp
Status Comment Indexed Database API 2.0The definition of 'cmp()' in that specification. Recommendation Indexed Database API DraftThe definition of 'cmp()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetcmpChrome Full support 24 Full support 24 No support 23 -- 24Prefix...
databases - Web APIs
s => { console.log(databases) }) Specifications Specification Status Comment Indexed Database API DraftThe definition of 'databases()' in that specification. Recommendation Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetdatabases ExperimentalChrome Full support 71Edge Full support 79Firefox No s...
IDBFactory.deleteDatabase() - Web APIs
base API DraftThe definition of 'deleteDatabase()' in that specification. Recommendation Indexed Database API 2.0The definition of 'deleteDatabase()' in that specification. Recommendation Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetdeleteDatabaseChrome Full support 24 Full support 24 No support 23 ...
IDBFactory.open() - Web APIs
Web › API › IDBFactory › open
tatus Comment Indexed Database API 2.0The definition of 'open()' in that specification. Recommendation Indexed Database API DraftThe definition of 'open()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetopenChrome Full support 24 Full support 24 No support 23 -- 24Prefi...
IDBFactory - Web APIs
Comment Indexed Database API 2.0The definition of 'IDBFactory' in that specification. Recommendation Indexed Database API DraftThe definition of 'IDBFactory' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetIDBFactoryChrome Full support 24 Full support 24 No support 23 -- 5...
IDBIndex.count() - Web APIs
Web › API › IDBIndex › count
tatus Comment Indexed Database API 2.0The definition of 'count()' in that specification. Recommendation Indexed Database API DraftThe definition of 'count()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetcountChrome Full support 24 Full support 24 No support 23 -- 24Pref...
IDBIndex.get() - Web APIs
Web › API › IDBIndex › get
{ console.log('Entries all displayed.'); } }; }; Specification Specification Status Comment Indexed Database API 2.0The definition of 'get()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetgetChrome Full support 24 Full support 24 No support 23 -- 24Prefix...
IDBIndex.getKey() - Web APIs
Web › API › IDBIndex › getKey
tus Comment Indexed Database API 2.0The definition of 'getKey()' in that specification. Recommendation Indexed Database API DraftThe definition of 'getKey()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetgetKeyChrome Full support 24 Full support 24 No support 23 -- 24Pre...
IDBIndex.keyPath - Web APIs
Web › API › IDBIndex › keyPath
tus Comment Indexed Database API 2.0The definition of 'keyPath' in that specification. Recommendation Indexed Database API DraftThe definition of 'keyPath' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetkeyPathChrome Full support 24 Full support 24 No support 23 -- 24Pr...
IDBIndex.multiEntry - Web APIs
Comment Indexed Database API 2.0The definition of 'multiEntry' in that specification. Recommendation Indexed Database API DraftThe definition of 'multiEntry' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetmultiEntryChrome Full support 24 Full support 24 No support 23 -- 2...
IDBIndex.name - Web APIs
Web › API › IDBIndex › name
Status Comment Indexed Database API 2.0The definition of 'name' in that specification. Recommendation Indexed Database API DraftThe definition of 'name' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetnameChrome Full support 24 Full support 24 No support 23 -- 24Prefi...
IDBIndex.objectStore - Web APIs
omment Indexed Database API 2.0The definition of 'objectStore' in that specification. Recommendation Indexed Database API DraftThe definition of 'objectStore' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetobjectStoreChrome Full support 24 Full support 24 No support 23 -- ...
IDBIndex.openCursor() - Web APIs
omment Indexed Database API 2.0The definition of 'openCursor()' in that specification. Recommendation Indexed Database API DraftThe definition of 'openCursor()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetopenCursorChrome Full support 24 Full support 24 No support 23 -- 2...
IDBIndex.openKeyCursor() - Web APIs
Indexed Database API 2.0The definition of 'openKeyCursor()' in that specification. Recommendation Indexed Database API DraftThe definition of 'openKeyCursor()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetopenKeyCursorChrome Full support 24 Full support 24 No support 23 -...
IDBIndex.unique - Web APIs
Web › API › IDBIndex › unique
tatus Comment Indexed Database API 2.0The definition of 'unique' in that specification. Recommendation Indexed Database API DraftThe definition of 'unique' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetuniqueChrome Full support 24 Full support 24 No support 23 -- 24Pre...
IDBIndex - Web APIs
Web › API › IDBIndex
us Comment Indexed Database API 2.0The definition of 'IDBIndex' in that specification. Recommendation Indexed Database API DraftThe definition of 'IDBIndex' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetIDBIndexChrome Full support 24 Full support 24 No support 23 -- 57P...
IDBKeyRange.bound() - Web APIs
Web › API › IDBKeyRange › bound
us Comment Indexed Database API 2.0The definition of 'bound()' in that specification. Recommendation Indexed Database API DraftThe definition of 'bound()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetboundChrome Full support 24 Full support 24 No support 23 -- 24Pref...
IDBKeyRange.includes() - Web APIs
omment Indexed Database API DraftThe definition of 'includes()' in that specification. Recommendation Indexed Database API DraftThe definition of 'includes()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetincludesChrome Full support 52Edge Full support <=18Firefox Full support ...
IDBKeyRange.lower - Web APIs
Web › API › IDBKeyRange › lower
Status Comment Indexed Database API 2.0The definition of 'lower' in that specification. Recommendation Indexed Database API DraftThe definition of 'lower' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetlowerChrome Full support 24 Full support 24 No support 23 -- 24Pref...
IDBKeyRange.lowerBound() - Web APIs
ment Indexed Database API 2.0The definition of 'lowerBound()' in that specification. Recommendation Indexed Database API DraftThe definition of 'lowerBound()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetlowerBoundChrome Full support 24 Full support 24 No support 23 -- 2...
IDBKeyRange.lowerOpen - Web APIs
Comment Indexed Database API 2.0The definition of 'lowerOpen' in that specification. Recommendation Indexed Database API DraftThe definition of 'lowerOpen' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetlowerOpenChrome Full support 24 Full support 24 No support 23 -- 24...
IDBKeyRange.only() - Web APIs
Web › API › IDBKeyRange › only
Status Comment Indexed Database API 2.0The definition of 'only' in that specification. Recommendation Indexed Database API DraftThe definition of 'only' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetonlyChrome Full support 24 Full support 24 No support 23 -- 24Prefi...
IDBKeyRange.upper - Web APIs
Web › API › IDBKeyRange › upper
Status Comment Indexed Database API 2.0The definition of 'upper' in that specification. Recommendation Indexed Database API DraftThe definition of 'upper' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetupperChrome Full support 24 Full support 24 No support 23 -- 24Pref...
IDBKeyRange.upperBound() - Web APIs
ment Indexed Database API 2.0The definition of 'upperBound()' in that specification. Recommendation Indexed Database API DraftThe definition of 'upperBound()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetupperBoundChrome Full support 24 Full support 24 No support 23 -- 2...
IDBKeyRange.upperOpen - Web APIs
Comment Indexed Database API 2.0The definition of 'upperOpen' in that specification. Recommendation Indexed Database API DraftThe definition of 'upperOpen' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetupperOpenChrome Full support 24 Full support 24 No support 23 -- 24...
IDBKeyRange - Web APIs
API 2.0The definition of 'IDBKeyRange' in that specification. Recommendation Initial definition. Indexed Database API DraftThe definition of 'IDBKeyRange' in that specification. Recommendation Adds includes(). Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetIDBKeyRangeChrome Full support 24 Full support 24 No support 23 -- ...
IDBObjectStore.add() - Web APIs
Status Comment Indexed Database API 2.0The definition of 'add()' in that specification. Recommendation Indexed Database API DraftThe definition of 'add()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetaddChrome Full support 24 Full support 24 No support 23 -- 57Prefix...
IDBObjectStore.autoIncrement - Web APIs
nt Indexed Database API 2.0The definition of 'autoIncrement' in that specification. Recommendation Indexed Database API DraftThe definition of 'autoIncrement' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetautoIncrementChrome Full support 24 Full support 24 No support 23 -...
IDBObjectStore.clear() - Web APIs
tus Comment Indexed Database API 2.0The definition of 'clear()' in that specification. Recommendation Indexed Database API DraftThe definition of 'clear()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetclearChrome Full support 24 Full support 24 No support 23 -- 57Pref...
IDBObjectStore.count() - Web APIs
tus Comment Indexed Database API 2.0The definition of 'count()' in that specification. Recommendation Indexed Database API DraftThe definition of 'count()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetcountChrome Full support 24 Full support 24 No support 23 -- 57Pref...
IDBObjectStore.createIndex() - Web APIs
ment Indexed Database API 2.0The definition of 'createIndex()' in that specification. Recommendation Indexed Database API DraftThe definition of 'createIndex()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetcreateIndexChrome Full support 24 Full support 24 No support 23 -- ...
IDBObjectStore.delete() - Web APIs
s Comment Indexed Database API 2.0The definition of 'delete()' in that specification. Recommendation Indexed Database API DraftThe definition of 'delete()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetdeleteChrome Full support 24 Full support 24 No support 23 -- 57Pre...
IDBObjectStore.deleteIndex() - Web APIs
nt Indexed Database API 2.0The definition of 'deleteIndex()' in that specification. Recommendation Indexed Database API DraftThe definition of 'deleteIndex()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetdeleteIndexChrome Full support 24 Full support 24 No support 23 -- ...
IDBObjectStore.get() - Web APIs
Status Comment Indexed Database API 2.0The definition of 'get()' in that specification. Recommendation Indexed Database API DraftThe definition of 'get()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetgetChrome Full support 24 Full support 24 No support 23 -- 57Prefix...
IDBObjectStore.getKey() - Web APIs
4 hours was occurred at " + when); }; }; Specifications Specification Status Comment Indexed Database API DraftThe definition of 'getKey()' in that specification. Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetgetKeyChrome Full support 48Edge Full support <=79Firefox Full support ...
IDBObjectStore.index() - Web APIs
tus Comment Indexed Database API 2.0The definition of 'index()' in that specification. Recommendation Indexed Database API DraftThe definition of 'index()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetindexChrome Full support 24 Full support 24 No support 23 -- 57Pref...
IDBObjectStore.indexNames - Web APIs
Comment Indexed Database API 2.0The definition of 'indexNames' in that specification. Recommendation Indexed Database API DraftThe definition of 'indexNames' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetindexNamesChrome Full support 24 Full support 24 No support 23 -- 5...
IDBObjectStore.keyPath - Web APIs
tus Comment Indexed Database API 2.0The definition of 'keyPath' in that specification. Recommendation Indexed Database API DraftThe definition of 'keyPath' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetkeyPathChrome Full support 24 Full support 24 No support 23 -- 57Pr...
IDBObjectStore.name - Web APIs
Status Comment Indexed Database API 2.0The definition of 'name' in that specification. Recommendation Indexed Database API DraftThe definition of 'name' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetnameChrome Full support 24 Full support 24 No support 23 -- 57Prefi...
IDBObjectStore.openCursor() - Web APIs
ment Indexed Database API 2.0The definition of 'openCursor()' in that specification. Recommendation Indexed Database API DraftThe definition of 'openCursor()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetopenCursorChrome Full support 24 Full support 24 No support 23 -- 5...
IDBObjectStore.put() - Web APIs
Status Comment Indexed Database API 2.0The definition of 'put()' in that specification. Recommendation Indexed Database API DraftThe definition of 'put()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetputChrome Full support 24 Full support 24 No support 23 -- 57Prefix...
IDBObjectStore.transaction - Web APIs
omment Indexed Database API 2.0The definition of 'transaction' in that specification. Recommendation Indexed Database API DraftThe definition of 'transaction' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternettransactionChrome Full support 24 Full support 24 No support 23 -- ...
IDBObjectStore - Web APIs
nt Indexed Database API 2.0The definition of 'IDBObjectStore' in that specification. Recommendation Indexed Database API DraftThe definition of 'IDBObjectStore' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetIDBObjectStoreChrome Full support 24 Full support 24 No support 23 ...
IDBOpenDBRequest.onblocked - Web APIs
Comment Indexed Database API 2.0The definition of 'onblocked' in that specification. Recommendation Indexed Database API DraftThe definition of 'onblocked' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetonblockedChrome Full support 24 Full support 24 No support 23 -- 57...
IDBOpenDBRequest.onupgradeneeded - Web APIs
Indexed Database API 2.0The definition of 'onupgradeneeded' in that specification. Recommendation Indexed Database API DraftThe definition of 'onupgradeneeded' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetonupgradeneededChrome Full support 24 Full support 24 No support 23...
IDBRequest.error - Web APIs
Web › API › IDBRequest › error
Status Comment Indexed Database API 2.0The definition of 'error' in that specification. Recommendation Indexed Database API DraftThe definition of 'error' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InterneterrorChrome Full support 24 Full support 24 No support 23 -- 57Pref...
IDBRequest.onerror - Web APIs
tus Comment Indexed Database API 2.0The definition of 'onerror' in that specification. Recommendation Indexed Database API DraftThe definition of 'onerror' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetonerrorChrome Full support 24 Full support 24 Full support ...
IDBRequest.onsuccess - Web APIs
Comment Indexed Database API 2.0The definition of 'onsuccess' in that specification. Recommendation Indexed Database API DraftThe definition of 'onsuccess' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetonsuccessChrome Full support 24 Full support 24 Full support ...
IDBRequest.readyState - Web APIs
Comment Indexed Database API 2.0The definition of 'readyState' in that specification. Recommendation Indexed Database API DraftThe definition of 'readyState' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetreadyStateChrome Full support 24 Full support 24 Full support ...
IDBRequest.result - Web APIs
Web › API › IDBRequest › result
tatus Comment Indexed Database API 2.0The definition of 'result' in that specification. Recommendation Indexed Database API DraftThe definition of 'result' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetresultChrome Full support 24 Full support 24 Full support ...
IDBRequest.source - Web APIs
Web › API › IDBRequest › source
tatus Comment Indexed Database API 2.0The definition of 'source' in that specification. Recommendation Indexed Database API DraftThe definition of 'source' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetsourceChrome Full support 24 Full support 24 Full support ...
IDBRequest.transaction - Web APIs
omment Indexed Database API 2.0The definition of 'transaction' in that specification. Recommendation Indexed Database API DraftThe definition of 'transaction' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternettransactionChrome Full support 24 Full support 24 Full support ...
IDBTransaction.objectStoreNames - Web APIs
Indexed Database API 2.0The definition of 'ObjectStoreNames' in that specification. Recommendation Indexed Database API DraftThe definition of 'ObjectStoreNames' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetobjectStoreNamesChrome Full support 48Edge Full support <=79Firefox Full supp...
IDBTransaction.abort() - Web APIs
Status Comment Indexed Database API 2.0The definition of 'abort()' in that specification. Recommendation Indexed Database API DraftThe definition of 'abort()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetabortChrome Full support 24 Full support 24 Full support ...
IDBTransaction.commit() - Web APIs
asap transaction.commit(); Specification Specification Status Comment Indexed Database API DraftThe definition of 'IDBTransaction.commit()' in that specification. Recommendation Unitial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetcommitChrome Full support 76Edge Full support 79Firefox Full support ...
IDBTransaction.db - Web APIs
Web › API › IDBTransaction › db
ion Status Comment Indexed Database API 2.0The definition of 'db' in that specification. Recommendation Indexed Database API DraftThe definition of 'db' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetdbChrome Full support 24 Full support 24 No support 23 -- 57Prefixe...
IDBTransaction.error - Web APIs
Status Comment Indexed Database API 2.0The definition of 'error' in that specification. Recommendation Indexed Database API DraftThe definition of 'error' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InterneterrorChrome Full support 24 Full support 24 No support 23 -- 57Pref...
IDBTransaction.mode - Web APIs
Status Comment Indexed Database API 2.0The definition of 'mode' in that specification. Recommendation Indexed Database API DraftThe definition of 'mode' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetmodeChrome Full support 24 Full support 24 Full support ...
IDBTransaction.objectStore() - Web APIs
ent Indexed Database API 2.0The definition of 'objectStore()' in that specification. Recommendation Indexed Database API DraftThe definition of 'objectStore()' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetobjectStoreChrome Full support 24 Full support 24 Full support ...
IDBTransaction.onabort - Web APIs
tus Comment Indexed Database API 2.0The definition of 'onabort' in that specification. Recommendation Indexed Database API DraftThe definition of 'onabort' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetonabortChrome Full support 24 Full support 24 Full support ...
IDBTransaction.oncomplete - Web APIs
Comment Indexed Database API 2.0The definition of 'oncomplete' in that specification. Recommendation Indexed Database API DraftThe definition of 'oncomplete' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetoncompleteChrome Full support 24 Full support 24 Full support ...
IDBTransaction.onerror - Web APIs
tatus Comment Indexed Database API 2.0The definition of 'onerror' in that specification. Recommendation Indexed Database API DraftThe definition of 'onerror' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetonerrorChrome Full support 24 Full support 24 Full support ...
IDBTransaction - Web APIs
d Database API 2.0The definition of 'IDBTransaction' in that specification. Recommendation Initial definition Indexed Database API DraftThe definition of 'IDBTransaction' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetIDBTransactionChrome Full support 24 Full support 24 No support 23 ...
IDBVersionChangeEvent.newVersion - Web APIs
Comment Indexed Database API 2.0The definition of 'newVersion' in that specification. Recommendation Indexed Database API DraftThe definition of 'newVersion' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetnewVersionChrome Full support 24 Full support 24 No support 23 -- 5...
IDBVersionChangeEvent.oldVersion - Web APIs
Comment Indexed Database API 2.0The definition of 'oldVersion' in that specification. Recommendation Indexed Database API DraftThe definition of 'oldVersion' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetoldVersionChrome Full support 24 Full support 24 No support 23 -- 5...
IDBVersionChangeEvent.version - Web APIs
s, the latest specification replaces it with the oldVersion and newVersion attributes. See the compatibility table to know what browsers support them. Syntax readonly attribute unsigned long long? version; Value A 64-bit integer. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetversion DeprecatedNon-standardChrome Full support 12Edge Full support <=18Firefox ...
IDBVersionChangeRequest.setVersion() - Web APIs
hangeRequest setVersion ([TreatNullAs=EmptyString] in DOMString version); Example TBD Parameters version The version to store in the database. Returns IDBVersionChangeRequest The request to change the version of a database. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetsetVersion DeprecatedNon-standardChrome No support NoEdge No support NoFirefox ...
IDBVersionChangeRequest - Web APIs
immediately and runs a versionchange transaction on the connected database in a separate thread. Attributes Attribute Type Description onblocked Function The event handler for the blocked event. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetIDBVersionChangeRequest DeprecatedNon-standardChrome No support 12 -- 23Prefixed No support 12 -- 23Prefixed Prefixed Implemented ...
IIRFilterNode() - Web APIs
forward: feedForward, feedback: feedBackward }); Specifications Specification Status Comment Web Audio APIThe definition of 'IIRFilterNode()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetIIRFilterNode() constructorChrome Full support 55Notes Full support 55Notes Notes Before ver...
IIRFilterNode - Web APIs
properties from its parent, AudioNode. Methods Inherits methods from its parent, AudioNode. It also has the following additional methods: getFrequencyResponse() Uses the filter's current parameter settings to calculate the response for frequencies specified in the provided array of frequencies. Examples You can find a simple IIR filter demo live on Codepen. Also see the source code on GitHub. It includes some different coefficient values for different lowpass frequencies -- you can change the value of the filterNumber constant to a value between 0 and 3 to check out the different available effects. Also see our Using IIR filters guide for a full explanation. Specifications Specification Status Comment Web Audio APIThe definition of 'IIRFilterNode' in tha...
ImageCapture.takePhoto() - Web APIs
('takePhoto() error: ', error); }); } Specifications Specification Status Comment MediaStream Image CaptureThe definition of 'takePhoto()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternettakePhoto ExperimentalChrome Full support 60 Full support 60 No support ...
InputEvent.dataTransfer - Web APIs
= e.dataTransfer.getData('text/html'); }); Specifications Specification Status Comment Input Events Level 2The definition of 'dataTransfer' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetdataTransfer ExperimentalChrome Full support 60Edge Full support 79Firefox Fu...
InputEvent.getTargetRanges() - Web APIs
value An array of StaticRange objects. Specifications Specification Status Comment Input Events Level 2The definition of 'getTargetRanges()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetgetTargetRanges ExperimentalChrome Full support 60Edge Full support 79Firefox ...
Timing element visibility with the Intersection Observer API - Web APIs
, "0"); } This code finds the ad's timer using its ID, "timer", and computes the number of seconds elapsed by dividing the ad's totalViewTime by 1000. Then it calculates the number of minutes and seconds elapsed before setting the timer's innerText to a string representing that time in the form m:ss. The String.padStart() method is used to ensure that the number of seconds is padded out to two digits if it's less than 10. Building the page contents The buildContents() function is called by the startup code to select and insert into the document the articles and ads to be presented: let loremIpsum = "<p>Lorem ipsum dolor sit amet, consectetur adipiscing" + " elit. Cras at sem diam. Vestibulum venenatis massa in tincidunt" + " egestas. Morbi eu lorem vel est sodales auctor hendrerit pla...
KeyboardEvent - Web APIs
d the right Alt key (Option on a Mac keyboard). DOM_KEY_LOCATION_NUMPAD 0x03 The key is located on the numeric keypad, or is a virtual key associated with the numeric keypad if there's more than one place the key could originate from. The NumLock key does not fall into this group and is always encoded with the location DOM_KEY_LOCATION_STANDARD. Examples include the digits on the numeric keypad, the keypad's Enter key, and the decimal point on the keypad. Properties This interface also inherits properties of its parents, UIEvent and Event. KeyboardEvent.altKey Read only Returns a Boolean that is true if the Alt ( Option or ? on OS X) key was active when the key event was generated. KeyboardEvent.code Read only Returns a DOMString with the co...
LocalFileSystem - Web APIs
e URL was invalid. NOT_FOUND_ERR The URL was structurally correct, but refers to a resource that does not exist. SECURITY_ERR The application does not have permission to access the file system interface. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. No compatibility data found. Please contribute data for "api.LocalFileSystem" (depth: 1) to the MDN compatibility data repository. ...
LocalFileSystemSync - Web APIs
e URL was invalid. NOT_FOUND_ERR The URL was structurally correct, but refers to a resource that does not exist. SECURITY_ERR The application does not have permission to access the file system interface. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. No compatibility data found. Please contribute data for "api.LocalFileSystemSync" (depth: 1) to the MDN compatibility data repository. ...
MSGestureEvent - Web APIs
is deprecated as of Microsoft Edge. Gesture event types MSGestureStart MSGestureEnd MSGestureTap MSGestureHold MSGestureChange MSInertiaStart Specifications Not part of any specification. Microsoft has a description on MSDN. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetMSGestureEvent Non-standardChrome No support NoEdge No support 12 -- 79Firefox No support ...
MediaDeviceInfo.deviceId - Web APIs
fo.deviceId Value A DOMString. Specifications Specification Status Comment Media Capture and StreamsThe definition of 'deviceId' in that specification. Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetdeviceIdChrome Full support 55Notes Full support 55Notes Notes For earlier versions, this in...
MediaDeviceInfo.kind - Web APIs
DeviceInfo.kind Value A DOMString. Specifications Specification Status Comment Media Capture and StreamsThe definition of 'kind' in that specification. Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetkindChrome Full support 55Notes Full support 55Notes Notes For earlier versions, this interf...
MediaKeyMessageEvent() - Web APIs
tions are as follows: messageType: A developer-defined message type that allows applications to differentiate messages without parsing them. message: An array containing the message generated by the content decryption module. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetMediaKeyMessageEvent() constructor ExperimentalChrome Full support 42Edge Full support <=18Fi...
MediaKeyStatusMap.entries() - Web APIs
the status map, in insertion order. Syntax // TBD Parameters None. Returns Exceptions Specifications Specification Status Comment Encrypted Media Extensions Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetentries ExperimentalChrome Full support 42Edge Full support 16Firefox ? ...
MediaKeyStatusMap.forEach() - Web APIs
to. thisArg Optional Value used as this when executing callback. Returns undefined. Specifications Specification Status Comment Encrypted Media Extensions Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetforEach ExperimentalChrome Full support 42Edge Full support 13Firefox ? ...
MediaKeyStatusMap.get() - Web APIs
e value you want returned. Returns The value associated with the given key, or undefined. Specifications Specification Status Comment Encrypted Media Extensions Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetget ExperimentalChrome Full support 42Edge Full support 13Firefox Full suppor...
MediaKeyStatusMap.has() - Web APIs
atusMap(key) Parameters key The key whose value you want returned Returns A Boolean. Specifications Specification Status Comment Encrypted Media Extensions Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internethas ExperimentalChrome Full support 42Edge Full support 13Firefox Full suppor...
MediaKeyStatusMap.keys() - Web APIs
Syntax var iterator = mediaKeyStatusMap.keys() Parameters None. Returns A new iterator. Specifications Specification Status Comment Encrypted Media Extensions Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetkeys ExperimentalChrome Full support 42Edge Full support 16Firefox ? ...
MediaKeyStatusMap.size - Web APIs
diaKeyStatusMap.size; Value A long integer. Specifications Specification Status Comment Encrypted Media ExtensionsThe definition of 'size' in that specification. Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetsize ExperimentalChrome Full support 42Edge Full support 13Firefox Full suppo...
MediaKeyStatusMap.values() - Web APIs
ntax var iterator = mediaKeyStatusMap.values() Parameters None. Returns A new iterator. Specifications Specification Status Comment Encrypted Media Extensions Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetvalues ExperimentalChrome Full support 42Edge Full support 16Firefox ? ...
MediaMetadata.album - Web APIs
album Value A String containing the name of the album. Specifications Specification Status Comment Media Session StandardThe definition of 'album' in that specification. Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetalbum ExperimentalChrome Full support 57Edge No support NoFirefox Full suppor...
MediaMetadata.artist - Web APIs
tist Value A String containing the name of the artist. Specifications Specification Status Comment Media Session StandardThe definition of 'artist' in that specification. Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetartist ExperimentalChrome Full support 57Edge No support NoFirefox Full suppo...
MediaMetadata.artwork - Web APIs
ork = artwork[] Value An Array of MediaImage objects. Specifications Specification Status Comment Media Session StandardThe definition of 'artwork' in that specification. Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetartwork ExperimentalChrome Full support 57Edge No support NoFirefox Full supp...
MediaMetadata.title - Web APIs
title Value A String containing the title of the media. Specifications Specification Status Comment Media Session StandardThe definition of 'title' in that specification. Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internettitle ExperimentalChrome Full support 57Edge No support NoFirefox Full suppor...
MediaMetadata - Web APIs
array of images associated with playing media. Specifications Specification Status Comment Media Session StandardThe definition of 'MediaMetaData' in that specification. Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetMediaMetadata ExperimentalChrome Full support 57Edge No support NoFirefox Ful...
MediaQueryList - Web APIs
You can find other examples on the individual property and method pages. Specifications Specification Status Comment CSS Object Model (CSSOM) View ModuleThe definition of 'MediaQueryList' in that specification. Working Draft Initial definition ...
MediaRecorder.audioBitsPerSecond - Web APIs
cond Value A Number (unsigned long). Specifications Specification Status Comment MediaStream RecordingThe definition of 'audioBitsPerSecond' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetaudioBitsPerSecond ExperimentalChrome Full support 49Edge Full support 79Firefox ...
MediaRecorder.ignoreMutedMedia - Web APIs
. If this attribute is false, MediaRecorder will record silence for audio and black frames for video. The default is false. Syntax var boolean = MediaRecorder.ignoreMutedMedia MediaRecorder.ignoreMutedMedia = boolean Value A Boolean. Browser Compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetignoreMutedMedia DeprecatedNon-standardChrome No support 49 -- 57Edge No support NoFirefox ? ...
MediaSession.playbackState - Web APIs
avigator.mediaSession.playbackState = "paused"; } Specifications Specification Status Comment Media Session StandardThe definition of 'playbackState' in that specification. Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetplaybackState ExperimentalChrome Full support 73Edge Full support <=79Firefox ...
MediaStream.getTracks() - Web APIs
[0].stop() }, 5000) }) Specifications Specification Status Comment Media Capture and StreamsThe definition of 'getTracks()' in that specification. Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetgetTracks ExperimentalChrome Full support 45Edge Full support 12Firefox Full...
MediaStream.id - Web APIs
Web › API › MediaStream › id
console.log(stream.id); }) Specifications Specification Status Comment Media Capture and StreamsThe definition of 'MediaStream.id' in that specification. Candidate Recommendation Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetidChrome No support ? -- 54Edge No support 12 -- 79Firefox Full support 41IE ...
Using the MediaStream Recording API - Web APIs
phone To demonstrate basic usage of the MediaRecorder API, we have built a web-based dictaphone. It allows you to record snippets of audio and then play them back. It even gives you a visualization of your device's sound input, using the Web Audio API. We'll concentrate on the recording and playback functionality for this article. You can see this demo running live, or grab the source code on GitHub. CSS goodies The HTML is pretty simple in this app, so we won't go through it here; there are a couple of slightly more interesting bits of CSS worth mentioning, however, so we'll discuss them below. If you are not interested in CSS and want to get straight to the JavaScript, skip to the Basic app setup section. Keeping the interface constrained to the viewport, regardless of device height,...
MediaTrackSettings.sampleRate - Web APIs
Rate as returned by a call to MediaDevices.getSupportedConstraints(). However, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. Syntax var sampleRate = MediaTrackSettings.sampleRate; Value An integer value indicating how many samples each second of audio data includes. Common values include 44,100 (standard CD audio), 48,000 (standard digital audio), 96,000 (commonly used in audio mastering and post-production), and 192,000 (used for high-resolution audio in professional recording and mastering sessions). However, lower values are often used to reduce bandwidth requirements; 8,000 samples per second is adequate for comprehensible albeit imperfect human speech, and both 11,025 FPS and 22,050 FPS are often used for low-bandwidth, redu...
MessageChannel() - Web APIs
Specifications Specification Status Comment HTML Living StandardThe definition of 'MessageChannel()' in that specification. Living Standard ...
MessageChannel.port2 - Web APIs
Specifications Specification Status Comment HTML Living StandardThe definition of 'port2' in that specification. Living Standard ...
MessageChannel - Web APIs
Specifications Specification Status Comment HTML Living StandardThe definition of 'Message channels' in that specification. Living Standard ...
MessagePort.onmessage - Web APIs
Specifications Specification Status Comment HTML Living StandardThe definition of 'onmessage' in that specification. Living Standard ...
MessagePort.postMessage() - Web APIs
Specifications Specification Status Comment HTML Living StandardThe definition of 'postMessage()' in that specification. Living Standard ...
MessagePort - Web APIs
Specifications Specification Status Comment HTML Living StandardThe definition of 'Message ports' in that specification. Living Standard ...
Metadata.modificationTime - Web APIs
n() { workingDirectory.getFile("tmp/workfile.json", { create: true }, function(newEntry) { fileEntry = newEntry; }); }); } }); }, handleError); This API has no official W3C or WHATWG specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetmodificationTime ExperimentalNon-standardChrome Full support 13Edge Full support <=79Firefox ...
Metadata.size - Web APIs
Web › API › Metadata › size
on(metadata) { if (metadata.size > 1048576) { fileEntry.remove(function() { /* log file removed; do something clever here */ }); } }); }, handleError); This API has no official W3C or WHATWG specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetsize ExperimentalNon-standardChrome Full support 13Edge Full support <=79Firefox ...
Metadata - Web APIs
Web › API › Metadata
ing the size of the entry in bytes. Specifications Specification Status Comment File and Directory Entries API Draft Draft of proposed API This API has no official W3C or WHATWG specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetMetadata ExperimentalNon-standardChrome Full support 13Prefixed Full support 13Prefixed Pref...
Microdata DOM API - Web APIs
an alert using the "name" property from that item. 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. The PropertyNodeList object can be used to obtain all the values at once usingits getValues method, which returns an array of all the values. Code example In an earlier example, a "http://example.org/animals#cat" item had two "http://example.com/color" values. This script looks up the first such item and then lists all its values. var cat = document.getItems('http://example.org/animals#cat')[0]; var colors = cat.properties['http://example.com/color'].getValues(); var resul...
msPlayToPreferredSourceUri - Web APIs
as a cloud media server. This proprietary property is specific to Internet Explorer and Microsoft Edge. Syntax ptr = object.msPlayToPreferredSourceUri; Value msPlayToPreferredSourceUri enables a PlayTo reference (a URI or URL) for streaming content on the PlayTo target device from a different location, such as a cloud media server. This enables web pages and Microsoft Store apps to play Digital Rights Management (DRM) protected content. The app specifies a preferred Uniform Resource Identifier (URI). This URI can point to a cloud based media server allowing streaming directly from the cloud, which can be DRM protected, instead of streaming content from the Windows machine which must be unprotected content. A forward slash ("/") is appended to the URI string when it is sent over the n...
msSetMediaProtectionManager - Web APIs
ns and the behavior may change in the future. The msSetMediaProtectionManager method specifies the media protection manager for a given media pipeline. This proprietary method is specific to Internet Explorer and Microsoft Edge. Syntax HTMLMediaElement.msSetMediaProtectionManager(mediaProtectionManager); Parameters The Windows.Media.Protection namespace provides classes to manage Digital Rights Management (DRM) media contents. The MediaProtectionManager class can be passed as an input to a media playback API or the mediaProtectionManager property inside the tag's video or audio. The optional parameter of the msSetMediaProtectionManager property is mediaProtectionManager and can be any type. Return value This method does not return a value. ...
NavigationPreloadManager - Web APIs
turn fetch(event.request); }()); }); Specifications Specification Status Comment Service WorkersThe definition of 'NavigationPreloadManager' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNavigationPreloadManager ExperimentalChrome Full support 62Edge Full support 18Firefox ...
Node.getRootNode() - Web APIs
Web › API › Node › getRootNode
representing the entire page. Calling it on an element inside a shadow DOM will return the associated ShadowRoot. Examples The first simple example returns a reference to the HTML/document node: rootNode = node.getRootNode(); This more complex example shows the difference between returning a normal root, and a root incuding the shadow root. ...
NodeList.prototype.forEach() - Web APIs
Web › API › NodeList › forEach
ch() (Chrome, for example). Specifications Specification Status Comment Web IDLThe definition of 'forEach' in that specification. Candidate Recommendation Defines forEach on iterable declarations Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetforEachChrome Full support 51Edge Full support 16Firefox Full support ...
NotificationEvent - Web APIs
Notifications APIThe definition of 'NotificationEvent' in that specification. Living Standard Living standard. Note: This interface is specified in the Notifications API, but accessed through ServiceWorkerGlobalScope. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNotificationEvent ExperimentalChrome Full support 42Edge Full support <=18Firefox ...
OfflineAudioCompletionEvent.OfflineAudioCompletionEvent() - Web APIs
ioCompletionEvent object instance. Specifications Specification Status Comment Web Audio APIThe definition of 'OfflineAudioCompletionEvent()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetOfflineAudioCompletionEvent() constructorChrome Full support 57Notes Full support 57Notes No...
OfflineAudioCompletionEvent.renderedBuffer - Web APIs
tInstance.renderedBuffer; Value An AudioBuffer. Specifications Specification Status Comment Web Audio APIThe definition of 'renderedBuffer' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetrenderedBufferChrome Full support 14Edge Full support 12Firefox Full support ...
OfflineAudioContext.OfflineAudioContext() - Web APIs
d as requested. Like a regular AudioContext, an OfflineAudioContext can be the target of events, therefore it implements the EventTarget interface. Example const offlineCtx = new OfflineAudioContext({ numberOfChannels: 2, length: 44100 * 40, sampleRate: 44100, }); const source = offlineCtx.createBufferSource(); // etc... For a full working example, see our offline-audio-context-promise Github repo (see the source code too.) Specifications Specification Status Comment Web Audio APIThe definition of 'OfflineAudioContext()' in that specification. Working Draft ...
OfflineAudioContext.startRendering() - Web APIs
startRendering() promise resolves, rendering has completed and the output AudioBuffer is returned out of the promise. At this point we create another audio context, create an AudioBufferSourceNode inside it, and set its buffer to be equal to the promise AudioBuffer. This is then played as part of a simple standard audio graph. ...
OfflineAudioContext - Web APIs
startRendering() promise resolves, rendering has completed and the output AudioBuffer is returned out of the promise. At this point we create another audio context, create an AudioBufferSourceNode inside it, and set its buffer to be equal to the promise AudioBuffer. This is then played as part of a simple standard audio graph. ...
PasswordCredential - Web APIs
Url }); navigator.credentials.store(cred) .then(function() { // Do something else. }); Specifications Specification Status Comment Credential Management Level 1 Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetPasswordCredential ExperimentalChrome Full support 51Edge Full support <=79Firefox ...
PaymentAddress.toJSON() - Web APIs
) Parameters None. Return value A JSON object. Specifications Specification Status Comment Web IDLThe definition of 'toJSON()' in that specification. Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternettoJSON()Chrome Full support 61Disabled Full support 61Disabled Disabled From version 61: thi...
PaymentCurrencyAmount - Web APIs
erties All properties are required. currency A string containing a valid 3-letter ISO 4217 currency identifier (ISO 4217) indicating the currency used for the payment value. value A string containing a valid decimal value representing the mount of currency constituting the payment amount. This string must only contain an optional leading "-" to indicate a negative value, then one or more digits from 0 to 9, and an optional decimal point (".", regardless of locale) followed by at least one more digit. No whitespace is permitted. Obsolete properties These properties have been removed from the specification and should no longer be used. currencySystem Optional A string describing the standard or specification as well as the currency system identifier within that system which was ...
PaymentRequest.abort() - Web APIs
}, 20 * 60 * 1000); /* 20 minutes */ Specifications Specification Status Comment Payment Request APIThe definition of 'abort()' in that specification. Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetabort()Chrome Full support 61Edge Full support 15Firefox Full support ...
PaymentRequest.canMakePayment() - Web APIs
nts using HTML form element } Specifications Specification Status Comment Payment Request APIThe definition of 'canMakePayment()' in that specification. Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetcanMakePayment()Chrome Full support 61Edge Full support 16Firefox Full suppor...
PaymentRequest.prototype.id - Web APIs
Web › API › PaymentRequest › id
id = paymentRequest.id Value A DOMString. Specifications Specification Status Comment Payment Request APIThe definition of 'id' in that specification. Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetidChrome Full support 61Edge Full support 16Firefox Full support ...
PaymentRequest.onshippingaddresschange - Web APIs
ed", err.message); }); Specifications Specification Status Comment Payment Request APIThe definition of 'onshippingaddresschange' in that specification. Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetonshippingaddresschangeChrome Full support 61Edge Full support 15Firefox Full...
PaymentRequest.onshippingoptionchange - Web APIs
.shippingAddress)); }); Specifications Specification Status Comment Payment Request APIThe definition of 'onshippingoptionchange' in that specification. Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetonshippingoptionchangeChrome Full support 61Edge Full support 15Firefox Full ...
PaymentRequest.shippingAddress - Web APIs
ons; } resolve(details); } Specifications Specification Status Comment Payment Request APIThe definition of 'shippingaddress' in that specification. Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. No compatibility data found. Please contribute data for "api.PaymentRequest.shippingAddress" (depth: 1) to the MDN compatibility data repository. ...
PaymentRequest.shippingOption - Web APIs
ship to your address.` }; } } Specifications Specification Status Comment Payment Request APIThe definition of 'shippingOption' in that specification. Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetshippingOptionChrome Full support 61Edge Full support 15Firefox Full support ...
PaymentRequest.shippingType - Web APIs
g", "delivery", "pickup", or null. Specifications Specification Status Comment Payment Request APIThe definition of 'shippingType' in that specification. Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetshippingTypeChrome Full support 61Edge Full support 15Firefox Full support ...
PaymentRequest - Web APIs
ntext Causes the user agent to end the payment request and to remove any user interface that might be shown. Events merchantvalidation Secure context With some payment handlers (e.g., Apple Pay), this event handler is called to handle the merchantvalidation event, which is dispatched when the user agent requires that the merchant validate that the merchant or vendor requesting payment is legitimate. Also available using the onmerchantvalidation event handler property. paymentmethodchange Secure context With some payment handlers (e.g., Apple Pay), dispatched whenever the user changes payment instrument, like switching from a credit card to a debit card. Also available using the onpaymentmethodchange event handler property. shippingaddresschange Secure context Dispatched whenever ...
PaymentResponse.complete() - Web APIs
d", err.message); }); Specifications Specification Status Comment Payment Request APIThe definition of 'PaymentResponse: complete' in that specification. Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetcomplete()Chrome Full support 61Edge Full support 15Firefox Full support ...
PaymentResponse.details - Web APIs
ess: toDict(paymentResponse.shippingAddress) }; // Send information to the server }); Specifications Specification Status Comment Payment Request API Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetdetailsChrome Full support 61Edge Full support 15Firefox Full support ...
PaymentResponse.payerEmail - Web APIs
to the PaymentRequest constructor. Syntax var payerEmail = PaymentResponse.payerEmail; Specifications Specification Status Comment Payment Request API Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetpayerEmailChrome Full support 61Edge Full support 15Firefox Full support ...
PaymentRequest.payerName - Web APIs
A string containing the payer name. Specifications Specification Status Comment Payment Request APIThe definition of 'payerName' in that specification. Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetpayerNameChrome Full support 61Edge Full support 15Firefox Full support ...
PaymentResponse.requestId - Web APIs
aymentRequest.id Value A DOMString. Specifications Specification Status Comment Payment Request APIThe definition of 'requestId' in that specification. Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetrequestIdChrome Full support 61Edge Full support 16Firefox Full support ...
PaymentResponse.shippingAddress - Web APIs
shippingOption]; } else { delete details.shippingOptions; } resolve(details); } Specifications Specification Status Comment Payment Request API Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetshippingAddressChrome Full support 61Edge Full support 15Firefox Full support...
PaymentResponse.shippingOption - Web APIs
alse; details.displayItems.splice(2, 1, selectedShippingOption); resolve(details); } Specifications Specification Status Comment Payment Request API Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetshippingOptionChrome Full support 61Edge Full support 15Firefox Full support ...
Performance.timeOrigin - Web APIs
imeOrigin = performance.timeOrigin Value A high resolution timestamp. Specifications Specification Status High Resolution Time Level 2The definition of 'timeOrigin' in that specification. Recommendation Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternettimeOrigin ExperimentalChrome Full support 62Edge Full support 16Firefox Full...
PerformanceEventTiming - Web APIs
entry.startTime; // Synchronous event processing time (between start and end dispatch). const inputSyncProcessingTime = entry.processingEnd - entry.processingStart; }); }); // Register observer for event. observer.observe({entryTypes: ["event"]}); We can also directly query the first input delay. // Keep track of whether (and when) the page was first hidden, see: // https://github.com/w3c/page-visibility/issues/29 // NOTE: ideally this check would be performed in the document <head> // to avoid cases where the visibility state changes before this code runs. let firstHiddenTime = document.visibilityState === 'hidden' ? 0 : Infinity; document.addEventListener('visibilitychange', (event) => { firstHiddenTime = Math.min(firstHiddenTime, event.timeStamp); }, {once: true});...
PerformanceLongTaskTiming.attribution - Web APIs
ue A sequence of TaskAttributionTiming instances. Specifications Specification Status Comment Long Tasks API 1The definition of 'attribution' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetattribution ExperimentalChrome Full support 58Edge Full support <=79Firefox N...
PerformanceLongTaskTiming - Web APIs
of TaskAttributionTiming instances. Specifications Specification Status Comment Long Tasks API 1The definition of 'PerformanceLongTaskTiming' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetPerformanceLongTaskTiming ExperimentalChrome Full support 58Edge Full support <=79Firefox ...
Permissions - Web APIs
} // Don't do anything if the permission was denied. }); Specification Specification Status Comment PermissionsThe definition of 'Permissions' in that specification. Working Draft Initial definition. Browser Support The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetPermissionsChrome Full support 43Edge Full support 79Firefox Full support ...
Using the Permissions API - Web APIs
issions API in Chrome are Geolocation and Notification, with Firefox also recognizing Push and WebMIDI. More features will be added as time progresses. A simple example For this article, we have put together a simple demo called Location Finder. It uses Geolocation to query the user's current location and plot it out on a Google Map: You can run the example live, or view the source code on Github. Most of the code is simple and unremarkable -- below we'll just be walking through the Permissions API-related code, so check the code yourself if you want to study any of the other parts. Accessing the Permissions API The Navigator.permissions property has been added to the browser to allow access to the global Permissions object. This object will eventually include methods for querying, r...
Permissions API - Web APIs
atus for a specific API. Not all APIs' permission statuses can be queried using the Permissions API. Notable APIs that are Permissions-aware include: Clipboard API Notifications API Push API Web MIDI API More APIs will gain Permissions API support over time. Examples We have made a simple example available called Location Finder. You can run the example live, or view the source code on Github. Read more about how it works in our article Using the Permissions API. Interfaces Navigator.permissions and WorkerNavigator.permissions Read only Provides access to the Permissions object from the main context and worker context respectively. Permissions Provides the core Permission API functionality, such as methods for querying and revoking permissions. PermissionStatus Provides ...
PhotoCapabilities.fillLightMode - Web APIs
Always use the device's fill light. Specifications Specification Status Comment MediaStream Image CaptureThe definition of 'fillLightMode' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetfillLightMode ExperimentalChrome Full support 59Edge Full support <=79Firefox ...
PhotoCapabilities.imageHeight - Web APIs
ght Value A MediaSettingsRange object. Specifications Specification Status Comment MediaStream Image CaptureThe definition of 'imageHeight' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetimageHeight ExperimentalChrome Full support 59Edge Full support <=79Firefox ?
imageWidth - Web APIs
Value A MediaSettingsRange is an object. Specifications Specification Status Comment MediaStream Image CaptureThe definition of 'imageWidth' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetimageWidth ExperimentalChrome Full support 59Edge Full support <=79Firefox ? ...
PhotoCapabilities.redEyeReduction - Web APIs
rable via the PhotoSettings object. Specifications Specification Status Comment MediaStream Image CaptureThe definition of 'redEyeReduction' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetredEyeReduction ExperimentalChrome Full support 59Edge Full support <=79Firefox ...
PhotoCapabilities - Web APIs
og('Argh!', error.name || error)); Specifications Specification Status Comment MediaStream Image CaptureThe definition of 'PhotoCapabilities' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetPhotoCapabilities ExperimentalChrome Full support 59Edge Full support <=79Firefox ...
PointerEvent.getCoalescedEvents() - Web APIs
ence of PointerEvent instances. Specifications Specification Status Comment Pointer Events - Level 3The definition of 'getCoalescedEvents()' in that specification. Editor's Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetgetCoalescedEvents ExperimentalChrome Full support 58Edge Full support 79Firefox ...
Pointer Lock API - Web APIs
canvas.requestPointerLock || canvas.mozRequestPointerLock; canvas.requestPointerLock() If a user has exited pointer lock via the default unlock gesture, or pointer lock has not previously been entered for this document, an event generated as a result of an engagement gesture must be received by the document before requestPointerLock will succeed. (from https://w3c.github.io/pointerlock/#extensions-to-the-element-interface) pointerLockElement and exitPointerLock() The Pointer lock API also extends the Document interface, adding both a new property and a new method. The new property is used for accessing the currently locked element (if any), and is named pointerLockElement and the new method on Document is exitPointerLock() and, as the name implies, it is us...
Multi-touch interaction - Web APIs
pport multiple simultaneous pointers such as multiple fingers on a touch screen. This additional feature can be used to provide richer user interaction models but at the cost of additional complexity in the multi-touch interaction handling. This document demonstrates via example code, using pointer events with different multi-touch interactions. A live version of this application is available on Github. The source code is available on Github; pull requests and bug reports are welcome. Example This example demonstrates using pointer events' various event types (pointerdown, pointermove, pointerup pointercancel, etc.) for different multi-touch interactions. Define touch targets The application uses <div> to define three different touch target areas. <style> div { margin: 0em; pa...
Pinch zoom gestures - Web APIs
ypes of gestures, from the simple single-touch swipe gesture to the more complex multi-touch twist gesture, where the touch points (aka pointers) move in different directions. This example shows how to detect the pinch/zoom gesture, which uses pointer events to detect whether the user moves two pointers closer or farther apart from each other. A live version of this application is available on GitHub. The source code is available on GitHub; pull requests and bug reports are welcome. Example In this example, you use the pointer events to simultaneously detect two pointing devices of any type, including fingers, mice, and pens. The pinch in (zoom out) gesture, which moves the two pointers toward each other, changes the target element's background color to lightblue. The pinch out (zoom in)...
PublicKeyCredential.response - Web APIs
The response read-only property of the PublicKeyCredential interface is an AuthenticatorResponse object which is sent from the authenticator to the user agent for the creation/fetching of credentials. The information contained in this response will be used by the relying party's server to verify the demand is legitimate. An AuthenticatorResponse is either: an AuthenticatorAttestationResponse (when the PublicKeyCredential is created via CredentialsContainer.create()) an AuthenticatorAssertionResponse (when the PublicKeyCredential is obtained via CredentialsContainer.get()). In order to validate the creation of credentials, a relying party's server needs both: this response the extensions of the client (given by PublicKeyCredential.getClientExtensionResults()) to validate the dema...
PushEvent.PushEvent() - Web APIs
ntaining bytes extracted from the eventInitDict data member. Example var dataInit = { data : 'Some sample text' } var myPushEvent = new PushEvent('push', dataInit); myPushEvent.data.text(); // should return 'Some sample text' Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetPushEvent() constructor ExperimentalChrome Full support 42Edge Full support 16Disabled ...
PushEvent.data - Web APIs
Web › API › PushEvent › data
ample.blog.com/2015/03/04/something-new.html'); } }); }); Specifications Specification Status Comment Push APIThe definition of 'data' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetdata ExperimentalChrome Full support 57Edge Full support 16Disabled Full sup...
PushEvent - Web APIs
Web › API › PushEvent
.blog.com/2015/03/04/something-new.html'); } }); }); Specifications Specification Status Comment Push APIThe definition of 'PushEvent' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetPushEvent ExperimentalChrome Full support 42Edge Full support 16Disabled Ful...
PushManager.hasPermission() - Web APIs
tax PushManager.hasPermission().then(function(pushPermissionStatus) { ... } ); Example // TBD Specification Specification Status Comment Push API Working Draft Defines the PushManager interface. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternethasPermission ExperimentalChrome Full support 42Edge Full support 16Disabled ...
PushManager.permissionState() - Web APIs
e following properties: userVisibleOnly: A boolean indicating that the returned push subscription will only be used for messages whose effect is made visible to the user. applicationServerKey: A public key your push server will use to send messages to client apps via a push server. This value is part of a signing key pair generated by your application server and usable with elliptic curve digital signature (ECDSA) over the P-256 curve. Returns A Promise that resolves to a DOMString with a value of 'prompt', 'denied', or 'granted'. Specifications Specification Status Comment Push APIThe definition of 'permissionState()' in that specification. Working Draft Initial definition. ...
PushManager.supportedContentEncodings - Web APIs
tentEncodings Value An array of strings. Specifications Specification Status Comment Push APIThe definition of 'supportedContentEncodings' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetsupportedContentEncodings ExperimentalChrome Full support 60Edge Full support 16Disabled ...
PushMessageData.arrayBuffer() - Web APIs
Buffer(); // do something with your array buffer }); Specifications Specification Status Comment Push APIThe definition of 'arrayBuffer()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetarrayBuffer ExperimentalChrome Full support 50Edge Full support <=79Firefox F...
PushMessageData.blob() - Web APIs
lob = event.data.blob(); // do something with your Blob }); Specifications Specification Status Comment Push APIThe definition of 'blob()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetblob ExperimentalChrome Full support 50Edge Full support <=79Firefox Full sup...
PushMessageData.json() - Web APIs
ata = event.data.json(); // do something with your data }); Specifications Specification Status Comment Push APIThe definition of 'json()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetjson ExperimentalChrome Full support 50Edge Full support <=79Firefox Full sup...
PushMessageData.text() - Web APIs
Obj = event.data.text(); // do something with your text }); Specifications Specification Status Comment Push APIThe definition of 'text()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internettext ExperimentalChrome Full support 50Edge Full support <=79Firefox Full sup...
PushRegistrationManager - Web APIs
getRegistration() Returns a promise that resolves the PushRegistration associated with the current webapp. PushRegistrationManager.hasPermission() Returns a promise that resolves to the PushPermissionStatus of the requesting webapp. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetPushRegistrationManager ExperimentalDeprecatedChrome No support NoEdge No support NoFirefox ...
PushSubscription.expirationTime - Web APIs
cription.expirationTime Value A DOMHighResTimeStamp. Specifications Specification Status Comment Push APIThe definition of 'expirationTime' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetexpirationTimeChrome Full support 60Edge Full support 16Firefox No support ...
PushSubscription.getKey() - Web APIs
.. Specifications Specification Status Comment Push API Working Draft This is the Push API spec, but note that getKey() is not currently specified in here. It is currently Firefox-only experimental. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetgetKey()Chrome Full support 42Edge Full support 16Firefox Full support ...
PushSubscription.subscriptionId - Web APIs
the subscription ID associated with the push subscription. Syntax var subId = pushSubscription.subscriptionId; Specifications Specification Status Comment Push API Working Draft Initial definition Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetsubscriptionIdChrome Full support 42Edge Full support <=18Firefox No support ...
RTCDTMFSender.toneBuffer - Web APIs
from the string as they're played, so only upcoming tones are listed. Syntax var toneBuffer = RTCDTMFSender.toneBuffer; Value A DOMString listing the tones to be played. If the string is empty, there are no tones pending. Tone buffer format The tone buffer is a string which can contain any combination of the characters that are permitted by the DTMF standard. DTMF tone characters The digits 0-9 These characters represent the digit keys on a telephone keypad. The letters A-D These characters represent the "A" through "D" keys which are part of the DTMF standard but not included on most telephones. These are not interpreted as digits. Lower-case "a"-"d" automatically gets converted to upper-case. The pound/hash sign ("#") and the asterisk ("*") These correspond to the similarly-...
RTCDTMFToneChangeEvent.RTCDTMFToneChangeEvent() - Web APIs
of the following fields: tone A DOMString containing a single DTMF tone character which has just begun to play, or an empty string ("") to indicate that the previous tone has stopped playing. See Tone characters for details on what characters are permitted. Return value A newly-created RTCDTMFToneChangeEvent, configured as specified in the provided options. Tone characters The digits 0-9 These characters represent the digit keys on a telephone keypad. The letters A-D These characters represent the "A" through "D" keys which are part of the DTMF standard but not included on most telephones. These are not interpreted as digits. Lower-case "a"-"d" automatically gets converted to upper-case. The pound/hash sign ("#") and the asterisk ("*") These correspond to the similarly-...
RTCIceCandidateStats.address - Web APIs
d domain name can be used as well. When a domain name is specified, the first IP address selected for that address is used, even if the domain name maps to multiple IP addresses. Syntax candidateAddress = rtcIceCandidateStats.address; Value Either an IPv4 or IPv6 address or a fully-qualified domain name, which corresponds to the candidate. If the value of address is comprised entirely of digits from 0-9 with periods as separators, the value is interpreted as an IPv4 address. If the value is entirely comprised of hexadecimal digits and colon (":") characters, it is interpreted as an IPv6 address. Otherwise, the address is presumed to be a fully-qualified domain name, which is resolved first using an AAAA record (assuming IPv6 is available), then using an A record (if no result is fou...
RTCRemoteOutboundRtpStreamStats.localId - Web APIs
we refer to as statsBox. The box contains a number of log entries, the last handful of which are visible. Each one represents approximately one second of time (since that's much time we're waiting between calling networkTestStart() and networkTestStop()). Try it and fork it This example is available on Glitch for you to try out, examine, or remix. You can also access it directly using Glitch's Git server. Specifications Specification Status Comment Identifiers for WebRTC's Statistics APIThe definition of 'RTCRemoteOutboundRtpStreamStats.localId' in that specification. Candidate Recommendation Initial definition. ...
RTCRtpContributingSource.source - Web APIs
ifier). Specifications Specification Status Comment WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'source' in that specification. Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetsourceChrome Full support 59Edge Full support <=79Firefox Full support ...
RTCRtpReceiver.track - Web APIs
nstance. Specifications Specification Status Comment WebRTC 1.0: Real-time Communication Between BrowsersThe definition of 'track' in that specification. Candidate Recommendation Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternettrackChrome Full support 59Edge Full support 12Firefox Full support ...
Request.url - Web APIs
Web › API › Request › url
RL of the request. Syntax var myURL = request.url; Value A USVString indicating the url of the request. Example In the following snippet, we create a new request using the Request.Request() constructor (for an image file in the same directory as the script), then save the url of the request in a variable: var myRequest = new Request('flowers.jpg'); var myURL = myRequest.url; // "http://mdn.github.io/fetch-examples/fetch-request/flowers.jpg" Specifications Specification Status Comment FetchThe definition of 'url' in that specification. Living Standard Initial definition ...
Resize Observer API - Web APIs
roviding access to the new dimensions and allowing you to do anything you like in response to those changes. Interfaces ResizeObserver Provides the ability to register new observers and to start and stop observing elements. ResizeObserverEntry Describes a single element which has been resized, identifying the element and its new size. Examples You find a couple of simple examples on our GitHub repo: resize-observer-border-radius.html (see source): A simple example with a green box, sized as a percentage of the viewport size. When the viewport size is changed, the box's rounded corners change in proportion to the size of the box. We could just implement this using border-radius with a percentage, but that quickly leads to ugly-looking elliptical corners, whereas the above solution...
Using the Resource Timing API - Web APIs
erface also includes other properties that provide data about the size of the fetched resource as well as the type of resource that initiated the fetch. This document shows the use of Resource Timing interfaces. For more details about the interfaces, including examples, see each interface's reference page and the references in the See also section. A live version of the examples is available on Github, as is the source code. Pull requests and bug reports are welcome. Resource loading phases An application can get timestamps for the various phases of resource loading such as redirection, DNS lookup, and TCP connection setup. Those phases and their property names are illustrated in Figure 1. Figure 1. Resource timing properties An application developer can use the property values to calc...
SVGAElement.target - Web APIs
or('a'); linkRef.target ='_blank'; ... Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'target' in that specification. Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternettargetChrome Full support YesEdge Full support 12Firefox Full support ...
SVGAnimatedAngle - Web APIs
ontents as baseVal. The object referenced by animVal will always be distinct from the one referenced by baseVal, even when the attribute is not animated. Methods The SVGAnimatedAngle interface do not provide any specific methods. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetSVGAnimatedAngleChrome Full support YesEdge Full support <=18Firefox Full sup...
SVGAnimatedBoolean - Web APIs
nt animated value of the attribute or property. If the given attribute or property is not currently being animated, contains the same value as baseVal. Methods The SVGAnimatedBoolean interface do not provide any specific methods. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetSVGAnimatedBooleanChrome Full support YesEdge Full support <=18Firefox Full s...
SVGAnimatedEnumeration - Web APIs
nimated value of the attribute or property. If the given attribute or property is not currently being animated, contains the same value as baseVal. Methods The SVGAnimatedEnumeration interface do not provide any specific methods. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetSVGAnimatedEnumerationChrome Full support YesEdge Full support <=18Firefox Fu...
SVGAnimatedInteger - Web APIs
t animated value of the attribute or property. If the given attribute or property is not currently being animated, contains the same value as baseVal. Methods The SVGAnimatedInteger interface do not provide any specific methods. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetSVGAnimatedIntegerChrome Full support YesEdge Full support <=18Firefox Full ...
SVGAnimatedLength - Web APIs
nt animated value of the attribute or property. If the given attribute or property is not currently being animated, contains the same value as baseVal. Methods The SVGAnimatedLength interface do not provide any specific methods. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetSVGAnimatedLengthChrome Full support YesEdge Full support <=18Firefox Full s...
SVGAnimatedLengthList - Web APIs
ts as baseVal. The object referenced by animVal will always be distinct from the one referenced by baseVal, even when the attribute is not animated. Methods The SVGAnimatedLengthList interface do not provide any specific methods. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetSVGAnimatedLengthListChrome Full support YesEdge Full support <=18Firefox Ful...
SVGAnimatedNumber - Web APIs
ent animated value of the attribute or property. If the given attribute or property is not currently being animated, contains the same value as baseVal. Methods The SVGAnimatedNumber interface do not provide any specific methods. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetSVGAnimatedNumberChrome Full support YesEdge Full support <=18Firefox Full su...
SVGAnimatedNumberList - Web APIs
ontents as baseVal. The object referenced by animVal will always be distinct from the one referenced by baseVal, even when the attribute is not animated. Methods The SVGAnimatedNumberList interface do not provide any specific methods. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetSVGAnimatedNumberListChrome Full support YesEdge Full support <=18Firefox Ful...
SVGAnimatedPoints - Web APIs
rent animated value of the attribute or property. If the given attribute or property is not currently being animated, contains the same value as points. Methods The SVGAnimatedPoints interface do not provide any specific methods. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetSVGAnimatedPointsChrome ? Edge Full support <=18Firefox ? IE ?
SVGAnimatedPreserveAspectRatio - Web APIs
nts as baseVal. The object referenced by animVal is always distinct from the one referenced by baseVal, even when the attribute is not animated. Methods The SVGAnimatedPreserveAspectRatio interface do not provide any specific methods. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetSVGAnimatedPreserveAspectRatioChrome Full support YesEdge Full support <=18Firefox ...
SVGAnimatedRect - Web APIs
contents as baseVal. The object referenced by animVal will always be distinct from the one referenced by baseVal, even when the attribute is not animated. Methods The SVGAnimatedRect interface do not provide any specific methods. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetSVGAnimatedRectChrome Full support YesEdge Full support <=18Firefox Full supp...
SVGAnimatedString.animVal - Web APIs
ect.animVal Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition) Recommendation Scalable Vector Graphics (SVG) 2 Candidate Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetanimValChrome Full support YesEdge Full support 12Firefox Full support ...
SVGAnimatedString.baseVal - Web APIs
DOMException. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition) Recommendation Scalable Vector Graphics (SVG) 2 Candidate Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetbaseValChrome Full support YesEdge Full support 12Firefox Full support ...
SVGAnimatedString - Web APIs
ific methods. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition) Recommendation Scalable Vector Graphics (SVG) 2 Candidate Recommendation Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetSVGAnimatedStringChrome Full support YesEdge Full support <=18Firefox Full su...
SVGAnimatedTransformList - Web APIs
s baseVal. The object referenced by animVal will always be distinct from the one referenced by baseVal, even when the attribute is not animated. Methods The SVGAnimatedTransformList interface doesn't provide any specific methods. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetSVGAnimatedTransformListChrome Full support YesEdge Full support <=18Firefox ...
SVGCircleElement - Web APIs
ourcesRequired, SVGStylable, and SVGTransformable by SVGGeometryElement Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'SVGCircleElement' in that specification. Recommendation Initial definition Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetSVGCircleElementChrome Full support 1Edge Full support 12Firefox Full support...
SVGImageElement.decoding - Web APIs
g.decoding = 'sync'; img.src = 'img/logo.svg'; Specifications Specification Status Comment HTML Living StandardThe definition of 'decoding' in that specification. Living Standard Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetdecoding ExperimentalChrome Full support 65Edge Full support <=79Firefox ? ...
SVGLength - Web APIs
Web › API › SVGLength
were "0.5cm" and the method was invoked to convert to millimeters, then the unitType would be changed to SVG_LENGTHTYPE_MM, valueInSpecifiedUnits would be changed to the numeric value 5 and valueAsString would be changed to "5mm". Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetSVGLengthChrome Full support YesEdge Full support <=18Firefox Full support ...
SVGLengthList - Web APIs
rted item is the item itself and not a copy. Exceptions: a DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised when the list corresponds to a read only attribute or when the object itself is read only. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetSVGLengthListChrome Full support YesEdge Full support <=18Firefox Full suppor...
SVGNumberList - Web APIs
item is the item itself and not a copy. Exceptions: a DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised when the list corresponds to a read only attribute or when the object itself is read only. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetSVGNumberListChrome Full support YesEdge Full support <=18Firefox Full suppor...
SVGPreserveAspectRatio - Web APIs
tions on setting: a DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised on an attempt to change the value of an attribute on a read only object. Methods The SVGPreserveAspectRatio interface do not provide any specific methods. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetSVGPreserveAspectRatioChrome Full support YesEdge Full support <=18Firefox Fu...
SVGStylable - Web APIs
eturns the base (i.e., static) value of a given presentation attribute as an object of type CSSValue. The returned object is live; changes to the objects represent immediate changes to the objects to which the CSSValue is attached. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetSVGStylableChrome ? Edge Full support <=18Firefox ? IE ? ...
SVGTransform - Web APIs
arameter angle defining the amount of skew. Exceptions: a DOMException with code NO_MODIFICATION_ALLOWED_ERR is raised when attempting to modify a read only attribute or when the object itself is read only. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetSVGTransformChrome Full support YesEdge Full support <=18Firefox Full support...
SVGTransformList - Web APIs
GTransformList' in that specification. Candidate Recommendation Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'SVGTransformList' in that specification. Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetSVGTransformListChrome Full support YesEdge Full support <=18Firefox Full sup...
SVGTransformable - Web APIs
ties Name Type Description transform SVGAnimatedTransformList Corresponds to attribute transform on the given element. Methods The SVGTransformable interface do not provide any specific methods. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetSVGTransformableChrome ? Edge Full support <=18Firefox ? IE ? ...
ScreenOrientation.angle - Web APIs
entation.angle Value An unsigned short integer. Specifications Specification Status Comment Screen Orientation APIThe definition of 'angle' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetangleChrome Full support 38Edge Full support 79Firefox Full support ...
ScreenOrientation.lock() - Web APIs
"landscape-secondary" Return value A Promise. Specifications Specification Status Comment Screen Orientation APIThe definition of 'lock()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetlockChrome Full support 38Edge Full support 79Firefox Full support ...
ScreenOrientation.onchange - Web APIs
reenOrientation.onchange = function(e) { ... } Specifications Specification Status Comment Screen Orientation APIThe definition of 'onchange' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetonchangeChrome Full support 38Edge Full support 79Firefox Full support ...
ScreenOrientation.type - Web APIs
x type = ScreenOrientation.type Value A String. Specifications Specification Status Comment Screen Orientation APIThe definition of 'type' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternettypeChrome Full support 38Edge Full support 79Firefox Full support ...
ScreenOrientation.unlock() - Web APIs
lock() Parameters None. Return value Void. Specifications Specification Status Comment Screen Orientation APIThe definition of 'unlock()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetunlockChrome Full support 38Edge Full support 79Firefox Full support ...
ScreenOrientation - Web APIs
ocument from its default orientation. Specifications Specification Status Comment Screen Orientation APIThe definition of 'ScreenOrientation' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetScreenOrientationChrome Full support 38Edge Full support 79Firefox Full suppo...
Screen Orientation API - Web APIs
on about the orientation of the screen. Interfaces ScreenOrientation Specifications Specification Status Comment Screen Orientation API Working Draft Initial definition. Browser Compatibility ScreenOrientation The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetScreenOrientationChrome Full support 38Edge Full support 79Firefox Full suppo...
Screen Wake Lock API - Web APIs
); Reacquiring a wake lock The following code reacquires the wake lock should the visibility of the document change and the wake lock is released. document.addEventListener('visibilitychange', () => { if (wakeLock !== null && document.visibilityState === 'visible') { wakeLock = await navigator.wakeLock.request('screen'); } }); Putting it all together You can find the complete code on github here. The demo uses a button to acquire a wake lock and also release it, which in turn updates the UI. The UI also updates if the wake lock is released automatically for any reason. There's a checkbox which when checked, will automatically reacquire the wake lock if the document's visibility state changes and becomes visible again. Performance considerations Release the screen wake lock wh...
ScriptProcessorNode.bufferSize - Web APIs
tinationNode. For each channel and each sample frame, the scriptNode.onaudioprocess function takes the associated audioProcessingEvent and uses it to loop through each channel of the input buffer, and each sample in each channel, and add a small amount of white noise, before setting that result to be the output sample in each case. ...
ScriptProcessorNode.onaudioprocess - Web APIs
tinationNode. For each channel and each sample frame, the scriptNode.onaudioprocess function takes the associated audioProcessingEvent and uses it to loop through each channel of the input buffer, and each sample in each channel, and add a small amount of white noise, before setting that result to be the output sample in each case. ...
ScriptProcessorNode - Web APIs
tinationNode. For each channel and each sample frame, the scriptNode.onaudioprocess function takes the associated audioProcessingEvent and uses it to loop through each channel of the input buffer, and each sample in each channel, and add a small amount of white noise, before setting that result to be the output sample in each case. ...
Selection.extend() - Web APIs
Web › API › Selection › extend
moved to. If not specified, the default value 0 is used. Specifications Specification Status Comment Selection APIThe definition of 'Selection.extend()' in that specification. Working Draft Current Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetextend ExperimentalChrome Full support YesEdge Full support 12Firefox Full su...
Selection.removeAllRanges() - Web APIs
yntax sel.removeAllRanges(); Parameters None. Specifications Specification Status Comment Selection APIThe definition of 'Selection.removeAllRanges()' in that specification. Working Draft Current Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetremoveAllRanges ExperimentalChrome Full support YesEdge Full support 12Firefox ...
Selection.removeRange() - Web APIs
Count; i++) { s.removeRange(s.getRangeAt(i)); } } Specifications Specification Status Comment Selection APIThe definition of 'Selection.removeRange()' in that specification. Working Draft Current Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetremoveRange ExperimentalChrome Full support 58Edge Full support 12Firefox Ful...
Selection.setBaseAndExtent() - Web APIs
Working Draft ...
Selection.toString() - Web APIs
ring()) // What is actually being effectively called. Specifications Specification Status Comment Selection APIThe definition of 'Selection: toString()' in that specification. Working Draft Current Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternettoString ExperimentalChrome Full support 1Edge Full support <=18Firefox Full ...
Selection API - Web APIs
Is specification and focuses on the Selection-related functionality. HTML Editing APIsThe definition of 'Selection' in that specification. Editor's Draft Initial (older) definition, which is now outdated. Browser compatibility Selection The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetSelection ExperimentalChrome Full support 1Edge Full support 12Firefox Full s...
Using server-sent events - Web APIs
ob_end_flush(); flush(); sleep(1); } The code above generates an event every second, with the event type "ping". Each event's data is a JSON object containing the ISO 8601 timestamp corresponding to the time at which the event was generated. At random intervals, a simple message (with no event type) is sent. Note: You can find a full example that uses the code shown in this article on GitHub -- see Simple SSE demo using PHP. Error handling When problems occur (such as a network timeout or issues pertaining to access control), an error event is generated. You can take action on this programmatically by implementing the onerror callback on the EventSource object: evtSource.onerror = function(err) { console.error("EventSource failed:", err); }; Closing event streams By defau...
Server-sent events - Web APIs
r-sent events' in that specification. Living Standard See also Tools EventSource polyfill for Node.js Remy Sharp's EventSource polyfill Yaffle's EventSource polyfill Rick Waldron's jquery plugin intercooler.js declarative SSE support Related Topics AJAX JavaScript WebSockets Other resources A Twitter like application powered by server-sent events and its code on Github. HTML5 and Server-sent events Server-sent events using Asp.Net ...
ServiceWorkerRegistration.navigationPreload - Web APIs
lue An instance of NavigationPreloadManager. Specifications Specification Status Comment Service WorkersThe definition of 'navigationPreload' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetnavigationPreload ExperimentalChrome Full support 59Edge Full support 17 Full...
SharedWorkerGlobalScope.applicationCache - Web APIs
ntax var nameObj = self.applicationCache; Value An ApplicationCache. Example If a shared worker has an AppCache associated with it, you can return a reference to the cache using self.applicationCache from inside the shared worker. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetapplicationCacheChrome Full support 4Edge Full support <=79Firefox Full suppo...
SharedWorkerGlobalScope.onconnect - Web APIs
now initialized to an empty string, as per spec (bug 1508824). Specifications Specification Status Comment HTML Living StandardThe definition of 'onconnect' in that specification. Living Standard Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetonconnectChrome Full support 4Edge Full support <=79Firefox Full support ...
Slottable: assignedSlot - Web APIs
g(slottedSpan.assignedSlot); // logs '<slot name="my-text">' Specifications Specification Status Comment DOMThe definition of 'assignedSlot' in that specification. Living Standard Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetassignedSlot ExperimentalChrome Full support 53Edge Full support 79Firefox Fu...
Slottable - Web APIs
Web › API › Slottable
Returns the <slot> the node is inserted in. Methods None. Specifications Specification Status Comment DOMThe definition of 'Slottable' in that specification. Living Standard Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetSlottable ExperimentalChrome Full support 53Edge Full support 79Firefox Full ...
StereoPannerNode.StereoPannerNode() - Web APIs
alue A new StereoPannerNode object instance. Specifications Specification Status Comment Web Audio APIThe definition of 'StereoPannerNode()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetStereoPannerNode() constructorChrome Full support 55Notes Full support 55Notes Notes Before ...
StorageManager.persist() - Web APIs
age may be cleared by the UA under storage pressure."); }); Specifications Specification Status Comment StorageThe definition of 'persist' in that specification. Living Standard Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetpersistChrome Full support 52 Full support 52 No support 48 -- 52Al...
SubtleCrypto - Web APIs
ter. Using SubtleCrypto We can split the functions implemented by this API into two groups: cryptography functions and key management functions. Cryptography functions These are the functions you can use to implement security features such as privacy and authentication in a system. The SubtleCrypto API provides the following cryptography functions: * sign() and verify(): create and verify digital signatures. * encrypt() and decrypt(): encrypt and decrypt data. * digest(): create a fixed-length, collision-resistant digest of some data. Key management functions Except for digest(), all the cryptography functions in the API use cryptographic keys. In the SubtleCrypto API a cryptographic key is represented using a CryptoKey object. To perform operations like signing and encrypting, you ...
TaskAttributionTiming.containerId - Web APIs
DOMString containing the containers id attribute. Specifications Specification Status Comment Long Tasks API 1The definition of 'containerId' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetcontainerId ExperimentalChrome Full support 58Edge Full support <=79Firefox N...
TaskAttributionTiming.containerType - Web APIs
tainer's type, one of iframe, embed, or object. Specifications Specification Status Comment Long Tasks API 1The definition of 'containerType' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetcontainerType ExperimentalChrome Full support 58Edge Full support <=79Firefox ...
HTMLSlotElement.assignedSlot - Web APIs
Web › API › Text › assignedSlot
ax var htmlSlotElement = text.assignedSlot Value A HTMLSlotElement object. Specifications Specification Status Comment DOMThe definition of 'assignedSlot' in that specification. Living Standard Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetassignedSlotChrome Full support 53Edge Full support <=18Firefox Full support ...
TextEncoder.prototype.encodeInto() - Web APIs
Living Standard Initial definition. ...
TouchEvent - Web APIs
TouchList of all the Touch objects representing all current points of contact with the surface, regardless of target or changed status. TouchEvent.rotation Read only Change in rotation (in degrees) since the event's beginning. Positive values indicate clockwise rotation; negative values indicate anticlockwise rotation. Initial value: 0.0 TouchEvent.scale Read only Distance between two digits since the event's beginning. Expressed as a floating-point multiple of the initial distance between the digits at the beginning of the event. Values below 1.0 indicate an inward pinch (zoom out). Values above 1.0 indicate an outward unpinch (zoom in). Initial value: 1.0 Touch event types There are several types of event that can be fired to indicate that touch-related changes have occurred. Y...
Multi-touch interaction - Web APIs
interactions. However, the interfaces can be a bit tricky for programmers to use because touch events are very different from other DOM input events, such as mouse events. The application described in this guide shows how to use touch events for simple single and multi-touch interactions, the basics needed to build application-specific gestures. A live version of this application is available on Github. The source code is available on Github and pull requests and bug reports are welcome. Example This example demonstrates using the touchstart, touchmove, touchcancel, and touchend) touch events for the following gestures: single touch, two (simultaneous) touches, more than two simultaneous touches, 1-finger swipe, and 2-finger move/pinch/swipe. Define touch targets The application uses <di...
Touch events - Web APIs
uch() function is used to pick a color based on the touch's unique identifier. This identifier is an opaque number, but we can at least rely on it differing between the currently-active touches. function colorForTouch(touch) { var r = touch.identifier % 16; var g = Math.floor(touch.identifier / 3) % 16; var b = Math.floor(touch.identifier / 7) % 16; r = r.toString(16); // make it a hex digit g = g.toString(16); // make it a hex digit b = b.toString(16); // make it a hex digit var color = "#" + r + g + b; console.log("color for touch with identifier " + touch.identifier + " = " + color); return color; } The result from this function is a string that can be used when calling <canvas> functions to set drawing colors. For example, for a Touch.identifier value of 10, the resul...
UIEvent.initUIEvent() - Web APIs
ument Object Model (DOM) Level 2 Events Specification, deprecated. Document Object Model (DOM) Level 2 Events SpecificationThe definition of 'UIEvent.initUIEvent()' in that specification. Obsolete Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetinitUIEvent DeprecatedNon-standardChrome Full support YesEdge Full support 12Firefox ...
UIEvent.layerX - Web APIs
Web › API › UIEvent › layerX
ds" size="7" /><br /> layerX:<input type="text" name="layerXCoords" size="7" /> layerY:<input type="text" name="layerYCoords" size="7" /> </form> </div> </body> </html> Specifications This property is not part of any specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetlayerX Non-standardChrome Full support YesEdge Full support 12Firefox Full su...
URLUtilsReadOnly.hash - Web APIs
e var result = window.self.hash; // Returns:'#hash' Specifications Specification Status Comment URLThe definition of 'URLUtilsReadOnly.hash' in that specification. Living Standard Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internethash ExperimentalChrome No support NoEdge No support NoFirefox Full support ...
URLUtilsReadOnly.host - Web APIs
w.self.host; // Returns:'developer.mozilla.org:80' Specifications Specification Status Comment URLThe definition of 'URLUtilsReadOnly.host' in that specification. Living Standard Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internethost ExperimentalChrome No support NoEdge No support NoFirefox Full support ...
URLUtilsReadOnly.hostname - Web APIs
f.hostname; // Returns:'developer.mozilla.org' Specifications Specification Status Comment URLThe definition of 'URLUtilsReadOnly.hostname' in that specification. Living Standard Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internethostname ExperimentalChrome No support NoEdge No support NoFirefox Full suppo...
URLUtilsReadOnly.href - Web APIs
tps://developer.mozilla.org/URLUtilsReadOnly.href' Specifications Specification Status Comment URLThe definition of 'URLUtilsReadOnly.href' in that specification. Living Standard Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internethref ExperimentalChrome No support NoEdge No support NoFirefox Full support ...
URLUtilsReadOnly.origin - Web APIs
; // Returns:'https://developer.mozilla.org:443' Specifications Specification Status Comment URLThe definition of 'URLUtilsReadOnly.origin' in that specification. Living Standard Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetorigin ExperimentalChrome No support NoEdge No support NoFirefox Full support...
URLUtilsReadOnly.pathname - Web APIs
hname; // Returns:'/URLUtilsReadOnly.pathname' Specifications Specification Status Comment URLThe definition of 'URLUtilsReadOnly.pathname' in that specification. Living Standard Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetpathname ExperimentalChrome No support NoEdge No support NoFirefox Full suppo...
URLUtilsReadOnly.port - Web APIs
ort var result = window.self.port; // Returns:'80' Specifications Specification Status Comment URLThe definition of 'URLUtilsReadOnly.port' in that specification. Living Standard Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetport ExperimentalChrome No support NoEdge No support NoFirefox Full support ...
URLUtilsReadOnly.protocol - Web APIs
lt = window.self.protocol; // Returns:'https:' Specifications Specification Status Comment URLThe definition of 'URLUtilsReadOnly.protocol' in that specification. Living Standard Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetprotocol ExperimentalChrome No support NoEdge No support NoFirefox Full suppo...
URLUtilsReadOnly.search - Web APIs
result = window.self.search; // Returns:'?t=67' Specifications Specification Status Comment URLThe definition of 'URLUtilsReadOnly.search' in that specification. Living Standard Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetsearch ExperimentalChrome No support NoEdge No support NoFirefox Full support...
URLUtilsReadOnly.toString() - Web APIs
f. Syntax string = object.toString(); Examples // In a Web worker, on the page https://developer.mozilla.org/URLUtilsReadOnly.href var result = window.self.toString(); // Returns:'https://developer.mozilla.org/URLUtilsReadOnly.href' Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternettoString ExperimentalChrome No support NoEdge No support NoFirefox Full suppo...
URLUtilsReadOnly - Web APIs
aining a '#' followed by the fragment identifier of the URL. Methods This interface doesn't inherit any methods. URLUtilsReadOnly.toString() Returns a DOMString containing the whole URL. It is a synonym for URLUtilsReadOnly.href. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetURLUtilsReadOnlyChrome No support NoEdge No support NoFirefox Full support ...
Using the User Timing API - Web APIs
med by the application but they are placed between two marks thus they are effectively a midpoint between two marks. This document shows how to create mark and measure performance entry types and how to use User Timing methods (which are extensions of the Performance interface) to retrieve and remove entries from the browser's performance timeline. A live version of the examples is available on Github, as is the source code. Pull requests, enhancement requests and bug reports are welcome. Performance marks A performance mark is a named performance entry that is created by the application at some location in an application. The mark is a timestamp in the browser's performance timeline. Creating a performance mark The performance.mark() method is used to create a performance mark. The met...
WaveShaperNode.WaveShaperNode() - Web APIs
rn value A new WaveShaperNode object instance. Specifications Specification Status Comment Web Audio APIThe definition of 'WaveShaperNode()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetWaveShaperNode() constructorChrome Full support 55Notes Full support 55Notes Notes Before Ch...
WebGL2RenderingContext.samplerParameter[if]() - Web APIs
nate t. param A GLint (samplerParameteri) or a GLfloat (samplerParameterf) specifying a value for pname. Return value None. Examples var sampler = gl.createSampler(); gl.samplerParameteri(sampler, gl.TEXTURE_MAG_FILTER, gl.NEAREST); Specifications The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetsamplerParameteriChrome Full support 56Edge Full support 79Firefox Full suppo...
WebGLRenderingContext - Web APIs
"Failed to get WebGL context. " + "Your browser or device may not support WebGL."; return; } gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight); gl.enable(gl.SCISSOR_TEST); gl.scissor(30, 10, 60, 60); gl.clearColor(1.0, 1.0, 0.0, 1.0); gl.clear(gl.COLOR_BUFFER_BIT); }); }, false); The source code of this example is also available on GitHub. Specifications Specification Status Comment WebGL 1.0The definition of 'WebGLRenderingContext' in that specification. Recommendation Initial definition ...
Basic scissoring - Web APIs
<< PreviousNext >> ...
Boilerplate 1 - Web APIs
<< PreviousNext >> ...
Canvas size and WebGL - Web APIs
"Failed to get WebGL context. " + "Your browser or device may not support WebGL."; return; } gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight); gl.enable(gl.SCISSOR_TEST); gl.scissor(30, 10, 60, 60); gl.clearColor(1.0, 1.0, 0.0, 1.0); gl.clear(gl.COLOR_BUFFER_BIT); }); }, false); The source code of this example is also available on GitHub. << PreviousNext >> ...
Clearing by clicking - Web APIs
<< PreviousNext >> ...
Clearing with colors - Web APIs
ns! Your browser supports WebGL. "; gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight); // Set the clear color to darkish green. gl.clearColor(0.0, 0.5, 0.0, 1.0); // Clear the context with the newly set color. This is // the function call that actually does the drawing. gl.clear(gl.COLOR_BUFFER_BIT); }, false); The source code of this example is also available on GitHub. << PreviousNext >> ...
Color masking - Web APIs
<< PreviousNext >> ...
Detect WebGL - Web APIs
text("experimental-webgl"); // Report the result. if (gl && gl instanceof WebGLRenderingContext) { paragraph.innerHTML = "Congratulations! Your browser supports WebGL."; } else { paragraph.innerHTML = "Failed to get WebGL context. " + "Your browser or device may not support WebGL."; } } }, false); The source code of this example is also available on GitHub. << PreviousNext >> ...
Hello GLSL - Web APIs
<< PreviousNext >> ...
Hello vertex attributes - Web APIs
<< PreviousNext >> ...
Raining rectangles - Web APIs
<< PreviousNext >> ...
Scissor animation - Web APIs
<< PreviousNext >> ...
Simple color animation - Web APIs
WebGLRenderingContext clear color to the // random color. gl.clearColor(color[0], color[1], color[2], 1.0); // Clear the context with the newly set color. gl.clear(gl.COLOR_BUFFER_BIT); } // Random color helper function. function getRandomColor() { return [Math.random(), Math.random(), Math.random()]; } }, false); The source code of this example is also available on GitHub. << PreviousNext >> ...
Textures from code - Web APIs
<< PreviousNext >> ...
Adding 2D content to a WebGL context - Web APIs
This project uses the glMatrix library to perform its matrix operations, so you will need to include that in your project. We're loading a copy from a CDN in our HTML's <head>. ...
Getting started with WebGL - Web APIs
ther HTML elements and composited with other parts of the page or page background. This article will introduce you to the basics of using WebGL. It's assumed that you already have an understanding of the mathematics involved in 3D graphics, and this article doesn't pretend to try to teach you 3D graphics concepts itself. The code examples in this tutorial can also be found in the webgl-examples GitHub repository. It's worth noting here that this series of articles introduces WebGL itself; however, there are a number of frameworks available that encapsulate WebGL's capabilities, making it easier to build 3D applications and games, such as THREE.js and BABYLON.js. Preparing to render in 3D The first thing you need in order to use WebGL for rendering is a canvas. The HTML fragment below dec...
WebGL model view projection - Web APIs
will create 2 triangles that will draw a square on the screen. The Z depth in the squares determines what gets drawn on top when the squares share the same space. The smaller Z values are rendered on top of the larger Z values. WebGLBox example This example will create a custom WebGLBox object that will draw a 2D box on the screen. Note: The code for each WebGLBox example is available in this github repo and is organized by section. In addition there is a JSFiddle link at the bottom of each section. WebGLBox constructor The constructor looks like this: function WebGLBox() { // Setup the canvas and WebGL context this.canvas = document.getElementById('canvas'); this.canvas.width = window.innerWidth; this.canvas.height = window.innerHeight; this.gl = MDN.createContext(canvas); ...
Taking still photos with WebRTC - Web APIs
The HTML markup Our HTML interface has two main operational sections: the stream and capture panel and the presentation panel. Each of these is presented side-by-side in its own <div> to facilitate styling and control. ...
Using DTMF with WebRTC - Web APIs
an opportunity to update interface elements, for example. When the tone buffer is empty, indicating that all the tones have been sent, a tonechange event with its tone property set to "" (an empty string) is delivered to the connection object. If you'd like to know more about how this works, read RFC 3550: RTP: A Transport Protocol for Real-Time Applications and RFC 4733: RTP Payload for DTMF Digits, Telephony Tones, and Telephony Signals. The details of how DTMF payloads are handled on RTP are beyond the scope of this article. Instead, we'll focus on how to use DTMF within the context of an RTCPeerConnection by studying how an example works. Simple example This simple example constructs two RTCPeerConnections, establishes a connection between them, then waits for the user to click a "Dia...
WebRTC API - Web APIs
and an associated RTCDataChannel to exchange arbitrary data between two peers. Using DTMF with WebRTC WebRTC's support for interacting with gateways that link to old-school telephone systems includes support for sending DTMF tones using the RTCDTMFSender interface. This guide shows how to do so. Tutorials Improving compatibility using WebRTC adapter.js The WebRTC organization provides on GitHub the WebRTC adapter to work around compatibility issues in different browsers' WebRTC implementations. The adapter is a JavaScript shim which lets your code to be written to the specification so that it will "just work" in all browsers with WebRTC support. Taking still photos with WebRTC This article shows how to use WebRTC to access the camera on a computer or mobile phone with WebRTC suppor...
Web Video Text Tracks Format (WebVTT) - Web APIs
verlapping timings. Each cue timing contains five components: Timestamp for start time. At least one space. The string "-->". At least one space. Timestamp for end time. Which must be greater than the start time. The timestamps must be in one of two formats: mm:ss.ttt hh:mm:ss.ttt Where the components are defined as follows: hh is hours. Must be at least two digits. Hours can be greater than two digits (e.g., 9999:00:00.000). mm is minutes. Must be between 00 and 59 inclusive. ss is seconds. Must be between 00 and 59 inclusive. ttt is miliseconds. Must be between 000 and 999 inclusive. Example 10 - Basic cue timing examples 00:00:22.230 --> 00:00:24.606 00:00:30.739 --> 00:00:34.074 00:00:34.159 --> 00:00:35.7...
Geometry and reference spaces in WebXR - Web APIs
positions and orientations of objects--both physical and virtual--are described in relation to one another using spaces and, in particular, reference spaces. The article Spatial tracking in WebXR builds upon the information provided here to cover how the physical position and orientation of the user's head, as well as potentially other parts of their body such as the hands, are mapped into the digital world, as well as how the relative positions of both physical and virtual objects are tracked as they move around, so that the scene can be properly rendered and composited. Fundamentals of 3D geometry While we'll examine here the required math operations used to compute the positions, orientations, and movement of objects in virtual space--plus the need to integrate the human viewer of the s...
Inputs and input sources - Web APIs
ls are beyond the scope of this article, however. Input profiles As mentioned above, each input source has a list of input profile names that correspond to a set of information describing that input source and how it can be used. Those names are found in the input source's profiles property, and the official registry of these profile strings is maintained in the WebXR Input Profiles Registry on GitHub. For example, the generic-trigger-squeeze-touchpad profile name can be used to locate the following JSON profile data by locating the profileId field that has the value generic-trigger-squeeze-touchpad. { "profileId": "generic-trigger-squeeze-touchpad", "fallbackProfileIds": [], "layouts" : { "left-right-none" : { "selectComponentId": "xr-standard-trigger", ...
Lighting a WebXR setting - Web APIs
orithms and machine learning engines to generate the estimated lighting information. At present, WebXR doesn't offer support for lighting estimation. However, a specification is currently being drafted under the auspices of the W3C. You can learn all about the proposed API and a fair amount about the concept of lighting estimation in the explainer documnent that's included in the specification's GitHub repository. In essence, lighting estimation collects this information about the light sources and the shape and orientation of the objects in the scene, along with information about the materials they're made of, then returns data you can use to create virtual light source objects that approximately match the real world's lighting. The specifics of how lighting estimation works, especially i...
Movement, orientation, and motion: A WebXR example - Web APIs
he user at the moment. It's called once for each eye, with slightly different positions for each eye, in order to establish the 3D effect needed for XR gear. Most of this code is typical WebGL rendering code, taken directly from the drawScene() function in the Lighting in WebGL article, and it's there that you should look for details on the WebGL rendering parts of this example [view the code on GitHub]. But here it begins with some code specific to this example, so we'll take a deeper look at that part. const normalMatrix = mat4.create(); const modelViewMatrix = mat4.create(); function renderScene(gl, view, programInfo, buffers, texture, deltaTime) { const xRotationForTime = (xRotationDegreesPerSecond * RADIANS_PER_DEGREE) * deltaTime; const yRotationForTime = (yRotationDegreesPerSeco...
Starting up and shutting down a WebXR session - Web APIs
hould always test your code on actual AR and/or VR hardware before releasing or shipping a product! Emulated, simulated, or polyfilled environments are not an adequate substitute for actual testing on physical devices. Getting the extension Download the WebXR API Emulator for your supported browser below: Google Chrome Mozilla Firefox The source code for the extension is also available on GitHub. Emulator issues and notes While this isn't the place for a full article about the extension, there are some specific things worth mentioning. Version 0.4.0 of the extension was announced on March 26, 2020. It introduced support for augmented reality (AR) through the WebXR AR Module, which has is approaching a stable state. Documentation for AR is forthcoming shortly here on MDN. Other imp...
Basic concepts behind Web Audio API - Web APIs
esent time, in a useful way for doing precise audio manipulation. Note: To get a time in seconds from a frame count, simply divide the number of frames by the sample rate. To get a number of frames from a number of samples, simply divide by the channel count. Here's a couple of simple examples: var context = new AudioContext(); var buffer = context.createBuffer(2, 22050, 44100); Note: In digital audio, 44,100 Hz (alternately represented as 44.1 kHz) is a common sampling frequency. Why 44.1kHz? Firstly, because the hearing range of human ears is roughly 20 Hz to 20,000 Hz. Via the Nyquist-Shannon sampling theorem, the sampling frequency must be greater than twice the maximum frequency one wishes to reproduce. Therefore, the sampling rate has to be greater than 40 kHz. Secondly, s...
Web Audio API best practices - Web APIs
for working with the Web Audio API. Loading sounds/files There are four main ways to load sound with the Web Audio API and it can be a little confusing as to which one you should use. When working with files, you are looking at either the grabbing the file from an HTMLMediaElement (i.e. an <audio> or <video> element), or you're looking to fetch the file and decode it into a buffer. Both are legitimate ways of working, however, it's more common to use the former when you are working with full-length tracks, and the latter when working with shorter, more sample-like tracks. Media elements have streaming support out of the box. The audio will start playing when the browser determines it can load the rest of the file before playing finishes. You can see an example of how to use this with the...
Using the Web Audio API - Web APIs
f playing more than 1,000 simultaneous sounds without stuttering. Example code Our boombox looks like this: Note the retro cassette deck with a play button, and vol and pan sliders to allow you to alter the volume and stereo panning. We could make this a lot more complex, but this is ideal for simple learning at this stage. Check out the final demo here on Codepen, or see the source code on GitHub. Browser support Modern browsers have good support for most features of the Web Audio API. There are a lot of features of the API, so for more exact information, you'll have to check the browser compatibility tables at the bottom of each reference page. Audio graphs Everything within the Web Audio API is based around the concept of an audio graph, which is made up of nodes. The Web Audio ...
Web Speech API - Web APIs
speech service including information about language, name and URI. Window.speechSynthesis Specced out as part of a [NoInterfaceObject] interface called SpeechSynthesisGetter, and Implemented by the Window object, the speechSynthesis property provides access to the SpeechSynthesis controller, and therefore the entry point to speech synthesis functionality. Examples The Web Speech API repo on GitHub contains demos to illustrate speech recognition and synthesis. Specifications Specification Status Comment Web Speech API Draft Initial definition ...
Using the Web Storage API - Web APIs
s still no guarantee that the localStorage API is actually available, as various browsers offer settings that disable localStorage. So a browser may support localStorage, but not make it available to the scripts on the page. For example, Safari browser in Private Browsing mode gives us an empty localStorage object with a quota of zero, effectively making it unusable. Conversely, we might get a legitimate QuotaExceededError, which means that we've used up all available storage space, but storage is actually available. Our feature detection should take these scenarios into account. Here is a function that detects whether localStorage is both supported and available: function storageAvailable(type) { var storage; try { storage = window[type]; var x = '__storage_test__'...
window.cancelIdleCallback() - Web APIs
ple in the article Cooperative Scheduling of Background Tasks API. Specifications Specification Status Comment Cooperative Scheduling of Background Tasks Proposed Recommendation Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetcancelIdleCallback ExperimentalChrome Full support 47Edge Full support 79Firefox ...
Window.customElements - Web APIs
ples repo for more usage examples. Specification Specification Status Comment HTML Living StandardThe definition of 'window.customElements' in that specification. Living Standard Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetcustomElementsChrome Full support 54Edge Full support 79Firefox Full support ...
Window.devicePixelRatio - Web APIs
d; } Result Specifications Specification Status Comment CSS Object Model (CSSOM) View ModuleThe definition of 'Window.devicePixelRatio' in that specification. Working Draft Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetdevicePixelRatioChrome Full support 1Edge Full support 12Firefox Full support...
window.dump() - Web APIs
Web › API › Window › dump
a terminal. To redirect the console output to a file, run firefox without the -console option and use the syntax to redirect stderr and stdout to a file, i.e.: firefox > console.txt 2>&1 If you would like the console messages to appear in the console you used to launch the application, you can use the Gecko Console Redirector. Precompiled binaries are available in the zipped archive https://github.com/matthewkastor/Redirector/archive/master.zip under Redirector-master\Gecko\Console Redirector\bin\Release Copy all the dll's and the exe to wherever you want. Then run Console Redirector.exe /? Specification This is not part of any specification ...
Window.event - Web APIs
Web › API › Window › event
is not accurate for events dispatched within shadow trees. Specifications Specification Status Comment DOMThe definition of 'Window.event' in that specification. Living Standard Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InterneteventChrome Full support 1Edge Full support 12Firefox Full support ...
Window.minimize() - Web APIs
Web › API › Window › minimize
The Window.minimize() method sets the window to a minimized state. A way to undo this method programatically is by calling window.moveTo(). Browser Compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetminimize Non-standardChrome No support NoEdge No support NoFirefox No support NoIE ? Opera ? ...
Window.openDialog() - Web APIs
Web › API › Window › openDialog
call returns. Inside the dialog code, you can set the properties as follows: var retVals = window.arguments[2]; retVals.address = enteredAddress; retVals.delivery = "immediate"; Specification This is not part of any specification. Browser Compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetopenDialog Non-standardChrome No support NoEdge No support NoFirefox No suppo...
Window.pageYOffset - Web APIs
h. Integer bibendum imperdiet suscipit. Fusce ligula leo, consectetur ac ante eget, gravida laoreet purus. Cras sodales efficitur risus, sed feugiat sem. Pellentesque justo augue, placerat non leo sit amet, laoreet fringilla arcu.</p> <p>Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Proin in gravida libero. Vivamus placerat, lacus eget condimentum sagittis, enim nunc bibendum nisi, quis varius erat felis sit amet risus.</p> <p>Sed non finibus ligula. Fusce a magna auctor, molestie nibh eget, sodales felis. Donec imperdiet facilisis mi ut aliquam. Etiam sodales suscipit urna, eget hendrerit neque elementum a. Vivamus fringilla sodales est ut ultricies. Nulla convallis congue maximus. Nullam consectetur felis vitae ultricies accumsan. Mauris at al...
Window.print() - Web APIs
Web › API › Window › print
sions of Safari, it may return immediately. Syntax window.print() Specification Specification Status Comment HTML Living StandardThe definition of 'print()' in that specification. Living Standard Browser Compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetprintChrome Full support 1Notes Full support 1Notes Notes Starting with Chrome 46, this meth...
Window.prompt() - Web APIs
Web › API › Window › prompt
umber. const aNumber = Number(window.prompt("Type a number", "")); Specification Specification Status Comment HTML Living StandardThe definition of 'prompt()' in that specification. Living Standard Browser Compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetpromptChrome Full support 1Notes Full support 1Notes Notes Starting with Chrome 46, this met...
Window.releaseEvents() - Web APIs
that you can pass a list of events to this method using the following syntax: window.releaseEvents(Event.KEYPRESS | Event.KEYDOWN | Event.KEYUP). See also window.captureEvents ( ). Specification This is not part of any specification. Browser Compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetreleaseEvents DeprecatedNon-standardChrome Full support YesEdge Full support 12Firefox ...
Window.requestFileSystem() - Web APIs
r. Return value undefined Example Specifications Specification Status Comment File and Directory Entries API Draft Draft of proposed API This API has no official W3C or WHATWG specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetrequestFileSystem ExperimentalNon-standardChrome Full support 13Prefixed Full support 13Pref...
window.requestIdleCallback() - Web APIs
ample in the article Cooperative Scheduling of Background Tasks API. Specifications Specification Status Comment Cooperative Scheduling of Background Tasks Proposed Recommendation Initial definition. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetrequestIdleCallback ExperimentalChrome Full support 47Edge Full support 79Firefox ...
Window: resize event - Web APIs
l possible to set onresize attributes or use addEventListener() to set a handler on any element. However, resize events are only fired on the window object (i.e. returned by document.defaultView). Only handlers registered on the window object will receive resize events. There is a proposal to allow all elements to be notified of resize changes. See Resize Observer to read the draft document, and GitHub issues to read the on-going discussions. Examples Window size logger The following example reports the window size each time it is resized. Bear in mind that since the example is running in an <iframe>, you'll need to actually get the <iframe> to resize before you see an effect. <p>Resize the browser window to fire the <code>resize</code> event.</p> <p>Window height: <span id="height"></sp...
Window.restore() - Web APIs
Web › API › Window › restore
This method is currently not working, but you can use: window.moveTo(window.screenX, window.screenY); Browser Compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetrestoreChrome No support NoEdge No support NoFirefox No support NoIE ? Opera ? Safari ? WebV...
Window.routeEvent() - Web APIs
Web › API › Window › routeEvent
couraged since it could be removed at any time. Try to avoid using it. The Window method routeEvent(), which is obsolete and no longer available, used to be called to forward an event to the next object that has asked to capture events. Browser Compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetrouteEvent DeprecatedNon-standardChrome No support NoEdge No support NoFirefox ...
Window.scroll() - Web APIs
Web › API › Window › scroll
and Element.scrollLeft. Specification Specification Status Comment CSS Object Model (CSSOM) View ModuleThe definition of 'window.scroll()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetscrollChrome Full support 1Edge Full support 12Firefox Full support ...
Window.scrollBy() - Web APIs
Web › API › Window › scrollBy
ndow.scrollByPages(). Specification Specification Status Comment CSS Object Model (CSSOM) View ModuleThe definition of 'window.scrollBy()' in that specification. Working Draft Initial definition. Browser Compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetscrollByChrome Full support 1Edge Full support 79 Full support ...
Window.setCursor() - Web APIs
Web › API › Window › setCursor
isn't reset until it's set back to auto. This function is a part of ChromeWindow interface. This function is unavailable to web pages, which can use the CSS cursor property instead. Specification This is not part of any specification. Browser Compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetsetCursor Non-standardChrome No support NoEdge No support NoFirefox No suppor...
Window.showModalDialog() - Web APIs
. Examples Try out showModalDialog(). Notes showModalDialog() was briefly standardized as part of HTML5. The third argument for additional options was not present in the HTML5 version. Specification MSDN page for showModalDialog Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetshowModalDialog DeprecatedNon-standardChrome No support ? -- 43Edge No support NoFirefox No suppor...
Window.stop() - Web APIs
Web › API › Window › stop
fication Status Comment HTML Living StandardThe definition of 'Window.stop()' in that specification. Living Standard HTML5The definition of 'Window.stop' in that specification. Recommendation Browser Compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetstopChrome Full support YesEdge Full support 14Firefox Full support ...
Window.updateCommands() - Web APIs
d node as appropriate), or ensures that the command state reflects the state of the selection by setting current state information in the "state" attribute of the XUL command nodes. Specification DOM Level 0. Not part of specification. Browser Compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetupdateCommands Non-standardChrome No support NoEdge No support NoFirefox Full...
WindowOrWorkerGlobalScope.atob() - Web APIs
ntains an base64 encoded data. Return value An ASCII string containing decoded data from encodedData. Exceptions DOMException (name: InvalidCharacterError) Throws if encodedData is not valid base64. Example const encodedData = window.btoa('Hello, world'); // encode a string const decodedData = window.atob(encodedData); // decode the string Polyfill You can use a polifill from https://github.com/MaxArt2501/base64-js/blob/master/base64.js for browsers that don't support it. Specifications Specification Status Comment HTML Living StandardThe definition of 'WindowOrWorkerGlobalScope.atob()' in that specification. Living Standard Method moved to the WindowOrWorkerGlobalScope mixin in the latest spec. HTML 5.1The definition of 'WindowBase64.
WindowOrWorkerGlobalScope.btoa() - Web APIs
Specifications Specification Status Comment HTML Living StandardThe definition of 'WindowOrWorkerGlobalScope.btoa()' in that specification. Living Standard Method moved to the WindowOrWorkerGlobalScope mixin in the latest spec. HTML 5.1The definition of 'WindowBase64.
Worker.prototype.postMessage() - Web APIs
f.byteLength: 8 myWorker.js:5:2 incoming message from worker, msg: message { ... } bootstrap.js:20 got back buf in main thread, aBuf.byteLength: 8 bootstrap.js:12 from worker, POST send back aBuf.byteLength: 0 myWorker.js:7:2 byteLength goes to 0 as it is transferred. To see a full working example of this Firefox demo add-on see here: GitHub :: ChromeWorker - demo-transfer-arraybuffer Specifications Specification Status Comment HTML Living StandardThe definition of 'Worker.postMessage()' in that specification. Living Standard ...
WorkerNavigator.permissions - Web APIs
') { showNotification(); } else if (result.state === 'prompt') { requestNotificationPermission() } }); Specification Specification Status Comment Permissions Working Draft Initial definition. Browser Support The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetpermissions ExperimentalChrome Full support 43Edge Full support <=79Firefox N...
Worklet.addModule() - Web APIs
Web › API › Worklet › addModule
ction handler. AbortError The specified script is invalid or could not be loaded. SyntaxError The specified moduleURL is invalid. ...
WritableStream - Web APIs
and its writer when to resolve defaultWriter.ready. Specifications Specification Status Comment StreamsThe definition of 'WritableStream' in that specification. Living Standard Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetWritableStream ExperimentalChrome Full support 59Edge Full support 16Firefox ...
WritableStreamDefaultWriter.ready - Web APIs
console.log("Stream error: " + err); }); }); }); } Specifications Specification Status Comment StreamsThe definition of 'ready' in that specification. Living Standard Initial definition. Browser Compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetready ExperimentalChrome Full support 59Edge Full support 16Firefox No suppor...
Accessibility: What users can do to browse more safely - Accessibility
at by changing the value the image.animation_mode from "normal" to "none", all animated images will be blocked. To reverse it, you will have to change the value back to "normal" Use browser extensions Gif Blocker For Chrome, GIF Blocker is an extension available at the web store. Gif Scrubber Gif Scrubber is a chrome extension that allows you to control gifs like a video player. There is a Github repository for it at https://github.com/0ui/gif-scrubber Beeline Reader Beeline Reader has a browser extension that allows you to set up for grayscale and Dyslexi font, among other things Take advantage Operating System accessibility features Most operating systems such as Windows 10, have accessibility options that are surprisingly powerful. Usually they are quite easy to find by simpl...
Understanding the Web Content Accessibility Guidelines - Accessibility
2.0 or 2.1? WCAG 2.1 is the most recent and relevant accessibility standard. Use WCAG 2.1 to help more people with disabilities and reduce the future legal risk for web site owners. Target WCAG 2.0 first when allocating resources. Then step up to WCAG 2.1. What is WCAG 2.1? WCAG 2.1 was published as an official recommendation on 05 June 2018. The European Union (EU) adopted WCAG 2.1 as the digital accessibility standard in September 2018. W3C published a press release WCAG 2.1 Adoption in Europe. WCAG 2.1 includes: all of WCAG 2.0 (verbatim, word-for-word) 17 new Success Criteria at the A / AA / AAA levels primarily addressing user needs in these areas: Mobile Accessibility Low Vision Cognitive Read more about WCAG 2.1: Deque: WCAG 2.1: What is Next for Ac...
-moz-context-properties - CSS: Cascading Style Sheets
Specifications Not part of any standard. ...
::-webkit-scrollbar - CSS: Cascading Style Sheets
Proin at nulla elementum, consectetur ex eget, commodo ante. Sed eros mi, bibendum ut dignissim et, maximus eget nibh. Phasellus blandit quam turpis, at mollis velit pretium ut. Nunc consequat efficitur ultrices. Nullam hendrerit posuere est. Nulla libero sapien, egestas ac felis porta, cursus ultricies quam. Vestibulum tincidunt acc...
::slotted() - CSS: Cascading Style Sheets
Web › CSS › ::slotted
on">Superhero</span> </person-details> Specifications Specification Status Comment CSS Scoping Module Level 1The definition of '::slotted' in that specification. Working Draft Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet::slottedChrome Full support 50Edge Full support 79Firefox Full support ...
:checked - CSS: Cascading Style Sheets
Web › CSS › :checked
ition of ':checked' in that specification. Working Draft No change. Selectors Level 3The definition of ':checked' in that specification. Recommendation Defines the pseudo-class, but not the associated semantic Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet:checkedChrome Full support 1Notes Full support 1Notes Notes On macOS, styling <option&rt; e...
:defined - CSS: Cascading Style Sheets
Web › CSS › :defined
n't end up with flashes of ugly unstyled elements on the page Specifications Specification Status Comment HTML Living StandardThe definition of ':defined' in that specification. Living Standard Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet:definedChrome Full support 54Edge Full support 79Firefox Full support ...
:has() - CSS: Cascading Style Sheets
Web › CSS › :has
a <p> element directly following them: h1:has(+ p) Specifications Specification Status Comment Selectors Level 4The definition of ':has()' in that specification. Working Draft Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet:has()Chrome No support NoNotes No support NoNotes Notes See bug 669058Edge ...
:host-context() - CSS: Cascading Style Sheets
r inside the <h1> in our design. Specifications Specification Status Comment CSS Scoping Module Level 1The definition of ':host-context()' in that specification. Working Draft Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet:host-context()Chrome Full support 54Edge Full support 79Firefox No support ...
:host - CSS: Cascading Style Sheets
Web › CSS › :host
w host in this instance) in the document. Specifications Specification Status Comment CSS Scoping Module Level 1The definition of ':host' in that specification. Working Draft Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet:hostChrome Full support 54Edge Full support 79Firefox Full support ...
:hover - CSS: Cascading Style Sheets
Web › CSS › :hover
nly when the mouse moves over a thumbnail. See this demo for a possible cue. Note: For an analogous effect, but based on the :checked pseudo-class (applied to hidden radioboxes), see this demo, taken from the :checked reference page. Specifications Specification Comment Feedback HTML Living StandardThe definition of ':hover' in that specification. WHATWG HTML GitHub issues Selectors Level 4The definition of ':hover' in that specification. Allows :hover to be applied to any pseudo-element. CSS Working Group drafts GitHub issues Selectors Level 3The definition of ':hover' in that specification. CSS Level 2 (Revision 1)The definition of ':hover' in that specification. Initial definition. ...
:is() (:matches(), :any()) - CSS: Cascading Style Sheets
Web › CSS › :is
rated by the example on the :where() reference page. Specifications Specification Status Comment Selectors Level 4The definition of ':is()' in that specification. Working Draft Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet:is()Chrome Full support 68Notes Disabled Full support 68Notes Disabled Notes Combinators in...
:link - CSS: Cascading Style Sheets
Web › CSS › :link
definition of ':link' in that specification. Recommendation Lift the restriction to only apply it for <a> element. CSS Level 1The definition of ':link' in that specification. Recommendation Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet:linkChrome Full support 1Edge Full support 12Firefox Full support ...
:read-only - CSS: Cascading Style Sheets
tion Defines the semantics regarding HTML and constraint validation. Selectors Level 4The definition of ':read-only' in that specification. Working Draft Defines the pseudo-class, but not the associated semantics. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet:read-onlyChrome Full support 1Edge Full support 13Firefox Full support ...
:read-write - CSS: Cascading Style Sheets
ion Defines the semantics regarding HTML and constraint validation. Selectors Level 4The definition of ':read-write' in that specification. Working Draft Defines the pseudo-class, but not the associated semantics. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet:read-writeChrome Full support 1Edge Full support 13Firefox Full support ...
:scope - CSS: Cascading Style Sheets
Web › CSS › :scope
ds : <span id="results"></span> </p> Result Specifications Specification Status Comment Selectors Level 4The definition of ':scope' in that specification. Working Draft Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet:scopeChrome Full support 27Edge Full support 79Firefox Full support ...
:target - CSS: Cascading Style Sheets
Web › CSS › :target
: red; } Result Pure-CSS lightbox You can use the :target pseudo-class to create a lightbox without using any JavaScript. This technique relies on the ability of anchor links to point to elements that are initially hidden on the page. Once targeted, the CSS changes their display so that they are shown. Note: A more complete pure-CSS lightbox based on the :target pseudo-class is available on GitHub (demo). HTML <ul> <li><a href="#example1">Open example #1</a></li> <li><a href="#example2">Open example #2</a></li> </ul> <div class="lightbox" id="example1"> <figure> <a href="#" class="close"></a> <figcaption>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec felis enim, placerat id eleifend eu, semper vel sem.</figcaption> </figure> </div> <div class="l...
:visited - CSS: Cascading Style Sheets
Web › CSS › :visited
ts the restriction to only apply :visited to the <a> element. Lets browsers restrict its behavior for privacy reasons. CSS Level 1The definition of ':visited' in that specification. Recommendation Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet:visitedChrome Full support 1Edge Full support 12Firefox Full support ...
@charset - CSS: Cascading Style Sheets
Web › CSS › @charset
", the charset is not a CSS <string> */ Specifications Specification Status Comment CSS Level 2 (Revision 1)The definition of '@charset' in that specification. Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet@charsetChrome Full support 2Edge Full support 12Firefox Full support ...
@font-feature-values - CSS: Cascading Style Sheets
es: styleset(nice-style); } Specifications Specification Status Comment CSS Fonts Module Level 4The definition of '@font-feature-values' in that specification. Working Draft Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet@font-feature-valuesChrome No support NoEdge No support NoFirefox Full suppor...
scan - CSS: Cascading Style Sheets
Web › CSS › @media › scan
Rather, it means the process by which an image is painted onto a television screen (or other device). Syntax The scan feature is specified as a single keyword value chosen from the list below. interlace The device draws odd lines and even lines alternately. Some televisions use interlaced scanning. progressive The device draws all lines in sequence. ...
@supports - CSS: Cascading Style Sheets
Web › CSS › @supports
upports' in that specification. Editor's Draft Adds the selector() function. CSS Conditional Rules Module Level 3The definition of '@supports' in that specification. Candidate Recommendation Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet@supportsChrome Full support 28Edge Full support 12Firefox Full support ...
viewport-fit - CSS: Cascading Style Sheets
e initial layout viewport, and the whole web page is viewable. contain The viewport is scaled to fit the largest rectangle inscribed within the display. cover The viewport is scaled to fill the device display. It is highly recommended to make use of the safe area inset variables to ensure that important content doesn't end up outside the display. This descriptor hasn't been added to https://github.com/mdn/data/blob/master/css/at-rules.json yet. Accessibility concerns When using the viewport-fit descriptor, one must keep in mind that not all device displays are rectangular, and should therefore make use of the safe area inset variables. Formal definition Related at-rule@viewportInitial valueautoComputed valueas specified Formal syntax auto | contain | cover Examples Scaling viewp...
@viewport - CSS: Cascading Style Sheets
Web › CSS › @viewport
The @viewport CSS at-rule lets you configure the viewport through which the document is viewed. It's primarily used for mobile devices, but is also used by desktop browsers that support features like "snap to edge" (such as Microsoft Edge). Lengths specified as percentages are calculated relative to the initial viewport, which is the viewport before any user agent or authored styles have had an opportunity to adjust the viewport. This is typically based on the size of the window on desktop browsers that aren't in full screen mode. ...
Auto-placement in CSS Grid Layout - CSS: Cascading Style Sheets
t often come up as questions. Currently we can't do things like target every other cell of the grid with our items. A related issue may have already come to mind if you followed the last guide about named lines on the grid. It would be to define a rule that said "auto-place items against the next line named "n", and grid would then skip other lines.There is an issue raised about this on the CSSWG GitHub repository, and you would be welcome to add your own use cases to this. It may be that you come up with your own use cases for auto-placement or any other part of grid layout. If you do, raise them as issues or add to an existing issue that could solve your use case. This will help to make future versions of the specification better. ...
Basic concepts of Logical Properties and Values - CSS: Cascading Style Sheets
The CSS Working Group are currently trying to decide what to do about the four-value shorthands for logical properties, for example the equivalents to setting four physical properties at once, like margins with the margin property. We would need some kind of modifier if we were to reuse margin for flow-relative properties. If you would like to read the suggestions or comment on them the relevant GitHub issue is #1282. Testing for browser support You can test for support of logical properties and values using feature queries. For example you could set a width, test for inline-size and, if it is supported, set the width to auto and the inline-size to the original width value. ...
CSS Overflow - CSS: Cascading Style Sheets
nt appearing outside of the box for which scrolling mechanisms need to be provided. The overflow properties are how we can control what happens when content overflows a box. Basic example The following interactive example shows how changing the value of the overflow property, changes how the overflow of a fixed height box is dealt with. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Reference CSS properties overflow overflow-block overflow-inline overflow-x overflow-y text-overflow block-overflow line-clamp max-lines continue Non-standard properties -webkit-line-clamp Specificat...
CSS Scrollbars - CSS: Cascading Style Sheets
inition. Accessibility concerns When you customize scrollbars, consider they have enough contrast and that their hit area is large enough for people who use touch input. Baseline Rules for Scrollbar Usability | Adrian Roselli Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. scrollbar-width DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetscrollbar-widthChrome No support NoEdge No support NoFirefox ...
align-items - CSS: Cascading Style Sheets
SS align-items property sets the align-self value on all direct children as a group. In Flexbox, it controls the alignment of items on the Cross Axis. In Grid Layout, it controls the alignment of items on the Block Axis within their grid area. The interactive example below demonstrates some of the values for align-items using grid layout. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Basic keywords */ align-items: normal; align-items: stretch; /* Positional alignment */ /* align-items does not take left and right values */ align-items: center; /* Pack items around the center */ align-items: start; /* ...
animation-iteration-count - CSS: Cascading Style Sheets
The animation-iteration-count CSS property sets the number of times an animation sequence should be played before stopping. If multiple values are specified, each time the animation is played the next value in the list is used, cycling back to the first value after the last one is used. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. It is often convenient to use the shorthand property animation to set all animation properties at once. Syntax /* Keyword value */ animation-iteration-count: infinite; /* <number> values */ animation-iteration-count: 3; animation-iteration-count: 2.4; /* Multiple values */ animati...
animation-play-state - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Resuming a paused animation will start the animation from where it left off at the time it was paused, rather than starting over from the beginning of the animation sequence. ...
animation - CSS: Cascading Style Sheets
Web › CSS › animation
The animation shorthand CSS property applies an animation between styles. It is a shorthand for animation-name, animation-duration, animation-timing-function, animation-delay, animation-iteration-count, animation-direction, animation-fill-mode, and animation-play-state. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. /* @keyframes duration | timing-function | delay | iteration-count | direction | fill-mode | play-state | name */ animation: 3s ease-in 1s 2 reverse both paused slidein; /* @keyframes name | duration | timing-function | delay */ animation: 3s linear 1s slidein; /* @keyframes name | duration */ animat...
appearance (-moz-appearance, -webkit-appearance) - CSS: Cascading Style Sheets
's theme. The -moz-appearance and -webkit-appearance properties are non-standard versions of this propery, used (respectively) by Gecko (Firefox) and by WebKit-based (e.g., Safari) and Blink-based (e.g., Chrome, Opera) browsers to achieve the same thing. Note that Firefox and Edge also support -webkit-appearance, for compatibility reasons. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The -moz-appearance property was used in XUL stylesheets to design custom widgets with platform-appropriate styling. It was also used in the XBL implementations of the widgets that ship with the Mozilla platform. Starting with Gecko/...
aspect-ratio - CSS: Cascading Style Sheets
o: attr(width) / attr(height); } Specifications Specification Status Comment CSS Box Sizing Module Level 4The definition of 'aspect-ratio' in that specification. Editor's Draft Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetaspect-ratio ExperimentalChrome Partial support 79Notes Partial support 79Notes Notes Chrome 79 adds internal support only for map...
backface-visibility - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. An element's back face is a mirror image of its front face. Though invisible in 2D, the back face can become visible when a transformation causes the element to be rotated in 3D space. ...
background-blend-mode - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Blending modes should be defined in the same order as the background-image property. If the blending modes' and background images' list lengths are not equal, it will be repeated and/or truncated until lengths match. ...
background-image - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The background images are drawn on stacking context layers on top of each other. The first layer specified is drawn as if it is closest to the user. The borders of the element are then drawn on top of them, and the background-color is drawn beneath them. ...
<basic-shape> - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax The <basic-shape> data type is defined with one of the basic shape functions listed below. When creating a shape, the reference box is defined by each property that uses <basic-shape> values. ...
border-block-end-color - CSS: Cascading Style Sheets
lock-end border of an element, which maps to a physical border color depending on the element's writing mode, directionality, and text orientation. It corresponds to the border-top-color, border-right-color, border-bottom-color, or border-left-color property depending on the values defined for writing-mode, direction, and text-orientation. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax border-block-end-color: yellow; border-block-end-color: #F5F6F7; Related properties are border-block-start-color, border-inline-start-color, and border-inline-end-color, which define the other border colors of the element. ...
border-block-end-style - CSS: Cascading Style Sheets
lock-end border of an element, which maps to a physical border style depending on the element's writing mode, directionality, and text orientation. It corresponds to the border-top-style, border-right-style, border-bottom-style, or border-left-style property depending on the values defined for writing-mode, direction, and text-orientation. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <'border-style'> values */ border-block-end-style: dashed; border-block-end-style: dotted; border-block-end-style: groove; Related properties are border-block-start-style, border-inline-start-style, and border-inline-end...
border-block-end-width - CSS: Cascading Style Sheets
lock-end border of an element, which maps to a physical border width depending on the element's writing mode, directionality, and text orientation. It corresponds to the border-top-width, border-right-width, border-bottom-width, or border-left-width property depending on the values defined for writing-mode, direction, and text-orientation. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <'border-width'> values */ border-block-end-width: 5px; border-block-end-width: thick; Related properties are border-block-start-width, border-inline-start-width, and border-inline-end-width, which define the other borde...
border-block-start-color - CSS: Cascading Style Sheets
ck-start border of an element, which maps to a physical border color depending on the element's writing mode, directionality, and text orientation. It corresponds to the border-top-color, border-right-color, border-bottom-color, or border-left-color property depending on the values defined for writing-mode, direction, and text-orientation. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax border-block-start-color: blue; border-block-start-color: #4c5d21; Related properties are border-block-end-color, border-inline-start-color, and border-inline-end-color, which define the other border colors of the element. ...
border-block-start-style - CSS: Cascading Style Sheets
ck start border of an element, which maps to a physical border style depending on the element's writing mode, directionality, and text orientation. It corresponds to the border-top-style, border-right-style, border-bottom-style, or border-left-style property depending on the values defined for writing-mode, direction, and text-orientation. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <'border-style'> values */ border-block-start-style: dashed; border-block-start-style: dotted; border-block-start-style: groove; Related properties are border-block-end-style, border-inline-start-style, and border-inline...
border-block-start-width - CSS: Cascading Style Sheets
ck-start border of an element, which maps to a physical border width depending on the element's writing mode, directionality, and text orientation. It corresponds to the border-top-width, border-right-width, border-bottom-width, or border-left-width property depending on the values defined for writing-mode, direction, and text-orientation. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <'border-width'> values */ border-block-start-width: 5px; border-block-start-width: thick; Related properties are border-block-end-width, border-inline-start-width, and border-inline-end-width, which define the other bor...
border-collapse - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. When cells are collapsed, the border-style value of inset behaves like groove, and outset behaves like ridge. When cells are separated, the distance between cells is defined by the border-spacing property. ...
border-color - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Each side can be set individually using border-top-color, border-right-color, border-bottom-color, and border-left-color; or using the writing mode-aware border-block-start-color, border-block-end-color, border-inline-start-color, and border-inline-end-color. ...
border-image-outset - CSS: Cascading Style Sheets
The border-image-outset CSS property sets the distance by which an element's border image is set out from its border box. The parts of the border image that are rendered outside the element's border box with border-image-outset do not trigger overflow scrollbars and don't capture mouse events. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <length> value */ border-image-outset: 1rem; /* <number> value */ border-image-outset: 1.5; /* vertical | horizontal */ border-image-outset: 1 1.2; /* top | horizontal | bottom */ border-image-outset: 30px 2 45px; /* top | right | bottom | left */ border-image-ou...
border-image-source - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The border-image-slice property is used to divide the source image into regions, which are then dynamically applied to the final border image. ...
border-image-width - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. If this property's value is greater than the element's border-width, the border image will extend beyond the padding (and/or content) edge. ...
border-image - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Note: You should specify a separate border-style in case the border image fails to load. Indeed, this is required according to the specification, although not all browsers implement this requirement. ...
border-inline-end-color - CSS: Cascading Style Sheets
line-end border of an element, which maps to a physical border color depending on the element's writing mode, directionality, and text orientation. It corresponds to the border-top-color, border-right-color, border-bottom-color, or border-left-color property depending on the values defined for writing-mode, direction, and text-orientation. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax border-inline-end-color: rebeccapurple; border-inline-end-color: #663399; Related properties are border-block-start-color, border-block-end-color, and border-inline-start-color, which define the other border colors of the e...
border-inline-end-style - CSS: Cascading Style Sheets
line end border of an element, which maps to a physical border style depending on the element's writing mode, directionality, and text orientation. It corresponds to the border-top-style, border-right-style, border-bottom-style, or border-left-style property depending on the values defined for writing-mode, direction, and text-orientation. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <'border-style'> values */ border-inline-end-style: dashed; border-inline-end-style: dotted; border-inline-end-style: groove; Related properties are border-block-start-style, border-block-end-style, and border-inline-sta...
border-inline-end-width - CSS: Cascading Style Sheets
line-end border of an element, which maps to a physical border width depending on the element's writing mode, directionality, and text orientation. It corresponds to the border-top-width, border-right-width, border-bottom-width, or border-left-width property depending on the values defined for writing-mode, direction, and text-orientation. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <'border-width'> values */ border-inline-end-width: 2px; border-inline-end-width: thick; Related properties are border-block-start-width, border-block-end-width, and border-inline-start-width, which define the other bord...
border-inline-start-color - CSS: Cascading Style Sheets
ne start border of an element, which maps to a physical border color depending on the element's writing mode, directionality, and text orientation. It corresponds to the border-top-color, border-right-color, border-bottom-color, or border-left-color property depending on the values defined for writing-mode, direction, and text-orientation. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax border-inline-start-color: red; border-inline-start-color: #ee4141; Related properties are border-block-start-color, border-block-end-color, and border-inline-end-color, which define the other border colors of the element. ...
border-inline-start-style - CSS: Cascading Style Sheets
ne start border of an element, which maps to a physical border style depending on the element's writing mode, directionality, and text orientation. It corresponds to the border-top-style, border-right-style, border-bottom-style, or border-left-style property depending on the values defined for writing-mode, direction, and text-orientation. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <'border-style'> values */ border-inline-start-style: dashed; border-inline-start-style: dotted; border-inline-start-style: groove; Related properties are border-block-start-style, border-block-end-style, and border-inli...
border-inline-start-width - CSS: Cascading Style Sheets
ne-start border of an element, which maps to a physical border width depending on the element's writing mode, directionality, and text orientation. It corresponds to the border-top-width, border-right-width, border-bottom-width, or border-left-width property depending on the values defined for writing-mode, direction, and text-orientation. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <'border-width'> values */ border-inline-start-width: 5px; border-inline-start-width: thick; Related properties are border-block-start-width, border-block-end-width, and border-inline-end-width, which define the other bo...
box-align - CSS: Cascading Style Sheets
Web › CSS › box-align
s="example"> <p>I will be second from the bottom of div.example, centered horizontally.</p> <p>I will be on the bottom of div.example, centered horizontally.</p> </div> </body> </html> Specifications Not part of any standard. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetbox-align DeprecatedNon-standardChrome Full support 1Prefixed Full support 1Prefixed Prefixe...
box-direction - CSS: Cascading Style Sheets
xample { /* bottom-to-top layout */ -moz-box-direction: reverse; /* Mozilla */ -webkit-box-direction: reverse; /* WebKit */ box-direction: reverse; /* As specified */ } Specifications Not part of any standard. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetbox-direction DeprecatedNon-standardChrome Full support 1Prefixed Full support 1Prefixed Pre...
box-sizing - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. By default in the CSS box model, the width and height you assign to an element is applied only to the element's content box. If the element has any border or padding, this is then added to the width and height to arrive at the size of the box that's rendered on the screen. ...
break-after - CSS: Cascading Style Sheets
on keywords. CSS Multi-column Layout ModuleThe definition of 'break-after' in that specification. Working Draft Initial definition. Extends the CSS 2.1 page-break-after property to handle both page and column breaks. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. Support in multi-column layout DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetSupported in Multi-column LayoutChrome Full support 50Edge Full support ...
break-before - CSS: Cascading Style Sheets
keywords. CSS Multi-column Layout ModuleThe definition of 'break-before' in that specification. Working Draft Initial definition. Extends the CSS 2.1 page-break-before property to handle both page and column breaks. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. Support in multi-column layout DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetSupported in Multi-column LayoutChrome Full support 50Edge Full support ...
break-inside - CSS: Cascading Style Sheets
inside' in that specification. Working Draft Extends the property to handle region breaks. CSS Multi-column Layout ModuleThe definition of 'break-inside' in that specification. Working Draft Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetSupported in Multi-column LayoutChrome Full support 50Edge Full support 12Firefox ...
caret-color - CSS: Cascading Style Sheets
racter typed will be inserted. This is sometimes referred to as the text input cursor. The caret appears in elements such as <input> or those with the contenteditable attribute. The caret is typically a thin vertical line that flashes to help make it more noticeable. By default, it is black, but its color can be altered with this property. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Note that the insertion caret is only one type of caret. For example, many browsers have a "navigation caret," which acts similarly to an insertion caret but can be moved around in non-editable text. On the other hand, the mouse curs...
column-fill - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Keyword values */ column-fill: auto; column-fill: balance; column-fill: balance-all; /* Global values */ column-fill: inherit; column-fill: initial; column-fill: unset; The column-fill property is specified as one of the keyword values listed below. ...
column-gap (grid-column-gap) - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Initially a part of Multi-column Layout, the definition of column-gap has been broadened to include multiple layout methods. Now specified in Box Alignment, it may be used in Multi-column, Flexible Box, and Grid layouts. CSS Grid Layout initially defined the grid-column-gap property. ...
column-rule - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. It is a shorthand property that sets the individual column-rule-* properties in a single, convenient declaration: column-rule-width, column-rule-style, and column-rule-color. ...
column-width - CSS: Cascading Style Sheets
column-width CSS property sets the ideal column width in a multi-column layout. The container will have as many columns as can fit without any of them having a width less than the column-width value. If the width of the container is narrower than the specified value, the single column's width will be smaller than the declared column width. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. This property can help you create responsive designs that fit different screen sizes. Especially in the presence of the column-count property (which has precedence), you must specify all related length values to achieve an exact colu...
conic-gradient() - CSS: Cascading Style Sheets
radient() CSS function creates an image consisting of a gradient with color transitions rotated around a center point (rather than radiating from the center). Example conic gradients include pie charts and color wheels. The result of the conic-gradient() function is an object of the <gradient> data type, which is a special kind of <image>. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* A conic gradient rotated 45 degrees, starting blue and finishing red */ conic-gradient(from 45deg, blue, red); /* A a bluish purple box: the gradient goes from blue to red, but as only the bottom right quadrant ...
counter-reset - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Note: The counter's value can be increased or decreased using the counter-increment CSS property. ...
Adapting to the new two-value syntax of display - CSS: Cascading Style Sheets
k in Firefox! Other browsers do not yet implement the two-value versions. Therefore display: block flex will only get you flex layout in Firefox, and will be ignored as invalid in Chrome. You can see current support in the compat data for the two-value syntax: The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetMulti-keyword values ExperimentalChrome No support NoEdge No support NoFirefox ...
element() - CSS: Cascading Style Sheets
Web › CSS › element
fications Specification Status Comment CSS Images Module Level 4The definition of 'Using Elements as Images: the element() notation' in that specification. Working Draft Deferred from CSS3 Images. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetelement() ExperimentalChrome No support NoEdge No support NoFirefox Full supp...
blur() - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax blur(radius) Parameters radius The radius of the blur, specified as a <length>. It defines the value of the standard deviation to the Gaussian function, i.e., how many pixels on the screen blend into each other; thus, a larger value will create more blur. A value of 0 leaves the input unchanged. ...
brightness() - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax brightness(amount) Parameters amount The brightness of the result, specified as a <number> or a <percentage>. A value under 100% darkens the image, while a value over 100% brightens it. ...
contrast() - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax contrast(amount) Parameters amount The contrast of the result, specified as a <number> or a <percentage>. A value under 100% decreases the contrast, while a value over 100% increases it. ...
drop-shadow() - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. A drop shadow is effectively a blurred, offset version of the input image's alpha mask, drawn in a specific color and composited below the image. Note: This function is somewhat similar to the box-shadow property. ...
grayscale() - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax grayscale(amount) Parameters amount The amount of the conversion, specified as a <number> or a <percentage>. A value of 100% is completely grayscale, while a value of 0% leaves the input unchanged. Values between 0% and 100% are linear multipliers on the effect. Default value when omitted is 1. ...
hue-rotate() - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax hue-rotate(angle) Parameters angle The relative change in hue of the input sample, specified as an <angle>. A value of 0deg leaves the input unchanged. A positive hue rotation increases the hue value, while a negative rotation decreases the hue value. ...
invert() - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax invert(amount) Parameters amount The amount of the conversion, specified as a <number> or a <percentage>. A value of 100% is completely inverted, while a value of 0% leaves the input unchanged. Values between 0% and 100% are linear multipliers on the effect. ...
opacity() - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Note: This function is similar to the more established opacity property. The difference is that with filters, some browsers provide hardware acceleration for better performance. ...
saturate() - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax saturate(amount) Parameters amount The amount of the conversion, specified as a <number> or a <percentage>. A value under 100% desaturates the image, while a value over 100% super-saturates it. ...
sepia() - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax sepia(amount) Parameters amount The amount of the conversion, specified as a <number> or a <percentage>. A value of 100% is completely sepia, while a value of 0% leaves the input unchanged. ...
filter - CSS: Cascading Style Sheets
Web › CSS › filter
The filter CSS property applies graphical effects like blur or color shift to an element. Filters are commonly used to adjust the rendering of images, backgrounds, and borders. Included in the CSS standard are several functions that achieve predefined effects. You can also reference an SVG filter with a URL to an SVG filter element. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* URL to SVG filter */ filter: url("filters.svg#filter-id"); /* <filter-function> values */ filter: blur(5px); filter: brightness(0.4); filter: contrast(200%); filter: drop-shadow(16px 16px 20px blue); filter: grayscale(50%); fi...
flex-grow - CSS: Cascading Style Sheets
Web › CSS › flex-grow
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <number> values */ flex-grow: 3; flex-grow: 0.6; /* Global values */ flex-grow: inherit; flex-grow: initial; flex-grow: unset; The flex-grow property is specified as a single <number>. Values <number> See <number>. Negative values are invalid. Defaults to 0. ...
flex-shrink - CSS: Cascading Style Sheets
The flex-shrink CSS property sets the flex shrink factor of a flex item. If the size of all flex items is larger than the flex container, items shrink to fit according to flex-shrink. In use, flex-shrink is used alongside the other flex properties flex-grow and flex-basis, and normally defined using the flex shorthand. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <number> values */ flex-shrink: 2; flex-shrink: 0.6; /* Global values */ flex-shrink: inherit; flex-shrink: initial; flex-shrink: unset; The flex-shrink property is specified as a single <number>. Values <number> See <number>. Negati...
float - CSS: Cascading Style Sheets
Web › CSS › float
The float CSS property places an element on the left or right side of its container, allowing text and inline elements to wrap around it. The element is removed from the normal flow of the page, though still remaining a part of the flow (in contrast to absolute positioning). The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. A floating element is one where the computed value of float is not none. As float implies the use of the block layout, it modifies the computed value of the display values, in some cases: Specified value Computed value inline block inline-block block ...
font-kerning - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Kerning defines how letters are spaced. In well-kerned fonts, this feature makes character spacing more uniform and pleasant to read than it would otherwise be. ...
font-size-adjust - CSS: Cascading Style Sheets
inition of 'font-size-adjust' in that specification. Candidate Recommendation Initial definition The CSS property font-size-adjust was initially defined in CSS 2, but dropped in CSS 2.1. It has been newly defined in CSS 3. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetfont-size-adjustChrome Full support 43Disabled Full support 43Disabled Disabled From version...
font-synthesis - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax This property can take any one of the following forms: The keyword value none. Either of the keyword values weight and style. Both the keyword values weight and style. Values none Indicates that neither bold nor italic typeface may be synthesized. ...
font-variant-alternates - CSS: Cascading Style Sheets
ecific name mapped to a number. It corresponds to the OpenType value ornm, like ornm 2. Note: In order to preserve text semantics, font designers should include ornaments that don't match Unicode dingbat characters as ornamental variants of the bullet character (U+2022). Be aware that some existing fonts don't follow this advice. annotation() This function enables annotations, like circled digits or inverted characters. The parameter is a font-specific name mapped to a number. It corresponds to the OpenType value nalt, like nalt 2. Formal definition Initial valuenormalApplies toall elements. It also applies to ::first-letter and ::first-line.InheritedyesComputed valueas specifiedAnimation typediscrete Formal syntax normal | [ stylistic( <feature-value-name> ) | historical-forms | st...
font-variant-position - CSS: Cascading Style Sheets
sub; } Result Specifications Specification Status Comment CSS Fonts Module Level 3The definition of 'font-variant-position' in that specification. Candidate Recommendation Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetfont-variant-positionChrome No support NoEdge No support NoFirefox Full suppo...
font - CSS: Cascading Style Sheets
Web › CSS › font
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. As with any shorthand property, any individual value that is not specified is set to its corresponding initial value (possibly overriding values previously set using non-shorthand properties). ...
gap (grid-gap) - CSS: Cascading Style Sheets
Web › CSS › gap
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. CSS Grid Layout initially defined the grid-gap property. This prefixed property is being replaced by gap. However, in order to support browsers that implemented grid-gap and not gap for grid, you will need to use the prefixed property as in the interactive example above. ...
<gradient> - CSS: Cascading Style Sheets
Web › CSS › gradient
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. A CSS gradient has no intrinsic dimensions; i.e., it has no natural or preferred size, nor a preferred ratio. Its concrete size will match the size of the element to which it applies. ...
grid-auto-columns - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. If a grid item is positioned into a column that is not explicitly sized by grid-template-columns, implicit grid tracks are created to hold it. ...
grid-auto-rows - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. If a grid item is positioned into a row that is not explicitly sized by grid-template-rows, implicit grid tracks are created to hold it. ...
grid-column - CSS: Cascading Style Sheets
The grid-column CSS shorthand property specifies a grid item's size and location within a grid column by contributing a line, a span, or nothing (automatic) to its grid placement, thereby specifying the inline-start and inline-end edge of its grid area. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Constituent properties This property is a shorthand for the following CSS properties: grid-column-end grid-column-start Syntax This property is specified as one or two <grid-line> values. If two <grid-line> values are given they are separated by "/". The grid-column-start longhand is set to the value be...
grid-template-areas - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Those areas are not associated with any particular grid item, but can be referenced from the grid-placement properties grid-row-start, grid-row-end, grid-column-start, grid-column-end, and their shorthands grid-row, grid-column, and grid-area. ...
grid - CSS: Cascading Style Sheets
Web › CSS › grid
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Note: You can only specify the explicit or the implicit grid properties in a single grid declaration. The sub-properties you don't specify are set to their initial value, as normal for shorthands. ...
hyphens - CSS: Cascading Style Sheets
Web › CSS › hyphens
The hyphens CSS property specifies how words should be hyphenated when text wraps across multiple lines. It can prevent hyphenation entirely, hyphenate at manually-specified points within the text, or let the browser automatically insert hyphens where appropriate. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Hyphenation rules are language-specific. In HTML, the language is determined by the lang attribute, and browsers will hyphenate only if this attribute is present and the appropriate hyphenation dictionary is available. In XML, the xml:lang attribute must be used. Note: The rules defining how hyphenation is...
image-set() - CSS: Cascading Style Sheets
Web › CSS › image-set
iterion 1.1.1 | W3C Understanding WCAG 2.0 Specifications Specification Status Comment CSS Images Module Level 4The definition of 'The image-set() notation' in that specification. Working Draft Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetimage-set()Chrome Full support 21Prefixed Full support 21Prefixed Prefixed Implemented with ...
initial - CSS: Cascading Style Sheets
Web › CSS › initial
ial' in that specification. Candidate Recommendation No changes from Level 3. CSS Cascading and Inheritance Level 3The definition of 'initial' in that specification. Candidate Recommendation Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetinitialChrome Full support 1Edge Full support 13Firefox Full support ...
isolation - CSS: Cascading Style Sheets
Web › CSS › isolation
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. This property is especially helpful when used in conjunction with mix-blend-mode. Syntax /* Keyword values */ isolation: auto; isolation: isolate; /* Global values */ isolation: inherit; isolation: initial; isolation: unset; The isolation property is specified as one of the keyword values listed below. ...
justify-content - CSS: Cascading Style Sheets
The CSS justify-content property defines how the browser distributes space between and around content items along the main-axis of a flex container, and the inline axis of a grid container. The interactive example below demonstrates some of the values using Grid Layout. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The alignment is done after the lengths and auto margins are applied, meaning that, if in a Flexbox layout there is at least one flexible element, with flex-grow different from 0, it will have no effect as there won't be any available space. Syntax /* Positional alignment */ justify-content: center;...
justify-self - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The effect of this property is dependent of the layout mode we are in: In block-level layouts, it aligns an item inside its containing block on the inline axis. ...
line-height - CSS: Cascading Style Sheets
The line-height CSS property sets the height of a line box. It's commonly used to set the distance between lines of text. On block-level elements, it specifies the minimum height of line boxes within the element. On non-replaced inline elements, it specifies the height that is used to calculate line box height. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Keyword value */ line-height: normal; /* Unitless values: use this number multiplied by the element's font size */ line-height: 3.5; /* <length> values */ line-height: 3em; /* <percentage> values */ line-height: 34%; /* Global values */ line-heig...
list-style-position - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. It is often more convenient to use the shorthand list-style. Note: This property is applied to list items, i.e., elements with display: list-item;. By default this includes <li> elements. Because this property is inherited, it can be set on the parent element (normally <ol> or <ul>) to let it apply to all list items. ...
list-style-type - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The color of the marker will be the same as the computed color of the element it applies to. Only a few elements (<li> and <summary>) have a default value of display: list-item. ...
list-style - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Note: This property is applied to list items, i.e., elements with display: list-item; . By default this includes <li> elements. Because this property is inherited, it can be set on a parent element (normally <ol> or <ul>) to make the same list styling apply to all the items inside. ...
margin-inline-end - CSS: Cascading Style Sheets
the logical inline end margin of an element, which maps to a physical margin depending on the element's writing mode, directionality, and text orientation. In other words, it corresponds to the margin-top, margin-right, margin-bottom or margin-left property depending on the values defined for writing-mode, direction, and text-orientation. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <length> values */ margin-inline-end: 10px; /* An absolute length */ margin-inline-end: 1em; /* relative to the text size */ margin-inline-end: 5%; /* relative to the nearest block container's width */ /* Keyword...
margin-inline-start - CSS: Cascading Style Sheets
perty defines the logical inline start margin of an element, which maps to a physical margin depending on the element's writing mode, directionality, and text orientation. It corresponds to the margin-top, margin-right, margin-bottom, or margin-left property depending on the values defined for writing-mode, direction, and text-orientation. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <length> values */ margin-inline-start: 10px; /* An absolute length */ margin-inline-start: 1em; /* relative to the text size */ margin-inline-start: 5%; /* relative to the nearest block container's width */ /* Keyw...
max-block-size - CSS: Cascading Style Sheets
th, you should instead use max-block-size to set the maximum "height" of the content (even though this may not be a vertical value) and max-inline-size to set the maximum "width" of the content (although this may instead be vertical rather than horizontal). See the Example in writing-mode, which shows the different writing modes in action. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <length> values */ max-block-size: 300px; max-block-size: 25em; /* <percentage> values */ max-block-size: 75%; /* Keyword values */ max-block-size: auto; max-block-size: max-content; max-block-size: min-content; max-bloc...
max-inline-size - CSS: Cascading Style Sheets
ax-width or the max-height property depending on the value defined for writing-mode. If the writing mode is vertically oriented, the value of max-inline-size relates to the maximal height of the element, otherwise it relates to the maximal width of the element. It relates to max-block-size, which defines the other dimension of the element. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <length> values */ max-inline-size: 300px; max-inline-size: 25em; /* <percentage> values */ max-inline-size: 75%; /* Keyword values */ max-inline-size: auto; max-inline-size: max-content; max-inline-size: min-content; ma...
max() - CSS: Cascading Style Sheets
Web › CSS › max
The max() CSS function lets you set the largest (most positive) value from a list of comma-separated expressions as the value of a CSS property value. The max() function can be used anywhere a <length>, <frequency>, <angle>, <time>, <percentage>, <number>, or <integer> is allowed. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. In the first above example, the width will be at least 400px, but will be wider if the the viewport is more than 2000px wide (in which case 1vw would be 20px, so 20vw would be 400px). Think of the max() value as providing the minimum value a property can have. Syntax The max() function tak...
min() - CSS: Cascading Style Sheets
Web › CSS › min
The min() CSS function lets you set the smallest (most negative) value from a list of comma-separated expressions as the value of a CSS property value. The min() function can be used anywhere a <length>, <frequency>, <angle>, <time>, <percentage>, <number>, or <integer> is allowed. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. In the first above example, the width will be at most 200px, but will be smaller if the viewport is less than 400px wide (in which case 1vw would be 4px, so 50vw would be 200px). In other words, the maximum width is 200px. Think of the min() value as providing the maximum value a property c...
orphans - CSS: Cascading Style Sheets
Web › CSS › orphans
Recommendation Extends orphans to apply to any type of fragment, including pages, regions, or columns. CSS Level 2 (Revision 1)The definition of 'orphans' in that specification. Recommendation Initial definition. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetorphansChrome Full support 25Edge Full support 12Firefox No support ...
padding-bottom - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. An element's padding area is the space between its content and its border. Note: The padding property can be used to set paddings on all four sides of an element with a single declaration. ...
padding-left - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. An element's padding area is the space between its content and its border. Note: The padding property can be used to set paddings on all four sides of an element with a single declaration. ...
padding-right - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. An element's padding area is the space between its content and its border. Note: The padding property can be used to set paddings on all four sides of an element with a single declaration. ...
padding-top - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. An element's padding area is the space between its content and its border. Note: The padding property can be used to set paddings on all four sides of an element with a single declaration. ...
padding - CSS: Cascading Style Sheets
Web › CSS › padding
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. An element's padding area is the space between its content and its border. Note: Padding creates extra space within an element. In contrast, margin creates extra space around an element. ...
page-break-after - CSS: Cascading Style Sheets
orking Draft Extends the element that this property applies to table rows and table row groups. CSS Level 2 (Revision 1)The definition of 'page-break-after' in that specification. Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetpage-break-afterChrome Full support 1Edge Full support 12Firefox Full support...
page-break-before - CSS: Cascading Style Sheets
rking Draft Extends the element that this property applies to table rows and table row groups. CSS Level 2 (Revision 1)The definition of 'page-break-before' in that specification. Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetpage-break-beforeChrome Full support 1Edge Full support 12Firefox Full suppor...
place-items - CSS: Cascading Style Sheets
The CSS place-items shorthand property allows you to align items along both the block and inline directions at once (i.e. the align-items and justify-items properties) in a relevant layout system such as Grid or Flexbox. If the second value is not set, the first value is also used for it. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Constituent properties This property is a shorthand for the following CSS properties: align-items justify-items Syntax /* Keyword values */ place-items: auto center; place-items: normal start; /* Positional alignment */ place-items: center normal; place-items: start auto; pl...
place-self - CSS: Cascading Style Sheets
The place-self CSS shorthand property allows you to align an individual item in both the block and inline directions at once (i.e. the align-self and justify-self properties) in a relevant layout system such as Grid or Flexbox. If the second value is not present, the first value is also used for it. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Constituent properties This property is a shorthand for the following CSS properties: align-self justify-self Syntax /* Keyword values */ place-self: auto center; place-self: normal start; /* Positional alignment */ place-self: center normal; place-self: start aut...
radial-gradient() - CSS: Cascading Style Sheets
The radial-gradient() CSS function creates an image consisting of a progressive transition between two or more colors that radiate from an origin. Its shape may be a circle or an ellipse. The function's result is an object of the <gradient> data type, which is a special kind of <image>. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* A gradient at the center of its container, starting red, changing to blue, and finishing green */ radial-gradient(circle at center, red 0, blue, green 100%) Values <position> The position of the gradient, interpreted in the same way as background-position or transfor...
repeating-conic-gradient() - CSS: Cascading Style Sheets
The repeating-conic-gradient() CSS function creates an image consisting of a repeating gradient (rather than a single gradient) with color transitions rotated around a center point (rather than radiating from the center). {{EmbedInteractiveExample("pages/css/function-repeating-conic-gradient.html")}} The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Starburst: A a blue on blue starburst: the gradient is a starburst of lighter and darker blue, centered in the upper left quandrant, offset by 3degrees so there is no up/down straight line */ background: repeating-conic-gradient( from 3deg at 25% 25...
repeating-linear-gradient() - CSS: Cascading Style Sheets
dient() CSS function creates an image consisting of repeating linear gradients. It is similar to linear-gradient() and takes the same arguments, but it repeats the color stops infinitely in all directions so as to cover its entire container. The function's result is an object of the <gradient> data type, which is a special kind of <image>. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The length of the gradient that repeats is the distance between the first and last color stop. If the first color does not have a color-stop-length, the color-stop-length defaults to 0. With each repetition, the positions of the colo...
repeating-radial-gradient() - CSS: Cascading Style Sheets
gradients that radiate from an origin. It is similar to radial-gradient() and takes the same arguments, but it repeats the color stops infinitely in all directions so as to cover its entire container, similar to repeating-linear-gradient() . The function's result is an object of the <gradient> data type, which is a special kind of <image>. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. With each repetition, the positions of the color stops are shifted by a multiple of the dimensions of the basic radial gradient (the distance between the last color stop and the first). Thus, the position of each ending color stop co...
resize - CSS: Cascading Style Sheets
Web › CSS › resize
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Keyword values */ resize: none; resize: both; resize: horizontal; resize: vertical; resize: block; resize: inline; /* Global values */ resize: inherit; resize: initial; resize: unset; The resize property is specified as a single keyword value from the list below. ...
<resolution> - CSS: Cascading Style Sheets
umber 0 is always the same regardless of unit, the unit may not be omitted. In other words, 0 is invalid and does not represent 0dpi, 0dpcm, or 0dppx. Examples Use in a media query @media print and (min-resolution: 300dpi) { ... } Valid resolutions 96dpi 50.82dpcm 3dppx Invalid resolutions 72 dpi Spaces are not allowed between the number and the unit. ten dpi The number must use digits only. 0 The unit is required. Specifications Specification Status Comment CSS Values and Units Module Level 4The definition of '<resolution>' in that specification. Editor's Draft Adds the x unit. CSS Values and Units Module Level 3The definition of '<resolution>' in that specification. Candidate Recommendation Adds the dppx unit. ...
row-gap (grid-row-gap) - CSS: Cascading Style Sheets
Web › CSS › row-gap
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. CSS Grid Layout initially defined the grid-row-gap property. This prefixed property is being replaced by row-gap. However, in order to support browsers that implemented grid-row-gap and not row-gap for grid, you will need to use the prefixed property as in the interactive example above. ...
ruby-position - CSS: Cascading Style Sheets
uby-position:under; } Result Specifications Specification Status Comment CSS Ruby Layout Module Level 1The definition of 'ruby-position' in that specification. Working Draft Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetruby-position ExperimentalChrome No support NoEdge No support 12 -- 79Firefox Full support ...
scroll-behavior - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Note that any other scrolls, such as those performed by the user, are not affected by this property. When this property is specified on the root element, it applies to the viewport instead. ...
scroll-margin-block-end - CSS: Cascading Style Sheets
property defines the margin of the scroll snap area at the end of the block dimension that is used for snapping this box to the snapport. The scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container's coordinate space), then adding the specified outsets. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <length> values */ scroll-margin-block-end: 10px; scroll-margin-block-end: 1em; /* Global values */ scroll-margin-block-end: inherit; scroll-margin-block-end: initial; scroll-margin-block-end: unset; Values <length> ...
scroll-margin-block-start - CSS: Cascading Style Sheets
operty defines the margin of the scroll snap area at the start of the block dimension that is used for snapping this box to the snapport. The scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container's coordinate space), then adding the specified outsets. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <length> values */ scroll-margin-block-start: 10px; scroll-margin-block-start: 1em; /* Global values */ scroll-margin-block-start: inherit; scroll-margin-block-start: initial; scroll-margin-block-start: unset; Values ...
scroll-margin-bottom - CSS: Cascading Style Sheets
The scroll-margin-bottom property defines the bottom margin of the scroll snap area that is used for snapping this box to the snapport. The scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container's coordinate space), then adding the specified outsets. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <length> values */ scroll-margin-bottom: 10px; scroll-margin-bottom: 1em; /* Global values */ scroll-margin-bottom: inherit; scroll-margin-bottom: initial; scroll-margin-bottom: unset; Values <length> An outset from ...
scroll-margin-inline-end - CSS: Cascading Style Sheets
roperty defines the margin of the scroll snap area at the end of the inline dimension that is used for snapping this box to the snapport. The scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container's coordinate space), then adding the specified outsets. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <length> values */ scroll-margin-inline-end: 10px; scroll-margin-inline-end: 1em; /* Global values */ scroll-margin-inline-end: inherit; scroll-margin-inline-end: initial; scroll-margin-inline-end: unset; Values <len...
scroll-margin-inline-start - CSS: Cascading Style Sheets
perty defines the margin of the scroll snap area at the start of the inline dimension that is used for snapping this box to the snapport. The scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container's coordinate space), then adding the specified outsets. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <length> values */ scroll-margin-inline-start: 10px; scroll-margin-inline-start: 1em; /* Global values */ scroll-margin-inline-start: inherit; scroll-margin-inline-start: initial; scroll-margin-inline-start: unset; Valu...
scroll-margin-left - CSS: Cascading Style Sheets
The scroll-margin-left property defines the left margin of the scroll snap area that is used for snapping this box to the snapport. The scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container's coordinate space), then adding the specified outsets. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <length> values */ scroll-margin-left: 10px; scroll-margin-left: 1em; /* Global values */ scroll-margin-left: inherit; scroll-margin-left: initial; scroll-margin-left: unset; Values <length> An outset from the left edge...
scroll-margin-right - CSS: Cascading Style Sheets
The scroll-margin-right property defines the right margin of the scroll snap area that is used for snapping this box to the snapport. The scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container's coordinate space), then adding the specified outsets. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <length> values */ scroll-margin-right: 10px; scroll-margin-right: 1em; /* Global values */ scroll-margin-right: inherit; scroll-margin-right: initial; scroll-margin-right: unset; Values <length> An outset from the ri...
scroll-margin-top - CSS: Cascading Style Sheets
The scroll-margin-top property defines the top margin of the scroll snap area that is used for snapping this box to the snapport. The scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container's coordinate space), then adding the specified outsets. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* <length> values */ scroll-margin-top: 10px; scroll-margin-top: 1em; /* Global values */ scroll-margin-top: inherit; scroll-margin-top: initial; scroll-margin-top: unset; Values <length> An outset from the top edge of the s...
scroll-padding-block-end - CSS: Cascading Style Sheets
gion of the scrollport: the region used as the target region for placing things in view of the user. This allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or simply to put more breathing room between a targetted element and the edges of the scrollport. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Keyword values */ scroll-padding-block-end: auto; /* <length> values */ scroll-padding-block-end: 10px; scroll-padding-block-end: 1em; scroll-padding-block-end: 10%; /* Global values */ scroll-padding-block-end: inherit...
scroll-padding-block-start - CSS: Cascading Style Sheets
gion of the scrollport: the region used as the target region for placing things in view of the user. This allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or simply to put more breathing room between a targetted element and the edges of the scrollport. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Keyword values */ scroll-padding-block-start: auto; /* <length> values */ scroll-padding-block-start: 10px; scroll-padding-block-start: 1em; scroll-padding-block-start: 10%; /* Global values */ scroll-padding-block-star...
scroll-padding-block - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The scroll-padding properties define offsets for the optimal viewing region of the scrollport: the region used as the target region for placing things in view of the user. ...
scroll-padding-bottom - CSS: Cascading Style Sheets
gion of the scrollport: the region used as the target region for placing things in view of the user. This allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or simply to put more breathing room between a targetted element and the edges of the scrollport. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Keyword values */ scroll-padding-bottom: auto; /* <length> values */ scroll-padding-bottom: 10px; scroll-padding-bottom: 1em; scroll-padding-bottom: 10%; /* Global values */ scroll-padding-bottom: inherit; scroll-paddin...
scroll-padding-inline-end - CSS: Cascading Style Sheets
gion of the scrollport: the region used as the target region for placing things in view of the user. This allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or simply to put more breathing room between a targetted element and the edges of the scrollport. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Keyword values */ scroll-padding-inline-end: auto; /* <length> values */ scroll-padding-inline-end: 10px; scroll-padding-inline-end: 1em; scroll-padding-inline-end: 10%; /* Global values */ scroll-padding-inline-end: in...
scroll-padding-inline-start - CSS: Cascading Style Sheets
gion of the scrollport: the region used as the target region for placing things in view of the user. This allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or simply to put more breathing room between a targetted element and the edges of the scrollport. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Keyword values */ scroll-padding-inline-start: auto; /* <length> values */ scroll-padding-inline-start: 10px; scroll-padding-inline-start: 1em; scroll-padding-inline-start: 10%; /* Global values */ scroll-padding-inline...
scroll-padding-inline - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The scroll-padding properties define offsets for the optimal viewing region of the scrollport: the region used as the target region for placing things in view of the user. ...
scroll-padding-left - CSS: Cascading Style Sheets
gion of the scrollport: the region used as the target region for placing things in view of the user. This allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or simply to put more breathing room between a targetted element and the edges of the scrollport. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Keyword values */ scroll-padding-left: auto; /* <length> values */ scroll-padding-left: 10px; scroll-padding-left: 1em; scroll-padding-left: 10%; /* Global values */ scroll-padding-left: inherit; scroll-padding-left: in...
scroll-padding-right - CSS: Cascading Style Sheets
gion of the scrollport: the region used as the target region for placing things in view of the user. This allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or simply to put more breathing room between a targetted element and the edges of the scrollport. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Keyword values */ scroll-padding-right: auto; /* <length> values */ scroll-padding-right: 10px; scroll-padding-right: 1em; scroll-padding-right: 10%; /* Global values */ scroll-padding-right: inherit; scroll-padding-rig...
scroll-padding-top - CSS: Cascading Style Sheets
gion of the scrollport: the region used as the target region for placing things in view of the user. This allows the author to exclude regions of the scrollport that are obscured by other content (such as fixed-positioned toolbars or sidebars) or simply to put more breathing room between a targetted element and the edges of the scrollport. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Keyword values */ scroll-padding-top: auto; /* <length> values */ scroll-padding-top: 10px; scroll-padding-top: 1em; scroll-padding-top: 10%; /* Global values */ scroll-padding-top: inherit; scroll-padding-top: initial;...
scroll-padding - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The scroll-padding-* properties define offsets for the optimal viewing region of the scrollport: the region used as the target region for placing things in view of the user. ...
scroll-snap-type - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Specifying any precise animations or physics used to enforce those snap points is not covered by this property but instead left up to the user agent. ...
shape-margin - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The margin lets you adjust the distance between the edges of the shape (the float element) and the surrounding content. ...
shape-outside - CSS: Cascading Style Sheets
The shape-outside CSS property defines a shape--which may be non-rectangular--around which adjacent inline content should wrap. By default, inline content wraps around its margin box; shape-outside provides a way to customize this wrapping, making it possible to wrap text around complex objects rather than simple boxes. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Keyword values */ shape-outside: none; shape-outside: margin-box; shape-outside: content-box; shape-outside: border-box; shape-outside: padding-box; /* Function values */ shape-outside: circle(); shape-outside: ellipse(); shape-outside: ins...
<shape> - CSS: Cascading Style Sheets
Web › CSS › shape
t(10px, 20px, 20px, 10px); } Specifications Specification Status Comment CSS Level 2 (Revision 1)The definition of '<shape>' in that specification. Recommendation Defines with the clip property. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet<shape> DeprecatedChrome Full support 1Edge Full support 12Firefox Full suppo...
<string> - CSS: Cascading Style Sheets
Web › CSS › string
awesome string" Specifications Specification Status Comment CSS Values and Units Module Level 3The definition of '<string>' in that specification. Candidate Recommendation No significant change from CSS Level 2 (Revision 1). CSS Level 2 (Revision 1)The definition of '<string>' in that specification. Recommendation Explicit definition; allows 6-digit Unicode escaped characters. CSS Level 1The definition of '<string>' in that specification. Recommendation Implicit definition; allows 4-digit Unicode escaped characters. ...
symbols() - CSS: Cascading Style Sheets
Web › CSS › symbols
ls( <symbols-type>? [ <string> | <image> ]+ ); <symbols-type> can be one of the following: cyclic: The system cycles through the given values in the order of their definition, and returns to the start when it reaches the end. numeric: The system interprets the given values as the successive units of a place-value numbering system. alphabetic: The system interprets the given values as the digits of an alphabetic numbering system, like a place-value numbering system but without 0. symbolic: The system cycles through the values, printing them an additional time at each cycle (one time for the first cycle, two times for the second, etc.). fixed: The system cycles through the given values once, then falls back to Arabic numerals. Examples HTML <ol> <li>One</li> <li>Two</li> <li>...
table-layout - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Keyword values */ table-layout: auto; table-layout: fixed; /* Global values */ table-layout: inherit; table-layout: initial; table-layout: unset; Values auto By default, most browsers use an automatic table layout algorithm. The widths of the table and its cells are adjusted to fit the content. ...
text-decoration-color - CSS: Cascading Style Sheets
The text-decoration-color CSS property sets the color of decorations added to text by text-decoration-line. The color applies to decorations, such as underlines, overlines, strikethroughs, and wavy lines like those used to mark misspellings, in the scope of the property's value. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. CSS does not provide a direct mechanism for specifying a unique color for each line type. This effect can nevertheless be achieved by nesting elements, applying a different line type to each element (with the text-decoration-line property), and specifying the line color (with text-decoration-...
text-indent - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Horizontal spacing is with respect to the left (or right, for right-to-left layout) edge of the containing block-level element's content box. ...
text-orientation - CSS: Cascading Style Sheets
The text-orientation CSS property sets the orientation of the text characters in a line. It only affects text in vertical mode (when writing-mode is not horizontal-tb). It is useful for controlling the display of languages that use vertical script, and also for making vertical table headers. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax /* Keyword values */ text-orientation: mixed; text-orientation: upright; text-orientation: sideways-right; text-orientation: sideways; text-orientation: use-glyph-orientation; /* Global values */ text-orientation: inherit; text-orientation: initial; text-orientation: unse...
perspective() - CSS: Cascading Style Sheets
The perspective() CSS function defines a transformation that sets the distance between the user and the z=0 plane, the perspective from which the viewer would be if the 2-dimensional interface were 3-dimensional. Its result is a <transform-function> data type. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The perspective() transform function is part of the transform value applied on the element being transformed. This differs from the perspective and perspective-origin properties which are attached to the parent of a child transformed in 3-dimensional space. Syntax The perspective distance used by perspective()...
scaleZ() - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. This scaling transformation modifies the z-coordinate of each element point by a constant factor, except when the scale factor is 1, in which case the function is the identity transform. ...
skew() - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. This transformation is a shear mapping (transvection) that distorts each point within an element by a certain angle in the horizontal and vertical directions. ...
translate3d() - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. This transformation is characterized by a three-dimensional vector. Its coordinates define how much the element moves in each direction. Syntax translate3d(tx, ty, tz) Values tx Is a <length> or <percentage> representing the abscissa of the translating vector. ...
transform-origin - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The transformation origin is the point around which a transformation is applied. For example, the transformation origin of the rotate() function is the center of rotation. This property is applied by first translating the element by the value of the property, then applying the element's transform, then translating by the negated property value. ...
transform-style - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. If flattened, the element's children will not exist on their own in the 3D-space. As this property is not inherited, it must be set for all non-leaf descendants of the element. ...
transition-delay - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The delay may be zero, positive, or negative: A value of 0s (or 0ms) will begin the transition effect immediately. A positive value will delay the start of the transition effect for the given length of time. ...
transition-property - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Note: The set of properties that can be animated is subject to change. As such, you should avoid including any properties in the list that don't currently animate, as someday they might, causing unexpected results. ...
transition-timing-function - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. This, in essence, lets you establish an acceleration curve so that the speed of the transition can vary over its duration. This acceleration curve is defined using one <timing-function> for each property to be transitioned. ...
transition - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Transitions enable you to define the transition between two states of an element. Different states may be defined using pseudo-classes like :hover or :active or dynamically set using JavaScript. ...
vertical-align - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The vertical-align property can be used in two contexts: To vertically align an inline element's box inside its containing line box. ...
white-space - CSS: Cascading Style Sheets
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Note: To make words break within themselves, use overflow-wrap, word-break, or hyphens instead. ...
zoom - CSS: Cascading Style Sheets
Web › CSS › zoom
...
Adding captions and subtitles to HTML5 video - Developer guides
lso at how to style the player. This article will take the same player and show how to add captions and subtitles to it, using the WebVTT format and the <track> element. Captioned video example In this article, we will refer to the Video player with captions example. This example uses an excerpt from the Sintel open movie, created by the Blender Foundation. Note: You can find the source on Github, and also view the example live. HTML5 and Video Captions Before diving into how to add captions to the video player, there are a number of things that we will first mention, which you should be aware of before we start. Captions versus subtitles Captions and subtitles are not the same thing: they have significantly different audiences, and convey different information, and it is recommen...
Live streaming web audio and video - Developer guides
and FLV.) GStreamer plugins such as souphttpclientsink and shout2send exist to stream media over HTTP. You can also integrate with Python's Twisted framework or use something like Flumotion (open source streaming software). For RTMP transfer you can use the Nginx RTMP Module. SHOUTcast SHOUTcast is a cross-platform proprietary technology for streaming media. Developed by Nullsoft, it allows digital audio content in MP3 or AAC format to be broadcast. For web use, SHOUTcast streams are transmitted over HTTP. Note: SHOUTcast URLs may require a semi-colon to be appended to them. Icecast The Icecast server is an open source technology for streaming media. Maintained by the Xiph.org Foundation, it streams Ogg Vorbis/Theora as well as MP3 and AAC format via the SHOUTcast protocol. Note: SHOU...
Video player styling basics - Developer guides
In the previous Cross browser video player article we described how to build a cross-browser HTML5 video player using the Media and Fullscreen APIs. This follow-up article looks at how to style this custom player, including making it responsive. The example in action You can find the code for the updated, styled example on Github, and view it live. Preliminary modifications from the original example This section summarises the modifications that were made to the original video player example to make the styling task easier, before the bulk of the work was started. HTML Markup There are a few changes that were made to the HTML markup shown in the previous article. The custom video controls and <progress> element are now contained within <div> elements, rather than residing in...
Creating a cross-browser video player - Developer guides
efaults. The player controls themselves won't be styled beyond the basics required to get them working; full styling of the player will be taken care of in a future article. Working example Our example video player displays a clip from an open source movie called Tears of Steel, and includes typical video controls. Note: You can see the example running live, or check out the source code on Github. HTML Markup To start off with, let's take a look at the HTML that makes up the player. The video First of all the <video> element is defined, contained within a <figure> element that acts as the video container. To anyone familiar with HTML5 markup and the <video> element, there should be nothing here that surprises you. <figure id="videoContainer"> <video id="video" controls preload...
Audio and Video Delivery - Developer guides
he API supports use cases ranging from simple clear key decryption to high value video (given an appropriate user agent implementation). License/key exchange is controlled by the application, facilitating the development of robust playback applications supporting a range of content decryption and protection technologies. One of the principle uses of EME is to allow browsers to implement DRM (Digital Rights Management), which helps to prevent web-based content (especially video) from being copied. Adaptive Streaming New formats and protocols are being rolled out to facilitate adaptive streaming. Adaptive streaming media means that the bandwidth and typically quality of the stream can change in real-time in reaction to the user's available bandwidth. Adaptive streaming is often used in con...
Challenge solutions - Developer guides
ext styles Big initial letters Challenge Without changing anything else, make all six initial letters twice the size in the browser's default serif font. Solution Add the following style declaration to the strong rule: font: 200% serif; If you use separate declarations for font-size and font-family, then the font-style setting on the first paragraph is not overridden. Color Three-digit color codes Challenge In your CSS file, change all the color names to 3-digit color codes without affecting the result. Solution The following values are reasonable approximations of the named colors: strong { color: #f00; /* red */ background-color: #ddf; /* pale blue */ font: 200% serif; } .carrot { color: #fa0; /* orange */ } .spinach { color: #080; /* dark green */ } p { ...
Separate sites for mobile and desktop - Developer guides
l, at least you have this option. Examples Most of the major Web applications you see in the wild have chosen this path, including Facebook, YouTube, Digg, and Flickr. In fact, Mozilla picked this strategy for the mobile versions of addons.mozilla.org (AMO) and support.mozilla.org (SUMO). If you'd like to see the source code behind an example of this approach in action, feel free to check out the github repository for AMO or SUMO. Approaches to mobile Web development See the following articles for background and other approaches to developing for mobile platforms. What is mobile-friendliness? Responsive design A hybrid approach Original document information This article was originally published on 13 May 2011, on the Mozilla Webdev blog as "Approaches to Mobile Web Development Pa...
User input and controls - Developer guides
h one. A pointer can be any point of contact on the screen made by a mouse cursor, pen, touch (including multi-touch), or other pointing input device. The events for handling generic pointer input look a lot like those for mouse: pointerdown, pointermove, pointerup, pointerover, pointerout, etc. Note: Pointer Events are not widely supported yet, but a pointer.js polyfill is available on Mozilla Github. Implement controls Pointer lock In some cases, typically game development, you might need to access mouse events even when the cursor goes past the boundary of the browser or screen: the Pointer_Lock_API gives you full control of the pointing device. This is the code to request pointer lock on an element: element.requestPointerLock(); Note: For a full tutorial and reference, read our ...
HTML attribute: accept - HTML: Hypertext Markup Language
Regardless of the user's device or operating system, the file input provides a button that opens up a file picker dialog that allows the user to choose a file. Including the multiple attribute, as shown above, specifies that multiple files can be chosen at once. The user can choose multiple files from the file picker in any way that ...
<h1>–<h6>: The HTML Section Heading elements - HTML: Hypertext Markup Language
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, heading content, palpable content. Permitted content Phrasing content. Tag omission None, both the starting and ending tag are mandatory. ...
<acronym> - HTML: Hypertext Markup Language
Web › HTML › Element › acronym
style this element, or accept some cross-browser variation. Specifications Specification Status Comment HTML 4.01 SpecificationThe definition of '<acronym>' in that specification. Recommendation Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetacronym DeprecatedNon-standardChrome Full support YesEdge Full support 12Firefox ...
<article>: The Article Contents element - HTML: Hypertext Markup Language
Web › HTML › Element › article
The HTML <article> element represents a self-contained composition in a document, page, application, or site, which is intended to be independently distributable or reusable (e.g., in syndication). Examples include: a forum post, a magazine or newspaper article, or a blog entry. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. A given document can have multiple articles in it; for example, on a blog that shows the text of each article one after another as the reader scrolls, each post would be contained in an <article> element, possibly with one or more <section>s within. Content categories Flow conten...
<audio>: The Embed Audio element - HTML: Hypertext Markup Language
Web › HTML › Element › audio
The HTML <audio> element is used to embed sound content in documents. It may contain one or more audio sources, represented using the src attribute or the <source> element: the browser will choose the most suitable one. It can also be the destination for streamed media, using a MediaStream. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The above example shows simple usage of the <audio> element. In a similar manner to the <img> element, we include a path to the media we want to embed inside the src attribute; we can include other attributes to specify information such as whether we want it to autoplay and loop, w...
<b>: The Bring Attention To element - HTML: Hypertext Markup Language
Web › HTML › Element › b
not otherwise granted special importance. This was formerly known as the Boldface element, and most browsers still draw the text in boldface. However, you should not use <b> for styling text; instead, you should use the CSS font-weight property to create boldface text, or the <strong> element to indicate that text is of special importance. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, phrasing content, palpable content. Permitted content Phrasing content. Tag omission None, both the starting and ending tag are mandatory. Permitted parent...
<bdi>: The Bidirectional Isolate element - HTML: Hypertext Markup Language
Web › HTML › Element › bdi
The HTML Bidirectional Isolate element (<bdi>) tells the browser's bidirectional algorithm to treat the text it contains in isolation from its surrounding text. It's particularly useful when a website dynamically inserts some text and doesn't know the directionality of the text being inserted. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Bidirectional text is text that may contain both sequences of characters that are arranged left-to-right (LTR) and sequences of characters that are arranged right-to-left (RTL), such as an Arabic quotation embedded in an English string. Browsers implement the Unicode Bidirectio...
<bdo>: The Bidirectional Text Override element - HTML: Hypertext Markup Language
Web › HTML › Element › bdo
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The text's characters are drawn from the starting point in the given direction; the individual characters' orientation is not affected (so characters don't get drawn backward, for example). ...
<blockquote>: The Block Quotation element - HTML: Hypertext Markup Language
lement (or HTML Block Quotation Element) indicates that the enclosed text is an extended quotation. Usually, this is rendered visually by indentation (see Notes for how to change it). A URL for the source of the quotation may be given using the cite attribute, while a text representation of the source can be given using the <cite> element. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, sectioning root, palpable content. Permitted content Flow content. Tag omission None, both the starting and ending tag are mandatory. Permitted parents ...
<button>: The Button element - HTML: Hypertext Markup Language
Web › HTML › Element › button
The HTML <button> element represents a clickable button, used to submit forms or anywhere in a document for accessible, standard button functionality. By default, HTML buttons are presented in a style resembling the platform the user agent runs on, but you can change buttons' appearance with CSS. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, phrasing content, Interactive content, listed, labelable, and submittable form-associated element, palpable content. Permitted content Phrasing content but there must be no Interactive content Tag omission ...
<caption>: The Table Caption element - HTML: Hypertext Markup Language
Web › HTML › Element › caption
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories None. Permitted content Flow content. Tag omission The end tag can be omitted if the element is not immediately followed by ASCII whitespace or a comment. Permitted parents A <table> element, as its first descendant. ...
<content>: The Shadow DOM Content Placeholder element (obsolete) - HTML: Hypertext Markup Language
Web › HTML › Element › content
2>Inserted Heading</h2> <content select="p"></content>'; </script> </body> </html> If you display this in a web browser it should look like the following. Specifications This element is no longer defined by any specifications. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetcontent DeprecatedNon-standardChrome Full support 35Edge Full support 79Firefox ...
<del>: The Deleted Text element - HTML: Hypertext Markup Language
Web › HTML › Element › del
The HTML <del> element represents a range of text that has been deleted from a document. This can be used when rendering "track changes" or source code diff information, for example. The <ins> element can be used for the opposite purpose: to indicate text that has been added to the document. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. This element is often (but need not be) rendered by applying a strike-through style to the text. Content categories Phrasing content or flow content. Permitted content Transparent. Tag omission None, both the starting and ending tag are mandat...
<details>: The Details disclosure element - HTML: Hypertext Markup Language
Web › HTML › Element › details
ng the <summary> element. A disclosure widget is typically presented onscreen using a small triangle which rotates (or twists) to indicate open/closed status, with a label next to the triangle. If the first child of the <details> element is a <summary>, the contents of the <summary> element are used as the label for the disclosure widget. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Note: The common use of a triangle which rotates or twists around to represent opening or closing the widget is why these are sometimes called "twisties." A <details> widget can be in one of two states. The default closed state di...
<dl>: The Description List element - HTML: Hypertext Markup Language
Web › HTML › Element › dl
The HTML <dl> element represents a description list. The element encloses a list of groups of terms (specified using the <dt> element) and descriptions (provided by <dd> elements). Common uses for this element are to implement a glossary or to display metadata (a list of key-value pairs). The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, and if the <dl> element's children include one name-value group, palpable content. Permitted content Either: Zero or more groups each consisting of one or more <dt> elements followed by one or more <dd> elements, optional...
<dt>: The Description Term element - HTML: Hypertext Markup Language
Web › HTML › Element › dt
ust be used inside a <dl> element. It is usually followed by a <dd> element; however, multiple <dt> elements in a row indicate several terms that are all defined by the immediate next <dd> element. The subsequent <dd> (Description Details) element provides the definition or other related text associated with the term specified using <dt>. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories None. Permitted content Flow content, but with no <header>, <footer>, sectioning content or heading content descendants. Tag omission Must have a start tag. The end tag may be o...
<element>: The Custom Element element (Obsolete) - HTML: Hypertext Markup Language
Web › HTML › Element › element
lements ??? DOM interface HTMLElement Attributes This element includes the global attributes. Specifications The <element> element was formerly in a draft specification of Custom Elements but it has been removed. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetelement DeprecatedNon-standardChrome ? Edge ? Firefox No support NoIE ...
<fieldset>: The Field Set element - HTML: Hypertext Markup Language
Web › HTML › Element › fieldset
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. As the example above shows, the <fieldset> element provides a grouping for a part of an HTML form, with a nested <legend> element providing a caption for the <fieldset>. ...
<form> - HTML: Hypertext Markup Language
Web › HTML › Element › form
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. It is possible to use the :valid and :invalid CSS pseudo-classes to style a <form> element based on whether or not the elements inside the form are valid. ...
<hgroup> - HTML: Hypertext Markup Language
Web › HTML › Element › hgroup
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, heading content, palpable content. Permitted content One or more <h1>, <h2>, <h3>, <h4>, <h5>, and/or <h6>. Tag omission None, both the starting and ending tag are mandatory. ...
<i>: The Idiomatic Text element - HTML: Hypertext Markup Language
Web › HTML › Element › i
The HTML Idiomatic Text element (<i>) represents a range of text that is set off from the normal text for some reason, such as idiomatic text, technical terms, taxonomical designations, among others. Historically, these have been presented using italicized type, which is the original source of the <i> naming of this element. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, phrasing content, palpable content. Permitted content Phrasing content. Tag omission None, both the starting and ending tag are mandatory. Permitted parents Any eleme...
<iframe>: The Inline Frame element - HTML: Hypertext Markup Language
Web › HTML › Element › iframe
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Each embedded browsing context has its own session history and document. The browsing context that embeds the others is called the parent browsing context. ...
<img>: The Image Embed element - HTML: Hypertext Markup Language
Web › HTML › Element › img
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The above example shows usage of the <img> element: The src attribute is required, and contains the path to the image you want to embed. The alt attribute holds a text description of the image, which isn't mandatory but is incredibly useful for accessibility -- screen readers read this description out to their users so they know what the image means. ...
<input type="checkbox"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › checkbox
t are checked (ticked) when activated, like you might see in an official government paper form. The exact appearance depends upon the operating system configuration under which the browser is running. Generally this is a square but it may have rounded corners. A checkbox allows you to select single values for submission in a form (or not). The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Note: Radio buttons are similar to checkboxes, but with an important distinction -- radio buttons are grouped into a set in which only one radio button can be selected at a time, whereas checkboxes allow you to turn single values o...
<input type="hidden"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › hidden
rver would set the value of the hidden input with the ID "postID" to the ID of the post in its database before sending the form to the user's browser and would use that information when the form is returned to know which database record to update with modified information. No scripting is needed in the content to handle this. The output looks like this: Note: You can also find the example on GitHub (see the source code, and also see it running live). When submitted, the form data sent to the server will look something like this: title=My+excellent+blog+post&content=This+is+the+content+of+my+excellent+blog+post.+I+hope+you+enjoy+it!&postId=34657 Even though the hidden input cannot be seen at all, its data is still submitted. Specifications Specification Status Comment...
<input type="radio"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › radio
<input> elements of type radio are generally used in radio groups--collections of radio buttons describing a set of related options. Only one radio button in a given group can be selected at the same time. Radio buttons are typically rendered as small circles, which are filled or highlighted when selected. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. They are called radio buttons because they look and operate in a similar manner to the push buttons on old-fashioned radios, such as the one shown below. Note: Checkboxes are similar to radio buttons, but with an important distinction: radio buttons are design...
<input type="range"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › range
alue, and no more than another given value. The precise value, however, is not considered important. This is typically represented using a slider or dial control rather than a text entry box like the number input type. Because this kind of widget is imprecise, it shouldn't typically be used unless the control's exact value isn't important. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. If the user's browser doesn't support type range, it will fall back and treat it as a text input. Value A DOMString containing the string representation of the selected numeric value; use valueAsNumber to get the value a...
<input type="tel"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › tel
<input> elements of type tel are used to let the user enter and edit a telephone number. Unlike <input type="email"> and <input type="url"> , the input value is not automatically validated to a particular format before the form can be submitted, because formats for telephone numbers vary so much around the world. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Despite the fact that inputs of type tel are functionally identical to standard text inputs, they do serve useful purposes; the most quickly apparent of these is that mobile browsers -- especially on mobile phones -- may opt to present a custom keypad optimiz...
<input type="text"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › text
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Value A DOMString representing the text contained in the text field. Events change and input Supported Common Attributes autocomplete, list, maxlength, minlength, pattern, placeholder, readonly, required and size IDL attributes list, value Methods select(), setRangeText() and setSelectionRange(). ...
<input type="time"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › time
r easily enter a time (hours and minutes, and optionally seconds). The control's user interface will vary from browser to browser. Support is good in modern browsers, with Safari being the sole major browser not yet implementing it; in Safari, and any other browsers that don't support <time>, it degrades gracefully to <input type="text">. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Appearance Chrome and Opera In Chrome/Opera the time control is simple, with slots to enter hours and minutes in 12 or 24-hour format depending on operating system locale, and up and down arrows to increment and decrement the curre...
<input type="week"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › week
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The control's user interface varies from browser to browser; cross-browser support is currently a bit limited, with only Chrome/Opera and Microsoft Edge supporting it at this time. ...
<keygen> - HTML: Hypertext Markup Language
Web › HTML › Element › keygen
is encrypted and stored in the local key database. PublicKeyAndChallenge ::= SEQUENCE { spki SubjectPublicKeyInfo, challenge IA5STRING } SignedPublicKeyAndChallenge ::= SEQUENCE { publicKeyAndChallenge PublicKeyAndChallenge, signatureAlgorithm AlgorithmIdentifier, signature BIT STRING } The public key and challenge string are DER encoded as PublicKeyAndChallenge, and then digitally signed with the private key to produce a SignedPublicKeyAndChallenge. The SignedPublicKeyAndChallenge is Base64 encoded, and the ASCII data is finally submitted to the server as the value of a form name/value pair, where the name is name as specified by the name attribute of the keygen element. If no challenge string is provided, then it will be encoded as an IA5STRING of length zero. Here i...
<label> - HTML: Hypertext Markup Language
Web › HTML › Element › label
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Associating a <label> with an <input> element offers some major advantages: The label text is not only visually associated with its corresponding text input; it is programmatically associated with it too. ...
<legend> - HTML: Hypertext Markup Language
Web › HTML › Element › legend
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories None. Permitted content Phrasing content and headings (h1-h6 elements). Tag omission None, both the starting and ending tag are mandatory. ...
<li> - HTML: Hypertext Markup Language
Web › HTML › Element › li
d to represent an item in a list. It must be contained in a parent element: an ordered list (<ol>), an unordered list (<ul>), or a menu (<menu>). In menus and unordered lists, list items are usually displayed using bullet points. In ordered lists, they are usually displayed with an ascending counter on the left, such as a number or letter. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories None. Permitted content Flow content. Tag omission The end tag can be omitted if the list item is immediately followed by another <li> element, or if there is no more content in...
<link>: The External Resource Link element - HTML: Hypertext Markup Language
Web › HTML › Element › link
The HTML External Resource Link element (<link>) specifies relationships between the current document and an external resource. This element is most commonly used to link to stylesheets, but is also used to establish site icons (both "favicon" style icons and icons for the home screen and apps on mobile devices) among other things. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. To link an external stylesheet, you'd include a <link> element inside your <head> like this: <link href="main.css" rel="stylesheet"> This simple example provides the path to the stylesheet inside an href attribute, and a rel attribute wit...
<listing> - HTML: Hypertext Markup Language
Web › HTML › Element › listing
han the global attributes, common to all elements. DOM interface This element implements the HTMLElement interface. Implementation note: up to Gecko 1.9.2 inclusive, Firefox implements the HTMLSpanElement interface for this element. Browser compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetlisting DeprecatedChrome No support NoEdge No support NoFirefox No support ...
<map> - HTML: Hypertext Markup Language
Web › HTML › Element › map
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, phrasing content, palpable content. Permitted content Any transparent element. Tag omission None, both the starting and ending tag are mandatory. Permitted parents Any element that accepts phrasing content. ...
<meter>: The HTML Meter element - HTML: Hypertext Markup Language
Web › HTML › Element › meter
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, phrasing content, labelable content, palpable content. Permitted content Phrasing content, but there must be no <meter> element among its descendants. Tag omission None, both the starting and ending tag are mandatory. ...
<ol>: The Ordered List element - HTML: Hypertext Markup Language
Web › HTML › Element › ol
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, and if the <ol> element's children include at least one <li> element, palpable content. Permitted content Zero or more <li>, <script> and <template> elements. Tag omission None, both the starting and ending tag are mandatory. ...
<optgroup> - HTML: Hypertext Markup Language
Web › HTML › Element › optgroup
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories None. Permitted content Zero or more <option> elements. Tag omission The start tag is mandatory. The end tag is optional if this element is immediately followed by another <optgroup> element, or if the parent element has no more content. Permitted parents A <select> element. ...
<p>: The Paragraph element - HTML: Hypertext Markup Language
Web › HTML › Element › p
d from adjacent blocks by blank lines and/or first-line indentation, but HTML paragraphs can be any structural grouping of related content, such as images or form fields. Paragraphs are block-level elements, and notably will automatically close if another block-level element is parsed before the closing </p> tag. See "Tag omission" below. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, palpable content. Permitted content Phrasing content. Tag omission The start tag is required. The end tag may be omitted if the <p> element is immediately followed ...
<picture>: The Picture element - HTML: Hypertext Markup Language
Web › HTML › Element › picture
ent display/device scenarios. The browser will consider each child <source> element and choose the best match among them. If no matches are found--or the browser doesn't support the <picture> element--the URL of the <img> element's src attribute is selected. The selected image is then presented in the space occupied by the <img> element. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. To decide which URL to load, the user agent examines each <source>'s srcset, media, and type attributes to select a compatible image that best matches the current layout and capabilities of the display device. The <img> element ser...
<progress>: The Progress Indicator element - HTML: Hypertext Markup Language
Web › HTML › Element › progress
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, phrasing content, labelable content, palpable content. Permitted content Phrasing content, but there must be no <progress> element among its descendants. ...
<q>: The Inline Quotation element - HTML: Hypertext Markup Language
Web › HTML › Element › q
The HTML <q> element indicates that the enclosed text is a short inline quotation. Most modern browsers implement this by surrounding the text in quotation marks. This element is intended for short quotations that don't require paragraph breaks; for long quotations use the <blockquote> element. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, phrasing content, palpable content. Permitted content Phrasing content. Tag omission None, both the starting and ending tag are mandatory. Permitted parents Any element that accepts phrasing conte...
<rb>: The Ruby Base element - HTML: Hypertext Markup Language
Web › HTML › Element › rb
The HTML Ruby Base (<rb>) element is used to delimit the base text component of a <ruby> annotation, i.e. the text that is being annotated. One <rb> element should wrap each separate atomic segment of the base text. {{EmbedInteractiveExample("pages/tabbed/rb.html", "tabbed-standard")}} The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories None. Permitted content As a child of a <ruby> element. Tag omission The end tag can be omitted if the element is immediately followed by an <rt>, <rtc>, or <rp> element or another <rb> element, or if there is no more content in the...
<rp>: The Ruby Fallback Parenthesis element - HTML: Hypertext Markup Language
Web › HTML › Element › rp
The HTML Ruby Fallback Parenthesis (<rp>) element is used to provide fall-back parentheses for browsers that do not support display of ruby annotations using the <ruby> element. One <rp> element should enclose each of the opening and closing parentheses that wrap the <rt> element that contains the annotation's text. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories None. Permitted content Text Tag omission The end tag can be omitted if the element is immediately followed by an <rt> or another <rp> element, or if there is no more content in the parent element. ...
<rt>: The Ruby Text element - HTML: Hypertext Markup Language
Web › HTML › Element › rt
The HTML Ruby Text (<rt>) element specifies the ruby text component of a ruby annotation, which is used to provide pronunciation, translation, or transliteration information for East Asian typography. The <rt> element must always be contained within a <ruby> element. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. See the article about the <ruby> element for more examples. Content categories None. Permitted content Phrasing content. Tag omission The end tag may be omitted if the <rt> element is immediately followed by an <rt> or <rp> element, or if there is no more content in th...
<ruby> - HTML: Hypertext Markup Language
Web › HTML › Element › ruby
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, phrasing content, palpable content. Permitted content Phrasing content. Tag omission None, both the starting and ending tag are mandatory. ...
<s> - HTML: Hypertext Markup Language
Web › HTML › Element › s
The HTML <s> element renders text with a strikethrough, or a line through it. Use the <s> element to represent things that are no longer relevant or no longer accurate. However, <s> is not appropriate when indicating document edits; for that, use the <del> and <ins> elements, as appropriate. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Phrasing content or flow content. Permitted content Phrasing content. Tag omission None, both the starting and ending tag are mandatory. Permitted parents Any element that accepts phrasing content. Implic...
<select>: The HTML Select element - HTML: Hypertext Markup Language
Web › HTML › Element › select
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The above example shows typical <select> usage. It is given an id attribute to enable it to be associated with a <label> for accessibility purposes, as well as a name attribute to represent the name of the associated data point submitted to the server. Each menu option is defined by an <option> element nested inside the <select>. ...
<source>: The Media or Image Source element - HTML: Hypertext Markup Language
Web › HTML › Element › source
> element, or the <video> element. It is an empty element, meaning that it has no content and does not have a closing tag. It is commonly used to offer the same media content in multiple file formats in order to provide compatibility with a broad range of browsers given their differing support for image file formats and media file formats. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories None. Permitted content None, it is an empty element. Tag omission It must have a start tag, but must not have an end tag. Permitted parents A media element--<au...
<span> - HTML: Hypertext Markup Language
Web › HTML › Element › span
t anything. It can be used to group elements for styling purposes (using the class or id attributes), or because they share attribute values, such as lang. It should be used only when no other semantic element is appropriate. <span> is very much like a <div> element, but <div> is a block-level element whereas a <span> is an inline element. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, phrasing content. Permitted content Phrasing content. Tag omission None, both the starting and ending tag are mandatory. Permitted parents Any element t...
<time> - HTML: Hypertext Markup Language
Web › HTML › Element › time
clude the datetime attribute to translate dates into machine-readable format, allowing for better search engine results or custom features such as reminders. It may represent one of the following: A time on a 24-hour clock. A precise date in the Gregorian calendar (with optional time and timezone information). A valid time duration. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, phrasing content, palpable content. Permitted content Phrasing content. Tag omission None, both the starting and ending tag are mandatory. Permitted parent...
<track>: The Embed Text Track element - HTML: Hypertext Markup Language
Web › HTML › Element › track
The HTML <track> element is used as a child of the media elements, <audio> and <video>. It lets you specify timed text tracks (or time-based data), for example to automatically handle subtitles. The tracks are formatted in WebVTT format (.vtt files) -- Web Video Text Tracks. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories None Permitted content None, it is an empty element. Tag omission As it is a void element, the start tag must be present and the end tag must not be present. Permitted parents A media element, <audio> or <video>. ...
<u>: The Unarticulated Annotation (Underline) element - HTML: Hypertext Markup Language
Web › HTML › Element › u
otation. This is rendered by default as a simple solid underline, but may be altered using CSS. This element used to be called the "Underline" element in older versions of HTML, and is still sometimes misused in this way. To underline text, you should instead apply a style that includes the CSS text-decoration property set to underline. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. See the Usage notes section for further details on when it's appropriate to use <u> and when it isn't. Content categories Flow content, phrasing content, palpable content. Permitted content Phrasing content. ...
<ul>: The Unordered List element - HTML: Hypertext Markup Language
Web › HTML › Element › ul
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, and if the <ul> element's children include at least one <li> element, palpable content. Permitted content Zero or more <li>, <script> and <template> elements. Tag omission None, both the starting and ending tag are mandatory. ...
class - HTML: Hypertext Markup Language
The class global attribute is a space-separated list of the case-sensitive classes of the element. Classes allow CSS and Javascript to select and access specific elements via the class selectors or functions like the DOM method document.getElementsByClassName. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Though the specification doesn't put requirements on the name of classes, web developers are encouraged to use names that describe the semantic purpose of the element, rather than the presentation of the element. For example, attribute to describe an attribute rather than italics, although an element of this cl...
hidden - HTML: Hypertext Markup Language
The hidden global attribute is a Boolean attribute indicating that the element is not yet, or is no longer, relevant. For example, it can be used to hide elements of the page that can't be used until the login process has been completed. Browsers won't render elements with the hidden attribute set. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The hidden attribute must not be used to hide content just from one presentation. If something is marked hidden, it is hidden from all presentations, including, for instance, screen readers. Hidden elements shouldn't be linked from non-hidden elements, and elements that a...
inputmode - HTML: Hypertext Markup Language
is an enumerated attribute that hints at the type of data that might be entered by the user while editing the element or its contents. It can have the following values: none No virtual keyboard. For when the page implements its own keyboard input control. text (default value) Standard input keyboard for the user's current locale. decimal Fractional numeric input keyboard containing the digits and decimal separator for the user's locale (typically . or ,). Devices may or may not show a minus key (-). numeric Numeric input keyboard, but only requires the digits 0-9. Devices may or may not show a minus key. tel A telephone keypad input, including the digits 0-9, the asterisk (*), and the pound (#) key. Inputs that require a telephone number should typically use <input type="tel">ins...
lang - HTML: Hypertext Markup Language
elements are written in, or the language that the editable elements should be written in by the user. The attribute contains a single "language tag" in the format defined in Tags for Identifying Languages (BCP47). The default value of lang is unknown, therefore it is recommended to always specify this attribute with the appropriate value. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. If the attribute value is the empty string (lang=""), the language is set to unknown; if the language tag is not valid according to BCP47, it is set to invalid. Language tag syntax The full BCP47 syntax is in-depth enough to mark...
spellcheck - HTML: Hypertext Markup Language
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. It may have the following values: true, which indicates that the element should be, if possible, checked for spelling errors; false, which indicates that the element should not be checked for spelling errors. ...
style - HTML: Hypertext Markup Language
The style global attribute contains CSS styling declarations to be applied to the element. Note that it is recommended for styles to be defined in a separate file or files. This attribute and the <style> element have mainly the purpose of allowing for quick styling, for example for testing purposes. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Usage note: This attribute must not be used to convey semantic information. Even if all styling is removed, a page should remain semantically correct. Typically it shouldn't be used to hide irrelevant information; this should be done using the hidden attribute. Specifi...
Global attributes - HTML: Hypertext Markup Language
itively export shadow parts from a nested shadow tree into a containing light tree. hidden A Boolean attribute indicates that the element is not yet, or is no longer, relevant. For example, it can be used to hide elements of the page that can't be used until the login process has been completed. The browser won't render such elements. This attribute must not be used to hide content that could legitimately be shown. id Defines a unique identifier (ID) which must be unique in the whole document. Its purpose is to identify the element when linking (using a fragment identifier), scripting, or styling (with CSS). inputmode Provides a hint to browsers as to the type of virtual keyboard configuration to use when editing this element or its contents. Used primarily on <input> elements, but is u...
HTML documentation index - HTML: Hypertext Markup Language
Web › HTML › Index
129 <input type="month"> Date picker, Element, Form input, Forms, HTML, HTML forms, HTML input, Input, Input Element, Input Type, Number, Reference, month <input> elements of type month create input fields that let the user enter a month and year allowing a month and year to be easily entered. The value is a string whose value is in the format "YYYY-MM", where YYYY is the four-digit year and MM is the month number. 130 <input type="number"> Element, Forms, HTML, HTML forms, Input, Input Element, Input Type, Number, Reference <input> elements of type number are used to let the user enter a number. They include built-in validation to reject non-numerical entries. 131 <input type="password"> Element, Forms, HTML, HTML Input Types, HTML Inputs...
HTTP authentication - HTTP
st services, such as Amazon AWS. Common authentication schemes include: Basic See RFC 7617, base64-encoded credentials. More information below. Bearer See RFC 6750, bearer tokens to access OAuth 2.0-protected resources Digest See RFC 7616, only md5 hashing is supported in Firefox, see bug 472823 for SHA encryption support HOBA See RFC 7486, Section 3, HTTP Origin-Bound Authentication, digital-signature-based Mutual See RFC 8120 AWS4-HMAC-SHA256 See AWS docs Basic authentication scheme The "Basic" HTTP authentication scheme is defined in RFC 7617, which transmits credentials as user ID/password pairs, encoded using base64. Security of basic authentication As the user ID and password are passed over the network as clear text (it is base64 encoded, but base64 is a reversible e...
Common MIME types - HTTP
pecifications: https://html.spec.whatwg.org/multipage/#scriptingLanguages https://html.spec.whatwg.org/multipage/#dependencies:willful-violation https://datatracker.ietf.org/doc/draft-ietf-dispatch-javascript-mjs/ .json JSON format application/json .jsonld JSON-LD format application/ld+json .mid .midi Musical Instrument Digital Interface (MIDI) audio/midi audio/x-midi .mjs JavaScript module text/javascript .mp3 MP3 audio audio/mpeg .mpeg MPEG Video video/mpeg .mpkg Apple Installer Package application/vnd.apple.installer+xml .odp OpenDocument presentation document application/vnd.oasis.opendocument.presentation .ods OpenDocument s...
Content negotiation - HTTP
fy it, either by not knowing how, or by not being able to do it, as in an Internet cafe for instance. Once a user has overridden the server-chosen language, a site should no longer use language detection and should stick with the explicitly-chosen language. In other words, only entry pages of a site should select the proper language using this header. The User-Agent header Though there are legitimate uses of this header for selecting content, it is considered bad practice to rely on it to define what features are supported by the user agent. The User-Agent header identifies the browser sending the request. This string may contain a space-separated list of product tokens and comments. A product token is a name followed by a '/' and a version number, like Firefox/4.0.1. There may be as ...
Using HTTP cookies - HTTP
Web › HTTP › Cookies
remembers stateful information for the stateless HTTP protocol. Cookies are mainly used for three purposes: Session management Logins, shopping carts, game scores, or anything else the server should remember Personalization User preferences, themes, and other settings Tracking Recording and analyzing user behavior Cookies were once used for general client-side storage. While this was legitimate when they were the only way to store data on the client, it is now recommended to use modern storage APIs. Cookies are sent with every request, so they can worsen performance (especially for mobile data connections). Modern APIs for client storage are the Web Storage API (localStorage and sessionStorage) and IndexedDB. To see stored cookies (and other storage that a web page can use), you ...
CSP: connect-src - HTTP
The HTTP Content-Security-Policy (CSP) connect-src directive restricts the URLs which can be loaded using script interfaces. The APIs that are restricted are: <a> ping, Fetch, XMLHttpRequest, WebSocket, EventSource, and Navigator.sendBeacon(). Note: connect-src 'self' does not resolve to websocket schemas in all browsers, more info: https://github.com/w3c/webappsec-csp/issues/7 CSP version 1 Directive type Fetch directive default-src fallback Yes. If this directive is absent, the user agent will look for the default-src directive. Syntax One or more sources can be allowed for the connect-src policy: Content-Security-Policy: connect-src <source>; Content-Security-Policy: connect-src <source> <source>; Sources <source> can be one of ...
CSP: trusted-types - HTTP
Specifications Specification Status Comment Trusted Types Draft Initial definition. ...
Date - HTTP
Web › HTTP › Headers › Date
end Date header: fetch('https://httpbin.org/get', { 'headers': { 'Date': (new Date()).toUTCString() } }) Header type General header Forbidden header name yes Syntax Date: <day-name>, <day> <month> <year> <hour>:<minute>:<second> GMT Directives <day-name> One of "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", or "Sun" (case-sensitive). <day> 2 digit day number, e.g. "04" or "23". <month> One of "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" (case sensitive). <year> 4 digit year number, e.g. "1990" or "2016". <hour> 2 digit hour number, e.g. "09" or "23". <minute> 2 digit minute number, e.g. "04" or "59". <second> 2 digit second number, e.g. "04" or "59". GMT Greenwich Mean Time. HTTP dates ar...
If-Modified-Since - HTTP
n't support If-None-Match. The most common use case is to update a cached entity that has no associated ETag. Header type Request header Forbidden header name no Syntax If-Modified-Since: <day-name>, <day> <month> <year> <hour>:<minute>:<second> GMT Directives <day-name> One of "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", or "Sun" (case-sensitive). <day> 2 digit day number, e.g. "04" or "23". <month> One of "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" (case sensitive). <year> 4 digit year number, e.g. "1990" or "2016". <hour> 2 digit hour number, e.g. "09" or "23". <minute> 2 digit minute number, e.g. "04" or "59". <second> 2 digit second number, e.g. "04" or "59". GMT Greenwich Mean Time. HTTP dates ar...
If-Range - HTTP
Web › HTTP › Headers › If-Range
e>:<second> GMT If-Range: <etag> Directives <etag> An entity tag uniquely representing the requested resource. It is a string of ASCII characters placed between double quotes (Like "675af34563dc-tr34") and may be prefixed by W/ to indicate that the weak comparison algorithm should be used. <day-name> One of "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", or "Sun" (case-sensitive). <day> 2 digit day number, e.g. "04" or "23". <month> One of "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" (case sensitive). <year> 4 digit year number, e.g. "1990" or "2016". <hour> 2 digit hour number, e.g. "09" or "23". <minute> 2 digit minute number, e.g. "04" or "59". <second> 2 digit second number, e.g. "04" or "59". GMT Greenwich Mean Time. HTTP dates ar...
If-Unmodified-Since - HTTP
f-Range header, it can be used to ensure that the new fragment requested comes from an unmodified document. Header type Request header Forbidden header name no Syntax If-Unmodified-Since: <day-name>, <day> <month> <year> <hour>:<minute>:<second> GMT Directives <day-name> One of "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", or "Sun" (case-sensitive). <day> 2 digit day number, e.g. "04" or "23". <month> One of "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" (case sensitive). <year> 4 digit year number, e.g. "1990" or "2016". <hour> 2 digit hour number, e.g. "09" or "23". <minute> 2 digit minute number, e.g. "04" or "59". <second> 2 digit second number, e.g. "04" or "59". GMT Greenwich Mean Time. HTTP dates ar...
Last-Modified - HTTP
fied-Since or If-Unmodified-Since headers make use of this field. Header type Response header Forbidden header name no CORS-safelisted response header yes Syntax Last-Modified: <day-name>, <day> <month> <year> <hour>:<minute>:<second> GMT Directives <day-name> One of "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", or "Sun" (case-sensitive). <day> 2 digit day number, e.g. "04" or "23". <month> One of "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" (case sensitive). <year> 4 digit year number, e.g. "1990" or "2016". <hour> 2 digit hour number, e.g. "09" or "23". <minute> 2 digit minute number, e.g. "04" or "59". <second> 2 digit second number, e.g. "04" or "59". GMT Greenwich Mean Time. HTTP dates ar...
Referrer-Policy - HTTP
s specified, or if the provided value is invalid. The origin, path, and querystring of the URL are sent as a referrer when the protocol security level stays the same (HTTP->HTTP, HTTPS->HTTPS) or improves (HTTP->HTTPS), but isn't sent to less secure destinations (HTTPS->HTTP). There is effort from browsers in moving to a stricter default value, namely strict-origin-when-cross-origin (see https://github.com/whatwg/fetch/pull/952), consider using this value (or a stricter one), if possible, when changing the Referrer-Policy. origin Only send the origin of the document as the referrer. For example, a document at https://example.com/page.html will send the referrer https://example.com/. origin-when-cross-origin Send the origin, path, and query string when performing a same-origin request,...
Set-Cookie - HTTP
from any response exposed to frontend code. For more information, see the guide on HTTP cookies. ...
Set-Cookie2 - HTTP
er Forbidden header name no Syntax Set-Cookie2: <cookie-name>=<cookie-value> Set-Cookie2: <cookie-name>=<cookie-value>; Comment=<value> Set-Cookie2: <cookie-name>=<cookie-value>; CommentURL=<http-url> Set-Cookie2: <cookie-name>=<cookie-value>; Discard Set-Cookie2: <cookie-name>=<cookie-value>; Domain=<domain-value> Set-Cookie2: <cookie-name>=<cookie-value>; Max-Age=<non-zero-digit> Set-Cookie2: <cookie-name>=<cookie-value>; Path=<path-value> Set-Cookie2: <cookie-name>=<cookie-value>; Port=<port-number> Set-Cookie2: <cookie-name>=<cookie-value>; Secure Set-Cookie2: <cookie-name>=<cookie-value>; Version=<version-number> // Multiple directives are also possible, for example: Set-Cookie2: <cookie-name>=<cookie-value>; Domain=<domain-value>; Secure // Multiple cookies are sep...
Trailer - HTTP
Web › HTTP › Headers › Trailer
The TE request header needs to be set to "trailers" to allow trailer fields. ...
Firefox user agent string reference - HTTP
1.2 26.0 1.3 28.0 1.4 30.0 2.0 32.0 2.1 34.0 2.2 37 2.5 44 It's easy to find the correspondences by looking at the Mercurial repository names: repositories starting by mozilla-b2g are the release repositories for Firefox OS, and have both Firefox OS and Gecko versions in their names. Firefox OS has a four-digit version number: X.X.X.Y. The first two digits are owned by the Mozilla product team and denote versions with new features (eg: v1.1, 1.2, etc). The third digit is incremented with regular version tags (about every 6 weeks) for security updates, and the fourth is owned by the OEM. Firefox Web Runtime The Web Runtime uses the same user agent string as desktop Firefox. Other Gecko-based browsers ...
103 Early Hints - HTTP
Web › HTTP › Status › 103
rt preloading resources while the server is still preparing a response. Syntax 103 Early Hints Specifications Specification Status Comments RFC 8297: 103 Early Hints IETF RFC Initial definition Browser Compatibility The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. No compatibility data found. Please contribute data for "http.status.103" (depth: 1) to the MDN compatibility data repository. ...
402 Payment Required - HTTP
Web › HTTP › Status › 402
However, no standard use convention exists and different entities use it in different contexts. ...
HTTP response status codes - HTTP
Web › HTTP › Status
t The server could not understand the request due to invalid syntax. 401 Unauthorized Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. 402 Payment Required This response code is reserved for future use. The initial aim for creating this code was using it for digital payment systems, however this status code is used very rarely and no standard convention exists. 403 Forbidden The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401, the client's identity is known to the server. 404 Not Found The server can not find the requested resource. In the browser, this...
JavaScript data types and data structures - JavaScript
y 0 to 65535 2 16-bit unsigned integer unsigned short uint16_t Int32Array -2147483648 to 2147483647 4 32-bit two's complement signed integer long int32_t Uint32Array 0 to 4294967295 4 32-bit unsigned integer unsigned long uint32_t Float32Array 1.2x10-38 to 3.4x1038 4 32-bit IEEE floating point number (7 significant digits e.g., 1.1234567) unrestricted float float Float64Array 5.0x10-324 to 1.8x10308 8 64-bit IEEE floating point number (16 significant digits e.g., 1.123...15) unrestricted double double BigInt64Array -263 to 263-1 8 64-bit two's complement signed integer bigint int64_t (signed long long) BigUint64Array 0 to 264-1 8 64-bit unsig...
Indexed collections - JavaScript
y 0 to 65535 2 16-bit unsigned integer unsigned short uint16_t Int32Array -2147483648 to 2147483647 4 32-bit two's complement signed integer long int32_t Uint32Array 0 to 4294967295 4 32-bit unsigned integer unsigned long uint32_t Float32Array 1.2x10-38 to 3.4x1038 4 32-bit IEEE floating point number (7 significant digits e.g., 1.1234567) unrestricted float float Float64Array 5.0x10-324 to 1.8x10308 8 64-bit IEEE floating point number (16 significant digits e.g., 1.123...15) unrestricted double double BigInt64Array -263 to 263-1 8 64-bit two's complement signed integer bigint int64_t (signed long long) BigUint64Array 0 to 264-1 8 64-bit unsig...
constructor - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax constructor([arguments]) { ... } Description A constructor enables you to provide any custom initialization that must be done before any other methods can be called on an instantiated object. ...
extends - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax class ChildClass extends ParentClass { ... } Description The extends keyword can be used to subclass custom classes as well as built-in objects. The .prototype of the extension must be an Object or null. ...
Deprecated and obsolete features - JavaScript
ons instead. Proxy Proxy.create and Proxy.createFunction are deprecated. Use Proxy instead. The following traps are obsolete: hasOwn (bug 980565, Firefox 33). getEnumerablePropertyKeys (bug 783829, Firefox 37) getOwnPropertyNames (bug 1007334, Firefox 33) keys (bug 1007334, Firefox 33) Escape sequences Octal escape sequences (\ followed by one, two, or three octal digits) are deprecated in string and regular expression literals. The escape and unescape functions are deprecated. Use encodeURI, encodeURIComponent, decodeURI or decodeURIComponent to encode and decode escape sequences for special characters. String methods HTML wrapper methods like String.prototype.fontsize and String.prototype.big. String.prototype.quote is removed from Firefox 37. non stan...
Warning: 08/09 is not a legal ECMA-262 octal constant - JavaScript
tal constant" occurs when 08 or 09 number literals are used. They can't be interpreted as an octal number. Message Warning: SyntaxError: 08 is not a legal ECMA-262 octal constant. Warning: SyntaxError: 09 is not a legal ECMA-262 octal constant. Error type Warning. JavaScript execution won't be halted. What went wrong? Decimal literals can start with a zero (0) followed by another decimal digit, but If all digits after the leading 0 are smaller than 8, the number is interpreted as an octal number. Because this is not the case with 08 and 09, JavaScript warns about it. Note that octal literals and octal escape sequences are deprecated and will present an additional deprecation warning. With ECMAScript 6 and later, the syntax uses a leading zero followed by a lowercase or uppercase Latin...
RangeError: radix must be an integer - JavaScript
he BigInt.prototype.toString() method was specified. Its value must be an integer (a number) between 2 and 36, specifying the base of the number system to be used for representing numeric values. For example, the decimal (base 10) number 169 is represented in hexadecimal (base 16) as A9. Why is this parameter's value limited to 36? A radix that is larger than 10 uses alphabetical characters as digits; therefore, the radix can't be larger than 36, since the Latin alphabet (used by English and many other languages) only has 26 characters. The most common radixes: 2 for binary numbers, 8 for octal numbers, 10 for decimal numbers, 16 for hexadecimal numbers. Examples Invalid cases (42).toString(0); (42).toString(1); (42).toString(37); (42).toString(150); // You cannot use a string lik...
SyntaxError: identifier starts immediately after numeric literal - JavaScript
The JavaScript exception "identifier starts immediately after numeric literal" occurs when an identifier started with a digit. Identifiers can only start with a letter, underscore (_), or dollar sign ($). Message SyntaxError: Unexpected identifier after numeric literal (Edge) SyntaxError: identifier starts immediately after numeric literal (Firefox) SyntaxError: Unexpected number (Chrome) Error type SyntaxError What went wrong? The names of variables, called identifiers, conform to certain rules, which your code must adhere to! A JavaScript identifier must start with a letter, underscore (_), or dollar sign ($). They can't start with a digit! Only subsequent characters can be digits (0-9). Examples Variable names starting with numeric literals Variable names can't start with numbe...
SyntaxError: missing formal parameter - JavaScript
rameters must be identifiers, not any value like numbers, strings, or objects. Declaring functions and calling functions are two separate steps. Declarations require identifier as parameters, and only when calling (invoking) the function, you provide the values the function should use. In JavaScript, identifiers can contain only alphanumeric characters (or "$" or "_"), and may not start with a digit. An identifier differs from a string in that a string is data, while an identifier is part of the code. Examples Provide proper function parameters Function parameters must be identifiers when setting up a function. All these function declarations fail, as they are providing values for their parameters: function square(3) { return number * number; }; // SyntaxError: missing formal parameter...
Default parameters - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax function [name]([param1[ = defaultValue1 ][, ..., paramN[ = defaultValueN ]]]) { statements } Description In JavaScript, function parameters default to undefined. However, it's often useful to set a different default value. ...
getter - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax {get prop() { ... } } {get [expression]() { ... } } Parameters prop The name of the property to bind to the given function. expression Starting with ECMAScript 2015, you can also use expressions for a computed property name to bind to the given function. ...
Rest parameters - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax function f(a, b, ...theArgs) { // ... } Description A function's last parameter can be prefixed with ... which will cause all remaining (user supplied) arguments to be placed within a "standard" JavaScript array. Only the last parameter can be a "rest parameter". ...
setter - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax {set prop(val) { . . . }} {set [expression](val) { . . . }} Parameters prop The name of the property to bind to the given function. val An alias for the variable that holds the value attempted to be assigned to prop. ...
Array.prototype.concat() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax const new_array = old_array.concat([value1[, value2[, ...[, valueN]]]]) Parameters valueN Optional Arrays and/or values to concatenate into a new array. ...
Array.prototype.copyWithin() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax arr.copyWithin(target[, start[, end]]) Parameters target Zero-based index at which to copy the sequence to. If negative, target will be counted from the end. ...
Array.prototype.every() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. 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. ...
Array.prototype.filter() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax let newArray = arr.filter(callback(element[, index, [array]])[, thisArg]) Parameters callback Function is a predicate, to test each element of the array. Return true to keep the element, false otherwise. ...
Array.prototype.flat() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax var newArray = arr.flat([depth]); Parameters depth Optional The depth level specifying how deep a nested array structure should be flattened. Defaults to 1. Return value A new array with the sub-array elements concatenated into it. ...
Array.prototype.flatMap() - JavaScript
The flatMap() method first maps each element using a mapping function, then flattens the result into a new array. It is identical to a map() followed by a flat() of depth 1, but flatMap() is often quite useful, as merging both into one method is slightly more efficient. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. 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 a...
Array.prototype.forEach() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax arr.forEach(callback(currentValue [, index [, array]])[, thisArg]) Parameters callback Function to execute on each element. It accepts between one and three arguments: currentValue The current element being processed in the array. index Optional The index currentValue in the array. ...
Array.from() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Array.from(arrayLike [, mapFn [, thisArg]]) Parameters arrayLike An array-like or iterable object to convert to an array. mapFn Optional Map function to call on every element of the array. thisArg Optional Value to use as this when executing mapFn. ...
Array.prototype.includes() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax arr.includes(valueToFind[, fromIndex]) Parameters valueToFind The value to search for. Note: When comparing strings and characters, includes() is case-sensitive. ...
Array.prototype.join() - JavaScript
The join() method creates and returns a new string by concatenating all of the elements in an array (or an array-like object), separated by commas or a specified separator string. If the array has only one item, then that item will be returned without using the separator. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax arr.join([separator]) Parameters separator Optional Specifies a string to separate each pair of adjacent elements of the array. The separator is converted to a string if necessary. If omitted, the array elements are separated with a comma (","). If separator is an empty string, all eleme...
Array.prototype.pop() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax arrName.pop() Return value The removed element from the array; undefined if the array is empty. Description The pop method removes the last element from an array and returns that value to the caller. ...
Array.prototype.push() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax arr.push([element1[, ...[, elementN]]]) Parameters elementN The element(s) to add to the end of the array. Return value The new length property of the object upon which the method was called. Description The push method appends values to an array. push is intentionally generic. ...
Array.prototype.reverse() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax a.reverse() Return value The reversed array. Description The reverse method transposes the elements of the calling array object in place, mutating the array, and returning a reference to the array. ...
Array.prototype.sort() - JavaScript
The sort() method sorts the elements of an array in place and returns the sorted array. The default sort order is ascending, built upon converting the elements into strings, then comparing their sequences of UTF-16 code units values. The time and space complexity of the sort cannot be guaranteed as it depends on the implementation. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax arr.sort([compareFunction]) Parameters compareFunction Optional Specifies a function that defines the sort order. If omitted, the array elements are converted to strings, then sorted according to each character's Unicode code...
Array.prototype.splice() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax let arrDeletedItems = array.splice(start[, deleteCount[, item1[, item2[, ...]]]]) Parameters start The index at which to start changing the array. If greater than the length of the array, start will be set to the length of the array. ...
Array.prototype.toLocaleString() - JavaScript
ing with a BCP 47 language tag, or an array of such strings. For the general form and interpretation of the locales argument, see the Intl page. options Optional An object with configuration properties, for numbers see Number.prototype.toLocaleString(), and for dates see Date.prototype.toLocaleString(). Return value A string representing the elements of the array. Polyfill // https://tc39.github.io/ecma402/#sup-array.prototype.tolocalestring if (!Array.prototype.toLocaleString) { Object.defineProperty(Array.prototype, 'toLocaleString', { value: function(locales, options) { // 1. Let O be ? ToObject(this value). if (this == null) { throw new TypeError('"this" is null or not defined'); } var a = Object(this); // 2. Let len be ? ToLength(? Ge...
ArrayBuffer() constructor - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax new ArrayBuffer(length) Parameters length The size, in bytes, of the array buffer to create. Return value A new ArrayBuffer object of the specified size. Its contents are initialized to 0. Exceptions A RangeError is thrown if the length is larger than Number.MAX_SAFE_INTEGER (>= 2 ** 53) or negative. ...
ArrayBuffer.prototype.byteLength - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Description The byteLength property is an accessor property whose set accessor function is undefined, meaning that you can only read this property. The value is established when the array is constructed and cannot be changed. This property returns 0 if this ArrayBuffer has been detached. ...
ArrayBuffer.isView() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax ArrayBuffer.isView(value) Parameters value The value to be checked. Return value true if the given argument is one of the ArrayBuffer views; otherwise, false. ...
ArrayBuffer.prototype.slice() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. 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. ...
Atomics.compareExchange() - JavaScript
s.compareExchange() method exchanges a given replacement value at a given position in the array, if a given expected value equals the old value. It returns the old value at that position whether it was equal to the expected value or not. This atomic operation guarantees that no other write happens until the modified value is written back. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Atomics.compareExchange(typedArray, index, expectedValue, replacementValue) Parameters typedArray An integer typed array. One of Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, BigInt64Array, or...
Atomics.exchange() - JavaScript
The static Atomics.exchange() method stores a given value at a given position in the array and returns the old value at that position. This atomic operation guarantees that no other write happens between the read of the old value and the write of the new value. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Atomics.exchange(typedArray, index, value) Parameters typedArray An integer typed array. One of Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, BigInt64Array, or BigUint64Array. index The position in the typedArray to exchange a value. value The number to exchange. R...
Atomics.load() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Atomics.load(typedArray, index) Parameters typedArray An integer typed array. One of Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, BigInt64Array, or BigUint64Array. index The position in the typedArray to load from. Return value The value at the given position (typedArray[index]). ...
Atomics.store() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Atomics.store(typedArray, index, value) Parameters typedArray An integer typed array. One of Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, BigInt64Array, or BigUint64Array. index The position in the typedArray to store a value in. ...
BigInt.asIntN() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax BigInt.asIntN(width, bigint); Parameters width The amount of bits available for the integer size. bigint The integer to clamp to fit into the supplied bits. Returns The value of bigint modulo 2width as a signed integer. ...
BigInt.asUintN() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax BigInt.asUintN(width, bigint); Parameters width The amount of bits available for the integer size. bigint The integer to clamp to fit into the supplied bits. Returns The value of bigint modulo 2width as an unsigned integer. ...
BigInt.prototype.toString() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax bigIntObj.toString([radix]) Parameters radixOptional Optional. An integer in the range 2 through 36 specifying the base to use for representing numeric values. Return value A string representing the specified BigInt object. ...
BigInt.prototype.valueOf() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax bigIntObj.valueOf() Return value A BigInt representing the primitive value of the specified BigInt object. ...
BigInt - JavaScript
n // ? 18014398509481982n const subtr = multi - 10n // ? 18014398509481972n const mod = multi % 10n // ? 2n const bigN = 2n ** 54n // ? 18014398509481984n bigN * -1n // ? -18014398509481984n The / operator also works as expected with whole numbers. However, since these are BigInts and not BigDecimals, this operation will round towards 0 (which is to say, it will not return any fractional digits). An operation with a fractional result will be truncated when used with a BigInt. const expected = 4n / 2n // ? 2n const rounded = 5n / 2n // ? 2n, not 2.5n Comparisons A BigInt is not strictly equal to a Number, but it is loosely so: 0n === 0 // ? false 0n == 0 // ? true A Number and a BigInt may be compared as usual: 1n < 2 // ? true 2n > 1 // ? true 2 > 2 // ? false 2n > 2 //...
Boolean() constructor - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax new Boolean([value]) Parameters value Optional The initial value of the Boolean object. ...
Boolean.prototype.toString() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax bool.toString() Return value A string representing the specified Boolean object. Description The Boolean object overrides the toString method of the Object object; it does not inherit Object.prototype.toString(). For Boolean objects, the toString method returns a string representation of the object. ...
Boolean.prototype.valueOf() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax bool.valueOf() Return value The primitive value of the given Boolean object Description The valueOf() method of Boolean returns the primitive value of a Boolean object or literal Boolean as a Boolean data type. This method is usually called internally by JavaScript and not explicitly in code. ...
DataView() constructor - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax new DataView(buffer [, byteOffset [, byteLength]]) Parameters buffer An existing ArrayBuffer or SharedArrayBuffer to use as the storage backing the new DataView object. byteOffset Optional The offset, in bytes, to the first byte in the above buffer for the new view to reference. If unspecified, the buffer view starts with the first byte. ...
DataView.prototype.buffer - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Description The buffer property is an accessor property whose set accessor function is undefined, meaning that you can only read this property. The value is established when the DataView is constructed and cannot be changed. ...
DataView.prototype.byteLength - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Description The byteLength property is an accessor property whose set accessor function is undefined, meaning that you can only read this property. The value is established when an DataView is constructed and cannot be changed. ...
DataView.prototype.byteOffset - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Description The byteOffset property is an accessor property whose set accessor function is undefined, meaning that you can only read this property. The value is established when an DataView is constructed and cannot be changed. ...
DataView.prototype.getBigInt64() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dataview.getBigInt64(byteOffset [, littleEndian]) Parameters byteOffset The offset, in bytes, from the start of the view to read the data from. littleEndian Optional Indicates whether the 64-bit int is stored in little- or big-endian format. ...
DataView.prototype.getBigUint64() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dataview.getBigUint64(byteOffset [, littleEndian]) Parameters byteOffset The offset, in bytes, from the start of the view to read the data from. ...
DataView.prototype.getFloat32() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dataview.getFloat32(byteOffset [, littleEndian]) Parameters byteOffset The offset, in byte, from the start of the view where to read the data. littleEndian Optional Indicates whether the 32-bit float is stored in little- or big-endian format. ...
DataView.prototype.getFloat64() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dataview.getFloat64(byteOffset [, littleEndian]) Parameters byteOffset The offset, in byte, from the start of the view where to read the data. littleEndian Optional Indicates whether the 64-bit float is stored in little- or big-endian format. ...
DataView.prototype.getInt16() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dataview.getInt16(byteOffset [, littleEndian]) Parameters byteOffset The offset, in byte, from the start of the view where to read the data. littleEndian Optional Indicates whether the 16-bit int is stored in little- or big-endian format. ...
DataView.prototype.getInt32() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dataview.getInt32(byteOffset [, littleEndian]) Parameters byteOffset The offset, in bytes, from the start of the view where to read the data. littleEndian Optional Indicates whether the 32-bit int is stored in little- or big-endian format. ...
DataView.prototype.getInt8() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dataview.getInt8(byteOffset) Parameters byteOffset The offset, in byte, from the start of the view where to read the data. Return value A signed 8-bit integer number. ...
DataView.prototype.getUint16() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dataview.getUint16(byteOffset [, littleEndian]) Parameters byteOffset The offset, in byte, from the start of the view where to read the data. ...
DataView.prototype.getUint32() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dataview.getUint32(byteOffset [, littleEndian]) Parameters byteOffset The offset, in byte, from the start of the view where to read the data. ...
DataView.prototype.getUint8() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dataview.getUint8(byteOffset) Parameters byteOffset The offset, in byte, from the start of the view where to read the data. Return value An unsigned 8-bit integer number. ...
DataView.prototype.setBigInt64() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dataview.setBigInt64(byteOffset, value [, littleEndian]) Parameters byteOffset The offset, in bytes, from the start of the view to store the data from. value The value to set as a BigInt. ...
DataView.prototype.setBigUint64() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dataview.setBigUint64(byteOffset, value [, littleEndian]) Parameters byteOffset The offset, in bytes, from the start of the view to store the data from. value The value to set as a BigInt. ...
DataView.prototype.setFloat32() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dataview.setFloat32(byteOffset, value [, littleEndian]) Parameters byteOffset The offset, in byte, from the start of the view where to store the data. value The value to set. ...
DataView.prototype.setFloat64() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dataview.setFloat64(byteOffset, value [, littleEndian]) Parameters byteOffset The offset, in byte, from the start of the view where to store the data. value The value to set. ...
DataView.prototype.setInt16() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dataview.setInt16(byteOffset, value [, littleEndian]) Parameters byteOffset The offset, in byte, from the start of the view where to store the data. value The value to set. ...
DataView.prototype.setInt32() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dataview.setInt32(byteOffset, value [, littleEndian]) Parameters byteOffset The offset, in byte, from the start of the view where to store the data. value The value to set. ...
DataView.prototype.setInt8() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dataview.setInt8(byteOffset, value) Parameters byteOffset The offset, in byte, from the start of the view where to store the data. value The value to set. Return value undefined. ...
DataView.prototype.setUint16() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dataview.setUint16(byteOffset, value [, littleEndian]) Parameters byteOffset The offset, in byte, from the start of the view where to store the data. value The value to set. ...
DataView.prototype.setUint32() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dataview.setUint32(byteOffset, value [, littleEndian]) Parameters byteOffset The offset, in byte, from the start of the view where to store the data. value The value to set. ...
DataView.prototype.setUint8() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dataview.setUint8(byteOffset, value) Parameters byteOffset The offset, in byte, from the start of the view where to store the data. value The value to set. Return value undefined. ...
Date.prototype.getDate() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dateObj.getDate() Return value An integer number, between 1 and 31, representing the day of the month for the given date according to local time. Examples Using getDate() The second statement below assigns the value 25 to the variable day, based on the value of the Date object Xmas95. ...
Date.prototype.getHours() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dateObj.getHours() Return value An integer number, between 0 and 23, representing the hour for the given date according to local time. Examples Using getHours() The second statement below assigns the value 23 to the variable hours, based on the value of the Date object Xmas95. ...
Date.prototype.getMilliseconds() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dateObj.getMilliseconds() Return value A number, between 0 and 999, representing the milliseconds for the given date according to local time. ...
Date.prototype.getSeconds() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dateObj.getSeconds() Return value An integer number, between 0 and 59, representing the seconds in the given date according to local time. Examples Using getSeconds() The second statement below assigns the value 30 to the variable seconds, based on the value of the Date object Xmas95. ...
Date.prototype.getTime() - JavaScript
eas Unix Time is in seconds. getTime() always uses UTC for time representation. For example, a client browser in one timezone, getTime() will be the same as a client browser in any other timezone. You can use this method to help assign a date and time to another Date object. This method is functionally equivalent to the valueOf() method. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dateObj.getTime() Return value A number representing the milliseconds elapsed between 1 January 1970 00:00:00 UTC and the given date. Reduced time precision To offer protection against timing attacks and fingerprinting, ...
Date.prototype.getTimezoneOffset() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dateObj.getTimezoneOffset() Return value A number representing the time-zone offset, in minutes, from the date based on current host system settings to UTC. Description The time-zone offset is the difference, in minutes, from local time to UTC. ...
Date.prototype.getUTCDay() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dateObj.getUTCDay() Return value An integer number corresponding to the day of the week for the given date, according to universal time: 0 for Sunday, 1 for Monday, 2 for Tuesday, and so on. ...
Date.prototype.getUTCHours() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dateObj.getUTCHours() Return value An integer number, between 0 and 23, representing the hours in the given date according to universal time. Examples Using getUTCHours() The following example assigns the hours portion of the current time to the variable hours. ...
Date.prototype.getYear() - JavaScript
Year() returns 76. For years less than 1900, the value returned by getYear() is less than 0. For example, if the year is 1800, getYear() returns -100. To take into account years before and after 2000, you should use getFullYear() instead of getYear() so that the year is specified in full. Backward compatibility Behavior in JavaScript 1.2 and earlier The getYear() method returns either a 2-digit or 4-digit year: For years between and including 1900 and 1999, the value returned by getYear() is the year minus 1900. For example, if the year is 1976, the value returned is 76. For years less than 1900 or greater than 1999, the value returned by getYear() is the four-digit year. For example, if the year is 1856, the value returned is 1856. If the year is 2026, the value returned is 2026. ...
Date.parse() - JavaScript
l date values (e.g. 2015-02-31). It is not recommended to use Date.parse as until ES5, parsing of strings was entirely implementation dependent. There are still many differences in how different hosts parse date strings, therefore date strings should be manually parsed (a library can help if many different formats are to be accommodated). The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Direct call: Date.parse(dateString) Implicit call: new Date(dateString) Parameters dateString A string representing a simplification of the ISO 8601 calendar date extended format. (Other formats may be used, but re...
Date.prototype.setDate() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dateObj.setDate(dayValue) Parameters dayValue An integer representing the day of the month. Return value The number of milliseconds between 1 January 1970 00:00:00 UTC and the given date (the Date object is also changed in place). ...
Date.prototype.setFullYear() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dateObj.setFullYear(yearValue[, monthValue[, dateValue]]) Parameters yearValue An integer specifying the numeric value of the year, for example, 1995. monthValue Optional. An integer between 0 and 11 representing the months January through December. dateValue Optional. ...
Date.prototype.setMilliseconds() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dateObj.setMilliseconds(millisecondsValue) Parameters millisecondsValue A number between 0 and 999, representing the milliseconds. Return value The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. ...
Date.prototype.setMinutes() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dateObj.setMinutes(minutesValue[, secondsValue[, msValue]]) Versions prior to JavaScript 1.3 dateObj.setMinutes(minutesValue) Parameters minutesValue An integer between 0 and 59, representing the minutes. secondsValue Optional. An integer between 0 and 59, representing the seconds. ...
Date.prototype.setSeconds() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dateObj.setSeconds(secondsValue[, msValue]) Versions prior to JavaScript 1.3 dateObj.setSeconds(secondsValue) Parameters secondsValue An integer between 0 and 59, representing the seconds. msValue Optional. A number between 0 and 999, representing the milliseconds. ...
Date.prototype.setTime() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dateObj.setTime(timeValue) Parameters timeValue An integer representing the number of milliseconds since 1 January 1970, 00:00:00 UTC. ...
Date.prototype.setUTCDate() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dateObj.setUTCDate(dayValue) Parameters dayValue An integer from 1 to 31, representing the day of the month. Return value The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. ...
Date.prototype.setUTCFullYear() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dateObj.setUTCFullYear(yearValue[, monthValue[, dayValue]]) Parameters yearValue An integer specifying the numeric value of the year, for example, 1995. monthValue Optional. An integer between 0 and 11 representing the months January through December. dayValue Optional. ...
Date.prototype.setUTCMilliseconds() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dateObj.setUTCMilliseconds(millisecondsValue) Parameters millisecondsValue A number between 0 and 999, representing the milliseconds. Return value The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. ...
Date.prototype.setUTCMinutes() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dateObj.setUTCMinutes(minutesValue[, secondsValue[, msValue]]) Parameters minutesValue An integer between 0 and 59, representing the minutes. secondsValue Optional. An integer between 0 and 59, representing the seconds. If you specify the secondsValue parameter, you must also specify the minutesValue. ...
Date.prototype.setUTCMonth() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dateObj.setUTCMonth(monthValue[, dayValue]) Parameters monthValue An integer between 0 and 11, representing the months January through December. dayValue Optional. An integer from 1 to 31, representing the day of the month. ...
Date.prototype.setUTCSeconds() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dateObj.setUTCSeconds(secondsValue[, msValue]) Parameters secondsValue An integer between 0 and 59, representing the seconds. msValue Optional. A number between 0 and 999, representing the milliseconds. Return value The number of milliseconds between 1 January 1970 00:00:00 UTC and the updated date. ...
Date.prototype.toDateString() - JavaScript
The toDateString() method returns the date portion of a Date object in English in the following format separated by spaces: First three letters of the week day name First three letters of the month name Two digit day of the month, padded on the left a zero if necessary Four digit year (at least), padded on the left with zeros if necessary E.g. "Thu Jan 01 1970". The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dateObj.toDateString() Return value A string representing the date portion of the given Date object in human readable form in English. Description Date instances refer to a specific point i...
Date.prototype.toISOString() - JavaScript
The toISOString() method returns a string in simplified extended ISO format (ISO 8601), which is always 24 or 27 characters long (YYYY-MM-DDTHH:mm:ss.sssZ or +-YYYYYY-MM-DDTHH:mm:ss.sssZ, respectively). The timezone is always zero UTC offset, as denoted by the suffix "Z". The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dateObj.toISOString() Return value A string representing the given date in the ISO 8601 format according to universal time. Polyfill This method was standardized in ECMA-262 5th edition. Engines which have not been updated to support this method can work around the absence of this method...
Date.prototype.toJSON() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dateObj.toJSON() Return value A string representation of the given date. Description Date instances refer to a specific point in time. Calling toJSON() returns a string (using toISOString()) representing the Date object's value. This method is generally intended to, by default, usefully serialize Date objects during JSON serialization. ...
Date.prototype.toTimeString() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax dateObj.toTimeString() Return value A string representing the time portion of the given date in human readable form in American English. Description Date instances refer to a specific point in time. ...
Function() constructor - JavaScript
The Function constructor creates a new Function object. Calling the constructor directly can create functions dynamically, but suffers from security and similar (but far less significant) performance issues to eval. However, unlike eval, the Function constructor creates functions which execute in the global scope only. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax new Function([arg1 [, arg2 [, ...argN]] ,] functionBody) Parameters arg1, arg2, ... argN Names to be used by the function as formal argument names. Each must be a string that corresponds to a valid JavaScript identifier, or a list of such s...
Function.prototype.call() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax func.call([thisArg[, arg1, arg2, ...argN]]) Parameters thisArg Optional The value to use as this when calling func. Caution: In certain cases, thisArg may not be the actual value seen by the method. ...
Function.length - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Property attributes of Function.length Writable no Enumerable no Configurable yes Description length is a property of a function object, and indicates how many arguments the function expects, i.e. the number of formal parameters. ...
Function.prototype.toString() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax function.toString() Return value A string representing the source code of the function. Description The Function object overrides the toString method inherited from Object; it does not inherit Object.prototype.toString. ...
Intl.Collator() constructor - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax new Intl.Collator([locales[, options]]) Parameters locales Optional. A string with a BCP 47 language tag, or an array of such strings. For the general form and interpretation of the locales argument, see the Intl page. ...
Intl.Collator - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Constructor Intl.Collator() Creates a new Collator object. Static methods Intl.Collator.supportedLocalesOf() Returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale. ...
Intl.DisplayNames() constructor - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax new Intl.DisplayNames([locales[, options]]) Parameters locales Optional A string with a BCP 47 language tag, or an array of such strings. For the general form and interpretation of the locales argument, see the Intl page. ...
Intl.ListFormat() constructor - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax new Intl.ListFormat([locales[, options]]) Parameters locales Optional. A string with a BCP 47 language tag, or an array of such strings. For the general form and interpretation of the locales argument, see the Intl page. options Optional. ...
Intl.ListFormat - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Constructor Intl.ListFormat() Creates a new ListFormat object. Static methods Intl.ListFormat.supportedLocalesOf() Returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale. ...
Intl.Locale.prototype.maximize() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax locale.maximize() Return value A Locale instance whose baseName property returns the result of the Add Likely Subtags algorithm executed against locale.baseName. ...
Intl.Locale.prototype.minimize() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax locale.minimize() Return value A Locale instance whose baseName property returns the result of the Remove Likely Subtags algorithm executed against locale.baseName. ...
Intl.Locale.prototype.numeric - JavaScript
dification to the collation rules utilized by the locale. numeric is a Boolean value, which means that it can be either true or false. If numeric is set to false, there will be no special handling of numeric values in strings. If numeric is set to true, then the locale will take numeric characters into account when collating strings. This special numeric handling means that sequences of decimal digits will be compared as numbers. For example, the string "A-21" will be considered less than "A-123". Examples Setting the numeric value via the locale string In the Unicode locale string spec, the values that numeric represents correspond to the key kn. kn is considered a locale string "extension subtag". These subtags add additional data about the locale, and are added to locale identifiers by ...
Intl.Locale.prototype.toString() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax locale.toString() Return value The locale's Unicode locale identifier string. Description The Locale object is a JavaScript representation of a concept Unicode locale identifier. Information about a particular locale (language, script, calendar type, etc.) can be encoded in a locale identifier string. ...
Intl.RelativeTimeFormat - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Constructor Intl.RelativeTimeFormat.RelativeTimeFormat() Creates a new Intl.RelativeTimeFormat object. Static methods Intl.RelativeTimeFormat.supportedLocalesOf() Returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale. ...
Map.prototype.delete() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax myMap.delete(key); Parameters key The key of the element to remove from the Map object. Return value true if an element in the Map object existed and has been removed, or false if the element does not exist. Examples Using delete() var myMap = new Map(); myMap.set('bar', 'foo'); myMap.delete('bar'); // Returns true. Successfully removed. ...
Map.prototype.forEach() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax myMap.forEach(callback([value][,key][,map])[, thisArg]) Parameters callback Function to execute for each entry of myMap. It takes the following arguments: value Optional Value of each iteration. key Optional Key of each iteration. ...
Map.prototype.get() - JavaScript
The get() method returns a specified element from a Map object. If the value that is associated to the provided key is an object, then you will get a reference to that object and any change made to that object will effectively modify it inside the Map object. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax myMap.get(key) Parameters key The key of the element to return from the Map object. Return value The element associated with the specified key, or undefined if the key can't be found in the Map object. Examples Using get() let myMap = new Map(); myMap.set('bar', 'foo'); myMap.get('bar'); //...
Map.prototype.has() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax myMap.has(key) Parameters key The key of the element to test for presence in the Map object. Return value true if an element with the specified key exists in the Map object; otherwise false. ...
Map.prototype.set() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax myMap.set(key, value) Parameters key The key of the element to add to the Map object. value The value of the element to add to the Map object. Return value The Map object. ...
Map.prototype.size - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Description The value of size is an integer representing how many entries the Map object has. A set accessor function for size is undefined; you can not change this property. ...
Math.acos() - JavaScript
The Math.acos() function returns the arccosine (in radians) of a number, that is ?x?[-1;1],Math.acos(x)=arccos(x)= the unique y?[0;?]such thatcos(y)=x\forall x \in [{-1};1],\;\mathtt{\operatorname{Math.acos}(x)} = \arccos(x) = \text{ the unique } \; y \in [0; \pi] \, \text{such that} \; \cos(y) = x The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Math.acos(x) Parameters x A number representing a cosine, where x is between -1 and 1. Return value The arccosine (angle in radians) of the given number if it's between -1 and 1; otherwise, NaN. Description The Math.acos() method returns a numeric value b...
Math.acosh() - JavaScript
The Math.acosh() function returns the hyperbolic arc-cosine of a number, that is ?x>=1,Math.acosh(x)=arcosh(x)= the unique y>=0such thatcosh(y)=x\forall x \geq 1, \mathtt{\operatorname{Math.acosh}(x)} = \operatorname{arcosh}(x) = \text{ the unique } \; y \geq 0 \; \text{such that} \; \cosh(y) = x The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Math.acosh(x) Parameters x A number. Return value The hyperbolic arc-cosine of the given number. If the number is less than 1, NaN. Description Because acosh() is a static method of Math, you always use it as Math.acosh(), rather than as a method of a Math ...
Math.asinh() - JavaScript
The Math.asinh() function returns the hyperbolic arcsine of a number, that is Math.asinh(x)=arsinh(x)= the unique ysuch thatsinh(y)=x\mathtt{\operatorname{Math.asinh}(x)} = \operatorname{arsinh}(x) = \text{ the unique } \; y \; \text{such that} \; \sinh(y) = x The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Math.asinh(x) Parameters x A number. Return value The hyperbolic arcsine of the given number. Description Because asinh() is a static method of Math, you always use it as Math.asinh(), rather than as a method of a Math object you created (Math is not a constructor). Polyfill Math.asinh can b...
Math.atan() - JavaScript
The Math.atan() function returns the arctangent (in radians) of a number, that is Math.atan(x)=arctan(x)= the unique y?[-?2;?2]such thattan(y)=x\mathtt{\operatorname{Math.atan}(x)} = \arctan(x) = \text{ the unique } \; y \in \left[-\frac{\pi}{2}; \frac{\pi}{2}\right] \, \text{such that} \; \tan(y) = x The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Math.atan(x) Parameters x A number. Return value The arctangent (in radians) of the given number. Description The Math.atan() method returns a numeric value between -?2-\frac{\pi}{2} and ?2\frac{\pi}{2} radians. Because atan() is a static method of Ma...
Math.atanh() - JavaScript
The Math.atanh() function returns the hyperbolic arctangent of a number, that is ?x?(-1,1),Math.atanh(x)=arctanh(x)= the unique ysuch thattanh(y)=x\forall x \in \left( -1, 1 \right), \mathtt{\operatorname{Math.atanh}(x)} = \operatorname{arctanh}(x) = \text{ the unique } \; y \; \text{such that} \; \tanh(y) = x The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Math.atanh(x) Parameters x A number. Return value The hyperbolic arctangent of the given number. Description Because atanh() is a static method of Math, you always use it as Math.atanh(), rather than as a method of a Math object you created (M...
Math.clz32() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Math.clz32(x) Parameters x A number. Return value The number of leading zero bits in the 32-bit binary representation of the given number. Description "clz32" is short for CountLeadingZeroes32. ...
Math.expm1() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Math.expm1(x) Parameters x A number. Return value A number representing ex - 1, where e is Euler's number and x is the argument. ...
Math.floor() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Math.floor(x) Parameters x A number. Return value A number representing the largest integer less than or equal to the specified number. Description Because floor() is a static method of Math, you always use it as Math.floor(), rather than as a method of a Math object you created (Math is not a constructor). ...
Math.hypot() - JavaScript
The Math.hypot() function returns the square root of the sum of squares of its arguments, that is: Math.hypot(v1,v2,...,vn)=?i=1nvi2=v12+v22+...+vn2\mathtt{\operatorname{Math.hypot}(v_1, v_2, \dots, v_n)} = \sqrt{\sum_{i=1}^n v_i^2} = \sqrt{v_1^2 + v_2^2 + \dots + v_n^2} The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Math.hypot([value1[, value2[, ...]]]) Parameters value1, value2, ... Numbers. Return value The square root of the sum of squares of the given arguments. If at least one of the arguments cannot be converted to a number, NaN is returned. Description Calculating the hypotenuse of a rig...
Math.imul() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax var product = Math.imul(a, b); Parameters a First number. b Second number. Return value The result of the C-like 32-bit multiplication of the given arguments. Description Math.imul() allows for 32-bit integer multiplication with C-like semantics. ...
Math.log() - JavaScript
The Math.log() function returns the natural logarithm (base e) of a number, that is ?x>0,Math.log(x)=ln(x)=the uniqueysuch thatey=x\forall x > 0, \mathtt{\operatorname{Math.log}(x)} = \ln(x) = \text{the unique} \; y \; \text{such that} \; e^y = x The JavaScript Math.log() function is equivalent to ln(x) in mathematics. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Math.log(x) Parameters x A number. Return value The natural logarithm (base e) of the given number. If the number is negative, NaN is returned. Description If the value of x is 0, the return value is always -Infinity. If the value o...
Math.max() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Math.max([value1[, value2[, ...]]]) Parameters value1, value2, ... Numbers. Return value The largest of the given numbers. If at least one of the arguments cannot be converted to a number, NaN is returned. ...
Math.min() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Math.min([value1[, value2[, ...]]]) Parameters value1, value2, ... Zero or more numbers among which the lowest value will be selected and returned. Return value The smallest of the given numbers. ...
Math.pow() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Math.pow(base, exponent) Parameters base The base number. exponent The exponent used to raise the base. Return value A number representing the given base taken to the power of the given exponent. ...
Math.round() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Math.round(x) Parameters x A number. Return value The value of the given number rounded to the nearest integer. Description If the fractional portion of the argument is greater than 0.5, the argument is rounded to the integer with the next higher absolute value. ...
Math.sign() - JavaScript
The Math.sign() function returns either a positive or negative +/- 1, indicating the sign of a number passed into the argument. If the number passed into Math.sign() is 0, it will return a +/- 0. Note that if the number is positive, an explicit (+) will not be returned. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Math.sign(x) Parameters x A number. If this argument is not a number, it is implicitly converted to one. Return value A number representing the sign of the given argument: If the argument is positive, returns 1. If the argument is negative, returns -1. If the argument is positive z...
Math.sin() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Math.sin(x) Parameters x A number (given in radians). Return value The sine of the given number. Description The Math.sin() method returns a numeric value between -1 and 1, which represents the sine of the angle given in radians. Because sin() is a static method of Math, you always use it as Math.sin(), rather than as a method of a Math object you created (Math is not a constructor). ...
Math.tan() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Math.tan(x) Parameters x A number representing an angle in radians. Return value The tangent of the given number. Description The Math.tan() method returns a numeric value that represents the tangent of the angle. Because tan() is a static method of Math, you always use it as Math.tan(), rather than as a method of a Math object you created (Math is not a constructor). ...
Math.trunc() - JavaScript
The Math.trunc() function returns the integer part of a number by removing any fractional digits. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Math.trunc(x) Parameters x A number. Return value The integer part of the given number. Description Unlike the other three Math methods: Math.floor(), Math.ceil() and Math.round(), the way Math.trunc() works is very simple. It truncates (cuts off) the dot and the digits to the right of it, no matter whether the argument is a positive or negative number. The argument passed to this method will be converted to number type implicitly. Because trunc() is ...
Math - JavaScript
th.sign(x) Returns the sign of the x, indicating whether x is positive, negative, or zero. Math.sin(x) Returns the sine of x. Math.sinh(x) Returns the hyperbolic sine of x. Math.sqrt(x) Returns the positive square root of x. Math.tan(x) Returns the tangent of x. Math.tanh(x) Returns the hyperbolic tangent of x. Math.trunc(x) Returns the integer portion of x, removing any fractional digits. Examples Converting between degrees and radians The trigonometric functions sin(), cos(), tan(), asin(), acos(), atan(), and atan2() expect (and return) angles in radians. Since humans tend to think in degrees, and some functions (such as CSS transforms) can accept degrees, it is a good idea to keep functions handy that convert between the two: function degToRad(degrees) { return degree...
Number.MAX_VALUE - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Property attributes of Number.MAX_VALUE Writable no Enumerable no Configurable no Description The MAX_VALUE property has a value of approximately 1.79E+308, or 21024. Values larger than MAX_VALUE are represented as Infinity. ...
Number.MIN_VALUE - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Property attributes of Number.MIN_VALUE Writable no Enumerable no Configurable no Description The MIN_VALUE property is the number closest to 0, not the most negative number, that JavaScript can represent. ...
Number.NEGATIVE_INFINITY - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Property attributes of Number.NEGATIVE_INFINITY Writable no Enumerable no Configurable no Description The value of Number.NEGATIVE_INFINITY is the same as the negative value of the global object's Infinity property. ...
Number.POSITIVE_INFINITY - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Property attributes of Number.POSITIVE_INFINITY Writable no Enumerable no Configurable no Description The value of Number.POSITIVE_INFINITY is the same as the value of the global object's Infinity property. ...
Number.isFinite() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Number.isFinite(value) Parameters value The value to be tested for finiteness. Return value A Boolean indicating whether or not the given value is a finite number. Description In comparison to the global isFinite() function, this method doesn't forcibly convert the parameter to a number. ...
Number.isInteger() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Number.isInteger(value) Parameters value The value to be tested for being an integer. Return value A Boolean indicating whether or not the given value is an integer. Description If the target value is an integer, return true, otherwise return false. If the value is NaN or Infinity, return false. ...
Number.isNaN() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Number.isNaN(value) Parameters value The value to be tested for NaN. Return value true if the given value is NaN and its type is Number; otherwise, false. ...
Number.isSafeInteger() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. A safe integer is an integer that can be exactly represented as an IEEE-754 double precision number, and whose IEEE-754 representation cannot be the result of rounding any other integer to fit the IEEE-754 representation. ...
Number.parseFloat() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Number.parseFloat(string) Parameters string The value to parse. If this argument is not a string, then it is converted to one using the ToString abstract operation. ...
Number.parseInt() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Number.parseInt(string,[ radix]) Parameters string The value to parse. If this argument is not a string, then it is converted to one using the ToString abstract operation. Leading whitespace in this argument is ignored. ...
Number.prototype.toString() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax numObj.toString([radix]) Parameters radix Optional. An integer in the range 2 through 36 specifying the base to use for representing numeric values. Return value A string representing the specified Number object. Exceptions RangeError If toString() is given a radix less than 2 or greater than 36, a RangeError is thrown. ...
Number.prototype.valueOf() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax numObj.valueOf() Return value A number representing the primitive value of the specified Number object. Description This method is usually called internally by JavaScript and not explicitly in web code. ...
Number - JavaScript
etermine whether the passed value is an integer. Number.isSafeInteger() Determine whether the passed value is a safe integer (number between -(253 - 1) and 253 - 1). Number.parseFloat(string) This is the same as the global parseFloat() function. Number.parseInt(string, [radix]) This is the same as the global parseInt() function. Instance methods Number.prototype.toExponential(fractionDigits) Returns a string representing the number in exponential notation. Number.prototype.toFixed(digits) Returns a string representing the number in fixed-point notation. Number.prototype.toLocaleString([locales [, options]]) Returns a string with a language sensitive representation of this number. Overrides the Object.prototype.toLocaleString() method. Number.prototype.toPrecision(precision) ...
Object.assign() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Object.assign(target, ...sources) Parameters target The target object -- what to apply the sources' properties to, which is returned after it is modified. ...
Object.create() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Object.create(proto, [propertiesObject]) Parameters proto The object which should be the prototype of the newly-created object. ...
Object.defineProperties() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Object.defineProperties(obj, props) Parameters obj The object on which to define or modify properties. props An object whose keys represent the names of properties to be defined or modified and whose values are objects describing those properties. ...
Object.defineProperty() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Object.defineProperty(obj, prop, descriptor) Parameters obj The object on which to define the property. prop The name or Symbol of the property to be defined or modified. ...
Object.entries() - JavaScript
tant difference is that a for...in loop enumerates properties in the prototype chain as well). The order of the array returned by Object.entries() does not depend on how an object is defined. If there is a need for certain ordering, then the array should be sorted first, like Object.entries(obj).sort((a, b) => b[0].localeCompare(a[0]));. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Object.entries(obj) Parameters obj The object whose own enumerable string-keyed property [key, value] pairs are to be returned. Return value An array of the given object's own enumerable string-keyed property [key, va...
Object.freeze() - JavaScript
d to it, existing properties from being removed, prevents changing the enumerability, configurability, or writability of existing properties, and prevents the values of existing properties from being changed. In addition, freezing an object also prevents its prototype from being changed. freeze() returns the same object that was passed in. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Object.freeze(obj) Parameters obj The object to freeze. Return value The object that was passed to the function. Description Nothing can be added to or removed from the properties set of a frozen object. Any attempt...
Object.fromEntries() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Object.fromEntries(iterable); Parameters iterable An iterable such as Array or Map or other objects implementing the iterable protocol. Return value A new object whose properties are given by the entries of the iterable. ...
Object.getOwnPropertyDescriptor() - JavaScript
The Object.getOwnPropertyDescriptor() method returns an object describing the configuration of a specific property on a given object (that is, one directly present on an object and not in the object's prototype chain). The object returned is mutable but mutating it has no effect on the original property's configuration. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Object.getOwnPropertyDescriptor(obj, prop) Parameters obj The object in which to look for the property. prop The name or Symbol of the property whose description is to be retrieved. Return value A property descriptor of the given pro...
Object.getOwnPropertySymbols() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Object.getOwnPropertySymbols(obj) Parameters obj The object whose symbol properties are to be returned. Return value An array of all symbol properties found directly upon the given object. ...
Object.getPrototypeOf() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Object.getPrototypeOf(obj) Parameters obj The object whose prototype is to be returned. Return value The prototype of the given object. If there are no inherited properties, null is returned. ...
Object.isExtensible() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Object.isExtensible(obj) Parameters obj The object which should be checked. Return value A Boolean indicating whether or not the given object is extensible. ...
Object.isFrozen() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Object.isFrozen(obj) Parameters obj The object which should be checked. Return value A Boolean indicating whether or not the given object is frozen. ...
Object.prototype.isPrototypeOf() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. isPrototypeOf() differs from the instanceof operator. In the expression "object instanceof AFunction", the object prototype chain is checked against AFunction.prototype, not against AFunction itself. Syntax prototypeObj.isPrototypeOf(object) Parameters object The object whose prototype chain will be searched. ...
Object.isSealed() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Object.isSealed(obj) Parameters obj The object which should be checked. Return value A Boolean indicating whether or not the given object is sealed. Description Returns true if the object is sealed, otherwise false. An object is sealed if it is not extensible and if all its properties are non-configurable and therefore not removable (but not necessarily non-writable). ...
Object.keys() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Object.keys(obj) Parameters obj The object of which the enumerable's own properties are to be returned. Return value An array of strings that represent all the enumerable properties of the given object. ...
Object.preventExtensions() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Object.preventExtensions(obj) Parameters obj The object which should be made non-extensible. Return value The object being made non-extensible. ...
Object.prototype.propertyIsEnumerable() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax obj.propertyIsEnumerable(prop) Parameters prop The name of the property to test. Return value A Boolean indicating whether the specified property is enumerable and is the object's own property. ...
Object.prototype.toString() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax obj.toString() Return value A string representing the object. Description Every object has a toString() method that is automatically called when the object is to be represented as a text value or when an object is referred to in a manner in which a string is expected. By default, the toString() method is inherited by every object descended from Object. ...
Object.prototype.valueOf() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax object.valueOf() Return value The primitive value of the specified object. A (unary) plus sign can sometimes be used as a shorthand for valueOf, e.g. in +new Number()). Also see Using unary plus. Description JavaScript calls the valueOf method to convert an object to a primitive value. ...
Promise() constructor - JavaScript
If you'd like to contribute to the interactive demo project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax new Promise(executor) Parameters executor A function to be executed by the constructor, during the process of constructing the promiseObj. The executor is custom code that ties an outcome to a promise. You, the programmer, write the executor. ...
Promise.all() - JavaScript
solves to an array of the results of the input promises. This returned promise will resolve when all of the input's promises have resolved, or if the input iterable contains no promises. It rejects immediately upon any of the input promises rejecting or non-promises throwing an error, and will reject with this first rejection message / error. The source for this interactive demo is stored in a GitHub repository. If you'd like to contribute to the interactive demo project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Promise.all(iterable); Parameters iterable An iterable object such as an Array. Return value An already resolved Promise if the iterable passed is empty. An asynchronously resolved Promise if the iterable passed contai...
Promise.prototype.catch() - JavaScript
rejected cases only. It behaves the same as calling Promise.prototype.then(undefined, onRejected) (in fact, calling obj.catch(onRejected) internally calls obj.then(undefined, onRejected)). This means that you have to provide an onRejected function even if you want to fall back to an undefined result value - for example obj.catch(() => {}). The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax p.catch(onRejected); p.catch(function(reason) { // rejection }); Parameters onRejected A Function called when the Promise is rejected. This function has one argument: reason The rejection reason. The Promis...
Promise.reject() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Promise.reject(reason); Parameters reason Reason why this Promise rejected. Return value A Promise that is rejected with the given reason. Description The static Promise.reject function returns a Promise that is rejected. ...
Promise - JavaScript
he <code>Promise<code> interface."; } This example is started by clicking the button. (You need a browser that supports Promise. ) By clicking the button several times in a short amount of time, you'll even see the different promises being fulfilled one after another. Loading an image with XHR Another simple example using Promise and XMLHttpRequest to load an image is available at the MDN GitHub js-examples repository. You can also see it in action. Each step is commented and allows you to follow the Promise and XHR architecture closely. Specifications Specification ECMAScript (ECMA-262)The definition of 'Promise' in that specification. ...
handler.apply() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax const p = new Proxy(target, { apply: function(target, thisArg, argumentsList) { } }); Parameters The following parameters are passed to the apply() method. this is bound to the handler. target The target object. thisArg The this argument for the call. argumentsList The list of arguments for the call. Return value The apply() method can return any value. ...
handler.defineProperty() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax const p = new Proxy(target, { defineProperty: function(target, property, descriptor) { } }); Parameters The following parameters are passed to the defineProperty() method. this is bound to the handler. target The target object. property The name or Symbol of the property whose description is to be retrieved. ...
handler.deleteProperty() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax const p = new Proxy(target, { deleteProperty: function(target, property) { } }); Parameters The following parameters are passed to the deleteProperty() method. this is bound to the handler. target The target object. property The name or Symbol of the property to delete. ...
handler.get() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax const p = new Proxy(target, { get: function(target, property, receiver) { } }); Parameters The following parameters are passed to the get() method. this is bound to the handler. target The target object. property The name or Symbol of the property to get. receiver Either the proxy or an object that inherits from the proxy. ...
handler.getOwnPropertyDescriptor() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax const p = new Proxy(target, { getOwnPropertyDescriptor: function(target, prop) { } }); Parameters The following parameters are passed to the getOwnPropertyDescriptor() method. this is bound to the handler. target The target object. prop The name of the property whose description should be retrieved. ...
handler.getPrototypeOf() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax const p = new Proxy(obj, { getPrototypeOf(target) { ... } }); Parameters The following parameter is passed to the getPrototypeOf() method. this is bound to the handler. target The target object. Return value The getPrototypeOf() method must return an object or null. ...
handler.has() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax const p = new Proxy(target, { has: function(target, prop) { } }); Parameters The following parameters are passed to has() method. this is bound to the handler. target The target object. prop The name or Symbol of the property to check for existence. Return value The has() method must return a boolean value. Description The handler.has() method is a trap for the in operator. ...
handler.isExtensible() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax const p = new Proxy(target, { isExtensible: function(target) { } }); Parameters The following parameter is passed to the isExtensible() method. this is bound to the handler. target The target object. Return value The isExtensible() method must return a boolean value. Description The handler.isExtensible() method is a trap for Object.isExtensible(). ...
handler.ownKeys() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax const p = new Proxy(target, { ownKeys: function(target) { } }); Parameters The following parameter is passed to the ownKeys() method. this is bound to the handler. target The target object. Return value The ownKeys() method must return an enumerable object. Description The handler.ownKeys() method is a trap for Reflect.ownKeys(). ...
handler.preventExtensions() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax const p = new Proxy(target, { preventExtensions: function(target) { } }); Parameters The following parameter is passed to the preventExtensions() method. this is bound to the handler. target The target object. Return value The preventExtensions() method must return a boolean value. ...
handler.set() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax const p = new Proxy(target, { set: function(target, property, value, receiver) { } }); Parameters The following parameters are passed to the set() method. this is bound to the handler. target The target object. property The name or Symbol of the property to set. value The new value of the property to set. ...
handler.setPrototypeOf() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax const p = new Proxy(target, { setPrototypeOf: function(target, prototype) { } }); Parameters The following parameters are passed to the setPrototypeOf() method. this is bound to the handler. target The target object. prototype The object's new prototype or null. ...
Reflect.apply() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Reflect.apply(target, thisArgument, argumentsList) Parameters target The target function to call. thisArgument The value of this provided for the call to target. argumentsList An array-like object specifying the arguments with which target should be called. ...
Reflect.defineProperty() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Reflect.defineProperty(target, propertyKey, attributes) Parameters target The target object on which to define the property. propertyKey The name of the property to be defined or modified. attributes The attributes for the property being defined or modified. ...
Reflect.deleteProperty() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Reflect.deleteProperty(target, propertyKey) Parameters target The target object on which to delete the property. propertyKey The name of the property to be deleted. Return value A Boolean indicating whether or not the property was successfully deleted. ...
Reflect.get() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Reflect.get(target, propertyKey[, receiver]) Parameters target The target object on which to get the property. propertyKey The name of the property to get. receiver Optional The value of this provided for the call to target if a getter is encountered. ...
Reflect.has() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Reflect.has(target, propertyKey) Parameters target The target object in which to look for the property. propertyKey The name of the property to check. Return value A Boolean indicating whether or not the target has the property. Exceptions A TypeError, if target is not an Object. ...
Reflect.ownKeys() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Reflect.ownKeys(target) Parameters target The target object from which to get the own keys. Return value An Array of the target object's own property keys. Exceptions A TypeError, if target is not an Object. ...
Reflect.set() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Reflect.set(target, propertyKey, value[, receiver]) Parameters target The target object on which to set the property. propertyKey The name of the property to set. value The value to set. receiver Optional The value of this provided for the call to target if a setter is encountered. ...
Reflect.setPrototypeOf() - JavaScript
The static Reflect.setPrototypeOf() method is the same method as Object.setPrototypeOf(), except for its return type. It sets the prototype (i.e., the internal [[Prototype]] property) of a specified object to another object or to null, and returns true if the operation was successful, or false otherwise. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Reflect.setPrototypeOf(target, prototype) Parameters target The target object of which to set the prototype. prototype The object's new prototype (an object or null). Return value A Boolean indicating whether or not the prototype was successfully se...
RegExp.prototype[@@match]() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax regexp[Symbol.match](str) Parameters str A String that is a target of the match. Return value An Array containing the entire match result and any parentheses-captured matched results, or null if there were no matches. Description This method is called internally in String.prototype.match(). ...
RegExp.prototype[@@matchAll]() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax regexp[Symbol.matchAll](str) Parameters str A String that is a target of the match. Return value An iterator. Description This method is called internally in String.prototype.matchAll(). For example, the following two examples return same result. ...
RegExp.prototype[@@search]() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax regexp[Symbol.search](str) Parameters str A String that is a target of the search. Return value integer If successful, [@@search]() returns the index of the first match of the regular expression inside the string. Otherwise, it returns -1. ...
get RegExp[@@species] - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Description The species accessor property returns the default constructor for RegExp objects. Subclass constructors may over-ride it to change the constructor assignment. ...
RegExp.prototype[@@split]() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax regexp[Symbol.split](str[, limit]) Parameters str The target of the split operation. limit Optional Integer specifying a limit on the number of splits to be found. ...
RegExp.prototype.exec() - JavaScript
osed to getting just the matching strings with String.prototype.match(). A newer function has been proposed to simplify matching multiple parts of a string (with capture groups): String.prototype.matchAll(). If you are executing a match simply to find true or false, use RegExp.prototype.test() method or String.prototype.search() instead. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax regexObj.exec(str) Parameters str The string against which to match the regular expression. Return value If the match succeeds, the exec() method returns an array (with extra properties index and input; see below) and...
RegExp.prototype.flags - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Property attributes of RegExp.prototype.flags Writable no Enumerable no Configurable yes Description Flags in the flags property are sorted alphabetically (from left to right, e.g. "gimsuy"). ...
RegExp.prototype.test() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax regexObj.test(str) Parameters str The string against which to match the regular expression. Returns true if there is a match between the regular expression and the string str. Otherwise, false. ...
RegExp.prototype.toString() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax regexObj.toString(); Return value A string representing the given object. Description The RegExp object overrides the toString() method of the Object object; it does not inherit Object.prototype.toString(). For RegExp objects, the toString() method returns a string representation of the regular expression. ...
RegExp - JavaScript
on or later: re = /\d/y; while (r = re.exec("123 456")) console.log(r, "AND re.lastIndex", re.lastIndex); // [ '1', index: 0, input: '123 456', groups: undefined ] AND re.lastIndex 1 // [ '2', index: 1, input: '123 456', groups: undefined ] AND re.lastIndex 2 // [ '3', index: 2, input: '123 456', groups: undefined ] AND re.lastIndex 3 // ... and no more match. With the global flag g, all 6 digits would be matched, not just 3. Regular expression and Unicode characters \w and \W only matches ASCII based characters; for example, a to z, A to Z, 0 to 9, and _. To match characters from other languages such as Cyrillic or Hebrew, use \uhhhh, where hhhh is the character's Unicode value in hexadecimal. This example demonstrates how one can separate out Unicode characters from a word. let te...
Set() constructor - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax new Set([iterable]) Parameters iterable Optional If an iterable object is passed, all of its elements will be added to the new Set. If you don't specify this parameter, or its value is null, the new Set is empty. ...
Set.prototype.add() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax mySet.add(value); Parameters value The value of the element to add to the Set object. Return value The Set object. ...
Set.prototype.delete() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax mySet.delete(value); Parameters value The value to remove from mySet. Return value Returns true if value was successfully removed from mySet; otherwise false. Examples Using the delete() method const mySet = new Set(); mySet.add('foo'); mySet.delete('bar'); // Returns false. No "bar" element found to be deleted. mySet.delete('foo'); // Returns true. ...
Set.prototype.entries() - JavaScript
method returns a new Iterator object that contains an array of [value, value] for each element in the Set object, in insertion order. For Set objects there is no key like in Map objects. However, to keep the API similar to the Map object, each entry has the same value for its key and value here, so that an array [value, value] is returned. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax mySet.entries() Return value A new Iterator object that contains an array of [value, value] for each element in the given Set, in insertion order. Examples Using entries() var mySet = new Set(); mySet.add('foobar'); mySe...
Set.prototype.forEach() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax mySet.forEach(callback[, thisArg]) Parameters callback Function to execute for each element, taking three arguments: currentValue, currentKey The current element being processed in the Set. As there are no keys in Set, the value is passed for both arguments. ...
Set.prototype.has() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax mySet.has(value); Parameters value The value to test for presence in the Set object. Return value Returns true if an element with the specified value exists in the Set object; otherwise false. ...
Set.prototype.size - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Description The value of size is an integer representing how many entries the Set object has. A set accessor function for size is undefined; you cannot change this property. ...
Set.prototype.values() - JavaScript
The values() method returns a new Iterator object that contains the values for each element in the Set object in insertion order. The keys() method is an alias for this method (for similarity with Map objects); it behaves exactly the same and returns values of Set elements. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax mySet.values(); Return value A new Iterator object containing the values for each element in the given Set, in insertion order. Examples Using values() var mySet = new Set(); mySet.add('foo'); mySet.add('bar'); mySet.add('baz'); var setIter = mySet.values(); console.log(setIter.nex...
SharedArrayBuffer() constructor - JavaScript
018 in response to Spectre. Chrome re-enabled it in v67 on platforms where its site-isolation feature is enabled to protect against Spectre-style vulnerabilities. The SharedArrayBuffer() constructor is used to create a SharedArrayBuffer object representing a generic, fixed-length raw binary data buffer, similar to the ArrayBuffer object. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax new SharedArrayBuffer([length]) Parameters length The size, in bytes, of the array buffer to create. Return value A new SharedArrayBuffer object of the specified size. Its contents are initialized to 0. Examples Al...
SharedArrayBuffer.prototype.byteLength - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Description The byteLength property is an accessor property whose set accessor function is undefined, meaning that you can only read this property. The value is established when the shared array is constructed and cannot be changed. ...
SharedArrayBuffer.prototype.slice() - JavaScript
ototype.slice() method returns a new SharedArrayBuffer whose contents are a copy of this SharedArrayBuffer's bytes from begin, inclusive, up to end, exclusive. If either begin or end is negative, it refers to an index from the end of the array, as opposed to from the beginning. This method has the same algorithm as Array.prototype.slice(). The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. 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. slice(-2) extr...
String.prototype.codePointAt() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax str.codePointAt(pos) Parameters pos Position of an element in str to return the code point value from. Return value A number representing the code point value of the character at the given pos. If there is no element at pos, returns undefined. ...
String.prototype.concat() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax str.concat(str2 [, ...strN]) Parameters str2 [, ...strN] Strings to concatenate to str. Return value A new string containing the combined text of the strings provided. Description The concat() function concatenates the string arguments to the calling string and returns a new string. ...
String.prototype.endsWith() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax str.endsWith(searchString[, length]) Parameters searchString The characters to be searched for at the end of str. length Optional If provided, it is used as the length of str. Defaults to str.length. ...
String.fromCodePoint() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax String.fromCodePoint(num1[, ...[, numN]]) Parameters num1, ..., numN A sequence of code points. Return value A string created by using the specified sequence of code points. Exceptions A RangeError is thrown if an invalid Unicode code point is given (e.g. ...
String.prototype.includes() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax str.includes(searchString[, position]) Parameters searchString A string to be searched for within str. position Optional The position within the string at which to begin searching for searchString. ...
String.prototype.match() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax str.match(regexp) Parameters regexp A regular expression object. If regexp is a non-RegExp object, it is implicitly converted to a RegExp by using new RegExp(regexp). If you don't give any parameter and use the match() method directly, you will get an Array with an empty string: [""]. ...
String.prototype.matchAll() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax str.matchAll(regexp) Parameters regexp A regular expression object. If a non-RegExp object obj is passed, it is implicitly converted to a RegExp by using new RegExp(obj). ...
String.prototype.normalize() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax str.normalize([form]) Parameters form Optional One of "NFC", "NFD", "NFKC", or "NFKD", specifying the Unicode Normalization Form. If omitted or undefined, "NFC" is used. These values have the following meanings: "NFC" Canonical Decomposition, followed by Canonical Composition. "NFD" Canonical Decomposition. ...
String.prototype.replaceAll() - JavaScript
supported by Firefox but not by Chrome. It will become available in Chrome 85. The replaceAll() method returns a new string with all matches of a pattern replaced by a replacement. The pattern can be a string or a RegExp, and the replacement can be a string or a function to be called for each match. The original string is left unchanged. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax const newStr = str.replaceAll(regexp|substr, newSubstr|function) when using a `regexp` you must have to set the global ("g") flag; otherwise, it will throw a TypeError: "replaceAll must be called with a global RegExp". P...
String.prototype.search() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax str.search(regexp) Parameters regexp A regular expression object. If a non-RegExp object regexp is passed, it is implicitly converted to a RegExp with new RegExp(regexp). ...
String.prototype.slice() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax str.slice(beginIndex[, endIndex]) Parameters beginIndex The zero-based index at which to begin extraction. If negative, it is treated as str.length + beginIndex. ...
String.prototype.substr() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax str.substr(start[, length]) Parameters start The index of the first character to include in the returned substring. length Optional. The number of characters to extract. ...
String.prototype.substring() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. 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. ...
String.prototype.toLowerCase() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax str.toLowerCase() Return value A new string representing the calling string converted to lower case. Description The toLowerCase() method returns the value of the string converted to lower case. toLowerCase() does not affect the value of the string str itself. ...
String.prototype.toUpperCase() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax str.toUpperCase() Return value A new string representing the calling string converted to upper case. Exceptions TypeError When called on null or undefined, for example, String.prototype.toUpperCase.call(undefined). ...
String.prototype.trimEnd() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax str.trimEnd(); str.trimRight(); Return value A new string representing the calling string stripped of whitespace from its (right) end. Description The trimEnd() / trimRight() methods return the string stripped of whitespace from its right end. ...
Symbol() constructor - JavaScript
The Symbol() constructor returns a value of type symbol, but is incomplete as a constructor because it does not support the syntax "new Symbol()" and it is not intended to be subclassed. It may be used as the value of an extends clause of a class definition but a super call to it will cause an exception. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Symbol([description]) Parameters description Optional A string. A description of the symbol which can be used for debugging but not to access the symbol itself. Examples Creating symbols To create a new primitive symbol, you write Symbol() with an opt...
Symbol.prototype.description - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Description Symbol objects can be created with an optional description which can be used for debugging but not to access the symbol itself. The Symbol.prototype.description property can be used to read that description. ...
Symbol.iterator - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Description Whenever an object needs to be iterated (such as at the beginning of a for..of loop), its @@iterator method is called with no arguments, and the returned iterator is used to obtain the values to be iterated. ...
Symbol.keyFor() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Symbol.keyFor(sym); Parameters sym Symbol, required. The symbol to find a key for. Return value A string representing the key for the given symbol if one is found on the global registry; otherwise, undefined. ...
Symbol.search - JavaScript
The Symbol.search well-known symbol specifies the method that returns the index within a string that matches the regular expression. This function is called by the String.prototype.search() method. For more information, see RegExp.prototype[@@search]() and String.prototype.search(). The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Property attributes of Symbol.search Writable no Enumerable no Configurable no Examples Custom string search class caseInsensitiveSearch { constructor(value) { this.value = value.toLow...
Symbol.split - JavaScript
The Symbol.split well-known symbol specifies the method that splits a string at the indices that match a regular expression. This function is called by the String.prototype.split() method. For more information, see RegExp.prototype[@@split]() and String.prototype.split(). The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Property attributes of Symbol.split Writable no Enumerable no Configurable no Examples Custom reverse split class ReverseSplit { [Symbol.split](string) { const array = string.split(' '); retu...
Symbol.prototype.toString() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Symbol().toString() Return value A string representing the specified Symbol object. Description The Symbol object overrides the toString method of the Object object; it does not inherit Object.prototype.toString(). For Symbol objects, the toString method returns a string representation of the object. ...
TypedArray.prototype.buffer - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Description The buffer property is an accessor property whose set accessor function is undefined, meaning that you can only read this property. The value is established when the TypedArray is constructed and cannot be changed. TypedArray is one of the TypedArray objects. ...
TypedArray.prototype.byteLength - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Description The byteLength property is an accessor property whose set accessor function is undefined, meaning that you can only read this property. The value is established when a TypedArray is constructed and cannot be changed. ...
TypedArray.prototype.copyWithin() - JavaScript
ay elements within the array to the position starting at target. The copy is taken from the index positions of the second and third arguments start and end. The end argument is optional and defaults to the length of the array. This method has the same algorithm as Array.prototype.copyWithin. TypedArray is one of the typed array types here. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. 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. end Option...
TypedArray.prototype.find() - JavaScript
The find() method returns a value in the typed array, if an element satisfies the provided testing function. Otherwise undefined is returned. TypedArray is one of the typed array types here. See also the findIndex() method, which returns the index of a found element in the typed array instead of its value. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax typedarray.find(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. index The index of the current element bein...
TypedArray.prototype.findIndex() - JavaScript
The findIndex() method returns an index in the typed array, if an element in the typed array satisfies the provided testing function. Otherwise -1 is returned. See also the find() method, which returns the value of a found element in the typed array instead of its index. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax typedarray.findIndex(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. index The index of the current element being processed in the typed array.
TypedArray.prototype.lastIndexOf() - JavaScript
The lastIndexOf() 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 fromIndex. This method has the same algorithm as Array.prototype.lastIndexOf(). TypedArray is one of the typed array types here. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax typedarray.lastIndexOf(searchElement[, fromIndex = typedarray.length]) Parameters searchElement Element to locate in the typed array. fromIndex Optional. The index at which to start searching backwards. Defaults to the typed array's length, i.e.
TypedArray.prototype.length - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Description The length property is an accessor property whose set accessor function is undefined, meaning that you can only read this property. The value is established when a TypedArray is constructed and cannot be changed. If the TypedArray is not specifying an byteOffset or a length, the length of the referenced ArrayBuffer will be returned. ...
TypedArray.name - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Property attributes of TypedArray.name Writable no Enumerable no Configurable no Description TypedArray objects differ from each other in the number of bytes per element and in the way the bytes are interpreted. ...
TypedArray.prototype.reduce() - JavaScript
The reduce() method applies a function against an accumulator and each value of the typed array (from left-to-right) has to reduce it to a single value. This method has the same algorithm as Array.prototype.reduce(). TypedArray is one of the typed array types here. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax typedarray.reduce(callback[, initialValue]) Parameters callback Function to execute on each value in the typed array, taking four arguments: previousValue The value previously returned in the last invocation of the callback, or initialValue, if supplied (see below). currentValue The c...
TypedArray.prototype.set() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax typedarray.set(array[, offset]) typedarray.set(typedarray[, offset]) Parameters array The array from which to copy values. ...
TypedArray.prototype.sort() - JavaScript
The sort() method sorts the elements of a typed array numerically in place and returns the typed array. This method has the same algorithm as Array.prototype.sort(), except that sorts the values numerically instead of as strings. TypedArray is one of the typed array types here. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax typedarray.sort([compareFunction]) Parameters compareFunction Optional Specifies a function that defines the sort order. Return value The sorted typed array. Examples Using sort For more examples, see also the Array.prototype.sort() method. let numbers = new Uint8Array([40, ...
WeakMap.prototype.delete() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax wm.delete(key); Parameters key The key of the element to remove from the WeakMap object. Return value true if an element in the WeakMap object has been removed successfully. false if the key is not found in the WeakMap or if the key is not an object. ...
WeakMap.prototype.get() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax wm.get(key); Parameters key Required. The key of the element to return from the WeakMap object. Return value The element associated with the specified key in the WeakMap object. If the key can't be found, undefined is returned. Examples Using the get method var wm = new WeakMap(); wm.set(window, 'foo'); wm.get(window); // Returns "foo". ...
WeakMap.prototype.has() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax wm.has(key); Parameters key Required. The key of the element to test for presence in the WeakMap object. Return value Boolean Returns true if an element with the specified key exists in the WeakMap object; otherwise false. ...
WeakMap.prototype.set() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax wm.set(key, value); Parameters key Required. Must be object. The key of the element to add to the WeakMap object. value Required. Any value. The value of the element to add to the WeakMap object. Return value The WeakMap object. ...
WeakSet.prototype.add() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax ws.add(value); Parameters value Required. The object to add to the WeakSet collection. Return value The WeakSet object. ...
WeakSet.prototype.delete() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax ws.delete(value); Parameters value Required. The object remove from the WeakSet object. Return value true if an element in the WeakMap object has been removed successfully. false if the key is not found in the WeakMap or if the key is not an object. ...
WeakSet.prototype.has() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax ws.has(value); Parameters value Required. The object to test for presence in the WeakSet. Return value Boolean Returns true if an element with the specified value exists in the WeakSet object; otherwise false. ...
WebAssembly.CompileError() constructor - JavaScript
Specification WebAssembly JavaScript InterfaceThe definition of 'WebAssembly constructors' in that specification. ECMAScript (ECMA-262)The definition of 'NativeError constructor' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileServerChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.jsCompileError() constructorChrome Full support 57Edge Full support 16Firefox ...
WebAssembly.CompileError - JavaScript
ications Specification WebAssembly JavaScript InterfaceThe definition of 'WebAssembly constructors' in that specification. ECMAScript (ECMA-262)The definition of 'NativeError' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileServerChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.jsCompileErrorChrome Full support 57Edge Full support 16Firefox Fu...
WebAssembly.Instance() constructor - JavaScript
aming(fetch('simple.wasm'), importObject) .then(obj => obj.instance.exports.exported_func()); Specifications Specification WebAssembly JavaScript InterfaceThe definition of 'Instance' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileServerChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.jsInstance() constructorChrome Full support 57Edge Full support 16Firefox ...
WebAssembly.Instance.prototype.exports - JavaScript
le in the process. We then call an Exported WebAssembly function that is exported by the Instance. var importObject = { imports: { imported_func: function(arg) { console.log(arg); } } }; WebAssembly.instantiateStreaming(fetch('simple.wasm'), importObject) .then(obj => obj.instance.exports.exported_func()); Note: You can also find this example as instantiate-streaming.html on GitHub (view it live also). Specifications Specification WebAssembly JavaScript InterfaceThe definition of 'WebAssembly.Instance: exports' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us ...
WebAssembly.Instance - JavaScript
nc()); This also demonstrates how the exports property is used to access exported functions. Specifications Specification WebAssembly JavaScript InterfaceThe definition of 'Instance' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileServerChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.jsInstanceChrome Full support 57Edge Full support 16Firefox Full s...
WebAssembly.LinkError() constructor - JavaScript
ifications Specification WebAssembly JavaScript InterfaceThe definition of 'LinkError' in that specification. ECMAScript (ECMA-262)The definition of 'NativeError constructors' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileServerChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.jsLinkError() constructorChrome Full support 57Edge Full support 16Firefox ...
WebAssembly.LinkError - JavaScript
s run } Specifications Specification WebAssembly JavaScript InterfaceThe definition of 'LinkError' in that specification. ECMAScript (ECMA-262)The definition of 'NativeError' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileServerChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.jsLinkErrorChrome Full support 57Edge Full support 16Firefox Full ...
WebAssembly.Memory.prototype.grow() - JavaScript
e); // "2" Note the return value of grow() here is the previous number of WebAssembly pages. Specifications Specification WebAssembly JavaScript InterfaceThe definition of 'grow()' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileServerChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.jsgrowChrome Full support 57Edge Full support 16Firefox Full suppo...
WebAssembly.Module() constructor - JavaScript
(mod, importObject) .then(result => result.exports.exported_func() ); }) Specifications Specification WebAssembly JavaScript InterfaceThe definition of 'WebAssembly.Module()' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileServerChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.jsModule() constructorChrome Full support 57Edge Full support 16Firefox ...
WebAssembly.Module.customSections() - JavaScript
ole.log("Module contains a name section"); console.log(nameSections[0]); }; }); Specifications Specification WebAssembly JavaScript InterfaceThe definition of 'customSections()' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileServerChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.jscustomSectionsChrome Full support 57Edge Full support 16Firefox ...
WebAssembly.Module.imports() - JavaScript
The output looks like this: { module: "imports", name: "imported_func", kind: "function" } Specifications Specification WebAssembly JavaScript InterfaceThe definition of 'imports()' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileServerChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.jsimportsChrome Full support 57Edge Full support 16Firefox Full su...
WebAssembly.RuntimeError() constructor - JavaScript
fication WebAssembly JavaScript InterfaceThe definition of 'WebAssembly.RunTimeError constructor' in that specification. ECMAScript (ECMA-262)The definition of 'NativeError constructor' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileServerChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.jsRuntimeError() constructorChrome Full support 57Edge Full support 16Firefox ...
WebAssembly.RuntimeError - JavaScript
ications Specification WebAssembly JavaScript InterfaceThe definition of 'WebAssembly constructors' in that specification. ECMAScript (ECMA-262)The definition of 'NativeError' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileServerChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.jsRuntimeErrorChrome Full support 57Edge Full support 16Firefox Fu...
WebAssembly.Table() constructor - JavaScript
table from JavaScript, but the same table is visible and callable inside the wasm instance too. Specifications Specification WebAssembly JavaScript InterfaceThe definition of 'Table' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileServerChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.jsTable() constructorChrome Full support 57Edge Full support 16Firefox ...
WebAssembly.Table.prototype.grow() - JavaScript
able.length); // "2" console.log(table.grow(1)); // "2" console.log(table.length); // "3" Specifications Specification WebAssembly JavaScript InterfaceThe definition of 'grow()' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileServerChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.jsgrowChrome Full support 57Edge Full support 16Firefox Full suppo...
WebAssembly.Table.prototype.length - JavaScript
able.length); // "2" console.log(table.grow(1)); // "2" console.log(table.length); // "3" Specifications Specification WebAssembly JavaScript InterfaceThe definition of 'length' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileServerChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.jslengthChrome Full support 57Edge Full support 16Firefox Full sup...
WebAssembly.Table.prototype.set() - JavaScript
e table from JavaScript, but the same table is visible and callable inside the wasm instance too. Specifications Specification WebAssembly JavaScript InterfaceThe definition of 'set()' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileServerChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.jssetChrome Full support 57Edge Full support 16Firefox Full suppor...
WebAssembly.Table - JavaScript
table from JavaScript, but the same table is visible and callable inside the wasm instance too. Specifications Specification WebAssembly JavaScript InterfaceThe definition of 'Table' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileServerChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.jsTableChrome Full support 57Edge Full support 16Firefox Full supp...
WebAssembly.compile() - JavaScript
o use WebAssembly.compileStreaming() in most cases, as it is more efficient than compile(). Specifications Specification WebAssembly JavaScript InterfaceThe definition of 'compile()' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileServerChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.jscompileChrome Full support 57Edge Full support 16Firefox Full su...
WebAssembly.validate() - JavaScript
nsole.log("The given bytes are " + (valid ? "" : "not ") + "a valid wasm module"); }); Specifications Specification WebAssembly JavaScript InterfaceThe definition of 'validate()' in that specification. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileServerChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.jsvalidateChrome Full support 57Edge Full support 16Firefox Full s...
decodeURI() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax decodeURI(encodedURI) Parameters encodedURI A complete, encoded Uniform Resource Identifier. Return value A new string representing the unencoded version of the given encoded Uniform Resource Identifier (URI). ...
encodeURI() - JavaScript
The encodeURI() function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two "surrogate" characters). The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax encodeURI(URI) Parameters URI A complete URI. Return value A new string representing the provided string encoded as a URI. Description The encodeURI() function does not encode characters that have special meaning (reserved characters) for a URI. The following example shows all the ...
encodeURIComponent() - JavaScript
The encodeURIComponent() function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character (will only be four escape sequences for characters composed of two "surrogate" characters). The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax encodeURIComponent(str); Parameters str String. A component of a URI. Return value A new string representing the provided string encoded as a URI component. Description encodeURIComponent() escapes all characters except: Not Escaped: A-Z a-z 0-9 - _ . ! ~ * ' ( ) ...
globalThis - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Property attributes of globalThis Writable yes Enumerable no Configurable yes Description Historically, accessing the global object has required different syntax in different JavaScript environments. ...
isFinite() - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax isFinite(testValue) Parameters testValue The value to be tested for finiteness. Return value false if the argument is positive or negative Infinity or NaN or undefined; otherwise, true. ...
undefined - JavaScript
The global undefined property represents the primitive value undefined. It is one of JavaScript's primitive types. Property attributes of undefined Writable no Enumerable no Configurable no The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax undefined Description undefined is a property of the global object. That is, it is a variable in global scope. The initial value of undefined is the primitive value undefined. In modern browsers (JavaScript 1.8.5 / Firefox 4+), undefined is a non-configurable, non-writable pr...
Bitwise AND (&) - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax a & b Description The operands are converted to 32-bit integers and expressed by a series of bits (zeroes and ones). Numbers with more than 32 bits get their most significant bits discarded. ...
Bitwise NOT (~) - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax ~a Description The operands are converted to 32-bit integers and expressed by a series of bits (zeroes and ones). Numbers with more than 32 bits get their most significant bits discarded. ...
Bitwise OR (|) - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax a | b Description The operands are converted to 32-bit integers and expressed by a series of bits (zeroes and ones). Numbers with more than 32 bits get their most significant bits discarded. ...
Bitwise XOR (^) - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax a ^ b Description The operands are converted to 32-bit integers and expressed by a series of bits (zeroes and ones). Numbers with more than 32 bits get their most significant bits discarded. ...
Comma operator (,) - JavaScript
ch of its operands (from left to right) and returns the value of the last operand. This lets you create a compound expression in which multiple expressions are evaluated, with the compound expression's final value being the value of the rightmost of its member expressions. This is commonly used to provide multiple parameters to a for loop. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax expr1, expr2, expr3... Parameters expr1, expr2, expr3... One or more expressions, the last of which is returned as the value of the compound expression. Usage notes You can use the comma operator when you want to incl...
Conditional (ternary) operator - JavaScript
al (ternary) operator is the only JavaScript operator that takes three operands: a condition followed by a question mark (?), then an expression to execute if the condition is truthy followed by a colon (:), and finally the expression to execute if the condition is falsy. This operator is frequently used as a shortcut for the if statement. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax condition ? exprIfTrue : exprIfFalse Parameters condition An expression whose value is used as a condition. exprIfTrue An expression which is evaluated if the condition evaluates to a truthy value (one which equals or ...
Decrement (--) - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Operator: x-- or --x Description If used postfix, with operator after operand (for example, x--), the decrement operator decrements and returns the value before decrementing. ...
Greater than (>) - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax x > y Description The operands are compared using the Abstract Relational Comparison algorithm. See the documentation for the Less than operator for a summary of this algorithm. ...
Greater than or equal (>=) - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax x >= y Description The operands are compared using the Abstract Relational Comparison algorithm. See the documentation for the Less than operator for a summary of this algorithm. ...
Grouping operator ( ) - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax ( ) Description The grouping operator consists of a pair of parentheses around an expression or sub-expression to override the normal operator precedence so that expressions with lower precedence can be evaluated before an expression with higher priority. As it sounds, it groups what's inside of the parentheses. ...
Increment (++) - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Operator: x++ or ++x Description If used postfix, with operator after operand (for example, x++), the increment operator increments and returns the value before incrementing. If used prefix, with operator before operand (for example, ++x), the increment operator increments and returns the value after incrementing. ...
Less than (<) - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax x < y Description The operands are compared using the Abstract Relational Comparison algorithm, which is roughly summarised below: First, objects are converted to primitives using Symbol.ToPrimitive. ...
Less than or equal (<=) - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax x <= y Description The operands are compared using the Abstract Relational Comparison algorithm. See the documentation for the Less than operator for a summary of this algorithm. ...
Logical AND (&&) - JavaScript
for a set of operands is true if and only if all of its operands are true. It is typically used with Boolean (logical) values. When it is, it returns a Boolean value. However, the && operator actually returns the value of one of the specified operands, so if this operator is used with non-Boolean values, it will return a non-Boolean value. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax expr1 && expr2 Description If expr1 can be converted to true, returns expr2; else, returns expr1. If a value can be converted to true, the value is so-called truthy. If a value can be converted to false, the value is so-c...
Logical NOT (!) - JavaScript
The logical NOT (!) operator (logical complement, negation) takes truth to falsity and vice versa. It is typically used with Boolean (logical) values. When used with non-Boolean values, it returns false if its single operand can be converted to true; otherwise, returns true. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax !expr Description Returns false if its single operand can be converted to true; otherwise, returns true. If a value can be converted to true, the value is so-called truthy. If a value can be converted to false, the value is so-called falsy. Examples of expressions that can be converte...
Logical OR (||) - JavaScript
et of operands is true if and only if one or more of its operands is true. It is typically used with Boolean (logical) values. When it is, it returns a Boolean value. However, the || operator actually returns the value of one of the specified operands, so if this operator is used with non-Boolean values, it will return a non-Boolean value. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax expr1 || expr2 Description If expr1 can be converted to true, returns expr1; else, returns expr2. If a value can be converted to true, the value is so-called truthy. If a value can be converted to false, the value is so-c...
Logical OR assignment (||=) - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax expr1 ||= expr2 Description Short-circuit evaluation The logical OR operator works like this: x || y; // returns x when x is truthy // returns y when x is not truthy The logical OR operator short-circuits: the second operand is only evaluated if the first operand doesn't already determine the result. ...
Nullish coalescing operator (??) - JavaScript
d. Contrary to the logical OR (||) operator, the left operand is returned if it is a falsy value which is not null or undefined. In other words, if you use || to provide some default value to another variable foo, you may encounter unexpected behaviors if you consider some falsy values as usable (eg. '' or 0). See below for more examples. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. See PR #1482 regarding the addition of this example. Syntax leftExpr ?? rightExpr Examples Using the nullish coalescing operator In this example, we will provide default values but keep values other than null or undefined. con...
Object initializer - JavaScript
Objects can be initialized using new Object(), Object.create(), or using the literal notation (initializer notation). An object initializer is a comma-delimited list of zero or more pairs of property names and associated values of an object, enclosed in curly braces ({}). The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax let o = {} let o = {a: 'foo', b: 42, c: {}} let a = 'foo', b = 42, c = {} let o = {a: a, b: b, c: c} let o = { property: function (parameters) {}, get property() {}, set property(value) {} }; New notations in ECMAScript 2015 Please see the compatibility table for support for these ...
Optional chaining (?.) - JavaScript
alls, it returns undefined if the given function does not exist. This results in shorter and simpler expressions when accessing chained properties when the possibility exists that a reference may be missing. It can also be helpful while exploring the content of an object when there's no known guarantee as to which properties are required. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax obj?.prop obj?.[expr] arr?.[index] func?.(args) Description The optional chaining operator provides a way to simplify accessing values through connected objects when it's possible that a reference or function may be undefi...
Property accessors - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax object.property object['property'] Description One can think of an object as an associative array (a.k.a. map, dictionary, hash, lookup table). The keys in this array are the names of the object's properties. ...
Right shift (>>) - JavaScript
(>>) shifts the first operand the specified number of bits to the right. Excess bits shifted off to the right are discarded. Copies of the leftmost bit are shifted in from the left. Since the new leftmost bit has the same value as the previous leftmost bit, the sign bit (the leftmost bit) does not change. Hence the name "sign-propagating". The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax a >> b Description This operator shifts the first operand the specified number of bits to the right. Excess bits shifted off to the right are discarded. Copies of the leftmost bit are shifted in from the left. Since the ne...
Spread syntax (...) - JavaScript
Spread syntax (...) allows an iterable such as an array expression or string to be expanded in places where zero or more arguments (for function calls) or elements (for array literals) are expected, or an object expression to be expanded in places where zero or more key-value pairs (for object literals) are expected. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax For function calls: myFunction(...iterableObj); For array literals or strings: [...iterableObj, '4', 'five', 6]; For object literals (new in ECMAScript 2018): let objClone = { ...obj }; Rest syntax (parameters) Rest syntax looks exactly li...
Unary negation (-) - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax Operator: -x Examples Negating numbers const x = 3; const y = -x; // y = -3 // x = 3 Negating non-numbers The unary negation operator can convert a non-number into a number. ...
Unsigned right shift (>>>) - JavaScript
) (zero-fill right shift) shifts the first operand the specified number of bits to the right. Excess bits shifted off to the right are discarded. Zero bits are shifted in from the left. The sign bit becomes 0, so the result is always non-negative. Unlike the other bitwise operators, zero-fill right shift returns an unsigned 32-bit integer. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax a >>> b Description This operator shifts the first operand the specified number of bits to the right. Excess bits shifted off to the right are discarded. Zero bits are shifted in from the left. The sign bit becomes 0, so t...
class expression - JavaScript
The class expression is one way to define a class in ECMAScript 2015. Similar to function expressions, class expressions can be named or unnamed. If named, the name of the class is local to the class body only. JavaScript classes use prototype-based inheritance. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax const MyClass = class [className] [extends otherClassName] { // class body }; Description A class expression has a similar syntax to a class declaration (statement). As with class statements, the body of a class expression is executed in strict mode. There are several differences between class...
function* expression - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax function* [name]([param1[, param2[, ..., paramN]]]) { statements } Parameters name Optional The function name. Can be omitted, in which case the function is anonymous. The name is only local to the function body. paramN Optional The name of an argument to be passed to the function. A function can have up to 255 arguments. ...
in operator - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax prop in object Parameters prop A string or symbol representing a property name or array index (non-symbols will be coerced to strings). object Object to check if it (or its prototype chain) contains the property with specified name (prop). ...
new.target - JavaScript
The new.target pseudo-property lets you detect whether a function or constructor was called using the new operator. In constructors and functions invoked using the new operator, new.target returns a reference to the constructor or function. In normal function calls, new.target is undefined. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax new.target Description The new.target syntax consists of the keyword new, a dot, and the identifier target. Normally, the left-hand side of the dot is the object on which property access is performed, but here, new is not an object. The new.target pseudo-property is avai...
this - JavaScript
be set by assignment during execution, and it may be different each time the function is called. ES5 introduced the bind() method to set the value of a function's this regardless of how it's called, and ES2015 introduced arrow functions which don't provide their own this binding (it retains the this value of the enclosing lexical context). The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax this Value A property of an execution context (global, function or eval) that, in non-strict mode, is always a reference to an object and in strict mode can be any value. Description Global context In the global executio...
typeof - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax The typeof operator is followed by its operand: typeof operand typeof(operand) Parameters operand An expression representing the object or primitive whose type is to be returned. Description The following table summarizes the possible return values of typeof. ...
void operator - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax void expression Description This operator allows evaluating expressions that produce a value into places where an expression that evaluates to undefined is desired. The void operator is often used merely to obtain the undefined primitive value, usually using "void(0)" (which is equivalent to "void 0"). ...
yield* - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax yield* expression; expression The expression which returns an iterable object. Description The yield* expression iterates over the operand and yields each value returned by it. The value of yield* expression itself is the value returned by that iterator when it's closed (i.e., when done is true). ...
yield - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax [rv] = yield [expression] expression Optional Defines the value to return from the generator function via the iterator protocol. If omitted, undefined is returned instead. rv Optional Retrieves the optional value passed to the generator's next() method to resume its execution. ...
empty - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax ; Description The empty statement is a semicolon (;) indicating that no statement will be executed, even if JavaScript syntax requires one. ...
async function - JavaScript
async keyword. Async functions are instances of the AsyncFunction constructor, and the await keyword is permitted within them. The async and await keywords enable asynchronous, promise-based behavior to be written in a cleaner style, avoiding the need to explicitly configure promise chains. Async functions may also be defined as expressions. The source for this interactive demo is stored in a GitHub repository. If you'd like to contribute to the interactive demo project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax async function name([param[, param[, ...param]]]) { statements } Parameters name The function's name. param The name of an argument to be passed to the function. statements The statements comprising the body of the f...
class - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. You can also define a class using a class expression. But unlike a class expression, a class declaration doesn't allow an existing class to be declared again and will throw a SyntaxError if attempted. ...
for...of - JavaScript
The for...of statement creates a loop iterating over iterable objects, including: built-in String, Array, array-like objects (e.g., arguments or NodeList), TypedArray, Map, Set, and user-defined iterables. It invokes a custom iteration hook with statements to be executed for the value of each distinct property of the object. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax for (variable of iterable) { statement } variable On each iteration a value of a different property is assigned to variable. variable may be declared with const, let, or var. iterable Object whose iterable properties are iterated.
function* - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. You can also define generator functions using the GeneratorFunction constructor, or the function expression syntax. Syntax function* name([param[, param[, ... param]]]) { statements } name The function name. ...
if...else - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax if (condition) statement1 [else statement2] condition An expression that is considered to be either truthy or falsy. statement1 Statement that is executed if condition is truthy. ...
label - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Note: Labeled loops or blocks are very uncommon. Usually function calls can be used instead of loop jumps. Syntax label : statement label Any JavaScript identifier that is not a reserved word. ...
let - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax let var1 [= value1] [, var2 [= value2]] [, ..., varN [= valueN]; Parameters var1, var2, ..., varN The names of the variable or variables to declare. Each must be a legal JavaScript identifier. ...
return - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax return [[expression]]; expression The expression whose value is to be returned. If omitted, undefined is returned instead. Description When a return statement is used in a function body, the execution of the function is stopped. ...
throw - JavaScript
The throw statement throws a user-defined exception. Execution of the current function will stop (the statements after throw won't be executed), and control will be passed to the first catch block in the call stack. If no catch block exists among caller functions, the program will terminate. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax throw expression; expression The expression to throw. Description Use the throw statement to throw an exception. When you throw an exception, expression specifies the value of the exception. Each of the following throws an exception: throw 'Error2'; // generates a...
try...catch - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax try { try_statements } [catch (exception_var_1 if condition_1) { // non-standard catch_statements_1 }] ... [catch (exception_var_2) { catch_statements_2 }] [finally { finally_statements }] try_statements The statements to be executed. ...
var - JavaScript
If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Syntax var varname1 [= value1] [, varname2 [= value2] ... [, varnameN [= valueN]]]; varnameN Variable name. It can be any legal identifier. valueN Optional Initial value of the variable. It can be any legal expression. Default value is undefined. ...
Transitioning to strict mode - JavaScript
2; global.b = a + x * 35; } f(42); Trying to delete a non-configurable property 'use strict'; delete Object.prototype; // error! In non-strict, this would silently fail, in contradiction with the user expectation. Poisoned arguments and function properties Accessing arguments.callee, arguments.caller, anyFunction.caller, or anyFunction.arguments throws an error in strict mode. ...
Template literals (Template strings) - JavaScript
ged templates and escape sequences ES2016 behavior As of ECMAScript 2016, tagged templates conform to the rules of the following escape sequences: Unicode escapes started by "\u", for example \u00A9 Unicode code point escapes indicated by "\u{}", for example \u{2F804} Hexadecimal escapes started by "\x", for example \xA9 Octal literal escapes started by "\0o" and followed by one or more digits, for example \0o251 This means that a tagged template like the following is problematic, because, per ECMAScript grammar, a parser looks for valid Unicode escape sequences, but finds malformed syntax: latex`\unicode` // Throws in older ECMAScript versions (ES2016 and earlier) // SyntaxError: malformed Unicode character escape sequence ES2018 revision of illegal escape sequences Tagged templ...
JavaScript typed arrays - JavaScript
y 0 to 65535 2 16-bit unsigned integer unsigned short uint16_t Int32Array -2147483648 to 2147483647 4 32-bit two's complement signed integer long int32_t Uint32Array 0 to 4294967295 4 32-bit unsigned integer unsigned long uint32_t Float32Array 1.2x10-38 to 3.4x1038 4 32-bit IEEE floating point number (7 significant digits e.g., 1.123456) unrestricted float float Float64Array 5.0x10-324 to 1.8x10308 8 64-bit IEEE floating point number (16 significant digits e.g., 1.123...15) unrestricted double double BigInt64Array -263 to 263-1 8 64-bit two's complement signed integer bigint int64_t (signed long long) BigUint64Array 0 to 264-1 8 64-bit unsign...
MathML attribute reference - MathML
nment scopes or not. Unimplemented altimg altimg-width altimg-height altimg-valign alttext <math> Visual and textual fall-back options. bevelled <mfrac> Specifies the style how the fraction should be displayed. Deprecated. Use U+2044 (fraction slash) instead. Unimplemented charalign <mstack> Specifies the horizontal alignment of digits. close <mfenced> A string for the closing delimiter. columnalign <mtable>, <mtd>, <mtr>, <mlabeledtr> Specifies the horizontal alignment of table cells. columnlines <mtable> Specifies table column borders. columnspacing <mtable> Specifies the space between table columns. columnspan <mtd> A non-negative integer value that ...
<mn> - MathML
Web › MathML › Element › mn
However, it is also allowed to have arbitrary text in it which is actually a numeric quantity, for example "eleven". Attributes class, id, style Provided for use with stylesheets. dir The text direction. Possible values are either ltr (left to right) or rtl (right to left). href Used to set a hyperlink to a specified URI. mathbackground The background color. You can use #rgb, #rrggbb and HTML color names. mathcolor The text color. You can use #rgb, #rrggbb and HTML color names. mathsize The size of the content. See length for possible values. ...
MathML documentation index - MathML
Web › MathML › Index
r. A 1-dimensional array (e.g. vectors) is a 1st-order tensor and so 2nd-order tensors are needed to represent square matrices. To learn more about the mathematical background of tensors refer to the entry on Wikipedia. 20 <mn> MathML, MathML Reference, MathML:Element, MathML:Token Elements The MathML <mn> element represents a numeric literal which is normally a sequence of digits with a possible separator (a dot or a comma). However, it is also allowed to have arbitrary text in it which is actually a numeric quantity, for example "eleven". 21 <mo> MathML, MathML Reference, MathML:Element, MathML:Token Elements The MathML <mo> element represents an operator in a broad sense. Besides operators in strict mathematical meaning, this element also includes...
Add to Home screen - Progressive web apps (PWAs)
We've written a very simple example web site (see our demo live, and also see the source code) that doesn't do much, but was developed with the necessary code to allow it to be added to a Home screen, as well as a service worker to enable it to be used offline. The example displays a series of fox pictures. If you have Firefox for Android available, use it to navigate to our demo at https://mdn.github.io/pwa-examples/a2hs/. You'll see fox pictures, but more important, you'll see a "home" icon with a plus (+) icon inside it -- this is the "Add to Home screen" icon displayed for any site that has the necessary features in place. Tapping this will show a confirmation banner -- pressing the big + ADD TO HOME SCREEN button completes the action, adding the app to the Home screen. (Note: In And...
Installing and uninstalling web apps - Progressive web apps (PWAs)
We've written a very simple example web site (see our demo live, and also see the source code) that doesn't do much, but was developed with the necessary code to allow it to be installed, as well as a service worker to enable it to be used offline. The example displays a series of fox pictures.If you have a web application compatible device available, use it to navigate to our demo at https://mdn.github.io/pwa-examples/a2hs/. You'll see fox pictures, but more importantly, some form of user interface will be available to let you install the site as a web app. The UI for this varies from browser to browser, but the general idea is the same. Unfortunately, there isn't a standard for icons and symbols used for operations such as this. Firefox for Android On an Android device using Firefox, y...
Introduction to progressive web apps - Progressive web apps (PWAs)
es of articles we will examine the source code of a super simple website that lists information about games submitted to the A-Frame category in the js13kGames 2017 competition. You don't have to think about what the actual content on the website is; the main point is to learn how to use PWA features in your own projects. You can see this app in action online, and the source code is available on GitHub. We'll be examining this code carefully over the course of this series of articles. For now, let's move to the second part of this series, where we'll be looking at the structure of our example app. Overview: Progressive web apps Next ...
Making PWAs work offline with Service workers - Progressive web apps (PWAs)
kers are quite powerful as they can take control over network requests, modify them, serve custom responses retrieved from the cache, or synthesize responses completely. Security Because they are so powerful, Service Workers can only be executed in secure contexts (meaning HTTPS). If you want to experiment first before pushing your code to production, you can always test on a localhost or setup GitHub Pages -- both support HTTPS. Offline First The "offline first" -- or "cache first" -- pattern is the most popular strategy for serving content to the user. If a resource is cached and available offline, return it first before trying to download it from the server. If it isn't in the cache already, download it and cache it for future usage. "Progressive" in PWA When implemented properly as ...
The building blocks of responsive design - Progressive web apps (PWAs)
called Snapshot, which takes a video stream from your webcam (using getUserMedia()) then allows you to capture stills from that video stream (using HTML5 <canvas>), and save them to a gallery. You can then view previously-captured images and delete them. Other articles will discuss the functionality in more detail, but here we're interested in the layout. Note: You can find the Snapshot app on Github; check out the code and help improve it. You can also see Snapshot running live. Note that getUserMedia() is an experimental technology, which currently only works in Google Chrome and Firefox desktop. More functionality and a clean up of the styling of Snapshot are planned for a future date. Our desktop layout for Snapshot is three columns, containing the camera viewer, image capture view, ...
Progressive web apps (PWAs)
dvantage of Add to home screen (A2HS). 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. ServiceWorkerWare -- An Express-like microframework for easy Service Worker development. oghliner -- Not only a template but a tool for deploying Offline Web Apps to GitHub Pages. sw-precache -- A node module to generate service worker code that will precache specific resources. workbox -- Spiritual successor to sw-precache with more advanced caching strategies and easy precaching. upup -- A tiny script that makes sure your site is always there for your users. The service worker cookbook -- A series of excellent service worker/push recipes, showing how to imp...
alignment-baseline - SVG: Scalable Vector Graphics
auto, before-edge, after-edge, text-before-edge, and text-after-edge Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'alignment-baseline' in that specification. Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetalignment-baselineChrome ? Edge ? Firefox ? IE ? Opera ...
baseline-shift - SVG: Scalable Vector Graphics
CSS Inline Layout and notes that vertical-align should be preferred. Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'alignment-baseline' in that specification. Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetbaseline-shiftChrome ? Edge ? Firefox ? IE ? Opera ...
clip-path - SVG: Scalable Vector Graphics
indicates to use the object bounding box extended with the stroke; view-box indicates to use the nearest SVG viewport as the reference box. Note: For more details on the clip-path syntax, see the CSS property clip-path reference page. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetclip-pathChrome ? Edge ? Firefox ? IE ? Opera ?
clip-rule - SVG: Scalable Vector Graphics
th> <rect clip-path="url(#filledStar)" width="50" height="90" x="50" fill="red" /> </svg> Elements The following elements can use the clip-rule attribute, but only if they are inside a <clipPath> element. Graphical elements >> Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetclip-ruleChrome ? Edge ? Firefox ? IE ? Opera ?
color-interpolation-filters - SVG: Scalable Vector Graphics
hat specification. Working Draft No significant change Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'color-interpolation-filters' in that specification. Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetcolor-interpolation-filtersChrome ? Edge ? Firefox ? IE ? Opera...
color-interpolation - SVG: Scalable Vector Graphics
specification. Candidate Recommendation No significant change Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'color-interpolation' in that specification. Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetcolor-interpolationChrome ? Edge ? Firefox ? IE ? Opera ...
color-profile - SVG: Scalable Vector Graphics
mage. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'color-profile' in that specification. Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetcolor-profile DeprecatedChrome ? Edge ? Firefox ? IE ? Opera ...
color - SVG: Scalable Vector Graphics
Web › SVG › Attribute › color
Candidate Recommendation Removed the restriction to which elements it applies. Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'color' in that specification. Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetcolorChrome ? Edge ? Firefox ? IE ? Opera ? ...
cursor - SVG: Scalable Vector Graphics
Web › SVG › Attribute › cursor
d Edition) <FuncIRI> Functional notation for a reference. The syntax for this reference is the same as the css uri. Elements The following elements can use the cursor attribute Container elements >> Graphics elements >> Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetcursorChrome ? Edge ? Firefox ? IE ? Opera ? ...
dominant-baseline - SVG: Scalable Vector Graphics
e-script, no-change, and reset-size and introduced the text-top value. Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'dominant-baseline' in that specification. Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetdominant-baselineChrome ? Edge ? Firefox ? IE ? Opera ...
fill-opacity - SVG: Scalable Vector Graphics
able Yes Note: SVG2 introduces percentage values for fill-opacity, however, it is not widely supported yet (See Browser compatibility below) as a consequence, it is best practices to set opacity with a value in the range [0-1]. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetfill-opacityChrome ? Edge ? Firefox ? IE ? Opera ...
fill-rule - SVG: Scalable Vector Graphics
with the path segment moving in opposite direction (one square drawn clockwise, the other anti-clockwise) --> <path fill-rule="evenodd" stroke="red" d="M210,0 h90 v90 h-90 z M230,20 v50 h50 v-50 z"/> </svg> Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetfill-ruleChrome ? Edge ? Firefox ? IE ? Opera ?
fill - SVG: Scalable Vector Graphics
Web › SVG › Attribute › fill
cation. Recommendation Initial definition for animations Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'fill' in that specification. Recommendation Initial definition for shapes and texts Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetfillChrome ? Edge ? Firefox ? IE ? Opera ? ...
filter - SVG: Scalable Vector Graphics
Web › SVG › Attribute › filter
ion. Working Draft Extended the values by several special filter functions. Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'filter' in that specification. Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetfilterChrome ? Edge ? Firefox ? IE ? Opera ? ...
font-family - SVG: Scalable Vector Graphics
in that specification. Candidate Recommendation No significant change Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'font-family' in that specification. Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetfont-familyChrome ? Edge ? Firefox ? IE ? Opera ...
font-style - SVG: Scalable Vector Graphics
'font-style' in that specification. Candidate Recommendation No change Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'font-style' in that specification. Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetfont-styleChrome ? Edge ? Firefox ? IE ? Opera ...
font-weight - SVG: Scalable Vector Graphics
font-weight' in that specification. Candidate Recommendation No change Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'font-weight' in that specification. Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetfont-weightChrome ? Edge ? Firefox ? IE ? Opera ...
id - SVG: Scalable Vector Graphics
Web › SVG › Attribute › id
pace characters. Note: You should avoid the use of id values that would be parsed as an SVG view specification (e.g., MyDrawing.svg#svgView(viewBox(0,200,1000,1000))) or a basic media fragment when used as a URL target fragment. It must be valid in XML documents. A stand-alone SVG document uses XML 1.0 syntax, which specifies that valid IDs only include designated characters (letters, digits, and a few punctuation marks), and do not start with a digit, a full stop (.) character, or a hyphen-minus (-) character. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 2The definition of 'id' in that specification. Candidate Recommendation Defines the allowed values in more detail. Scalable Vector Graphics (SVG) 1.1 (Se...
panose-1 - SVG: Scalable Vector Graphics
s the closest possible font match given a set of typefaces. Only one element is using this attribute: <font-face> Usage notes Value <integer>{10} Default value 0 0 0 0 0 0 0 0 0 0 Animatable No <integer>{10} This value specifies a Panose-1 number and consists of ten decimal integers, separated by whitespace. The initial value zero for each PANOSE digit means "any", i.e. all fonts will match the Panose number if this value is used. Specifications Specification Status Comment Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'panose-1' in that specification. Recommendation Initial definition ...
pointer-events - SVG: Scalable Vector Graphics
leStroke | visible | painted | fill | stroke | all | none Default value visiblePainted Animatable Yes For a detailed explanation of each possible value, have a look at the CSS pointer-events documentation. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetpointer-eventsChrome ? Edge ? Firefox ? IE ? Opera ...
shape-rendering - SVG: Scalable Vector Graphics
ndering' in that specification. Candidate Recommendation No change Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'shape-rendering' in that specification. Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetshape-renderingChrome ? Edge ? Firefox ? IE ? Opera ...
spreadMethod - SVG: Scalable Vector Graphics
l definition for <radialGradient> Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'spreadMethod for <linearGradient>' in that specification. Recommendation Initial definition for <linearGradient> Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. No compatibility data found. Please contribute data for "svg.attributes.presentation.spreadMethod" (depth: 1) to the MDN compatibility data repository. ...
stroke-dasharray - SVG: Scalable Vector Graphics
th>s and <percentage>s that specify the lengths of alternating dashes and gaps. If an odd number of values is provided, then the list of values is repeated to yield an even number of values. Thus, 5,3,2 is equivalent to 5,3,2,5,3,2. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetstroke-dasharrayChrome ? Edge ? Firefox ? IE ? Opera ...
stroke-dashoffset - SVG: Scalable Vector Graphics
th> Default value 0 Animatable Yes The offset is usually expressed in user units resolved against the pathLength but if a <percentage> is used, the value is resolved as a percentage of the current viewport. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetstroke-dashoffsetChrome ? Edge ? Firefox ? IE ? Opera ...
stroke-linecap - SVG: Scalable Vector Graphics
ath for each stroke --> <path d="M1,1 h4" stroke="pink" stroke-width="0.025" /> <circle cx="1" cy="1" r="0.05" fill="pink" /> <circle cx="5" cy="1" r="0.05" fill="pink" /> <circle cx="3" cy="3" r="0.05" fill="pink" /> </svg> Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetstroke-linecapChrome ? Edge ? Firefox ? IE ? Opera ...
stroke-miterlimit - SVG: Scalable Vector Graphics
0.0 converts them for theta less than approximately 11.5 degrees. Usage context Value <number> Default value 4 Animatable Yes The value of stroke-miterlimit must be greater than or equal to 1. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetstroke-miterlimitChrome ? Edge ? Firefox ? IE ? Opera ...
stroke-opacity - SVG: Scalable Vector Graphics
roke with an opacity different than 1 will partially show the fill underneath. To avoid this effect, it is possible to apply a global opacity with the opacity attribute or to put the stroke behind the fill with the paint-order attribute. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetstroke-opacityChrome ? Edge ? Firefox ? IE ? Opera ...
stroke-width - SVG: Scalable Vector Graphics
" /> </svg> Usage notes Value <length> | <percentage> Default value 1px Animatable Yes Note: A percentage value is always computed as a percentage of the normalized viewBox diagonal length. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetstroke-widthChrome ? Edge ? Firefox ? IE ? Opera ...
stroke - SVG: Scalable Vector Graphics
Web › SVG › Attribute › stroke
shapes and texts. Adds context-fill and context-stroke. Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'stroke' in that specification. Recommendation Initial definition for shapes and texts Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetstrokeChrome ? Edge ? Firefox ? IE ? Opera ? ...
text-anchor - SVG: Scalable Vector Graphics
in that specification. Candidate Recommendation No significant change Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'text-anchor' in that specification. Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internettext-anchorChrome ? Edge ? Firefox ? IE ? Opera ...
text-rendering - SVG: Scalable Vector Graphics
endering' in that specification. Candidate Recommendation No change Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'text-rendering' in that specification. Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internettext-renderingChrome ? Edge ? Firefox ? IE ? Opera ...
writing-mode - SVG: Scalable Vector Graphics
defines a mapping between the deprecated SVG 1.1 values and the new values. Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'writing-mode' in that specification. Recommendation Initial definition Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internetwriting-modeChrome ? Edge ? Firefox ? IE ? Opera ...
mimeTypes.rdf corruption - SVG: Scalable Vector Graphics
e able to open and display SVG content with Mozilla, but for no apparent reason its behaviour changes and now it always pops up the "Open or Save File" dialog when you try to open local SVG files, and displays the "Additional plugins are required to display all the media on this page" bar when you try to view HTML with embedded SVG. Note: the "Additional plugins are required" bar can appear for legitimate reasons when the SVG or its embedding HTML is broken or served incorrectly over the network (see the SVG FAQ). If the blue square with the white cross displays when you load this scripting across embed demo, then you are not experiencing this problem. If it doesn't, then you almost certainly are. Background Mozilla decides if and how it can open files by using their media (MIME) type. It ...
Subdomain takeovers - Web security
g by claiming the virtual host; create DNS records last. Start deprovisioning by removing DNS records first. Create an inventory of all of your organization's domains and their hosting providers, and update it as things change, to ensure that nothing is left dangling. Put pressure on hosting vendors to close gaps; ask how they verify that someone claiming a virtual host actually has a legitimate claim to the domain name. Work within your organization to make this part of the vendor qualification process. My subdomain has been taken over. What should I do? If you discover that a subdomain of your domain has been taken over, the first step, if possible, is to "cut power" by removing the DNS entry for the subdomain. If your site has multiple layers of virtualization (e.g., a CDN in ...
Transport Layer Security - Web security
ms. The TLS 1.3 handshake is encrypted, except for the messages that are necessary to establish a shared secret. In particular, this means that server and client certificates are encrypted. Note however that the server identity (the server_name or SNI extension) that a client sends to the server is not encrypted. Numerous mechanisms have been disabled: renegotiation, generic data compression, Digital Signature Algorithm (DSA) certificates, static RSA key exchange, and key exchange with custom Diffie-Hellman (DH) groups. Implementations of draft versions of TLS 1.3 are available. TLS 1.3 is enabled in some browsers, including the 0-RTT mode. Web servers that enable TLS 1.3 might need to adjust configuration to allow TLS 1.3 to operate successfully. TLS 1.3 adds just one significant new us...
Types of attacks - Web security
RF protection or hijack a session after the user logs in. Alternatively, if the parent domain does not use HTTP Strict-Transport-Security with includeSubdomains set, a user subject to an active MitM (perhaps connected to an open WiFi network) could be served a response with a Set-Cookie header from a non-existent sub-domain. The end result would be much the same, with the browser storing the illegitimate cookie and sending it to all other pages under example.com. Session fixation should primarily be mitigated by regenerating session cookie values when the user authenticates (even if a cookie already exists) and by tieing any CSRF token to the user. Session side-jacking Browser hijacking malware ...
Weak signature algorithms - Web security
This article provides some information about signature algorithms known to be weak, so you can avoid them when appropriate. Weaknesses in hash algorithms can lead to situations in which attackers can create or obtain fraudulent certificates. As new attacks are found and improvements in available technology make attacks more feasible, the use of older algorithms is discouraged and support for them is eventually removed. SHA-1 SHA-1 certificates will no longer be treated as secure by major browser manufacturers beginning in 2017. ...
Using templates and slots - Web Components
Note: Elements that can be inserted into slots are known as Slotable; when an element has been inserted in a slot, it is said to be slotted. Note: An unnamed <slot> will be filled with all of the custom element's top-level child nodes that do not have the slot attribute. This includes text nodes. And that's it for our trivial example. If you want to play with it some more, you can find it on GitHub (see it running live also). A more involved example To finish off the article, let's look at something a little less trivial. The following set of code snippets show how to use <slot> together with <template> and some JavaScript to: create a <element-details> element with named slots in its shadow root design the <element-details> element in such a way that, when used in documents, it i...
Web Components
of the shadow DOM slot attached to the element. CSS pseudo-elements Pseudo-elements relating specifically to slots: ::slotted: Matches any content that is inserted into a slot. The slotchange event Fired on an HTMLSlotElement instance (<slot> element) when the node(s) contained in that slot change. Examples We are building up a number of examples in our web-components-examples GitHub repo. More will be added as time goes on. Specifications Specification Status Comment HTML Living StandardThe definition of '<template> element' in that specification. Living Standard The definition of <template>. HTML Living StandardThe definition of 'custom elements' in that specification. Living Standard The definition of HTML Custom Elements. ...
xml:base - XML: Extensible Markup Language
Web › XML › xml:base
>r</text> <style type="text/css"><![CDATA[ @font-face { font-family: ZapfDingbats_ghr; src: url("fonts/ZapfDingbats_ghr.woff") format("woff"); } ]]></style> </svg> Setting the xml:base on the SVG Element means you can inline the SVG and thereby bypass CORS issue while not changing the base URI for your entire document. Work-arounds xml:base support in old browsers https://gist.github.com/leonderijke/c5cf7c5b2e424c0061d2 Specifications Specification Status Comment XML Base (Second Edition) Recommendation ...
<xsl:number> - XSLT: Extensible Stylesheet Language Transformations
Web › XSLT › Element › number
nguages have more than one numbering system that use letters. If both systems begin with the same token, ambiguity can arise. This attribute can have the value "alphabetic" or "traditional". The default is "alphabetic". grouping-separator Specifies what character should be used as the group (e.g. thousands) separator. The default is the comma (,). grouping-size Indicates the number of digits that make up a numeric group. The default value is "3". Type Instruction, appears within a template. Defined XSLT, section 7.7 Gecko support Partial support. See comments above. ...
For Further Reading - XSLT: Extensible Stylesheet Language Transformations
amples. http://www.amazon.com/Xslt-Doug-Tidwell/dp/0596000537 Learning XML, Second Edition Author: Erik T. Ray Length: 432 pages Publisher: O'Reilly Media; 2 edition (September 22, 2003) ISBN: 0596004206 As the title indicates, this is an overview of XML generally. Chapter 6 is devoted specifically to XSLT. ...
Caching compiled WebAssembly modules - WebAssembly
d to a different URL. The URL of the wasm module you want to instantiate. An import object, if required. const wasmCacheVersion = 1; instantiateCachedURL(wasmCacheVersion, 'test.wasm').then(instance => console.log("Instance says the answer is: " + instance.exports.answer()) ).catch(err => console.error("Failure to instantiate: " + err) ); You can find the source code for this example on GitHub as indexeddb-cache.html (see it live also). Browser support At the moment, this technique will work in Firefox and Edge, as they both have support for structured cloning of WebAssembly modules. Chrome has support implemented behind the WebAssembly structured cloning support flag, but is yet to turn it on by default because of some concerns (see this discussion, for example). Safari is stil...
Exported WebAssembly functions - WebAssembly
tance via Instance.exports. Either way, you get the same kind of wrapper for the underlying function. From a JavaScript point of view, it's as if every wasm function is a JavaScript function too -- but they are encapsulated by the exported wasm function object instance and there are only limited ways to access them. ...
Compiling from Rust to WebAssembly - WebAssembly
ur library is written, let's build it. Compiling our code to WebAssembly To compile our code correctly, we first need to configure it with Cargo.toml. Open this file, and change its contents to look like this: [package] name = "hello-wasm" version = "0.1.0" authors = ["Your Name <you@example.com>"] description = "A sample project with wasm-pack" license = "MIT/Apache-2.0" repository = "https://github.com/yourgithubusername/hello-wasm" [lib] crate-type = ["cdylib"] [dependencies] wasm-bindgen = "0.2" Fill in your own repository and use the same info that git uses for the authors field. The big part to add is the stuff at the bottom. The first part -- [lib] -- tells Rust to build a cdylib version of our package; we won't get into what that means in this tutorial. For more, consult the Ca...
Converting WebAssembly text format to wasm - WebAssembly
format. To start with, make a copy of the above listing inside a text file; call it simple.wat. We need to assemble this textual representation into the assembly language the browser actually reads before we can use it. To do this, we can use the wabt tool, which includes compilers to convert between WebAssembly's text representation and wasm, and vice versa, plus more besides. Go to https://github.com/webassembly/wabt -- follow the instructions on this page to set up the tool. Once you've got the tool built, add the /wabt/out/clang/Debug directory to your system PATH. Next, execute the wat2wasm program, passing it the path to the input file, followed by an -o parameter, followed by the path to the output file: wat2wasm simple.wat -o simple.wasm This will convert the wasm into a ...
Compiling an Existing C Module to WebAssembly - WebAssembly
to take the existing ecosystem of C libraries and allow developers to use them on the web. These libraries often rely on C's standard library, an operating system, a file system and other things. Emscripten provides most of these features, although there are some limitations. As an example, let's compile an encoder for WebP to wasm. The source for the WebP codec is written in C and available on GitHub as well as some extensive API documentation. That's a pretty good starting point. $ git clone https://github.com/webmproject/libwebp To start off simple, expose WebPGetEncoderVersion() from encode.h to JavaScript by writing a C file called webp.c: #include "emscripten.h" #include "src/webp/encode.h" EMSCRIPTEN_KEEPALIVE int version() { return WebPGetEncoderVersion(); } This is a good si...
WebAssembly
bassembly-examples repo for a number of other examples. Specifications Specification Status Comment WebAssembly JavaScript Interface Working Draft Initial draft definition of the JavaScript API. Browser compatibility The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. DesktopMobileServerChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.jsWebAssemblyChrome Full support 57Edge Full support 16Firefox Ful...