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

Currently browsing Methods, Events and Scopes

Tuesday, May 17, 2022

How to create a YouTube video cover using the YouTube Iframe API

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

How to Get and Set URL Parameters with JavaScript

This is an old script, which helped a lot with the initial phase launching a project on all browsers and…

Monday, May 16, 2022

How to Implement a Service Worker in Your Website and How to Create a Basic PWA

You definitely don’t need a plugin for this. Although there are plugins which help with creating a service worker and…

Monday, May 16, 2022

Cross-browser Query Parameter Getter and Setter

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

How to Autoplay a Video Element Using JavaScript

The latest Chrome version has stopped video autoplay if the video is not muted. Firefox and the other browsers will soon…

Monday, June 12, 2023

JavaScript Data Types

Every variable in JavaScript has a data type which dictates the values that can be stored in it. However, JavaScript…

Monday, May 16, 2022

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…

Monday, May 16, 2022

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…

Monday, May 16, 2022

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…

Wednesday, June 15, 2022

Promises in JavaScript

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

Custom Events in JavaScript MVC

Events are the bread and butter in UI development. They are frequently used to kick off JavaScript to deal with…

Tuesday, May 10, 2022

Cutting Loose: Dynamic Namespacing in JavaScript

Most of the JavaScript libraries come wrapped in an easy to refer single object. The object acts as a namespace,…