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 5, 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 2, 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 21, 2019
December 19, 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
Time delay for setTimeout() / setInterval() methods executing on inactive browser tabs are set to one second regardless of their value defined in code.
December 15, 2019
When a fixed-position modal dialog is opened, scrollbars on the page can be removed by dynamically setting overflow:hidden CSS for the 〈body〉tag.
December 14, 2019
The Object.seal() method seals an object. After an object gets sealed, no new properties can be added to it.
December 11, 2019
The Object.freeze() method can make an object or array immutable. No changes can be made to that object once it gets immutable.
December 10, 2019
December 8, 2019
December 3, 2019
Numeric separators can be used to improve readability of large numbers. For example the number 111111111111111111111111, which is difficult to read, can be alternately written as 111_111_111_111_111_111_111_111
December 2, 2019
Sometimes we would like to detect when the subtitles change in the playing video. This can be done by listening to the cuechange event on the 〈track〉element.
November 29, 2019
It is very common to access current this context inside jQuery AJAX's response callbacks (success or error). This tutorial describes 3 ways of doing this.
November 28, 2019
The Page Visibility API can be used to check whether a browser tab is active or not, i.e. if the page is in view or hidden from view.
November 25, 2019
November 18, 2019
November 17, 2019
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