jQuery: Uncaught TypeError: url.indexOf is not a function

I got the “url.indexOf and e.indexOf is not a function” errors on my website. I got this error after my upgrade to my Magento webshop, but this error can happen on any website with a jQuery version upgrade. Error: Uncaught TypeError: e.indexOf is not a function at w.fn.load (jquery-3.3.1.min.js:2:82468) at caribbean-montego-mntgo-shell:1483:19 at Object.execCb (require.js:1696:33) at … Read more

Base64 encode/decode in Nodejs and Javascript

This article shows how you can base64 encode and decode string using both Nodejs and Javascript. Javascript: Base64 encode/decode string Encode String btoa() function creates a base-64 encoded ASCII string from the given String object. var encodedData = window.btoa("Hello World!"); console.log(encodedData); // output: SGVsbG8gV29ybGQh Decode String atob() function decoded the base-64 encoded string. var encodedData … Read more

Javascript: Set object & Loop

A Set object holds the unique values of any type like array or object. An array or any other iterable object can be passed to Set. – It’s a new data structure introduced in JavaScript ECMAScript 6 (ES6). – It has useful methods for iteration over the Set values. var mySet = new Set(); mySet.add(11); … Read more

Javascript: Map object & Loop

A Javascript Map object holds the key-value pairs of elements. An array or any other iterable object can be passed to the Map. – Map is a new data structure introduced in JavaScript ES6. – It’s an alternative to JavaScript Object for storing key/value pairs. – It has useful methods for iteration over the key/value … Read more

Javascript: Object & Loop

This article deals with creating a Javascript object and using different functions on the object. We also see how we can loop through the object and get the values. Create a new Javascript Object var myObject = { fruit: 'apple', flower: 'rose', vegetable: 'cabbage' }; console.log(myObject); // {fruit: "apple", flower: "rose", vegetable: "cabbage"} Access elements … Read more

Javascript: Check if a variable is an Array

This article shows how you can check if a Javascript variable is of an Array type. There are different ways to check if a variable is an Array in Javascript. 1) First way // define an array var myArray = [11, 'John']; console.log(Object.prototype.toString.call(myArray)); // [object Array] // check if the variable is an array if … Read more

Javascript: Check if a variable is an Object

This article shows how you can check if a Javascript variable is of an Object type. There are different ways to check if a variable is an Object in Javascript. 1) First way // define an object var myObject = {id: 11, name: John} console.log(Object.prototype.toString.call(myObject)); // [object Object] // check if the variable is an … Read more

Javascript: Multi-dimensional Array & Loop

This is a beginner tutorial on working with Javascript multi-dimensional arrays and looping through them. Javascript Array is a list-like object. It is used to store multiple values in a single variable. This article deals with creating a multi-dimensional Javascript array and using different functions on the array. We also see how we can loop … Read more

Javascript: Array & Loop

This is a beginner tutorial on working with Javascript arrays and looping through them. Javascript Array is a list-like object. It is used to store multiple values in a single variable. This article deals with creating a Javascript array and using different functions on the array. We also see how we can loop through the … Read more