Category "javascript"

Error message "Cannot set properties of undefined (setting 'x')"

I got the error message "Cannot set properties of undefined (setting 'x')" The message directs at this code: function spelareHitRoman(spelare, romans){

Phaser3 Scene switching error. How can i do?

I have this error when I touch a wall to change scene: Cannot read properties of undefined (reading 'start') I tried several techniques but none worked, yet I

Common used functions abstraction (correct structure)

I do know that there is commands.js where functions can be added that we often use but isnt it gets way to messy if we just have bunch of functions in that js f

How to use SwiperJS (npm package) in VueJS (CDN)

I have basic problem, but i don't know, how to solve it. I am using Twig templates, where SwiperJS is installed via npm. I import all Swiper dependencies which

I want to new array of 2 array is not equal data [duplicate]

I want to new array of 2 array is not equal data example let a = [{id:1, name:"a"},{id:2, name:"b"},{id:3, name:"c"}]; let b = [{id:1, name:"

React/Jest - How to simulate touch "swipe" event

I have a component that triggers a function call whenever a swipe interaction was done. This swipe interaction can either be executed by touchEvent or mouseEven

How to clip a background image using css without affecting its size?

I'm using a picture I found on Google Images as a background image. However, a Google Search bar appears at its top. On its left hand side various icons/logs su

How do I wait for users to click on certain buttons in component, then return a value from that in a function depending on which button was pressed?

I have an overlay component that appears when a user clicks on certain things in my page, and in this overlay it gives a warning and 2 buttons, one for yes and

How to load a static content in index.html

I was using vue-cli with webpack for my project and was loading an image in index.html like this // index.html <html> ... <style> .t

county boundaries for US map with large data

I am trying to load all the county boundaries in the initial load. So I researched and found that loadGeoJson will support that. when I test with state boundari

Npm install `vue@latest` error user agent

I wanted to try staging.vuejs https://staging.vuejs.org/guide/quick-start.html#with-build-tools and it said that I only need to install it with command npm init

How to make a cookie, that is random, and won't change once the user comes back (can't be PHPSESSID= because im running node.js)

I'm trying to create a cookie that acts like a PHPSESSID but is JavaScript, I would just use PHP but i'm running node so that is impossible. The hope is that yo

how to set env in Sheel for node.js [closed]

shell:$ set CONF = 44 const mytext = process.env.CONF console.log(mytext); //undefined

Why Linking.openURL fires automaticaly without TouchableOpacity?

i have a problem with function in React Native. I checking if the String is e-mail, text or phone and returns appropriate object, e.g Linking.openURL(mailto:${p

Why does using replaceAll instead of replace give me bad results?

I'm still working on my IDE and I keep running into problems and I'm wondering if I just keep doing something wrong this is the sample of code that I need help

Looking for an example for using markmap in HTML file with Markdown

I want to use markmap with a static site generator. Therefore I want to find an example where markmap is used from HTML. I.e., the HTML file should contain the

Ajax Loaded Content - Deeplinking URLs

On my WordPress website I have a custom page template containing a post grid (showing the titles only) and on click on the title it is loading the whole content

It seems Phaser 3 throws "animationcomplete" notification twice for a single animation, how do I make it one?

I'm confused about the 'animationcomplete' notification. I thought I would receive the notification one time when the animation I listen finishes. It turns out

How to build unhashed files in a 'dist/' folder with ParcelJS (v2)

I'm trying to bundle some scss and js files into a dist/main.css and a dist/main.js file using Parcel (v2). I don't want any hashes within the file names (just

Schedule Selector when creating events

I want to prevent the user from being able to select multiple times when creating the event, but I don't know how to do this, for example, when an event is at 1