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
List of nodes returned by querySelectorAll() can be looped through using the forEach() method of the returned NodeList object.
November 16, 2019
November 15, 2019
Options of a dropdown select element can be looped over its options property. This property gives a list of all option elements inside it.
November 13, 2019
November 10, 2019
Loading Disqus' script files and comments on page load can lower down speed and performance of the page, specially in mobiles. A solution would be to use an Intersection Observer to lazily load Disqus.
November 9, 2019
November 6, 2019
November 4, 2019
An anonymous async function can be defined using the Immediately-invoked Function Expression pattern for asynchronous functions.
November 2, 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