Found 8591 Articles for Front End Technology

How to locate the user's position in HTML?

Saba Hilal
Updated on 18-Apr-2023 15:19:08

405 Views

Sometimes, the task is to find the user’s current position and then to show the location coordinates on the webpage or show the location on a map. Using HTML and javascript code this process of getting the current location of the user in an HTML page is demonstrated in this article. This is shown by using two different examples. In the first example, the current location of the user can be fetched and then the location coordinates are displayed on the HTML page. In the second example, an open-source Leaflet map library is used to fetch and then display the ... Read More

How to load CSS files using JavaScript?

Saba Hilal
Updated on 18-Apr-2023 15:23:15

6K+ Views

Sometimes, the task is change the page themes and to use different CSS files on the same page content. In such tasks the need is to fetch a CSS and load it dynamically while selecting a theme. In this case the CSS file has to be accessed, loaded and even selected through a javascript program. Using HTML and javascript code this process of loading the CSS file is demonstrated in this article. This is shown by using two different examples. In the first example, a CSS file is selected on the windows load event. In the second example, two buttons ... Read More

How to load a hyperlink from one iframe to another iframe?

Saba Hilal
Updated on 18-Apr-2023 15:12:22

690 Views

Sometimes, the task is to click a link in one container and to display the content in another container. In HTML, iframes are used to easily show the content in specified area on the page. In this article, using two different examples, links are used to load an iframe using another iframe links. In example 1, the links in the upper Iframe are used to display two different pictures in the bottom iframe. In example 2, using the links in the upper iframe the video content is displayed both in the bottom iframe as well in the upper iframe. ... Read More

How to link back out of a folder using the a-href tag?

Saba Hilal
Updated on 18-Apr-2023 15:09:20

1K+ Views

Sometimes, the task is to fetch a page from a subfolder and then to come back to the page in the parent folder. Using HTML code this process of providing a link to back out of a folder using a tags and href tags is demonstrated in this article. This is shown by using two different examples. In the first example, a text link with a relative path is used for coming back to the page of parent folder. In the second example, tag with the SVG link is used to back out of a folder. In this second ... Read More

How to Update the State of React Components Using Callback?

Nikesh Jagsish Malik
Updated on 17-Apr-2023 16:10:21

4K+ Views

Updating the state of a React component is an essential part of building interactive and dynamic web applications. State management can become challenging as components become more complex and nested. This article will cover how to update the state of React components using callback functions, providing you with two different approaches and working examples to make your development process smoother. Algorithm Understand the state management in React components Choose the right approach for updating the state Implement the chosen approach with code and explanations Provide working examples to demonstrate the usage of the approach Conclude with the benefits of ... Read More

How to Switch CSS Class between Buttons Rendered with Map()?

Nikesh Jagsish Malik
Updated on 17-Apr-2023 16:09:11

321 Views

When building web applications, developers often need to create buttons with dynamic styles. One of the most efficient ways to do this is by using the map() method in JavaScript. This method allows you to render multiple buttons with different styles based on their data. However, sometimes you might want to change the CSS class of a button dynamically based on user interaction or other events. In this article, we will discuss two different approaches to switch CSS class between buttons rendered with map() in JavaScript. Algorithm The algorithm to switch CSS class between buttons rendered with map() involves the ... Read More

How to Send Axios Delete to the Backend ReactJS in JavaScript

Nikesh Jagsish Malik
Updated on 17-Apr-2023 16:06:15

4K+ Views

What is Send Axios Delete? Deleting data from a backend using ReactJS and Axios can be a challenging task. However, with the right approach and knowledge, you can easily achieve this task. In this article, we'll explore how to send an Axios delete request to the backend in ReactJS using JavaScript. We'll cover two different approaches with code and explanations, as well as two working examples. So, let's dive in! Algorithm To commence our discourse, it is of utmost importance to apprehend the procedure for transmitting an Axios obliteration entreaty to the back end when utilizing ReactJS. Here are the ... Read More

How do you make synchronous HTTP request in JavaScript?

Nikesh Jagsish Malik
Updated on 17-Apr-2023 16:01:26

9K+ Views

In the current digital terrain, the act of making HTTP requests is a vital component in transmitting and receiving data between the client and server. Asynchronous requests have gained prevalence as they provide a non-blocking experience, which ultimately enhances the overall user experience. Nevertheless, there are certain situations where synchronous HTTP requests may prove necessary or preferable. In the ensuing narrative, we shall delve into the algorithm for creating synchronous HTTP requests using JavaScript. We will also explore two distinct approaches with their corresponding code explanations and practical applications. Algorithm To initiate synchronous HTTP requests in JavaScript, one must execute ... Read More

Find quotient and remainder by dividing an integer in JavaScript

Nikesh Jagsish Malik
Updated on 17-Apr-2023 15:56:20

2K+ Views

Dividing an integer is a mathematical operation where we divide a number into two parts, the quotient, and the remainder. In JavaScript, we use this operation to perform various calculations and to get the desired result. In this article, we will discuss how to find the quotient and remainder by dividing an integer in JavaScript. Algorithm The algorithm for dividing an integer in JavaScript is straightforward. We divide the number into two parts, the quotient, and the remainder. The quotient is the result of the division, and the remainder is the part of the number that is left over after ... Read More

Find 1st January be Sunday between a range of years in JavaScript?

Nikesh Jagsish Malik
Updated on 17-Apr-2023 15:55:31

550 Views

It's always important to know when the 1st January falls on a Sunday in a range of years. This information can be used for various purposes, such as scheduling events, managing projects, and more. The purpose of this article is to help you find the 1st January falling on Sunday in a range of years in JavaScript. Algorithm The algorithm to find the 1st January falling on Sunday between a range of years involves several steps. The first step is to calculate the number of days between the current year and the year you want to find the 1st January ... Read More

Advertisements