Category "javascript"

How to set data in Firebase .onSnapshot()

I'm trying to set data with this function and its not setting the variable. How can I set information for outside use with this? Here is my code const docRef =

VueJS - create readonly copy of a ref object (Composition API)

I am getting data from db by onMounted hook and showing object in a form. When user clicks to save, I just want to check if object data has changed or not. onMo

Why my Interactive Art is not working like it should on mousemove

I made an Interactive Art but instead of scaling each child different pixels it is scaling each child same px. P.S the commented out code const WIDTH = 512

Firebase addDoc not writing data to Firestore

I'm trying to write some data to my Firestore database. I've been following Firebase docs but for some reason nothing is being written to my database. I'm not r

How do i use chartjs in react project properly?

Im trying to use chartjs in my react project but it doesnt work. What am i doing wrong? You can see console logs here: logs import styled from "styled-compo

Remove punctuation at end of line in responsive text block

I have a list of a large number of Things divided by bars, i.e. Thing 1 | Thing 2 | Thing 3. They're in a responsive container and so I have no way of knowing w

Django : Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0

Error When Click Button for send data. Please Helping me to solve problem. Error When Click Button for send data. Please Helping me to solve problem. Error When

How to read the user input on the client-side, modify it with JS on the client-side, and then POST it to the sever-side (Node.js)?

Problem: I want to read a user input on the client-side, do some processing on the variable using JavaScript, still on the client-side, then POST the modified v

How to send an email from JavaScript

I want my website to have the ability to send an email without refreshing the page. So I want to use Javascript. <form action="javascript:sendMail();" name=

How do I send fetched data from chrome extension background script to content script?

Once an event is triggered in my content script, it send a message request to the background script and waits for a response. content.js chrome.runtime.sendMess

How to paginate in react using inertia on laravel?

How to paginate in react using inertia on laravel? pulling the paginated data: $contacts = Contact::orderBy('name', 'asc')->paginate(10); return Inertia::ren

Pushing value to array that is the value of an object

I have the following structure: let mappings = { "1002": ["1000", "1003"], "2000": ["2001", "2002"] } and I want to add this piece of data const issueT

Infinity loops with useEffect and useCallback - Reactjs

somehow I got an infinity loop, the weird situation that I did solve it but I got a warning and I wish to fix the warning. this is code that work: import { Arro

Error $wpdb when use Ajax in Plugin WordPress

I'm a beginner in development and wordpress. I create a plugin to display a dynamic carousel with the help of the generator https://wppb.me/. So when I select a

How to use and load JS helpers in Stimulus controllers in Rails 7?

I want to import and use functions from my javascript/helpers/functions.js file in my stimulus controllers. I tried pinning it with: # importmap.rb pin_all_from

Camera not displaying after reloading app or running npx react-native start for the 2nd time

I have implemented tensor-flow camera functionalities for pose detection on a website and then hosted it on netlify. Link: https://uactivsite-mobile.netlify.app

Why does jQuery or a DOM method such as getElementById not find the element?

What are the possible reasons for document.getElementById, $("#id") or any other DOM method / jQuery selector not finding the elements? Example problems include

Javascript display ball with number when clicked

The below code showing that i click 4 times, the output like pic1 let sep = s.messages[s.player_at_the_table] == "" ? "" : "・"; s.messages[s.player_a

How to prepopulate name of the printer in the browser

I'm using ASP.NET MVC and I'm using a function with AJAX that opens in the browser the window to print. My questions is when I print I would like to already set

Shadowdom access form selenium javascript/typescript

I'm trying to get access to some shadow dom elements using selenium in Javascript/Typescript, but can't quite seem to get it to work as expected. I haven't bee