I have a tree structure that is made out of the data below. I need a search algorithm to find the top leader when I put in anyone’s _id value, regardless of leader or child. For example, if the input is “615e8215c3055d1addc216b0” (the id of Rahman) or “61164b4bc08f86505e7dcdd8” (…
Appending an Element on Mousedown Into Specific Div Element Only
I am trying to add circles when the event mousedown is generated into the square-one (grey square) only. If the mouse hovers outside of the square-one, it should not insert any circles anywhere else such as square-two(green square). Question: How can I set the limits for the circles such that they are only in…
Could someone explain the issue with this function chain? Not getting intended functionality
I am trying to understand JS and jQuery and have some code to append an element to the DOM. I try and create a text node and append it to the element node and then append that to the first div tag, all in one statement. I understand this is probably bad practice but I just wanted to see if
Why won’t my async call fire inside this Vue 3 component (using composition API)?
I’m trying to make an async call to fetch data from my Fauna database. But I can’t get the async call to fire. Inside the setup() function I have console.log(“Setup is working”); and that works as expected. It shows on page load. Then inside the callApi async function I have console.lo…
Calling JavaScript from component template
I’m working on integrating payment forms from a third party, by using the Link to Javascript they provide. when I place the code in the index.html page its works just fine, but when I move the code to the component template is not working, below is part of the code: this is the script code to initialize…
How to format a string of html in json
I am working on a tool for generating html files. The code is fairly simple. A user clicks a post button and the content from a textarea is sent to an endpoint. I have tried posting the html as a json string. Expected The saveContent method is called. The value from the textarea element is concatenated into a…
How do I use className to change appearance of html in reactjs?
I am currently learning ReactJS from a youtube tutorial and am trying to use className’s to make the page look better. The tutorial I am following only added: className=”card”> in the opening tag of a div element and it changed the page appearance though it does not seem to be working for…
Passing string from parent to render multiple children
I may lose something on the way.. I want to pass object arguments to a children to dinamically render it in three different ways. Here is my object: This is the children component: And then i have the parent component where i want to render multiple Card mapping the cards array: and then i receive this: Error…
Copy scrollTop value from textarea to div
I have a div and a textarea inside a parent div. I am trying to copy the scrollTop value of the textarea to the div so it moves in sync with the textarea scrolling. The problem seems to be when i add text into the textarea and then press enter for a new line, the div scrollTop value doesn’t seem
Inject Vue Component into web page using Quasar bex
I’m building a browser extension using Quasar BEX and I want to show a Vue component in the loaded web page. I already tried to use content script hook to add raw html and css in the web page, but I want to add a component from my src/components folder which is also using Quasar components like q-btn et…