I’m trying to create a confirmation dialog using something like this: confirm(‘Are you sure?’) inside of my EJS form but I don’t know where and how to get it to work correctly. Here is the code I have so far for my EJS template: I’m aware that the checker() function isn’t c…
How can I use Bootstrap 5 with Next.js?
After installing bootstrap with npm install bootstrap I added the style to /pages/_app.js like so: However anything from it that uses javascript does not work at all, e.g. the Collapse example from their docs. If I add import ‘bootstrap/dist/js/bootstrap.js’ to /pages/_app.js then it starts “…
JavaScript card game: set the player who deals the cards in each hand
I am working on a card game and I need to set the player who deals each hand. I have two arrays, one stores the hands and the other stores the players. My goal is to assign a dealer to each hand in a consecutive way until reaching the max number of hands. For example: I tried different loops, but
node express mongo API updating a record issue [closed]
i am creating a rest api using node, express, mongoDB. try to make fetch, create, delete , and update functions . all working except update function. when I try to check using postman the code hangs …
Remove duplicates from a string by value
I have a JS function which removes duplicates in string. I want to add a duplicate limit to function paremeter. In example if removeDuplicateChracters(“hellomellotesto”, 2 ) expected output should be “hellomeotst”. Answer You can try like this:
Change CSS style of an element after user click on an area of an image
The area is defined by using map tag. There is also a paragraph above the image. When the user click on the image area, the color of the paragraph will change. Any idea how to do this with javascript? For example, this is the html Answer To change the style of the <p> tag when you click on the area
Open modal when click on button
I have this code : SepaModal : I have the error : Error in v-on handler: “TypeError: this.$refs.sepaModal.open is not a function”. I tried with this.$refs.sepaModal.show(); (the same error). Very strange bacause I put a console.log and I have sepaModal in refs. Can you help me please ? Thx in adva…
I am trying to test using jest for a function that calls back a success message to be displayed once a task is added to array but its erroring out
This is the code I have to so far. I need help with my test function using jest. Visual studio points error to function addTask(“task 3) in the test function. The rest of the code executes fine i….
React Redux, trying to add products to cart
I am trying to add products to shopping cart by storing them in local storage but, they are not getting stored. I looked into Redux-dev-tools and found out my state is not updating: As you can see action is getting fired but my state is not updating: Here is the source code: cartAction.js cartReducer.js store…
Angular Property ‘expenseEntry’ does not exist on type ‘ExpenseEntryComponent’
I am trying to build expense entry app from this tutorial https://www.tutorialspoint.com/angular8/angular8_pdf_version.htm page 33. I am getting this error – Property ‘expenseEntry’ does not exist on type ‘ExpenseEntryComponent’. i have tried this links a) Angular error TS2339 Pr…