Category "javascript"

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

How do I "save and restore" the context of a xterm.js instance?

In my electron application, I have an xterm.js terminal emulator, in one of my react tabs. How do I preserve the state of this terminal so that when the use go

Google Sign-In button > How to logout user if he clicks on the google buttons

I'm new here I'm stuck on a functionality that I want to implement into my website : the Sign-In button using Google For now, the following code add the Google

Why I am getting this error: Error: failed to process internal error: entered unreachable code: assign property in object literal is invalid

during writing code for JSX file I got an error: Error: failed to process internal error: entered unreachable code: assign property in object literal is invalid

add div element dynamically in same form

I have a div element which should add itself when the image plus sign is clicked. Can someone please suggest the way to implement it? I am not experienced in we

How to select record in the database using BETWEEN in sql?

How to select record in the database using BETWEEN in sql? what I want here is to select record within the startDate and endDate. if the record is exists within