i have a long page with one button at tope and one button at the bottom , i made the first button scroll me to a div tag at the botton like this <button onClick="document.getElementById('…
Updating react state when receiving an array of object
I am using an axios.get to make a call to my MongoDB. My response from the DB is an array of objects containing all the data from the database. I am only trying to save the username of each user to state. I am trying to set the response (res.data.username) to my state however when i log my state I
Applying the sort method inside divs (cards) in a Single Page Application – Vanilla Javascript
I have been working on a single page application in Javascript and would like to implement a sort by names and popularity of cards created by some data fetched from Movie DB API. I have already tried …
Vue rendering elements before hiding them
I have a very simple site where I’m using the most basic Vue. When I load the site, it renders divs which are not supposed to show, for a fraction of a second, before hiding them. It makes the site look very unprofessional. Here is the site if you want to experience the glory of flashing divs: http://sq…
Uncaught ReferenceError: regeneratorRuntime is not defined in react 17, webpack 5 while making api calls through actions
Having this error Uncaught ReferenceError: regeneratorRuntime is not defined when trying to make a api call using superagent. Currently i am using react 17, webpack 5 along with css modules and all latest packages. package.json babel.config.js webpack.config.js Answer For Babel 7, install these two dependenci…
How to delete a file with an unknown extension using fs in NodeJS?
I want to delete a file named myfile with any extension. The error I get: But there is a file named myfile.jpg which I want to delete. Let’s pretend that we don’t know the extension. How can I delete it? Answer unlink doesn’t support regex to delete file. You will probably need to loop throu…
Carousel item dont scroll under nav bar
I’m new to HTML and CSS, so maybe my explanation of the problem may no be accurate but I will try my best to make it understandable. So the problem is I have a title bar and then a navbar below it. In the navbar, I have links to the pages which I name by the year 2021, 2020, 2019,
How can I add a normal space between these components?
How can I add a normal space between these components? I don’t like the way of increasing the padding to the right, I tried doing like this way by adding template strings ${“} but it did not work Any suggestion on how to add a normal white space? Current output: Expected output: This is a bold spa…
Javascript show specific array data from global array data
I need to show specific array data from my global array. So on that code above, I need to take out/hide Hiking with time 19:00. Here is the loop JS: and table HTML: I tried to run the code, Hiking is hide now but the time is not hide. Answer Here is the code, one more if statement check.
How to display comments from a JSON server using javascript and HTML?
I am making this website project where people can leave comments and the webpage will dynamically display the comments without reloading the page. My comments are stored in an array in my server in the format Allcomments=[ { username: ‘username’, info: ‘title’, commentinfo: ‘comm…