Category "javascript"

looping through an array of objects that contains three key, value pairs

I have these objects, which could be in an array, like in the example or a database: [ { "payer": "DANNON", "points": 1000, "timestamp": "2020-11-02T14:00:0

Using an async function in Array.find()

It seems I'm unable to use an async function as the first argument to Array.find(). I can't see why this code would not work what is happening under the hood?

Using this JS function, how can I store in a SQL database TMDB fields?

I'm currently developing a project that will be Client on Java and Admin on PHP. For this purpose, I would like to store the API's data in a SQL database, so th

Socket.IO cannot establish a connection

I use socket.io-client for Javascript server on JAVA and when I enter address 'ws://10.201.223.67:9902/' the request is not by 'ws' but by 'http'. It returns

URQL WSS connection with GraphQL-WS says error 4500

import { createClient, defaultExchanges,dedupExchange, cacheExchange, fetchExchange, subscriptionExchange, gql } from "@urql/core"; import { createClie

import { withAuthenticator } from '@aws-amplify/ui-react' error

I'm trying to complete a type-along and I keep receiving an error for authentication when trying to upload images as an object. Here is the link of the type-alo

How to use .map to get sting from array

This is my first question because I'm just new to coding. I want to use .map to get strings from an array. let root_vegetables = ['potato', 'taro', 'sweet p

Dynamically added svg viewbox values not working? [duplicate]

I'm trying to add an svg dynamically to a menu, but I'm having a problem setting the viewbox. When I inline the svgs (svg and svg-2), the view

How do I add a delay in a JavaScript loop?

I would like to add a delay/sleep inside a while loop: I tried it like this: alert('hi'); for(var start = 1; start < 10; start++) { setTimeout(function

Unexpected token ')' in D:\Mridul\Codes\js\API BASED\Anime Quote\views\info.ejs while compiling ejs

So I want to display MongoDB data in HTML so I used the EJS template but this is the error it is showing . I can't seem to figure out where the problem is, IS i

How to render "intrinsic" size of element with Dom-To-Image

I'm using tsayen's dom-to-image library to snapshot an image element. The intrinsic size of my image is close to 1000x1000px, but on my website I have it scaled

I can't seem to define variables in my code, because document.getElementById( ) won't insert the value in it [duplicate]

I am trying JavaScript and HTML with a little CSS (that is not required), and I can't seem to define this variable. I have the element id wit

Tailwind default color classes not working

I'm building a React application using Tailwind CSS Framework. I have used NPM to install tailwind in my react app in the following manner: npm install -D tailw

failed to get data from my contract using the navbar (web3 react hooks async function)

I'm trying to build My first react Dapp! The problem I encounter is the data doesn't load only when I'm refreshing the page instead of navigating with the navba

For nextJS installation npx create-next-app stuck on installation

The create-next-app isn't responding it is stuck midway through the installation with zero installation progress and its been like this for more than 10 mins c

IndexedDB Database version change not triggering onupgradeneeded

I have a function that basically grabs a bunch of delivery jobs from the remote database and saves them to the indexeddb for offline backup. After each download

Print object key/values in a csv format

I'm trying to print a object in comma seperated strings format. but I'm unable to understand how to concat keys for objects. Here is an example. let obj = {

How to call the same angular component multiple times using querySelector

So I have a component called custom-modal.component. The HTML file looks like this: <dialog id="custom-modal"> <ng-content></ng-content> <

Why does jQuery or a DOM method such as getElementById not find the element?

What are the possible reasons for document.getElementById, $("#id") or any other DOM method / jQuery selector not finding the elements? Example problems include

I need to use a boolean column from my database that is set a 1 or 0 to change the look of one of my articles in my web page

Sorry if the title is a little confusing was trying not to make it too long. I am currently in school and my teacher has tasked us with this "Add a boolean colu