Category "javascript"

Animation css for the last element added with js and Vue

I have an array in which I put all the elements that have the class Box, then I add a new div with Vue, which is added correctly, but I try that the last div th

how can i get the specific info about a user

i'm working on a web app in which a user can create an address when logged in, how can i get the current logged in user address which was created by the user th

TypeError: Cannot read properties of undefined (reading 'document')

I was using qraphql (JavaScript graphql-request library) in a project and ran into a typeError. Here's the code: import { request, gql } from 'graphql-request'

React Image Rendering using require()

I'm trying to render images in react using require(). Below is a snapshot of the code that is working. const ProjectBlock: React.FC<{ data: PROJECTBLOCK }>

Creating a pattern from a CSS-resized image and drawing it on a canvas

I'm working on an app that allows the user to select an image and define a custom clipping region for that image. The user can place blue dots on the canvas con

DiscordJS MessageManager is a circular dependency

I try to get a message by id in discord.js, but returned MessageManager is a circular dependency and I cannot access any of it's properties. console.log(cha

How i can get suspense to work on react 18?

Hello my code is as follow wnna try suspense with react 18 but not having luck to render Loading.... User.jsx import React, { useEffect, useState } from "re

Sort a list of products save in localstorage with JavaScript change event listener

I have saved a list of products in localstorgae and I want all my products to be displayed in descending order when I click on one of the combobox items con

Why are we offseting the pixels by 4 when updating colors?

var canvas = document.getElementById("canvas"); var canvas_context = canvas.getContext("2d"); var canvas_buffer = canvas_context.getImageData(0, 0, canvas.width

Props values are not updating in webpack server React js

Whenever I try to pass or update the props value from parent to child I need to restart the webpack server everytime. I don't know why props value are not getti

Send a jwt token in my SSE event source (subscribe request)

How can I send a jwt token (or a header (Authorization to be specific)) in my SSE subscription request (the event source)? void subscribe (String jwtToken) asyn

TypeError: Cannot destructure property 'image' of 'product' as it is null

I am unsure why I have this error. Could you please take a look and advise? import React from 'react'; import { client, urlFor } from '../../lib/client'; const

Chart.js v2 - Partial Y -grid lines with bar chart

I want tiny "ticks" on the x-axis as seen in the image in between the green bars, that go into the chart, but not all the way to the top of the chart. I have b

Convert JSON to different format using the javascript

I have the JSON please see below and I need help to convert changing the format mentioned below. I want to move the data to different columns (format mentioned

Sending a signed transaction is not working - Web3 / Node.js

I am trying to send an Ethereum transaction using a private key in Node.js using the web3 library. I have tried many pieces of code but I get the same issues ev

Draw curves over HTML table

Is it possible in JavaScript or Angular to use the mouse to draw quadratic curves over an HTML table's contents? The table contents have to remain editable, and

What’s the best way to reload / refresh an iframe?

I would like to reload an <iframe> using JavaScript. The best way I found until now was set the iframe’s src attribute to itself, but this isn&rsquo

Rails 7 Import Maps - import folder with custom scripts

playing around with Rails 7 and import maps. Trying to import a folder with some custom JS. # config/importmap.rb pin_all_from "app/javascript/custom", under: "

When we select todays date time is not showing

When we select todays date time is not showing. if we select the next days date the below mentioned times are showing. When we select todays date time is not

How to redirect to another page Reactjs/nextjs sending data with post

How can I send data using post I got this router.push({ pathname: "/investigacion-detalle", query: { data: JSON.stringify(salida),},