Category "javascript"

Get function inside default export function

I have function inside user.js with default export like this export default { var getListFriends = async (accessToken) =>{ } ....other function ret

Why my customize cursor keep blinking in react

I have problem with my customize cursor and this has been in a month but now I created it again and still wasn't solve it still. I'll direct how it will works.

Is the function binded to the button always executed or did I make a mistake?

So I have this PHP page, with at the start some unimportant stuff and a session opening : <?php session_start(); ?> I want the disconnect button to a

How do I manipulate data based on another data in Redux Toolkit (React)?

const { data, isLoading } = useGetDataQuery({ skip: !dependency } ); const { data2, isLoading2 } = useGetData2Query({ skip: !data } ); const { data3, isLoadin

How can I show tooltip info for 4 seconds on page load and then hide, then after show on hover?

I am using react-bootstrap version 0.32.4, I can't update the version, that will bring up many changes. I want to have a tooltip info showing for 4 seconds on p

JS Change the cursor for an image stored in a variable

Is it possible to change the cursor with a customized image stored in a variable? I have tried setAttribute or .style.cursor, but it does not seems to work.. He

How to upload images on node js?

I am having issues getting any image data on the form in the ejs file after submitting. Upon debugging, there is a req.body.image which has the filename but req

Stop function from functioning

So I'm modifying a webpage, it has a button, it is coded so mouseup goes to a link, I want to change this, adding mouseup functions don't work; mousedown works

how to reset input fild without empty string in react.js

How can I reset the input field if I use it this way? const [email, setEmail] = useState({ email: "", emailError: "" }); const handleEmail = (inputEmail

Web based Timer application using window.setInterval method in JavaScript does not work as expected on mobile browser (Chrome, Firefox etc.)

Web-based timer application using window.setInterval method in JavaScript does not work as expected in the mobile browser. The reason behind this is that after

How to run a custom element's constructor after it has all of its required attributes?

I'm trying to create a custom element "color-box" that will need an attribute named "color" to identify the box's color. So for example, <color-box color="gr

Common functions are not executed in Nuxt.js store

Assumption I wanted to use inject in Nuxt.js to share the same process, and I wanted to use it in Vuex, so I tried to use it in store, but it would not run. How

How to apply CSS styles based on existence of Browser API feature?

I have a page which has the content invisible (opacity = 0) and based on the isIntersecting property as the user scrolls down the opacity changes to 1. It's pre

How to sort sum up all values from object arrays inside react props

I would like to sort three top rated posts. The current function of displaying three post titles and their rating, but I can not sort them by best rating. Pleas

React Firebase upload images for each post

In Storage need to create a folder for each post and then display all the photos from the folder in posts Can you suggest the best way to do this? And also when

Dependency not found in Nuxt when defining alias in nuxt.config.js

I'm getting this error when trying to import a file using a custom alias: import api from 'api' api in ./node_modules/babel-loader/lib??ref--2-0!./node_modules

The best way to resize canvas with its objects

I have a Fabric.js canvas inside in a responsive design with boostrap. To resize the canvas, i use canvas.setDimensions({width:w, height:h}); From the width and

Convert a Canvas element into Image element

I have a website where I need to generate dynamic images specific to the user. The approach I found was using canvas. I have text information and image file whi

My event handler is executed before the event is fired, why?

I have a pop up window with a button. When I click the button I want something to happen, say an alert. The issue I am having is that the onclick event fires as

React useEffect infinite loop when using dependencies + cleanup

I know this question gets asked a lot, but from the answers I could find I saw: either no cleanup function in useEffect (so not my use case) people not using de