Category "javascript"

How to obtain the language of the string returned by i18next.t?

Let's say I have two translation resources (i.e. languages). One resource contains values for all the keys used in the software. This resource (here referred to

React - Error, Hookrouter invalid hook call

can't handle this error any suggestions? import "./App.css"; import { navigate, useRoutes } from "hookrouter"; const routes = { "/": () => <h1>h

Using A fetch() GET Request After A fetch() POST Request Has Been Submitted To Output Database Data Without A Hard Page Refresh

I have a form that submits data with the javascript fetch() API to MySQL database with PHP. In the code below, when the form is submitted a success message is o

How to print html code tags in a specific element?

<div class="container"> <pre> <code class="language-html"> <h1>I want to display html tag</h1> <

LightningChart JS - Logarithmic axis

I would like to show some line series on a logarithmic scale, using LightningChart. I saw that the .NET version has some config options, but I couldn't find any

Azure function CORS configuration with SignalR Service not working

I'm trying to connect to SignalR Service Azure function from a react front end. In front const urlRoot = 'http://localhost:7071/api'; const connection = new

Is it possible to create a virtual webcam based on a stream received over the network?

I have an application which requires webcam input for facial expression analysis. I want to host this application on a server where it can process a video strea

Running jest tests in parallel based on a list of parameters

In my case I have a test file containing a few hundred tests using jest describe('my test-suite', () => { test('test 1', () => { expect(1).toBe(

jest test case for URLSearchParams

search looks like this search: "?productId=1234" and changeId is action const urlParams = new URLSearchParams(window.location.search); const productId = urlP

Deleting Wasabi CDN Bucket 204 Error Not Deleting

So I'm trying to programmatically delete Wasabi CDN objects from one of my buckets. My request is sending back 204 and showing success but nothing is being move

React useContext to pass person object from signup to phone verification

I working on a portal using react and I am trying to pass the form data which is an object from the signup page to the phone verification page so I can verify a

Align indentation to the equal sign

I want to align the indentation to the equal sign when formatting my code. Is there any plugin or setup out there? Before: const React = require('react'); con

Ensuring sensitive code is run only server-side with NextJS, where can such code be ran from?

I'm learning NextJS and I'm trying to determine how to layout my project with a clean architecture that's also secure. However, I'm not sure about where to stor

firebase is not being recognized in Unity webGL Build

I have set up a test project in order to test Firebase with unity webGL builds. I have created a *.jslib plugin to keep my js functions in there : mergeInto(Lib

SSE/Redis - how to recover messages sent when SSE goes offline

On a website I have a very simple Live chat setup that uses SSE/Redis and pub/sub structure. The basic setup (without going into details) is: Client-side usin

How to know the height of the div when its overflow is hidden

I have a div, which have overflow hidden. Now want to display a arrow , up and down , up when we have overflow up and down arrow when we have overflow down. An

I want to execute a function if the userAgent is GoogleBot

I am trying to execute some code if it's a crawler. Specifically Googlebot. This is how I am doing it but I feel there is a cleaner way. I saw some posts wh

I am trying to create a rect element within a svg element, but its not working

Why is the red rectangle not appearing when I run the function createRect(). Any help would be much appreciated. function createRect() { var rec = doc

Puppeteer won't click on Facebook cookie notice, no matter what

I am trying to make a script that will load up facebook, type in an email and password and automatically log in. However, when opening the url "https://facebook

How to order an array of object during a forEach()?

So, basically I have this array of objects and I need to order them dependently on the value caricoData, which is a date. Problem is, the value is a string and