I’m really new to javascript. I’m trying to setup a page that fetches from a placeholder API(https://jsonplaceholder.typicode.com/posts) and displays the Title, Author(which I had to add) as well as the Body. I’m also trying to give the ability to use the search bar to filter the results by …
Tag: javascript
Data becoming a proxy when trying to make a SearchBar with vue3
i have an application made with VueJs3, and i trying to make a searchbar based on .filter(), and it seems to be working, but when i try to pass te value from my methods to my template its making a huge error, my data is becoming a proxy, and i cant use the data in a proxy format. The code:
Display file name after selecting it
I want to create a button on my site that will allow the user to upload a file from their device (computer, phone). I have already made this button and it opens a window where you can select a file. But I ran into a problem: I would like to display the name of this file on the page. I
How to use an image from a path in React Typescript without import or require?
I have a Typescript program with a readable name : img_path mapping saved in a .ts file. Based on certain criteria, I want to pass in an individual entry to a component which will then display the readable name as a title and under it show the image saved in img_path. I can do this in Javascript fine, but for
Delay before recursive function call
I’m trying to set a delay before every recursive function call. Currently, it’s returning undefined. The problem might be the scope of the recursive call (inside settimeout and then). I tried it like this: And this: Any help is appreciated! Answer You need to turn checkIfListElementIsRendered to a…
How to add transition or fade-in effect to dynamically added field
I have input section with add/delete button, that adds extra input fields. I am trying to get input field appear with a transition effect instead of popping up instantly. I tried to use transition but it didn’t helped. Is it possible to do it via pure CSS? Code Answer I don’t use jQuery so had to …
Why doesn’t the video stop when the “currentTime>=maxTime” in Javascript?
Look at this code I tried to play the video from a specific time to another specific time. Why doesn’t the video stop when the currentTime>=maxTime? i think there is something wrong with the eventListener. Answer You need to use the “timeupdate” event listener that executes whenever the t…
Getting Error while posting a request, ValidationError: TodoTask validation failed: user: Cast to ObjectId failed for value
i am getting an error while trying to post a todo to the database. ValidationError: TodoTask validation failed: user: Cast to ObjectId failed for value My function for posting the request : Schema is defined as : Answer Since the user property is defined as a ref you should just store the _id in it: When retr…
How add two values[1,2 elements] and verify its equal to result[3 element]
I need to verify if the sum of two elements is equal to the result shown on the UI. Below is the html structure for the three elements and need to do the calculation on the h1 tags. Below is the code I am trying to execute but nothing comes up in the test. The test runs and passes but
After resetting stopwatch stopwatch is beginning at the previous time
When I want to reset my stopwatch and start it again the timer begins at the stop-point of the previous timer execution but I want that the timer begins at zero. I tried different ways to solve this problem but my tries did not work. What is my failure? The considered area in my JavaScript is marked up. Answe…