Skip to content

Category: Questions

Javascript: Assign or don’t, depending on …

In JavaScript (only vanilla JS please), is there any way to “conditionally assign” a variable? I googled “conditionally assign” and got answers involving the ternary operator, assigning one thing or another depending on a condition, so perhaps I’m using the wrong term. I actually…

Infinite repeated while using v-for in vuejs

I have an API to get list of books, in each book I have author ID. I also want to get author name from that ID through another API (get author), so I use v-for to get items in list of book. Each item I call getAuthor(authorId) function but it repeats infinitely. Does anyone know what the reason is? My

How to get all corners of path?

I have a SVG path. How to get all extremum points from this path? (points of corners)? I have tried to get all points using this: For exmaple from this Path I need to get coordinates of 4 points, because it is rectangle: Answer The getPointAtLength() method gets any point along an SVGGeometryElement regardles…

How to use owl carousel in Nuxt?

I want to make script work on every page without that these page need loaded; I have owl caroussel script on my static folder, and i already put it in nuxt.config.js, here how i put it: And there is the script on my main-script.js: The caroussel work well on the page if the page is loaded, but if it come