I’m trying to create a JavaScript object based on a template I received as a test. I use Ajax to get the data from my database but i cant seem to create the object. I’m trying to create something like this object below This is the how i fetch the data from my database Answer Your lines with produc…
intersection observer works only for the first video
I need to pause a video if it is not in view the below code works only for the first video in list how to make it working for all .bvideo ? Answer Use querySelectorAll() method.
JavaScript: How to move through my question array
I am really stuck! As a newbie, I am trying to build a guessing game for Flags of the World. Here is what I’m trying to do: I have an array of objects which I want to shuffle I then want to select the correct country that matches the image Add countries to three answer buttons below the image I
How to call variabled ajax
I put the ajax call in a variable, how can I call it again and pass some parameters to the data attribute of the ajax?. now I have a date range picker, If i click apply button i just want to call the request variable to be able to trigger the ajax call again and pass some parameters. TIA Answer
How to add the values in an array of objects depending on the date value of each object
I have this array: I want to add the distance and time values grouping them by the month indicated by the start_date value. For example, if two start_dates have the same month 2022-12-01 and 2022-12-08, how can I add the distance and time values of those two months? so i get a new array like this: Answer …
Detect an element has been resized by a user with React
I have a React component that renders a canvas and draws polygons on it: Now I want to allow the user to be able to resize the canvas, so I’ve made that possible with the div around it and resize: “both”. Im using the library react-resize-detector library to detect when the div has been resi…
How to write data in Firebase Realtime Database as [custom key : value] in React?
What I’m trying to achieve is having random IDs in a dedicated node in Firebase Realtime Database, while being able to check if an ID already exists in the node before writing it to prevent duplicity. I’m working with web React (JavaScript). The database currently looks like this: What I’m a…
How to get function name from getEventListener
I am trying to figure out a website basket and what is the name of the function that gets fired when clicked. I got my EventListener list by using getEventListener($0), and the following is the list but I cannot figure out how to find what event was fired on mousedown Answer As in fact on the @mamady answer, …
tsx extension error in React project with Typescript
I’m trying to move my project from js to ts, so I’ve installed typescript and now I’m changing the extension of all files from .js to .tsx, then I tried to launch again the project and seems that can’t resolve .tsx files This is the folder tree of my project (Note that I just changed m…
Is it fine to use the same mkcert certificate for both your frontend and backend?
I’m developing a webapp that uses vite on the frontend for my local testing environment and also a separate API backend. I used mkcert to generate a local dev certificate and am using that one for the backend. My question is, for my frontend dev environment I also can use a certificate, as shown here in…