I am having trouble accessing data from an API. Here is my code with a fake access code. I am getting an error that says “Uncaught TypeError: Cannot read property ‘temp’ of undefined” Here is the API. I want to be able to access temp and description and append them or add them to my pa…
Category: Questions
How do you read the rotation of a div using javascript?
I have a spinning wheel that I need to read the rotation for. It spins and stops, then I need to read the rotation to know how many points to assign to it. (the wheel with point values on it). How would I do this? I would think that it would be document.querySelector(“.container”).style.transform.…
Getting environment variables to work in next js and netlify
I have deployed a next js application to netlify using git and I have a .env.local file that stores the backend route url that I use everywhere throughout the app when making fetch requests. The problem is that after deployment the process.env.NEXT_PUBLIC_BACKEND_ROUTE returns undefined. The .env.local file: …
VueJS : Unhandled error with simple script
Still learning VueJS, I just wanted to know why when I click on my button my function selection doesn’t work. All the rest in the created() is fine and shows the correct , but in my methods section, just to show a console.log on a click event I have this error : [Vue warn]: Unhandled error during execut…
How to click and hold in Puppeteer
I am trying to click and hold using Puppeteer. I tried using page.click inside a while loop but it didn’t work. I also tried this: Any ideas how to do this? Answer There are a few tools to trigger a mouse hold in Puppeteer: page.click, mouse.click, mouse.down and mouse.up. page.hover can be useful for p…
How do I fix “Identifier directly after number” error
could anyone tell me what’s wrong with this code and how to fix it? Any help would be appreciated, thanks. The error is: “null – parsing error: Identifier direcly after number”. Here’s the other code with the error “ChannelId already defined”: Answer In JavaScript obj…
Why does howSum solution work in Javascript but not in Python? (Dynamic programming)
This is a follow-up to this question asked on Stack Overflow. Write a function ‘howSum(targetSum, numbers)’ that takes in a targetSum and an array of numbers as arguments. The function should return an array containing any combination of elements that add up to exactly the targetSum. If there is n…
Why isn’t the alerts showing up?
I’m trynna make a simple validation in JS by checking if the name entered has at least 5 characters and the age is over 18. This is what I have so far: I have no idea what am I doing wrong and why is it not working. Answer There are various issues with your code in if (userName.length < 5)
How to listen to keyboard events in electron without interrupting default behavior?
I was trying to listen to Ctrl-C event using electron globalShortcut module, but as it seems, electron is re-writing default behavior automatically (without features like preventDefault in plain javascript). Here’s what I did: Is there an another way to listen to global keyboard shortcut events using el…
How to set the b-pagination’s main color?
In bootstrap-vue pagination there is no slot for change main color of pagination. you see there is only blue color for it. is there any way to change it to my required color? Answer You could change it by changing the CSS of the active item of b-pagination. I illustrated the solution by the following code: