Thursday, June 23, 2022
Here's an awesome JavaScript carousel built for a client project, but then scrapped. It definitely has potential for unlimited items.…
Friday, June 3, 2022
This JavaScript will modify the text of the browser tab when a visitor focuses or unfocuses the tab. You can…
Monday, May 16, 2022
First of all, we need a Foursquare app and a client ID and secret. Head over to developer.foursquare.com and get…
Monday, May 16, 2022
A responseless XHR (POST) request is a request which does not require any user feedback, such as storing post views…
Monday, May 16, 2022
Use this tutorial to create phone number links and track/measure views. As phone numbers are clickable (and work) only on…
Monday, May 16, 2022
Here’s a nice overview on why Internet Explorer 11 should be phased out and users blocked from viewing the site…
Wednesday, April 30, 2025
These JavaScript snippets implement a native hasClass() function, which checks if an element has a certain class. A prototype approach…
Monday, May 16, 2022
This JavaScript snippet will extract a price from a DOM element, remove all alphanumeric characters, such as currency or symbols…
Tuesday, December 5, 2023
Here are 3 methods to hide an element using JavaScript. How to hide an element using JavaScript? Set native display…
Monday, May 16, 2022
I’ll just leave this here for reference purposes and I won’t explain any code, as it’s obsolete and I’m not…
Monday, May 16, 2022
Here’s a short tutorial on how to create a programmatic JavaScript tooltip. I needed this feature to recreate a product…
Tuesday, May 17, 2022
There’s an increasing trend of adding full-width (possibly full-height) YouTube video covers with autoplay. Using the YouTube Iframe API, this…
Monday, May 16, 2022
This is an old script, which helped a lot with the initial phase launching a project on all browsers and…
Wednesday, April 30, 2025
This quick tutorial will show you how to create a basic slider in less than 100 lines. The actual JavaScript…
Monday, May 16, 2022
You definitely don’t need a plugin for this. Although there are plugins which help with creating a service worker and…
Wednesday, April 30, 2025
This post has been superseded by How to Build a Vanilla JavaScript Slider in Less Than 100 Lines. The past…
Monday, May 16, 2022
Here’s a cross-browser compatible way of getting query parameter from a URL or setting query parameters and reloading the page. An…
Monday, May 16, 2022
The latest Chrome version has stopped video autoplay if the video is not muted. Firefox and the other browsers will soon…
Monday, May 16, 2022
Modern browsers allow you to define native dragging & dropping functionality with a graceful degradation for older/ancient browsers, such as…
Monday, May 16, 2022
This post covers the topic of passing arguments to external JavaScript files. I want to say up front that there…
Monday, June 12, 2023
Every variable in JavaScript has a data type which dictates the values that can be stored in it. However, JavaScript…
Monday, May 16, 2022
I recently developed a simple tab strip using only HTML, CSS, and vanilla JavaScript. The script does not require any…
Monday, May 16, 2022
In the latest iteration of my YouTube Playlist Player plugin, I decided to remove all jQuery dependencies. I replaced the…
Monday, May 16, 2022
The basic idea to make this comparison would be to get arrays of parts from the version numbers and then compare pairs…
Wednesday, April 30, 2025
This is a reliable way of checking for DOM ready. The first version uses a procedural function, while the second…
Tuesday, August 20, 2024
DragonflyJS is a tiny vanilla JavaScript library that enables sorting (dragging and dropping) functionality with zero dependencies.
Monday, May 16, 2022
If you use jQuery for a handful of effects/animations, here’s a quick JavaScript replacement for jQuery slideToggle(). With small changes,…
Monday, May 16, 2022
The script below will check for a localStorage variable, which is the explicit user consent. If the variable exists, the…
Wednesday, May 8, 2024
RoarJS is a wonderful, responsive, customisable, accessible (WAI-ARIA), zero-dependency, vanilla JavaScript alert/confirm replacement. RoarJS automatically centers itself on the page…
Wednesday, April 30, 2025
In an effort to remove all jQuery dependency from one of my plugins, I decided to turn all jQuery.ajax() requests…
Monday, May 16, 2022
This is a function to remove all double whitespaces and preceding line breaks. This is a function to replace all line…
Monday, May 16, 2022
Creating an i18n system in JavaScript can be tricky. The most popular option is to use global variables, but it…
Tuesday, October 24, 2023
Server-side pagination is needed when you have to display hundreds of records. You may fetch results from a database using…
Monday, May 16, 2022
In JavaScript, any variable can be used in a logical context, such as the condition of an if statement or…
Monday, May 16, 2022
JavaScript Object Notation, or JSON, is a plain text data interchange format. It is based on a subset of the third…
Tuesday, June 14, 2022
JavaScript Object Notation, or JSON, is a text format used to represent JavaScript objects as strings. Like other text formats,…
Monday, May 16, 2022
For years, developers have needed a method for adding their own metadata to HTML elements, but no standardized technique existed.…
Tuesday, May 10, 2022
Dealing with the DOM can be a very tedious process. Traversing the DOM can quickly clutter your code with nested loops. For…
Wednesday, June 15, 2022
Writing code in an async programming framework like node.js becomes super complex and unbearably ugly, superfast. You are dealing with…
Monday, February 27, 2023
Events are the bread and butter in UI development. They are frequently used to kick off JavaScript to deal with…
Tuesday, May 10, 2022
Most of the JavaScript libraries come wrapped in an easy to refer single object. The object acts as a namespace,…
Tuesday, May 10, 2022
Using image beacons is one of those popular techniques that you would probably know about without knowing its name. The technique helps…
Tuesday, May 10, 2022
I recently fully understood the concept of utilizing Currying in JavaScript. The core concept can be grasped from these references: Wikipedia entry on…
Tuesday, May 10, 2022
Never again use for() for looping. Using for() can be dangerous, especially if you use a library which adds attributes…
Tuesday, May 10, 2022
I needed a random string for various purposes. For example, to provide a unique ID to HTML elements via JavaScript.…
Wednesday, April 30, 2025
John Resig, the creator of jQuery, has created this JavaScript inheritance code. I am still using it now to simplify several…
Tuesday, May 10, 2022
In JavaScript OOP there are attributes called private attributes. Knowing if an attribute is private or public, an API user…
Wednesday, April 30, 2025
When it comes to developing APIs, self-documenting code is very important, as it simplifies the user’s effort in filtering the…