Category: Displaying data

Recent Post

How to read and display a PDF using JavaScript

The native FileReader API can be used to read a PDF and create a URL to its contents.

Create a timestamp in JavaScript

The in-built Date() method can generate an accurate UNIX timestamp.

Getting and formatting date and time in JavaScript

Date and time objects created using the Date() constructor can be output in various formats.

Converting a number to a string with commas in JavaScript

How to print a number as a string with comma-formatting or other locale-specific styles.

Print the contents of a JavaScript object to the DOM

Printing a JavaScript object to the DOM is harder than you might think.

HTML Table of Contents Generator

A JavaScript solution for generating a table of contents for HTML content.

Detect a user’s language preference with JavaScript

Detect and use a user's language preference to format display values.

Currency formatting in JavaScript

How to convert a numeric values to a currency value using the native Internationalization API.

Lazy image and iframe loading using pure HTML

Just set the HTML 'loading' attribute to 'lazy' for images and iframes!

Create a live time display from different world cities

Create a ticking clock display for world cities using HTML, CSS and vanilla JS