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

Magento 2: Show Calendar/DatePicker & Date-Range Field in Custom Form

This article shows how you can add a calendar or date-picker field in any custom form in Magento 2. I will be showing three different ways of adding date picker in the template file (.phtml) in Magento 2. 1) using calendar widget 2) using datepicker widget 3) using datetimepicker widget I will also show how … Read more

Node.js: Include another JS, ENV, JSON file in the app

This article shows how you can include another JS (Javascript) file into your main application JS file. We can have a situation where we store configuration settings or database settings in another file. It can be .js, .env, .json or any other file. We will be using module.exports object to achieve this. I have created … Read more

Node.js: Using Async/Await Function to Avoid Promise Chaining & Callback Hell

This article shows how you can use Async/Await function instead of Callback functions or Promise while writing the synchronous programming code in Node.js. Node.js is asynchronous/non-blocking in nature. If we want to execute certain code only after the execution of another code then we can use Callback functions. However, there can be a need of … Read more

Node.js: Using Promise to Avoid Callback Hell

This article shows how you can use Promise instead of Callback functions while writing the synchronous programming code in Node.js. Node.js is asynchronous/non-blocking in nature. If we want to execute certain code only after the execution of another code then we can use Callback functions. However, there can be a need of using nested callback … Read more

Node.js: Using Callback Functions for Synchronous Programming

Node.js code is asynchronous in nature. This article shows how you can use callback function in Node.js for synchronous programming. I have written an article with examples on synchronous and asynchronous programming in Node.js. Here’s the link: Node.js: Asynchronous & Synchronous Code Programming In the callback method, you simply pass a function as a parameter … Read more

Node.js: Asynchronous & Synchronous Code Programming

Node.js is asynchronous in nature. The Node.js APIs are asynchronous or non-blocking. The long-running operations/APIs in Node.js are non-blocking. In Node.js: – The server never waits for any operation to complete and return the data. – The server moves to the next API/operation after calling it. – The response of the previous API call is … 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