Skip to content

Tag: javascript

Emit an event from child mount and access from parent mount

Let’s say I have a component called child. I have data there that I want to access in my parent component. I want to emit an event in the childs mount: this.$emit(‘get-data’, this.data) before finally retrieving it in the parent mount. Is this possible to do / practical? If it is how can one…

How to select next sibling of a certain type with JS?

I’ve got some html And I’ve got the <h4> with the id selected in JavaScript. How do I get from that selection in JS to the first <a> which is of the class link, or just the next sibling anchor tag? Answer Using document.querySelector() and a CSS selector, here with the general sibling …

Trigger click on SVG image

I’m having a play with a SVG image to see if I can create a map for my website. I grabbed the image from a 3rd party site, and now I’m just trying to implement it. Here is a fiddle of what I have: https://jsfiddle.net/hL1weg3o/1/ So basically the CSS is: HTML: ..and then I’m trying to captur…

Docker is not accepting proxy api server

i get the following error, when doing a docker-compose up. The app is running but cannot make any api post/get requests. The express server is using port 5000. ] [HPM] Error occurred while trying to proxy request /api/users/user from localhost:3000 to http://localhost:5000/ (ECONNREFUSED) (https://nodejs.org/…

Promises inside of setInterval

I’ve got this routine function that runs every 60000ms on a setInterval function. Inside of this routine function, I loop over all the usernames on a parsed JSON(db) and check whether or not they’re available via a promise (checkUsername), which is a network request. However, It’s pretty cle…

How to Convert Codepen to Vue.js?

I’m having trouble moving this pen to Vue.js This is what my code looks like for The Vue app – I understand where the HTML, and CSS should go. Should I add the Javascript to the individual component, or add it to the App.vue file? What I want to do is test this code in a view I can route