Posts

how to detect browser back and forward button clicks using Java Script

This code demonstrates how to detect browser back and forward button clicks using the History API and custom events. When the user interacts with the back or forward button, the corresponding custom event is fired, allowing you to handle specific actions in your application <!DOCTYPE html> <html lang="en"> <head>   <meta charset="UTF-8">     <meta http-equiv="X-UA-Compatible" content="IE=edge">     <meta name="viewport" content="width=device-width, initial-scale=1.0">     <title>Browser Back & Forward Identification</title> </head> <body>     <button id="btn"> <a href="#title">Click the link to change the URL</a></button>     <h2 id="title">How to detect browser back and forward button clicks</h2>     <p class="result"></p>     <script> if(window.history && histor

DACPAC Pros & Cons

The DACPAC (Data-tier Application Component Package) is a Microsoft SQL Server technology used for packaging and deploying SQL Server database schema and objects. It is specifically designed for SQL Server environments and is not applicable to other database platforms. Here's a list of its pros and cons:   Pros:     Version Control : Using GITHUB we can be able to control version management for database schema and objects, which helps in tracking changes over time and collaborating with team members effectively. Version control allows multiple team members to work on the same codebase simultaneously. Single source of truth: It ensures all the team members is working with the latest version of scripts and database objects. The version control enables developers to revert to a previous version if needed. The developers creating the same procedure for testing purposes in different names. While manually merging the procedure will affect the functionality which is already working

Understanding Asynchronous JavaScript

Image
Introduction One of the ideas in JavaScript that I think most beginners struggle with is asynchronous programming. I struggled to understand it as well. It took some time for me to finally grasp this notion, despite the fact that I saw a number of tutorials and read a lot about it. In order to make asynchronous JavaScript easy to comprehend for novices, I will do my best to describe it in this essay.   JavaScript is a single-threaded programming language which means only one thing can happen at a time. That is, the JavaScript engine can only process one statement at a time in a single thread. While the single-threaded languages simplify writing code because you don’t have to worry about the concurrency issues, this also means you can’t perform long operations such as network access without blocking the main thread. Imagine requesting some data from an API. Depending upon the situation the server might take some time to process the request while blocking the main thread maki

Convert Excel data into JSON using JavaScript

Image
This blog explains you how we can convert a JSON  from an uploaded Excel file to the browser.  Please follow the below steps to covert excel to json The first thing is getting the excel file from the user. We can do it using the  <input>  tag in HTML. It shows below. ( <input type=”file” id=”fileUploader” name=”fileUploader” accept=”.xls, .xlsx”/> ) Next we have to define what we are going to do when user upload the file. For that we are going to use the  change  event of the element above.   This is the important part. Now we are going to define what we want to do with the file uploaded. First, we have to read the file uploaded. In here we make an assumption that the user only uploading a one file. Next we are going to read that file data using a  FileReader.  From this FileReader we can read the data in our excel file as a binary string. Then we use  XLSX  which an inbuilt facility of  SheetJS js-xlsx  to convert our binary string into a JSON object. To use