FLASH SALE Get 20% OFF everything using the coupon code: FLASH20 View WordPress Plugins →

Currently browsing JavaScript

Thursday, November 2, 2023

Random Imgur Images Using Vanilla JavaScript

I found this old code I used for an old forum a long time ago, and I decided to bring…

Monday, May 16, 2022

How to Add the Facebook Messenger Customer Chat to Your Site Using Google Tag Manager

Google Tag Manager is using its own Closure Compiler behind the scenes to compress the JavaScript and HTML code. It…

Monday, June 13, 2022

How and why I added a circle following my mouse pointer

I’ve seen this behaviour on several Russian sites, and it looked really slick, especially when the movement was delayed compared…

Monday, May 16, 2022

Switching From JavaScript to PHP for Browser Detection and Avoiding Core Web Vitals Penalties

In the light of the recently introduced Core Web Vitals, I decided to save some script start-up speed and switch…

Thursday, June 23, 2022

Experiment: JavaScript Boxed Carousel with Progress Indicator

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

How to Change Page Title Using JavaScript

This JavaScript will modify the text of the browser tab when a visitor focuses or unfocuses the tab. You can…

Monday, May 16, 2022

How to Populate OpenStreetMap with Foursquare Venues/Amenities

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

WordPress Responseless XHR Request Using JavaScript

A responseless XHR (POST) request is a request which does not require any user feedback, such as storing post views…

Monday, May 16, 2022

How to track and measure phone number views with JavaScript

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

How to show an outdated browser alert on Internet Explorer 11

Here’s a nice overview on why Internet Explorer 11 should be phased out and users blocked from viewing the site…

Monday, May 16, 2022

Native JavaScript hasClass()

These JavaScript snippets implement a native hasClass() function (inspired by jQuery and dubbed elementHasClass()), which checks if an element has…

Monday, May 16, 2022

How to extract a value from an element and, optionally, round it

This JavaScript snippet will extract a price from a DOM element, remove all alphanumeric characters, such as currency or symbols…