Currently browsing JavaScript

Monday, July 9, 2018

Building a Simple Tab Strip using Vanilla JavaScript

I recently developed a simple tab strip using only HTML, CSS, and vanilla JavaScript. The script does not require any…

Wednesday, July 4, 2018

Convert jQuery.get() to Vanilla JavaScript

In the latest iteration of my YouTube Playlist Player plugin, I decided to remove all jQuery dependencies. I replaced the…

Monday, June 25, 2018

How to Compare Version Numbers in JavaScript

The basic idea to make this comparison would be to get arrays of parts from the version numbers and then compare pairs…

Thursday, June 21, 2018

DOM ready functionality using vanilla JavaScript

This is a reliable way of checking for DOM ready. The first version uses a procedural function, while the second…

Tuesday, May 29, 2018

DragonflyJS – Vanilla JavaScript Drag and Drop

DragonflyJS is a tiny vanilla JavaScript library that enables sorting (dragging and dropping) functionality with zero dependencies.

Thursday, May 24, 2018

How to Implement jQuery slideToggle() in Vanilla JavaScript

If you use jQuery for a handful of effects/animations, here’s a quick JavaScript replacement for jQuery slideToggle(). With small changes,…

Friday, May 18, 2018

How to Create a GDPR Modal Popup Using RoarJS

The script below will check for a localStorage variable, which is the explicit user consent. If the variable exists, the…

Wednesday, May 9, 2018

RoarJS – JavaScript Alert/Confirm Replacement

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 25, 2018

How to replace jQuery.ajax() with vanilla JavaScript in WordPress

In an effort to remove all jQuery dependency from one of my plugins, I decided to turn all jQuery.ajax() requests…

Monday, April 16, 2018

Useful JavaScript String Prototypes

This is a function to remove all double whitespaces and preceding line breaks. This is a function to replace all line…

Thursday, April 12, 2018

In Case You Missed It – My CodePen Snippets, Experiments and Code Samples

This post is an assortment of JavaScript snippets, experiments and code samples created for various projects. They are pretty small…

Wednesday, April 11, 2018

How to Create an Internationalisation System Using JavaScript

Creating an i18n system in JavaScript can be tricky. The most popular option is to use global variables, but it…