Category "javascript"

How to use JavaScript or jQuery to get updated styles when the pseudo element is :hovered or :active or :linked

It seems getComputedStyle only returns the original style of the pseudo element. getComputedStyle does, however, return the style of regular elements when they

How can I loop through an array one by one when a button is clicked

I want to be able to loop over an array one by one when the next button is clicked. I have a code in place but it only goes to the next one and then sticks to t

How to handle large no of data/records from backend and display in UI as Angular

There could be following possibilities, need help against each one. Pagination can be implemented, but if we apply pagination, then can we search data from all

Cannot click a button using puppeteer

I am trying to loop through an array to search and add multiple items in cart in https://www.woolworths.com.au/shop/search/ However, after the search the add to

"Variable" variables in JavaScript

I know it's possible in PHP to have "variable" variables. For example, $x = "variable"; $$x = "Hello, World!"; echo $variable; // Displays "Hello, World!" Is

What input type should I use for code which combines text and numbers? How to declare in TypeScript to avoid errors?

I'm using VueJs (coming from React so I'm new), and I have this input which contains a code => combinations of vowels and numbers. I'm having 2 problems, fir

Replacing JS require('...') with ESM imports

After updating node-fetch to v3, the following JavaScript error message appears when trying to launch my Electron app: Uncaught Exception: Error [ERR_REQUIRE_ES

How do I chop/slice/trim off last character in string using Javascript?

I have a string, 12345.00, and I would like it to return 12345.0. I have looked at trim, but it looks like it is only trimming whitespace and slice which I don

How can i check for only one occurence only of each provided symbol?

I have a provided array of symbols, which can be different. For instance, like this - ['@']. One occurrence of each symbol is a mandatory. But in a string there

Draw two or more images vertically in a single canvas

var base_image = new Image(); base_image.src = 'https://......jpg'; var can = document.getElementById("pai"); var ctx = can.getContext('2d'); base_image.onload

Dynamic API routing with getServerSideProps in Nextjs

I want to fetch Dynamic API routing after enter submit with input state. but I don't know how to pass state from react to getServerSideProps. this is my code ex

How to post image to my server from Flutter?

I have a small server based on node JS, which communicates with Post Gre SQL database, and server is working on port 5000. I have route called uploadImage, whic

ApexCharts dynamically change xaxis.categories

I working on a page where I let users select some criteria, which I use later to extract data from the DB and display them as a chart (apexcharts) Everything is

I/chromium: [INFO:CONSOLE(2)] "Uncaught SyntaxError: Unexpected token ..." spread operator in webview android studio

the problem is maybe the same as the link below : https://forum.vuejs.org/t/spread-operator-not-working-in-webview-android/74893/7 but the different is, im usin

Moment Js recur every nth month on first Sunday

I'm trying to generate recurrence for every 2 months on the first Sunday I have tried this code so far but not getting the expected output How Do I chain for ev

I can't access timeline in main.js, timeline initialize in the file anim.js

Hello everyone I have such a problem. I have two scripts, anim.js and main.js . In anim.js describes the animation, and in main.js I'm trying to make a stop by

Is there any benefit in using Map (Object) over objects in React functional components? [duplicate]

I couldn't find anything about this online but I recently saw some React examples using the Map object to make a simple mapper. This had me w

Why function from service class doesn't work from useContext?

I'm trying to pass service as context and then use it in app, but get error "service.getItems is not a function". What is wrong? I know I could just import and

no such element in Js webdriverio with Appium . and how to use promise here?

We run this coming promise error. We use the await function but not working correctly. **java script var wdio = require('webdriverio'); var allureReporter =

Is there a way to refactor four nested .forEach to change property?

Example: public disciplines: BrowserDiscipline[] = []; onAggregateSelect = (event) => { this.disciplines.forEach(disc => { disc.models.forEach(model =&