Category "javascript"

Schema for saving a lot of questions MongoDb

If I have a survey application for child tracking what is the best way to save survey questions in MongoDB? Knowing that survey is divided into stages (about 12

What are my options to deal with this stale closure in React besides using ref

I'm using the library React Datasheet Grid, the main component has a property called OnActiveCellChange, to which i'm passing my custom function: const [selecte

How to use the visibilitychange event to display messages when tab is hidden?

When an customer opens a new tab or goes away from the current sites tab, I'm trying to insert an promo message in the tab of a browser that flashes back and fo

How to add random minutes like first slots should be 30 minutes and then 1 of 15 minute slot and again 30 minute slot

const eventClick = (args) => { let StartTime = moment(args?.event?.StartTime, 'HH:mm ') let EndTime = moment(args?.event?.EndTime, 'HH:mm ') if (

mocking database calls in api routes

I am building a full stack application with NextJS and a MySQL database.In my API routes I make calls to this database (for example, createOne() for creating an

use ck editor in dark mode. works perfectly in light mode

I am beginner in vue and i want to use ck editor in dark mode it works perfectly in light mode but i am not able to make it in dark mode. documentation link fro

How to make Categories button functional

I got my current website displaying hard coded data from my data.js file. I implemented firebase as my database and I want to have my categories button work wit

Construct signatures with JSDoc and TS-Pragma ts(2351)

I've a function that returns a constructor dynamically. When I try to instantiate the new object it warns me This expression is not constructable. Type 'myConst

Insert tab character into SlateJS text editor

How to insert tab characters into SlateJS? So inserting   is a tab character, however, when inserting this as text, it appears as the literal character

Plucking specific substring from string - Javascript

I have a dynamic string that is generated like one of the following: var q = "FROM Table SELECT avg(1), avg(2), avg(3) where x='y' var q = "SELECT avg(1), avg(2

array.slice strange behaviour with nuxt-edge

EDIT AND SOLVED: I've found the origin of the problem: I thought arr.slice returned the new array but, actually, it returns the deleted element. See the documen

Show different image on different language Gtraslate

I use this java and find Gtranslate languege cookie (googtrans) <script type="text/javascript"> // Original JavaScript code by Chirp Internet: chirpintern

why ejs displays file.forEach is not a function

I have the following error TypeError: C:\Users\USER PC\Documents\Prime_News_Hub\views\Top_Stories.ejs:27 25| 26| <% if(file){ %>

intersection oberserver used with a loop through all the elements ends in error

I want to show some cards on scroll and for that purpose I chose to use an intersection observer. But I ended up with: Uncaught TypeError: Failed to execute 'o

State lost value in bootstrap table

I am using custom fields in react bootstrap table. { dataField: "hours", text: "# of Hours", sort: true, footer: "# of Hours", headerStyle: (colum, c

Next auth getSession with typescript

I am using next-auth getSession in API routes like this const mySession = await getSession({ req }); I am certain that the type of the mySession is this type S

Autodesk Forge - How to get all available family in revit file

I am using Autodesk Forge to build a web app, I want to get categories, families, and family types in the original revit project. I have researched but all I ca

TypeError: Class extends value undefined is not a constructor or null while using stream-browserify

While using stream-browserify to import Transform class and extend it in the code causing the following exception in the browser console AudioUtils.ts:52 Uncaug

Why history on chrome not working when added a new state?

I have pushed some states into browser but when I clicking on the back button browser it can not navigate to previous state. Although, I clicked and hold on the

Every time i refreshes my app it logs out even though i've used this onAuthStateChanged. Below is my code of loading screen

I'm using this screen to navigate between two screens by using the onAuthStateChanged but still every time It refresh the app it logs out even though I'm not lo