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…
Tag: javascript
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…
Zoom still show original image after switching new image from thumbnail
I use Image Zoom from w3schools, code as follows: And I use the following simple code to switch images: My url: https://cn.angelcorp.net/shop/goods.php?id=9 You may click the thumbnail image with flag, but the zoom still show original image without flag. Thank you. Answer You’ve got to change the backgr…
v-model in html.erb template renders function () { [native code] }
I am in the process of adding Vue.js to my Rails 6 app. The project is using turbolinks so “vue-turbolinks” is installed via yarn and my Vue config looks like this: and my rails template(.html.erb) contains a text field with a Vuejs “v-model” attribute Vue seems to be working as expect…
How to query on collection values and referenced documents values in MongoDB?
I don’t know how correctly I formulated the question. I need to execute a query on both the values of the collection and the values of the referenced objects. The original collection looks like this: When executing a query that meets the condition district == “Texas”, I need to get the f…
Install text editor in textarea
I’ve created a text editor using HTML and jQuery codes and I want to be able to place it in a textarea, like those editors you can find on the internet. I’ve tried to understand how do they manage to do that in order to do the same, but I’ve failed. I need to place the editor (that is in