Category "javascript"

Plaid - PAYMENT_STATUS_INPUT_NEEDED

I've got Plaid payment initiation working on my cart but for some reason, all payments have the status of "PAYMENT_STATUS_INPUT_NEEDED". Also, I can only get Pl

How to make whole html input type date field clickable for calendar popup?

In the HTML input type date field when we click on an icon, the calendar is popup. But I want to make it pop up when we click in the dd/mm/yyyy field?

How can I assign a JS function to a list of tag that are generate with a loop?

I have a loop in my twig file : {% for item in listItem %} <h2 class="title" id="name-id"> ID {{ item.getRobotName() }}</h2> <p id="latbot" data-

Lodash-es with Typescript and Webpack module error

I want to use lodash-es to be able to import only the functions I need, but I get an error. import { camelCase } from "lodash-es"; //... console.log(camelCase('

How to use the draw and keyTyped() function at the same time?

I want to create a code where when I click a key on the keyboard it will play music and draw a rectangle. I have managed to add music using the keyTyped() funct

Get array of object's keys

I would like to get the keys of a JavaScript object as an array, either in jQuery or pure JavaScript. Is there a less verbose way than this? var foo = { 'alph

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