So at the moment, the quiz keeps looping through the quiz until it switches to the endQuiz Function. What I am trying to do is determine if the answer is equal to the ID in the array when it has been checked, so I callback to the function called selectedAnswer. So when I can call back to it later in
Category: Questions
How to set ASP-Items value for SelectList via javascript ajax call
I have a states dropdown on a form, and when a user selects a state, I want the cities dropdown to populate with just the cities pertaining to that state. I have 2 Select Boxes in my form view: Then I have Javascript that gets the cities via ajax when the state is selected: My ajax call to the controller:
how do I make elements not move when other elements do?
i have some image elements that when hovered on, scale up, however, this causes some other elements to move, which i dont want happening. I have tried things like float: right which work, but dont fit for my website, since it’s margined and centered. here is a simpled version of my site: Answer Use tran…
How to check and access a function from another object using JavaScript Proxy?
I am practicing JavaScript Proxies and want to access a method from another object but with an empty Proxy object: Basically I’m trying to check if that method property exist in another object. I just want to tell the proxy to get the value from another object without passing it into the constructor. An…
Make nodemon ignore changes in all other files except the one it’s running in the same folder
I am running multiple Discord bots from the same folder. Each is controlled by a single .js file. The problem I have is that whenever I make code changes to one of them, all of the bots restart. I can use the –ignore command to make one instance ignore changes to everything in the folder, but it also ig…
error TS2688: Cannot find type definition file for ‘ioredis’
I have a project with nestJS. But in when trying to add some module it show error. and this is my tsconfig How to resolve the error ? Answer If you’re on ioredis@4, it comes without built-in TypeScript definitions. You’ll have to install @types/ioredis: If you’re on ioredis@5 and use @nestjs…
Pass array in another array of objects
I have this nested array which I am trying to sum the number in the last arrays individually so it should return 400 for each array also trying to get the average of the total, for example if it is 400 then it is 100%, if 399 it will be 99.99%, the average needs to be from 100% and dynamic
React / JS – Fetch() – Assigning resulting array to a variable I can use
Been banging my ahead against a wall on this one for a while. Doing the FCC course, essentially completed a project but trying to fetch a JSON with an array rather than just putting one in directly, myself, as I wanted to learn how to do it… Didn’t think it would be this difficult! What do I want …
Joi validate at least one of 2 input fields are completed
I seem to hit a roadblock when it comes to joi’s .or() function as it doesn’t seem to implement as I’d expect. I have 2 text input fields, both have their own way of validating, though only at least one is required. it just seems that this or doesn’t do as I’d expect and each fie…
How to: Subtract a CSS value from a JS variable height?
How can I subtract from the navbar_height for example 2rem in the following function? Thanks! Answer You can use calc