JavaScript Template element

2021 VietMX 0

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 […]

JavaScript Shadow DOM

2021 VietMX 0

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 […]

JavaScript animations

2021 VietMX 0

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 […]

JavaScript IndexedDB

2021 VietMX 0

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. […]

JavaScript LocalStorage, sessionStorage

2021 VietMX 0

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) […]

JavaScript Server Sent Events

2021 VietMX 0

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 […]

JavaScript WebSocket

2021 VietMX 0

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 […]

JavaScript Long polling

2021 VietMX 0

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 […]

Resumable file upload

2021 VietMX 0

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 […]

JavaScript XMLHttpRequest

2021 VietMX 1

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 […]

JavaScript URL objects

2021 VietMX 0

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 […]

JavaScript Fetch API

2021 VietMX 0

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: […]

JavaScript Fetch: Abort

2021 VietMX 1

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 […]

JavaScript Fetch: Download progress

2021 VietMX 0

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, […]