Category "javascript"

How do I make sure one Subcription finishes before another?

globleVariable: any; ngOnInit() { // This doesn't work. methodTwo throws error saying "cannot read someField from null. " this.methodOne(); this.me

Redirect page to url Next.JS

I have a simple web page running next.js, the page just returns the "Hello World" element and I would like it to redirect me to another URL (youtube) instead. I

React Confirm Alert library showing "Warning: ReactDOM.render is no longer supported in React 18."

I'm trying to use the react-confirm-alert library for a confirmation dialog. But it's giving me a warning when the confirmation pop-up is opening for the react

How to show alert on browser back button click event using jquery

I want to show alert while clicking on the back button in the browser. it only works before clicking on the back button, when you click to somewhere else on the

Firebase TypeError: Cannot read properties of null (reading 'indexOf')

When I console.log(docSnap) I'm getting a firebase error, see in the below image. I have tried all the solutions but none of them worked. useEffect(() =>

React Multiple Input value in single array

Hi I am making a react component which roughly looks like this below import React, { useState } from "react"; export default function App() { const [data, se

HTML Javascript image slider - adding slide animation/

I made an image slider that work, but now I'm trying to add an animation effect to it, and I believe JavaScript may be the answer for that. I'm trying to add th

Deep find object in tree, then return object and the path to it through the tree

I've written a recursive function to find a given object and the path within that tree, but when I change the target id (over here : if(tree.targetModuleId ===

Cannot make a new line using <br /> html

I have a problem breaking down 1 line using <br />, I have converted to string but it doesn't work. I have followed this https://stackoverflow.com/questio

Divergence with lookahead RegExp

I'm doing a test where all links that don't have 'investing' and 'news' are rejected, but I'm not understanding the logic of ?= and ?!, and I believe I'm doing

Calculate DPs using density and screenSize of iOS devices

Problem: Iam trying to calculate DP using the following formula. dp = (width * 160) / density; Iam using this formula since i don't know how can i have the DP

PostgreSQL 12.2 with Sequelize 6.3 - UPSERT a array of data and want ON CONFLIT DO UPDATE to merge current existing JSONB and EXCLUDED JSONB

I'm currently using this query to insert or update my array of data when retrieving my list : try { const query = `INSERT INTO "Tables" ("id","tomerge

Export in excel in ag-grid in plain javascript with Thymeleaf

I am using ag-grid and Thymleaf scripts to display data in the frontend. I am able to display data. To export the data I was following the steps given in this d

How do i replace vowel(s) from a character with * and get an array of all the possiblities in js

Suppose that i have a word "FadTheChad" (or any word that has vowels) and want the vowels replaced with "*" and return all the possibilities (subsets? not sure

React native web storybook react-native-vector-icons problem icon

I'm developing a react native component on storybook, which uses react-native-paper and react-native-vector-icons. The problem is that I can't see the icons, I

Javascript classList.add to element with 0px height

Not sure if I'm missing something obvious here, but I'm trying to add a class to an element that has 0px height to begin with. const teamMemberBioShow = fun

Transfer data between JavaScript and PHP through JSON

index.html: <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="

Yup when condition inside nested object

so i have a problem with conditional validation using yup. Basically i want shipping to have required properties when the checkbox is not toggled. I am using yu

("Document not defined" in renderer.js) - Sending data and rendering it in electron

I am trying to create a Debug app for Body Positioning Data. This data is received as JSON via MQTT in my receiveAndConversion.js. I was able to receive the dat

Check if the selection contains graphics

I'm trying to write a script where part of it is to find out if there is an image in the objects selected, or the objects are empty shapes. I need to check if t