Currently browsing JavaScript

Monday, May 16, 2022

Carbon: Basic Syntax Highlighting with Zero Overhead Using JavaScript

If you have ever used PrismJS or CodeMirror or any other syntax highlighter solution, you’ll know it adds lots of…

Wednesday, May 8, 2024

How I Created My Homepage JavaScript Post Carousel

My homepage now features a JavaScript section of 4 featured posts. Notice the official JavaScript yellow colour? Here’s how I…

Monday, May 16, 2022

🍪 How to Expire localStorage Items and Replace Cookies

I don’t use 🍪 cookies anymore, I think they are too… rigid. I use localStorage items. By default, they don’t…

Monday, May 16, 2022

tail.select takeover and update

I have been using the tail.select library on 200+ WordPress websites for more than 2 years. That number is growing,…

Monday, January 15, 2024

tail.select

HTML Select Fields as beautiful as never before tail.select is back: Create beautiful, functional and extensive (Multi) Select Fields with…

Monday, May 16, 2022

How I added a neat effect in 30 lines using IntersectionObserver

This is something I’ve always wanted to add to my theme, but I was afraid of the impact on the…

Tuesday, December 5, 2023

How to Get and Set Query Parameters From URL

Here are two ways to get (and set) query parameters from URL. I’ll add some real life examples in order…

Wednesday, November 29, 2023

Thoughts on Instant Loading in WordPress

If you are familiar with the instant loading concept, you’ll know it’s about faster subsequent page loads by prefetching hovered…

Tuesday, August 2, 2022

How to Create a Price Range Slider Using Vanilla JavaScript

All JavaScript range sliders are hacks or workarounds. Because there’s no native HTML element for a range slider (only a…

Monday, May 16, 2022

How to Create a JavaScript Typewriter Using Vanilla JavaScript

This was done for a client, and I do not recommend it as it uses setTimeout(). Anything using setTimeout() or…

Monday, May 16, 2022

JSONify Dropdown Element Using Vanilla JavaScript

This function converts a regular <select> element both into an intented ul/li structure and JSON. It’s light and it’s been…

Monday, May 16, 2022

Drift Chat: Speed Up Your Page Loading Speed by 3-4 Seconds

Here’s a neat trick to speed up your initial page loading time when you are using Drift. If you use…