Category "javascript"

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),},

`Phaser.Display.Align.In.Center` works well with the first line of my text but doesn't center my 2nd line. How do I fix it?

I'm trying to make some kind of a notification/message box giving players hints to advance the gameplay, here is the code var game = new Phaser.Game({ wid

Angular Syncfusion schedule cannot invoke an object which is possibly 'undefined

I am working on Angular Syncfusion for allowing user to show and book appoinments and following below link https://ej2.syncfusion.com/angular/documentation/sche

sort objects by key value 0 by number size

how i can sort this object by user_id ? { key_1: { user_id: 3 }, key_2: { user_id: 1 }, key_3: { user_id: 2 } } I need this: { key_2: { user_id: 1 }, key_

How to join three (multipe) collections with $lookup in mongodb?

How to join three (multipe) collections with $lookup in mongodb? Hi I am looking to join data from three collection users collection: [ { _id:0, name:"abc", pho

Sharepoint: Lookup against a large list with CAML Query

I have a SharePoint List (list_dls) which has all the Email addresses. The list has a single column with Field name "Title". I need to validate that the Item in

what does method mean/do in gtag event?

I'm reading the google analytics documentation and I'm slightly confused about what method means. In their documentation they have gtag('event', 'login', {'meth

AJAX/FLASK/JS: How to POST existing array into endpoint?

I am trying to POST the songFiles array pushed from the getTableData() function (inside the ajax request) into the /api/fileNames endpoint, which is then sent t