Category "javascript"

Resizing THREE.js Object using HTML div

I have two divs that I want to place side-by-side, and one of them contains my THREE.JS window/canvas. Basically, I don't want the THREE.js to take up the entir

OpenSea Error - Please use providerUtils.standardizeOrThrow()

I'm having trouble using the openseas.js library. I'm trying to do a getAsset call on a random asset on openseas I found, but I keep getting Error: DEPRECATED:

I am getting "AssertionError: Expected transaction to be reverted with Username " when I am testing my solidity code

When I am running npx hardhat test on the below smartcontract I am getting AssertionError: Expected transaction to be reverted with Username is taken please try

Error in Jest Test with Vanilla Javascript: expect(jest.fn()).toBeCalledWith(...expected) Expected: "click", Any<Function> Number of calls: 0

Looks like click method is not getting triggered I have tried evreything, it would be appreciated if someone knows the answer I'm getting this error: expect(jes

Can this search bar autosuggest by any word?

The search bar only suggest results by the first letter of the first word, can i make it suggest by de contains of the result that I'm looking for, for example

How to expose any API globally on Node

I have a web development framework which I use on personal backend projects. All web apps revolve around my framework and the API is quite big so importing it i

How to use the JSON response from a Python App, To render it with Javascript on to an HTML page using Fast API? [duplicate]

I have an HTML page being rendered with FastAPI: @app.get("/index", response_class=HTMLResponse) def write_home(request: Request): return t

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