Currently browsing Methods, Events and Scopes

Tuesday, May 17, 2022

How to Optimize a Theoretical Funnel Page Load Speed

Here’s a quick snippet to preload the next step in a theoretical funnel/workflow: PHP JavaScript

Tuesday, May 17, 2022

Numerical Integration Using JavaScript

This is a quick reminder on how to use mathematical functions inside JavaScript. Instructions Use * to indicate multiplication: Type…

Tuesday, May 17, 2022

Random JavaScript Tutorials

I needed some structural updates for a site, and among them, I added some JavaScript snippets. I will show you…

Tuesday, May 17, 2022

How to declare a global variable inside a jQuery function

A Javascript global variable is a variable with global scope, meaning that it is visible and┬áaccessible throughout the program, unless…

Monday, May 16, 2022

How to execute code for X visits

This JavaScript will let you execute code a certain number of times. For example, you might want to only show…

Friday, April 8, 2022

JavaScript shortcuts for TRUE and FALSE

Here’s a neat trick if you’re into micro-optimization. JavaScript compressors and minifers are used to make JavaScript code smaller and,…

Monday, April 26, 2021

­čŹ¬ 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…

Thursday, August 22, 2019

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…

Tuesday, July 9, 2019

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, July 8, 2019

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…

Sunday, September 30, 2018

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…

Saturday, September 29, 2018

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…