Detecting an element for change in dimensions using JS can be done with the ResizeObserver interface. This is supported in all modern browsers.
May 11, 2020
May 9, 2020
May 4, 2020
Failed HTTP responses can be handled in fetch() by checking whether the returned Promise was rejected due to a network error. Subsequently the Response.ok property needs to be checked for an invalid HTTP status code.
April 28, 2020
A responsive slider / carousel can be created with CSS flexbox using the order property. Items can be repeated infinitely in a circular loop by changing the order property each time.
April 25, 2020
April 22, 2020
April 13, 2020
March 13, 2020
March 9, 2020
The newly introduced formdata event can enable the Javscript FormData object to participate in form submissions. When trying to submit a form via AJAX, this is helpful to include custom elements in the request.
February 3, 2020
January 15, 2020
January 13, 2020
The binary data of a local file selected by the user can be retrieved using the readAsBinaryString method of a FileReader object.
January 9, 2020
Without cookies being enabled in the browser, some web applications may not work as expected. To prevent such cases navigator.cookieEnabled property can be used to do a prior check whether cookies are enabled or not.
January 6, 2020
Browsers allow user-sensitive and low-level web APIs to execute only when the page is in a secure context. In addition, the window.isSecureContext property can be used to check whether the current environment is safe or not.
January 3, 2020
The Array.fill() method can be used to fill an array with a specific value, starting from a given index and ending upto another index.
December 22, 2019
December 20, 2019
December 18, 2019
The finally() callback can be used to know whether the Promise was settled. We don't care whether it was resolved or rejected.
December 17, 2019
December 16, 2019
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