Category "javascript"

Phaser 3 (Game framework): collider callback is called, but somethimes object still passes through other object, instead of colliding

I'm working on a small flappy-bird-like-game demo. Everthing seems fine, but I have a small problem/question. I setup a collider function, and the callback work

Regex validation for a specific value with React Formik

First is, I want to validate the field that if the user type a character that is not existing in this (e.g.): /[ùûüÿ€’“&

How can I load Google Tag Manager to a next.js app, AFTER the app is fully loaded?

I'm building a next.js application and would like to load Google Tag Manager (GTM) only AFTER the entire page is loaded. The goal behind this is to improve the

How to use a CNN code in python inside a website?

I have website with backend in Python (Django) and JavaScript hosted on heroku. Also, I have code in python that does image classification with EfficientNet, so

Bookmarklet redirecturl trims off #tag

I have a bookmarklet I use to autologin to certain test sites but I have it to where I can redirect them to specific pages after the login occurs. However the u

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