I have a site in which all sections take 100vh/vw, and I want to animate the opacity transition when user attempts to scroll up/down. The thing is, the scroll event doesn’t fire because the window hasn’t really scrolled. here’s the codepen, and the gist of it: is this even possible? And if n…
Tag: javascript
Error in promise catch does not trigger global error handler
Why does an error thrown in a promise reject/catch method not trigger the global error handler? How can a global error handler that includes these be created? In my app the global error handler logs the error. Answer This is not an error, but Unhandled Rejection: The unhandledrejection event is sent to the gl…
Getting error while creating code for my netflix-clone
Row.js component code where i am calling the api key Row.js axios.js Error in the console log is below one, I got the API key from TMBD Api and it was working fine with postman but here in react it is not working properly. Answer you created an axios instance but you did not use it and in the fetchData
Looping Over And Array of Objects and Updating Each One
I’m trying to update objects inside an array based on specific conditions that I check using two functions. I couldn’t achieve this with the match feature available in mongoose. As you can see below, I’m trying to loop over the array of posts, send each post and check if it fulfills a condit…
Can someone explain this for/in loop to me?
The part that confuses me is the function calculateCartTotal. What I am confused about is how does this loop know to grab priceInCents? for example, if I was to add another value into the object called “weight: 24” assuming that it is 24 grams, how does the object value skip over quantity and weig…
Change component state – REACT
I’m currently working on a project with the Pokemon API and i’m facing a problem. I want to change the value parameter in the async function getPokemonTypes(), but the value I receive in handleSelect() is not working. On the console.log(value), the value changes every time I select a different opt…
Can’t get eventListener to display value in console
Hey guys im new to javascript and trying to get a better understanding of it, i am trying to make a 8 ball project and currently just to see if it works get it to display in the console but all i recieve is that it is undefined Answer There are a number of issues in your code: You are
addEventListener not working for a HTML Button that is within a Django for loop
I am trying to call a function when an HTML button is clicked, but right now, a console.log is supposed to run when the button is clicked, but nothing appears in the console. This button is within a for loop in Django and is being selected via querySelector through its class. I want only the specific button t…
Heroku App, Created File with Python, how can I get the download url?
with my Flask App I created some files to the heroku filesystem. I know that the files are deleted by each dyno restart. In my html/javascript frontend I want to download it now via button. The question is, how can I get the download url of these files in the heroku filesystem? Thank you! Answer I got the sol…
Change button value on ajax success
I want to be able to change the value of the button from “Submit” to “Submitted” when ajax succeeds. This works np. But I want it to work when the button is not clicked…In other words the button value “submit” should get changed to “Submitted” when ajax su…