Category "javascript"

how to sum 2 numbers in javascript before saving it in mongodb database

I'm building a web app using MERN stack. I want to sum 2 numbers then save it mongodb database. Here current num is from database and other is from input field

locomotive scroll disable the scroll of my page

When I put this function : const scroll = new LocomotiveScroll({ el: document.querySelector('[data-scroll-container]'), smooth: true }); The scroll of my page n

Uncaught (in promise) Error: No ethereum object at checkIfTransactionsExists (TransactionContext.jsx:105:13)

Here is my TransactionContext.jsx TransactionContext.jsx:105 Uncaught (in promise) Error: No ethereum object at checkIfTransactionsExists (TransactionContext.js

Sum of values in javascript object

I have the following javascript object const reizen = { personen: [ { naam: "Bob", reizen: [ { locatie: "Frankri

HLs.js stuttering audio stream on Safari only

I am using Hls.js to stream live audio for radio, and it works well on chrome but the audio is stuttering on Safari only. Here is the code sandbox example(kindl

v-bind:style for dynamical value in Vue.js

When I use v-bind:style for using dynamical value, I came across the problem that v-bind:style doesn't work but I'm sure v-bind:style gets correct value(:style=

want the app to save state separately according to each user in react native

I have a app that conducts a test and when the currently logged in user passes the test, the app shows a modal telling him that he has passed the test. I want t

GET method gives success but PUT method gives 401 despite same credentials

The problem Overview When getting products using a GET method everything works when trying to update a product using PUT method I get 401 unauthorized I use sam

Having trouble using List.js to filter student profiles in JavaScript?

I am trying to filter student profiles via an input field. JavaScript grabs the data via an API and then using a return function I display the data on an HTML p

How to verify ReCAPTCHA token in js?

I have written the following function in js to verify a ReCAPTCHA token: export async function validateHuman(token) { const secret = "funny_little_secret";

TypeError: _API.default is not a constructor with Jest tests

I have an API class that I am trying to use in a React app. // API file class API { ... } export default API; // Other file import API from "utils/API"; con

To get the default printer name

To get the default printer name . This code is what I am using, In order to get this <script language="javascript" type="text/javascript"> function

How can I use javascript to hide by default the navigation links in my navbar on small screens?

I set up my navber using tailwind css and was able to make it responsive. When viewed on a smaller screen the navigation links are displayed underneath each oth

Svelte Gantt Chart - Separate via months

I'm trying to have a gantt chart with all 12 months in it. I'm doing this by setting the from & to values to currentDate.clone().endOf('year') & current

How to preload text into text area in v-for loop(vue)?

I am struggling on something that I thought would first be easy to solve. Imagine a page loading with multiple text areas as: <div v-for="(item, index) in ar

Uncaught (in promise) Error: This contract object doesn't have address set yet, please set an address first

I would like to know why I get this error, if the contract is declared in CONTRACT_ADDRESS and is called through contract to be used in data: Uncaught (in prom

When I add SCEditor to my Blazor project, the editor keeps appearing in strange places, sometimes in multiple copies. How do I fix this?

I want to use SCEditor in my Blazor page. For example I create a new Blazor WASM project and I did these steps: According to documentation I add this codes and

"Module not found" when migrating to Webpack 5

I am trying to migrate my React app to webpack 5.72.0 (from 4.42.1). So I also have webpack-cli (4.9.2), webpack-dev-server (4.8.1) and babel (7.17.9). My probl

TS2322: Type 'Count' is not assignable to type 'ReactNode'

I am new in react and TS and I need help I am trying to use useState with typescript import React,{useState} from 'react' interface Count{ count: number } co

Live stream output from JS MediaRecorder to Python speech recognition server via soket.io

I'm trying to stream microphone from my browser to a server running a Python service connected to the google cloud speech-to-text. For the transfer I'm using so