Category "javascript"

Close open tab on click with vanilla javascript

I've been trying to build a tab system where the tabs close on click. At the moment when I try to close an open tab it just remains open. Basically when I click

Capture Option vs useCapture

The docs for addEventListener/removeEventListener both have a capture option and a useCapture parameter. On its face these seem to do the exact same thing. Coul

PWA for IOS on safari and chrome with javascript in html

I managed to create a custom pwa install button in html javascript that works well on an android only based on this documentation: Android Pwa My current proble

Return two values from getStaticPaths

I'm using getStaticPaths to create a product page within NextJS. I get my products from wooCommerce, problem is: I want to use "permalink" for my NextJS route U

Difference between Ant Design form.setFieldsValue and initialValues prop

As the title states. What is the difference between the two? 1. import { Form } from 'antd'; const Components = () => { const [form] = Form.useForm(); f

using react router with next.js

I am learning how to use Next.js/React for my application. I am currently researching the topic of routing and I had a few questions. I know that you can use re

error:failed to look up view "index" in views directory

local host port served an error in browser and did not load my static files. Returned an error 'Failed to lookup view "index" in views directory "C:\Users\xxxx\

Why won't my ImageMapster jquery plugin work in Power Apps portal code editor?

I am trying to apply some hover effects to my image map that I have coded inside my power apps portal site via the code editor. When I try to add in this method

Array of objects properties become NaN between function calls in Html Javascript

This code is done in HTML javascript. The following functions (placero() and runro()) are called in that order. placero() seems to initialize the xs and ys of t

Fail with error 'PancakeLibrary: INSUFFICIENT_AMOUNT'

I'm trying to fork PANCAKESWAP, everything seem to work well, I can add liquidity, but whenever I decided to add a liquidity that has to do with BNB (i.e callin

Show total number of selected filters array of items in React

I have the following problem. In widgetFilters array (length===3) i want to show the numbers of selected items in the header of the Filter. const [selectedFil

Mutation in javascript?

In the below code size2() method working fine.But in size1() it is mutating the object and making it null.why such behavior is not happening in size2()? class N

Handle a click event on Splide component

I'm using Vue-splide with the latest version. I want to handle the "click" event, so I wrote <Splide @splide:click="test" :options="options"> functio

Sending BNB with web3js won't log errors

I have this code that allows me to send bnb using web3.js using MetaMask I want to display a message when user rejects payment or there is any other error and i

Next.js, using random properties without triggering "did not match on server/client" error

I'd like to randomly generate the id property of form inputs, to prevent them from potentially conflicting with other inputs with the same id. This could happen

Next.js, using random properties without triggering "did not match on server/client" error

I'd like to randomly generate the id property of form inputs, to prevent them from potentially conflicting with other inputs with the same id. This could happen

How to remove double quotes from beginning and end of numbered value in a list [duplicate]

I have data as follow: let str = "1,2,3,4" and, I want to transform it into arr = [1,2,3,4]

Onclick Event Google Visualization Pie Chart create with Dynamic input value

I have 3 inputs and from where by click in a button get those input value and create a Google Visualization dynamic Pie Chart depend on those value . I have mad

How to overlay text on an SVG path element in React without using the coordinates of the path element?

I am attempting to create a global COVID-19 tracker for each country using React. In order to carve out individual countries and present them I have used an SVG

Vue JS: reactive syntax

While I was trying to grasp reactivity fundamentals and its syntax I've encountered following problem. Consider this snippet: const app = Vue.createApp({ dat