Currently browsing JavaScript

JavaScript
Ciprian on Thursday, May 24, 2018 — 1,780 Views

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 [...]

GDPR modal using RoarJS
Ciprian on Friday, May 18, 2018 — 582 Views

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 modal popup is not [...]

JavaScript Logo
Ciprian on Wednesday, May 9, 2018 — 971 Views

RoarJS – JavaScript Alert/Confirm Replacement

RoarJS is a wonderful, responsive, customisable, accessible (WAI-ARIA), zero-dependency, vanilla JavaScript alert/confirm replacement. [...]

JavaScript Logo
Ciprian on Wednesday, April 25, 2018 — 1,261 Views

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 into vanilla JavaScript [...]

JavaScript Logo
Ciprian on Monday, April 16, 2018 — 221 Views

Useful JavaScript String Prototypes

This is a function to remove all double whitespaces and preceding line breaks. /** * Prototype function to remove all double whitespaces [...]

JavaScript Logo
Ciprian on Thursday, April 12, 2018 — 341 Views

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 and [...]

JavaScript Logo
Ciprian on Wednesday, April 11, 2018 — 465 Views

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 is not best practice to [...]

JavaScript
Ciprian on Tuesday, March 27, 2018 — 4,277 Views

Client-Side JavaScript Pagination

🔥 Updated on May 4, 2021 to add a second solution, based on JSON data.Updated on August 30, 2019 to use the new ES syntax.Updated on May [...]

JavaScript Logo
Ciprian on Tuesday, March 20, 2018 — 216 Views

truthy and falsy in JavaScript

In JavaScript, any variable can be used in a logical context, such as the condition of an if statement or loop. Conditional expressions can [...]

JavaScript Logo
Ciprian on Tuesday, March 20, 2018 — 1,063 Views

A JSON Overview

JavaScript Object Notation, or JSON, is a plain text data interchange format. It is based on a subset of the third edition of the ECMA-262 [...]

JavaScript Logo
Ciprian on Tuesday, March 20, 2018 — 247 Views

Native Browser Support for JSON

JavaScript Object Notation, or JSON, is a text format used to represent JavaScript objects as strings. Like other text formats, JSON is not [...]

JavaScript Logo
Ciprian on Tuesday, February 27, 2018 — 316 Views

A Quick Introduction to Custom Data Attributes and Vanilla JavaScript

For years, developers have needed a method for adding their own metadata to HTML elements, but no standardized technique existed. One [...]

Privacy Policy