Category "javascript"

How to prepopulate name of the printer in the browser

I'm using ASP.NET MVC and I'm using a function with AJAX that opens in the browser the window to print. My questions is when I print I would like to already set

Shadowdom access form selenium javascript/typescript

I'm trying to get access to some shadow dom elements using selenium in Javascript/Typescript, but can't quite seem to get it to work as expected. I haven't bee

How to add a hover effect with dynamic styles to a component element?

I have this Angular component where hover effect is currently applied with pseudo-class :hover in .scss file. But I want to apply the hover effect with dynamic

How to optimise a condition which checks for each object of an array of objects whether specific properties are not undefined?

I want code optimisation for an if-statement because I otherwise have to add more key-value pairs into this condition with &&. I have an array of object

Synching validations between front-end and back-end projects

What do you do for synching validations between front-end and back-end teams in laravel? I read this post but I would like to know about laravel. I have also se

Typescript Function Arguement with Child/Inherited class?

I am trying to write a function that sets some properties on its arguments (not return a new object), the argument is of a class that extends from the same base

Flex direction changes when I use persist gate(next js with redux)

I am using next js and redux to build an app. When I use in my _app.js the flex direction changes in index.js, from row to column. No changes in the CSS or in

Why doesn't setting NodeJS module cache to false get NodeJS to reload module?

I have 2 files, one named one.js and other name first.js.one.js var first = require("./first.js") require.cache[first.module.id].loaded=false require("./first.j

Use an array as chart values

I need an array with chart values, I obtained one but after exiting from the function it became blank, here's what happens: Example function AddvotoTec(voto

node.js get https no responding 504

I am trying to make an https request in my backend node.js web app. I have the following code: const express = require('express'); const https = require('https'

Javascript regex on array

I currently have this example array: array = [1.2%, 16%, 9.0%, 8%] I want to get the highest number so I did this: Math.max.apply(null, array); But it shows a

Why can't I declare a position in my multidimensional array?

I'm trying to do a 3d version of an L-Syste. But I cannot declare elements in my multidimensional array. When I debug, I see that the element stays the same. I

How to fix Error with alchemy-web3 - Webpack < 5

interact.js require('dotenv').config(); const alchemyKey = process.env.REACT_APP_ALCHEMY_KEY; import { createAlchemyWeb3 } from "@alch/alchemy-web3"; const web3

How to fix Error with alchemy-web3 - Webpack < 5

interact.js require('dotenv').config(); const alchemyKey = process.env.REACT_APP_ALCHEMY_KEY; import { createAlchemyWeb3 } from "@alch/alchemy-web3"; const web3

Not getting the error message from asp.net web api backend in $ajax method

I have a simple ASP.Net Web API method that returns a BadRequest like this .. catch (Exception ex) { Log.Error($"CreateRequest:requ

How export and import classes in Javascript?

Why isn't working? index html: <script src="app.js" type="module"></script> <script src="cat.js" type="module"></script> cat.js export

find element by class name (node js)

For my tool there is a button with a dropdown list if you click the button. The button is using a class : countryButton-1cNDvB button-f2h6uQ lookFilled-yCfaCM c

How do i do to make wait the program untile an image is load ? (java script)

I have recently started to learn html and i'm currently working on java script. My problem is that i would to stop the program until a image as been load for, a

Display JS script result in Bootstrap color box

I want to display random numbers by JS calculation in CSS Bootstrap colored box as shown below. How can I structure my code by adding the following JS calculati

Adding an custom event to GTM Vimeo event tracking

I'm using this script to push play/pause/progress of vimeo videos on our website. I'd like to push another event "load" when video is loaded on page. I've tried