Shubham Vora

Shubham Vora

793 Articles Published

Articles by Shubham Vora

Page 11 of 80

How to create own Ajax functionality?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 432 Views

An Ajax (Asynchronous JavaScript and XML) request is an HTTP request made using JavaScript, typically with the XMLHttpRequest object, to exchange data with a server and update a specific part of a web page without requiring full page refresh. There are two ways to create own Ajax functionality: using JSONPlaceholder API or your own file. Using JSONPlaceholder API JSONPlaceholder is a free online REST API that you can use to test and practice your development skills. Syntax Users can follow the below syntax for creating an Ajax request using JavaScript's "XMLHttpRequest" object. let xhr ...

Read More

Hot Reload in ElectronJs

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 5K+ Views

Hot reloading is a powerful feature in ElectronJS that lets developers quickly view their code changes in real time without having to restart the application. It makes the development process faster and more efficient by reducing the time and effort required to test changes. Steps to Implement Hot Reload in ElectronJS The hot reloading feature is implemented using a library called "electron-reload", and it can be easily integrated into an Electron JS application by following a few simple steps. Install the electron-reload module The first step in implementing hot reload in Electron JS is to install ...

Read More

How to stop refreshing the page on submit in JavaScript?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 95K+ Views

In this tutorial, we will learn how to prevent forms from refreshing the page when submitted in JavaScript. By default, form submission causes a page refresh, but there are several methods to override this behavior. Using event.preventDefault() to Stop Page Refresh The event.preventDefault() method is the most common and recommended way to prevent the default form submission behavior. Syntax form.addEventListener('submit', function(event) { event.preventDefault(); // Your custom form handling code here }); Example In this example, we create a simple contact form that prevents page ...

Read More

Why split the tag when writing it with document.write()?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 1K+ Views

In this tutorial, we will learn why to split the tag when writing it with the document.write(). The script tag in HTML is added to execute JavaScript code on the webpage. The JavaScript programs must be enclosed with the script tag to execute. There are many methods in JavaScript that add HTML content to the page, like the document.write() method. The document.write() method is used to delete all the content from the HTML tag or the document and add the content specified in this method to the page. Because of performance degradation and errors in certain conditions, ...

Read More

How to avoid jQuery function conflict with any other JavaScript library

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 1K+ Views

In this tutorial, we will learn how to avoid jQuery function conflict with any other JavaScript library. For the jQuery function, the $ symbol is simply an identifier. A $ followed by a selector indicates that it is a jQuery selector. It is given a shorter identification as $ to save time while writing longer syntax. It includes all of the functions needed by a jQuery object, such as animation(), show(), hide(), CSS, and many others. Furthermore, $ is superior in terms of memory to jQuery because $ takes a byte while jQuery uses 6 bytes for the same ...

Read More

How to use polyfill in JavaScript?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 2K+ Views

The developers of JavaScript always keep adding new features to the JavaScript language to improve performance and add better functionalities. Sometimes, it happens that new features don't support by the old browser versions. For example, the exponential operator is introduced in ES7, and the trailing comma in the object is also valid in ES7. Now, while developing the application, we have used the exponential operator in the application. It will work with the newer versions of the browser, but if someone is using a very old version of the browser, they can get errors like the exponential operator is ...

Read More

How to view array of a structure in JavaScript?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 459 Views

The easiest way to debug JavaScript code is using console.log(), which many developers use. Sometimes, we need to know an array's structure and stored values for debugging purposes. In this tutorial, we will learn to view the structure of arrays containing different data types. Various JavaScript methods allow us to examine the structure of arrays. For example, we can see if an array contains objects, nested arrays, strings, numbers, or Boolean values. Using the JSON.stringify() Method The JSON.stringify() method converts JavaScript objects into JSON strings. Since arrays are objects in JavaScript, we can use this method to ...

Read More

How to wait resize end event and then perform an action using JavaScript?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 3K+ Views

When resizing a browser window, the 'resize' event fires continuously during the resize operation. This can cause performance issues if you execute heavy JavaScript code on every resize event. The solution is to wait until the resize operation ends before performing any action. The most common approach is using setTimeout() and clearTimeout() to create a debounced resize handler that only executes after the user stops resizing. Syntax let timeoutId; window.addEventListener('resize', () => { // Clear the previous timeout clearTimeout(timeoutId); // Set a ...

Read More

How to wrap setTimeout() method in a promise?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 8K+ Views

The setTimeout() method executes code or functions after a specified delay in milliseconds. When working with promises, you can wrap setTimeout() to create delayed asynchronous operations that resolve or reject after a specific time period. In JavaScript, a promise is an object that represents the eventual completion of an asynchronous operation. Here, we will learn to resolve or reject promises after some delay using the setTimeout() method. Basic Promise Without setTimeout() First, let's see a basic promise that resolves immediately without any delay: Using Promises without setTimeout() method ...

Read More

How to write a cell phone number in an international way using JavaScript?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 769 Views

When you have visitors from worldwide on your websites, it is a good idea to show things like a cell phone number according to international standards. So they can easily understand. We can use the International Public Telecommunication Numbering Format to represent the cell phone number in an international way. Also, it is represented by the 'E-164' format. We have given the syntax below to follow to write a cell phone number in an international way. [+] [country code] [local phone number] Users can see that the international phone number contains '+' initially ...

Read More
Showing 101–110 of 793 articles
« Prev 1 9 10 11 12 13 80 Next »
Advertisements