Category "javascript"

In Event Propogation, how does the event know when to fire?

In the following code: <div onClick={() => console.log('outer div')}> <div onClick={() => console.log('middle div')}> <div onClick={(

Pause menu in JavaScript?

I'm trying to make a pause menu for a game me and my friends are making, I was wondering if js has a simple way to make a keypress function that pauses the game

How to match a word with no special character at front and back

I am trying to match a word which has no special characters attached at both front and back. The regex I have written is /\btest\b/gi

How to play audio file with vue.js

I'm trying to play an audio file in my vue.js project as such: import sound from '../../recordings/sound.mp4' const audio = new Audio(sound) audio.play() This

PHP file is not reading my js script file

I am trying to make sure my php file is reading my js file and when I click my decrease button, my console says Uncaught ReferenceError: decrease is not defined

How to write, update local JSON file in vue js

I have tried to use file system (fs module) but, not getting that how to use that FS module. could anyone explain with proper example. I was doing an example in

How to define Netlify function endpoint as POST?

I am new to serverless and am trying to get my head around it. So I've created a function on netlify using GET and it works fine. Then I wanted a POST endpoint

How do I resolve TypeError: transactionContract.publishTransaction is not a function

I am trying to write a code to save my transactions on sanity database, but I keep getting TypeError: transactionContract.publishTransaction is not a function.

h1 element in div behaving differently with other divs

So I have looked everywhere on stack overflow and counldn't find someone with a similar issue. I have two classes in the main body with a few different images i

Node js with typescript; How to catch express errors

So if I am using node js with javascript, I used to catch errors by adding the following code in my app.js startup file: app.use((req, res, next) => { next

use free texture packer for phaser3

I'm using phaser3 and free texture packer, is it possible to do that? if yes please tell me how? I tried to use addAtlasJSONHash but it was logging that this fu

Socket.IO : connect_error event not emitted

i have a simple socket.IO server, and a client that connects to it : socket = io('http://localhost:' + port + '/chat', { reconnection: false,

Is there a way to create share link on a website for Instagram?

I am trying to implement a button that users can click. It would take them to Instagram and start a new post with my website URL. I did it for Facebook using

i have problem with {useDrawerProgress} Hook in react drawer navigator it is not working?

I am trying to make Drawer menu screen transitions but the animation don,t work and I think the problem is {useDrawerProgress} Hook but am not sure, This is m

Javascript Regex Replace Without Resolving Backreference

I'm trying to replace a password token [**PASSWORD**] in a string with the password and am having trouble with passwords that contain the string $&. For exa

Metamask - switch to ropsten network using react js

i'm developping a web 3.0 app and i want when users connect there metamask, if the network i not ropsten then metamask ask them to switch it cause my smart cont

Defining multiple encrypted parameters

I have encrypted parameters in my url, for example: Encrypted example.com/?auth= *****"encrypted data here including other parameters like &username=hellowo

Magento 2 cms backend javascript error Uncaught SyntaxError: Invalid or unexpected token

Suddenly I am having javascript error and cannot edit any cms page (cms/page/edit/page_id/45) or block. I have been trying to solve this for the past week with

Retrieve the deals from Hubspot using its APIs

I'm trying to integrate the Hubspot Deals to Google spreadsheets, I'm following a tutorial https://medium.com/how-to-lean-startup/create-a-hubspot-custom-dashbo

MongoClient not connected error while trying to use Mongoose?

As part of my course I'm learning mongodb and now Mongoose. I've written the code exactly as done in the lesson but when trying to start it with node app.js I g