Category "javascript"

How to generate RSA PKCS5 keypair in Javascript?

I need to create a set of RSA keys (public+private) on the client (javascript), send it to the server (Ruby) that uses those keys to encrypt data, which is sent

Dynamic Text under Product Price on Product page in case a variation is selected

How can I create a text A under the product price on the product page in case a variation is not selected. When a variation is selected I would like to have ano

is there any difference between this commands to install webpack? "npm install webpack webpack-cli --save-dev" & "npm install -D webpack webpack-cli "

Hello everyone I´m learning about webpack and i saw this two ways to install it, I was wondering if there is any difference between this two ways: this on

How do I validate user in reCAPTCHA v3 in react.js?

I am using the library "react-google-recaptcha-v3" for reCAPTCHA in React. I have a SignUp component, which essentially is something along the lines of a form w

How to add key value pair in array of Mongoose response in JavaScript

I tried to do basic things. I have an array that contains multiple objects. I want to add new key-value pair in every array object. I tried this by following co

How to remove loader GIF after image load with JavaScript

Can anyone tell me why I'm unable to detect the load event on this image element and set the loading GIF to display: none? I'd like to set the div with the load

Communication between multiple users of one extension

I am planning on building an chrome extension that would allow 2+ users communication on different devices. Basically one user would fill out the textarea and s

Google Sheets- How to Clear, Zero Out, or Replace Specific Cells Efficiently Via Script

This is three similar actions needed in one sheet. Hopefully this ends up being a useful question in general. I have a script that copies the values of arbitrar

How to get 2 filepond instance with 2 different settings

I want to be able to upload a profile picture as well as a banner picture on the same page. When I configure filepond in 2 separate elements it adds the options

Uncaught (in promise) Error: Invalid hook call. - SPECIAL CASE

I know that hooks cannot be called from functions other than React Functional Components, this is a bit different. I have created some utility/service type func

Tailwind CSS classes not updating after initial build of react app

I decided to bite the bullet today and upgrade from tailwind v2 to v3 for my react app. The upgrade went well, but I now have a problem where after I run "npm s

How to escape apostrophes using NodeJS

I'm trying to update a column in my PostgresQL database using Nodejs: res.rows.forEach((tmdbID) => { (async () => { const json = await fetchMovieDat

How to close all accordion panels on window resize?

My accordion is designed have multiple panels open when the window is greater than 992px. When the window is less than 992px, then only one panel will open at a

Typescript SyntaxError: Cannot use import statement outside a module (side file containing functions)

I am creating a minecraft bot using mineflayer library. After a bit of work I decided to make code readable and reusable (image of file organisation) and also s

Cannot properly concat to an array in ReactJS when using useState hook

I have a button that increments a vote counter whenever it is clicked, however I am having trouble implementing it. When I first click the Vote button, the func

Unable to get central Device Name via Web-Bluetooth API

I am trying to fetch the central device name where central is Javascript based web-app and pheripheral is Nano ble 33. I am using web-bluetooth API and I am abl

Here I add a question.I want to add spinnner ..how can i add spinner in this code

import axios from 'axios'; import React, { useEffect, useState } from 'react'; import { useAuthState } from 'react-firebase-hooks/auth'; import auth from '../..

Firefox extension DOM change weird behaviour

It's my first time trying to learn Firefox extension development. To get started, I'm trying to make a simple extension that alters some parts of the youtube.co

JavaScript: match a word in a text with a word in array and replace it

I need to change this text: var text = `this is an example text. 1coffee , 2 coffee , 1 apple, 2apple , ?banana ,carrot`; using these 2 arrays : var arrOld = [

Leaflet.js Polyline from an array of LatLng points - remove/hide part of points connection based on distance

I'm new in Leaflet and I need to add a red polyline using an array of LatLng points like var latlngs = [ [45.51, -122.68], [37.77, -122.43], [34.04, -118.2] ];