Wait for Multiple AJAX Requests to Finish
Waiting for multiple simultaneous AJAX requests to be finished has become quite easy by using the concept of Promises. We change each AJAX call to return a Promise. Promises from all AJAX calls are then passed to the Promise.all() method to find when all Promises are resolved.
March 29, 2021
Date & time for a given IANA timezone (such as America/Chicago, Asia/Kolkata etc) can be found by using the Date.toLocaleString() method.
March 27, 2021
March 24, 2021
This tutorial discusses two ways of removing a property from an object. The first way is using the delete operator, and the second way is object destructuring which is useful to remove multiple object properties in a single line of code.
March 22, 2021
Play, Pause & Restart CSS Animations
Playing & pausing a CSS animation can be done by using the animation-play-state property. Completely restarting the animation can be done by first removing the animation and then applying it again.
March 12, 2021
CSS Animation on Element Dynamically Inserted to DOM
Animation can be done on an element which is dynamically inserted to page using CSS animation property. This property allows to give an initial and the final state of an element, and perform an animation between those states.
March 10, 2021
The append() & prepend() methods can be used to insert HTML string inside a given element. Both methods parse given HTML string as text and create Text node.
February 25, 2021
Using External CSS Stylesheets for Custom Elements
While creating a custom element, it is perfectly fine to use an external stylesheet for defining the element's CSS.
February 16, 2021
Check If Custom Element is Registered in Page
The customElements.get() method can be used to check whether a given custom element has already been registered in the page..
February 11, 2021
Knowing When a Custom Element Gets Defined
The customElements.whenDefined() method can be used to know when a given custom element has been registered.
February 10, 2021
Creating a Custom Element Using Anonymous Class
While creating a new custom element, it is not necessary to give a name to the defining class. The custom element can be created using an anonymous class also.
February 3, 2021
Naming Rules for Custom Elements
A custom element's tag name must contain a dash character. The name must start with a lowercase ASCII character, and cannot have an uppercase ASCII character anywhere.
February 2, 2021
How to Create a HTML Custom Element
A custom element is a new HTML element that we can create ourselves. This tutorial explains how to create a simple custom element.
January 28, 2021
We can detect whether an element has been removed DOM using the MutationObserver object. This provides the ability to observe for changes being made to the DOM tree.
January 13, 2021
We can detect if an element has been added to DOM using a MutationObserver object. This provides the ability to observe for changes being made to the DOM tree.
January 12, 2021
There is no direct method to find out the maximum resolution supported by the camera. Instead we can specify the required width & height using the ideal property to find the closest possible resolution.
January 9, 2021
Videos can be recorded from the user camera using MediaDevices & MediaRecorder APIs.
January 7, 2021
Uploading Canvas Image to a Server
Canvas images can be uploaded to server-side as a data URL string, base64 string or as a file.
January 4, 2021
January 2, 2021
Replacing All String Instances With replaceAll()
December 26, 2020
Pan / Tilt / Zoom Support for Camera in getUserMedia()
Intersection Observer Now Also Accepts a Document as the Root Element
Better Caching With stale-while-revalidate Directive in Cache-Control Header
Synchronous AJAX Will Not Work in Page Dismissal Events