Category "javascript"

Using functions from imported modules in another file

Say I have file1.js and file2.js... file1.js: import React from 'react'; const test = ( {prop} ) => { function test1() { prop('1'); } fu

Vuejs types for component refs

I have following scenario: I have an component here: <div class="border shadow p-2"> <chart :config="barConfig" ref="linechart" /> </div>

Should I always return a promise when I have an async function?

When I write an async function it usually returns a promise: export const myPromiseFunction = async (params) => { // some logic return Promise.resolve('r

Take function from one file to another (React)

So I'm struggling to pass "polygonNFTs" to another file. I need to find its number to decide give user permission or not. its working in index but not in navbar

DOM .value attribute not working - returning blank string

For whatever reason, the .value attribute on the input boxes is not returning the values entered. When running it through the Number(), it returns 0, and withou

"Navigation is Blocked" message on Chrome 99 / Android devices

I am managing some payment pages now. Some online mall creates an Iframe and call our payment page. When I click button with Chrome 99 on Android devices, "Navi

App Script Array Push() in loop Optimization

I'm looking to improve my array push inside loops but I noticed that every time my function is being called (in a loop manner) and executing this lines of code,

How to override js method in Odoo 15?

Can anyone give me minimal code so that any method I can override for JS method? changeMode(mode) { if (!this.hasPriceControlRights && mode ===

Javascript works in codepen but not on browser

const toggleButton = document.getElementsByClassName('navbar-toggle')[0]; const navbarLinks = document.getElementsByClassName('navbar-links'); toggleButton.

React useCallback() not working as expected

I'm trying to understand useCallback() a bit better by creating a simple React app and playing around with it. I tried wrapping handleClick function in useCallb

Take full screenshot in Chrome

I developed a little chrome extension, which takes a screenshot from the current page. The Problem is, when a part of the current area is covered by e.g. the in

React Native update component

I'm pretty new to react-native. When I click the stop sleep or info button I send patch requests to the users.json file to change the status. My JSON file conta

Display text (flexbox) when hover over image

I want to hover over the rotating circle to display the 4 "about" texts. But the issue is that I am using flexbox and when I enter the cursor into the area cove

"Uncaught SyntaxError: Cannot use import statement outside a module" when importing ECMAScript 6

I'm using ArcGIS JSAPI 4.12 and wish to use Spatial Illusions to draw military symbols on a map. When I add milsymbol.js to the script, the console returns err

Convert a string to number with parseInt does not work as expected [duplicate]

A quick maybe simple question : We are trying to parse a string into number , the sample number is "1928433000460244141" so when we try to par

cloud function triggering delay and retry

I have a firebase trigger function with failurePolicy: true (the function will automatically retry if fails). I avoid infinite retry loops as described here : h

I am not able to implement recordrtc

I am not able implement recordrtc. I took the following code from the site: https://medium.com/@coolchoudharyvijay/use-mic-in-angular-to-record-audio-simplified

Apollo-Server display errors in a clean mannor

I'm pretty sure that the question is self explanatory. I'm using 'apollo-server-core' 3.6.5 Errors I want to get { "errors": [ { "messa

Javascript window.load events not triggering without using setTimeout

This question pertains to a shopify cart page. I am trying to manipulate a page on load with Javascript. 'DOMContentLoaded' was not reliable enough so I am usin

How to add bootstrap 5 and other global packages to a SvelteKit project?

I installed bootstrap using NPM In a normal svelte project I usualy add bootstrap and other packages, which are used project wide, in the App.ts file. However,