Category "javascript"

How to check if an element has a specific child?

How to check if an element has a specific child? I added children to my element using: var child1 = document.createElement('div'); document.body.appendChild(c

react-quill How to properly add attribute to a specific html tag

Here is what I want to achieve. My user is typing a text in a react-quill component and each time the user type a hashtag like "#S1 " (the space is importa

React Native - how to set fixed width to individual characters (number, letter, etc)

I am having a problem in a React Native app I'm building. I have a stopwatch and since each number character has a different width, when the time is increased t

Calling Express Route internally from inside NodeJS

I have an ExpressJS routing for my API and I want to call it from within NodeJS var api = require('./routes/api') app.use('/api', api); and inside my ./route

Can i use my own sign in form for aws cognito?

I have a nextjs app that use aws cognito for auth. i was wondering if there is a way to replace the hosted ui provided by aws with my own custom form. import {

Firebase App named '[DEFAULT]' already exists REACT

I'm a beginner in React and at the moment I try to connect my first app to a Firebase database. I have two files for that. The first, is a config.js file wher

yAxes not re-render new data in Chart.js with React.js

Hi I try using the Line chart in my project but get an error you can see it in the image below package.json "dependencies": { "chart.js": "^3.7.1", "react":

How do I implement custom error pages in NuxtJS 3?

I'm trying to get my NuxtJS 3 app to show custom error pages. The app is universal with SSR. The NuxtJS 2 docs say to add a layouts/error.vue file and it should

Material-table with MUI full screen dialog

Problem: Clicking a button in my material-table it opens the full screen dialog then closing the dialog, Then I am not able to click anywhere in the screen anym

Need help solving this method chaining question?

I got asked this in an Interview and I couldn't solve it. Was wondering if any of you guys can help me. fn("hello").fn("world").fn("!!!").fn(); function fn (st

Centered owl-carousel where each image has the same hight and keeps its aspect ratio

Is there an approach to to create a centered owl-carousel where each image has the same height without losing its aspect ratio? I tried to calculate the image s

Next.js overlaps static route with dynamic route

I am using Next.JS application routing system. I have created a dynamic route with structure like pages/[country]/[language]/index.js. Also there is a static ro

Jest not recognising JQuery Object ($)

I have used JavaScript to created a simple web application to measure how much time I spend on different projects. I want to test the code with Jest and this wo

Antd popover opening in two diffrent widths depending on the order in which the actions are performed

sorry if the title is confusing, I don't know how else to put it into words. I am currently learning react and made this application using antd UI componen

javascript exception in while controller in jmeter

I have been trying the javascript in jmeter while controller, and am using below function ${__javaScript(("${app_status_g1}".indexOf("100") == -1 && ${

How to detect when the div element width change (not window resize) in JS?

I have a scenario, if div element width changes, i need to perform some functionality. So is there any way to detect that element width changes (not window resi

Next.js and Webpack inline Javascript or CSS ressources

I have the following use case: I need to generate static files with React and Next.js. For that I extended the next.config.js with the following content: module

Node.js - Google Calendar API showing error "Missing end time" when inserting an event

I am using Google Calendar library for Node.js to get calendar ID and events list from API. This is working as expected. But when I'm trying to insert or modify

React beautiful DND - I get "Unable to find draggable with id: task-2

In the following code, I have two columns. One column has all the tasks. The other column has a group of selected tasks. So, my expectation is that, when a user

RxJs catch error and continue

I have a list of items to parse, but the parsing of one of them can fail. What is the "Rx-Way" to catch error but continue executing the sequence Code Sample: