
JavaScript Template element
1. Overview A built-in <template> element serves as a storage for HTML markup templates. The browser ignores it contents, only checks for syntax validity, but we can […]
1. Overview A built-in <template> element serves as a storage for HTML markup templates. The browser ignores it contents, only checks for syntax validity, but we can […]
Shadow DOM serves for encapsulation. It allows a component to have its very own “shadow” DOM tree, that can’t be accidentally accessed from the main […]
1. Overview We can create custom HTML elements, described by our class, with its own methods and properties, events and so on. Once a custom […]
This section describes a set of modern standards for “web components”. As of now, these standards are under development. Some features are well-supported and integrated […]
JavaScript animations can handle things that CSS can’t. For instance, moving along a complex path, with a timing function different from Bezier curves, or an […]
CSS animations make it possible to do simple animations without JavaScript at all. JavaScript can be used to control CSS animations and make them even […]
Bezier curves are used in computer graphics to draw shapes, for CSS animation and in many other places. They are a very simple thing, worth […]
IndexedDB is a database that is built into a browser, much more powerful than localStorage. Stores almost any kind of values by keys, multiple key types. […]
1. Overview Web storage objects localStorage and sessionStorage allow to save key/value pairs in the browser. What’s interesting about them is that the data survives a page refresh (for sessionStorage) […]
Cookies are small strings of data that are stored directly in the browser. They are a part of the HTTP protocol, defined by the RFC 6265 specification. […]
1. Overview The Server-Sent Events specification describes a built-in class EventSource, that keeps connection with the server and allows to receive events from it. Similar to WebSocket, the connection […]
The WebSocket protocol, described in the specification RFC 6455 provides a way to exchange data between browser and server via a persistent connection. The data can be passed in […]
Long polling is the simplest way of having persistent connection with server, that doesn’t use any specific protocol like WebSocket or Server Side Events. Being […]
With fetch method it’s fairly easy to upload a file. How to resume the upload after lost connection? There’s no built-in option for that, but we have […]
XMLHttpRequest is a built-in browser object that allows to make HTTP requests in JavaScript. Despite of having the word “XML” in its name, it can operate […]
The built-in URL class provides a convenient interface for creating and parsing URLs. There are no networking methods that require exactly a URL object, strings are good enough. So […]
1. Overview So far, we know quite a bit about fetch. Let’s see the rest of API, to cover all its abilities. Please note: Please note: […]
If we send a fetch request to another web-site, it will probably fail. For instance, let’s try fetching http://example.com: Fetch fails, as expected. The core concept here is origin – […]
As we know, fetch returns a promise. And JavaScript generally has no concept of “aborting” a promise. So how can we cancel an ongoing fetch? E.g. if the […]
The fetch method allows to track download progress. Please note: there’s currently no way for fetch to track upload progress. For that purpose, please use XMLHttpRequest, we’ll cover it later. To track download progress, […]