Category "javascript"

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

How can I get firebase realtime data using unique id

I'm using react js and firebase. I have this code below. I'm using it to get data from another table. const uniqueEventID = Object.keys(data).map((id) => aa

Youtube cookies auto accept with puppeteer

Im trying to find something can automatically accept or delete youtube cookies with puppeteer when i load "youtube.com" Example of popup you can get in private

ReferenceError: window is not defined, consider using the "jsdom" test environment (jest V28)

I would like some assistance in resolving this error. Am using Jest V28.0.0. Here's how my package.json's test script & devDependencies look like "scri

Can I change the state for given time and then revert it back to the original state using settimeout

I want to get the value to true for one second, after which it will revert back to false using settimeout but stuck. Here is my code: const [value, setValue] =

Can the Javascript Use-API be used to set properties

In AEM we can use the Javascript Use-API to access properties and perform some actions on them. In this example we can see that we use properties.get to retriev

Pending promises even though awaiting Promise.all()

I'm having difficulty understanding why I still have pending promises after awaiting Promise.all(). In the example below, I'm creating an array of promises by c

RegExp Match all text parts except given words

I have a text and I need to match all text parts except given words with regexp For example if text is ' Something went wrong and I could not do any

How add VueJS event listenner on a component in the mounted section

I important a componant and I want to attach an event listenner to the button element which has the class qkb-bubble-btn. I understand the fact I should put thi