Skip to content

Modal doesn’t open on all buttons

As my title already says, I have an issue with a modal not opening on all buttons. Here is the situation: I have a page that displays all applications a user has sent for different jobs. So it may be just one, or up to whatever. It looks like this: Now if the user wants to cancel the application he

How to do [:] like in Python but in JavaScript?

in Python, you can get a list like this (array in JavaScript) I’m wondering how I can do this too but in JavaScript. If it is possible, please tell me 🙂 Answer In python, a[:] creates a shallow copy of the array. The equivalent in JS is […a]. If you just want to get the first two elements, you can…

Express GET request not reloading page

I’m trying to send the client the next HTML page (create.html) as a response to a GET request (fired by button) using fetch. I am purposely trying to avoid using a form due to formatting issues and potential future scaling issues. The code registers that the request is sent, received, and is responded t…

Move g element for centering them in a tree layout

I would like move the g element include multiple tspan text to enter. The attribute dx and dy doesn’t work in this example. what’s the proper way to move the g element to make it move to center? Answer For repositioning them dynamically, an easy approach is getting the size of the element and tran…

Javascript Delay/Sleep function

I am writing a vanilla javascript function to add a page scrolling animation to my website. The problem is that I want the event listener to pause for the specified millisecond time to give time for the animation to complete since if I scroll normally, the animation will happen multiple times one after the ot…