Found 9054 Articles for Front End Technology

What is JavaScript AES Encryption?

Lokesh Badavath
Updated on 21-Nov-2022 14:54:35

11K+ Views

In this article, we are going to learn what is JavaScript AES Encryption. AES is an algorithm developed for the encryption of data. AES uses the same key to encrypt and decrypt data, called the symmetric encryption algorithm. AES encryption is Advanced Encryption Standard (AES) to encrypt the data in the application. We use the JavaScript library Forge to perform AES encryption. These algorithms are used in different communication apps such as WhatsApp, Signal, etc. The third-party user cannot be able to decrypt the message, and when the message is reached the destination receiver endpoint, it is decrypted using the ... Read More

How to get the body's content of an iframe in JavaScript?

Lokesh Badavath
Updated on 21-Nov-2022 10:57:03

18K+ Views

We use getIframeContent(frameId), to get the object reference of an iframe in JavaScript. To get the element in an iframe, first we need access the element inside the JavaScript using the document.getElementById() method by passing iframe id as an argument. Using iframetag The tag in HTML specifies an inline frame. This inline frame is used to embed another document within the current HTML document. The element is supported in every browser like (Google Chrome, Microsoft edge/ internet explorer, Firefox, safari, and opera). We are using srcdoc attribute in tag to specify the HTML content of ... Read More

Is their a negative lookbehind equivalent in JavaScript?

Ankith Reddy
Updated on 24-Jun-2020 06:45:12

52 Views

For a negative look-behind in JavaScript, use the following −(^|[^\])"To replace double quotes, you can use the following −str.replace(/(^|[^\])"/g, "$1'")

How to read data from *.CSV file using JavaScript?

Lokesh Badavath
Updated on 08-Sep-2023 23:20:20

35K+ Views

In this article, we are going to learn how to read data from *.CSV file using JavaScript. To convert or parse CSV data into an array, we need JavaScript’s FileReader class, which contains a method called readAsText() that will read a CSV file content and parse the results as string text. If we have the string, we can create a custom function to turn the string into an array. To read a CSV file, first we need to accept the file. Now let’s see how to accept the csv file from browser using HTML elements. Example Following is the example ... Read More

How to understand JavaScript module pattern?

Lokesh Badavath
Updated on 18-Nov-2022 12:05:07

140 Views

In this article we are going to learn how to understand JavaScript module pattern. The Module pattern is used to copy the concept of classes, so that we can store both public and private methods and variables inside a single object. Since JavaScript doesn’t support classes, similar to classes that are used in other programming languages like Java or Python. Why use modules? Maintainability − A module is self-contained and aims to lessen the dependencies, so that it can grow and improve independently. Name spacing − In JavaScript, variables outside the scope of a top-level function are global. Because ... Read More

How to convert the image into a base64 string using JavaScript?

Arjun Thakur
Updated on 24-Jun-2020 06:36:26

452 Views

To convert the image into a base64 string using JavaScript, use the FileReader API. You can try to run the following code to get base64string for an image −Example                    function toDataURL(url, callback) {             var httpRequest = new XMLHttpRequest();             httpRequest.onload = function() {                var fileReader = new FileReader();                   fileReader.onloadend = function() {                      callback(fileReader.result);                   }                   fileReader.readAsDataURL(httpRequest.response);             };             httpRequest.open('GET', url);             httpRequest.responseType = 'blob';             httpRequest.send();          }          toDataURL('https://www.tutorialspoint.com/videotutorials/images/tutor_connect_home.jpg', function(dataUrl) {          document.write('Result in string:', dataUrl)       })          

How to fix Array indexOf() in JavaScript for Internet Explorer browsers?

Ramu Prasad
Updated on 24-Jun-2020 06:37:02

313 Views

To fix Array.indexOf() for Internet Explorer web browser, use the following −jQuery.inArray( value, array [, fromIndex ] )Add the following,

How to iterate a JavaScript object's properties using jQuery?

Lokesh Badavath
Updated on 18-Nov-2022 12:00:20

1K+ Views

In this article, we are going to learn how to iterate a JavaScript object’s properties using jQuery. The simplest way to iterate over an object with JavaScript is to use a for in loop. The for statement will iterate over the objects as an array, but the loop will send the key to the object instead of an index as a parameter. This loop is used to iterate over all non-Symbol iterative properties of an object. The hasOwnProperty() method can be used to check if the property belongs to the object itself. The value of each key of the ... Read More

How to work with JavaScript Drag and drop for touch devices?

Lokesh Badavath
Updated on 18-Nov-2022 11:54:51

4K+ Views

In this article, we are going to discuss how to work with JavaScript Drag and drop for touch devices in JavaScript. Using JavaScript, we can only drag an image and some text. To drag an image, we simply hold the mouse button down and then move it. To drag the text, we need to highlight some text and drag it in the same way as image. HTML5 specifies almost all elements can be draggable. To make an element draggable, we add the draggable property with the value of true to its HTML element tag. Syntax Following is the syntax ... Read More

How to secretly copy to clipboard JavaScript function in Chrome and Firefox?

Lokesh Badavath
Updated on 18-Nov-2022 11:47:34

856 Views

In this article we are going to try how to secretly copy a JavaScript function to the clipboard. We use the copytext() method to secretly copy JavaScript function to the clipboard. These functions work on JavaScript console as well. To understand better let’s look into the examples one by one. Example Following is the example program we used copyText() method to copy text to clipboard using JavaScript function. Copy text ... Read More

Advertisements