How to Know when an Element Gets Visible in the Screen During Scrolling
Previously finding whether an element has entered the screen used to be a pain, but the new Intersection Observer API makes this quite easy, and less error prone.
Using the Reviver Function in JSON.parse
JSON.parse accepts an optional second parameter - the reviver function. The purpose of this function is to modify the result before returning, and can be thought of as filter function.
Displaying 360-Degree Photos & Videos on Websites using Google VR View
360-degree photos and videos really give an enhanced user experience. They can be embedded in web pages using Google VR Javascript SDK.
Creating Modal Dialog and Lightbox Becomes Easier with HTML <dialog> Tag
The new <dialog> tag makes it easier to create dialogs and lightboxes. With Javascript you can also call methods to open the dialog or close it, or know when the dialog was closed.
Detecting when an Element Becomes Fixed in CSS position:sticky with an Intersection Observer
Creating an element which would become fixed during scrolling has become very easy with CSS position : sticky. And with the new Intersection Observer API, it can be detected when an element comes in/out of sticky position.
How to Change Screen Orientation with Javascript
Changing screen orientation becomes somewhat necessary in some cases, like playing HTML5 games in the browser. Screen orientation can be changed and locked using the new Screen Orientation API.
Handling Uncatched Promise Rejections in Browser
Modern browsers have brought forward the unhandledrejection event. This is fired when a Promise is rejected, but there is no rejection handler function implemented in the code.
Loading CSS Files with Javascript
Loading external CSS files with Javascript is beneficial because it improves the loading time of the page.
Loading External Javascript Files with Javascript
Loading Javascript files dynamically is beneficial because it improves the loading time of the page. It can be done by appending a new script tag in the html.
Offline / Online Detection with Javascript
With a lot of stress on "offline mode for web applications", applications need to know when the user has gone offline. They also need to know when the user comes back online again.
Text to Speech with Javascript
In modern browsers text to speech feature is built natively in them. This means that you don't need external plugins or APIs to convert text to speech !
How to Enable Annotations in PDF.JS
Annotations data, such as links, can be shown in the rendered PDF canvas using getAnnotations and PDFJS.AnnotationLayer.render methods.
How to Enable Text Selection in PDF.JS
By default PDF.JS does not enable text selection in rendered PDFs. To enable text selection, another method needs to be called that renders the PDF text in a separate text layer.
Creating a Simple HTML Editor with Javascript
This tutorial shows how you can create a simple WYSIWYG HTML editor with Javascript, somewhat like a mini version of the famous TinyMCE HTML editor.
Javascript - Previewing PDFs During Upload
The very useful PDF.JS library makes it possible to show a preview of the PDF before uploading to server.
Javascript - Previewing Images During Upload
Showing a preview of the image before being uploaded to server provides a good user experience. You can show a preview image using the URL.createObjectURL method on the selected file.
The Useful <time> HTML Element
The time tag defines date and time in a HTML document. This tag is helpful in making the markup more structured, so that it becomes easier for machines to interpret the page.
Manipulation of HTML Select Element with Javascript
This tutorial explains how you can perform common operations on select element with vanilla Javascript - adding/deleting options or getting/setting the selected options.
Pure Javascript - Replacing an Element
replaceChild and replaceWith methods can be used to replace an element with pure vanilla Javascript.
How to Change URL Parameters with Javascript
This tutorial explains how you can change url parameters - edit, add or delete, using the URL and URLSearchParams objects.