Category "javascript"

text() method not available in Blob

I am doing some Integration tests with jest & nock to test Axios interceptors chaining. In one of them, I am expecting to receive a Blob instance and accord

Best practices for handling UIState in StimulusJS

Just starting off with StimulusJS and trying to follow best practices. As I come from VueJs/Nuxt, state management and communication between components is quite

Problem with SOGo theme background isn't getting applied to md-dialog and md-card

I made a theme for SOGo (https://github.com/inverse-inc/sogo/) everything works except md-dialog and md-card Does anyone know why the background color doesn't a

Problem: ParserError: Syntax Error at line: 1, column 32

I am new to programming and I am with this problem. When I put in the Terminal "npm run build" to create the compression of my project in React.js I have this e

Display different language text in <noscript> tag, depending on browser language

I'm new to HTML, and I want to display a message when JavaScript is disabled. So I put the message inside <noscript> tag, which works fine. <noscript&g

Mixed named and unnamed parameters in JavaScript?

For a function with an intuitive first argument (e.g. a find semantic) I'd like to provide a way to write a function call without argument names while more comp

context.putImageData() Not working in React

Im trying to create a drawing application in react, its working for the most part. But when i try add an undo button it doesnt work. I try make the undo button

How to write typescript interface for Window object ethereum that has a request method being called

I am running the following function import { ethers } from "ethers"; async function requestAccount() { await window.ethereum.request({ method: "eth_reques

What is the difference between Array.from(Object) and [...Object]? [duplicate]

There are these two ES6-methods of creating an array from an array-like or iterable object: Array.from(): let arr = Array.from(Object); Spre

How to display distance in AR.JS

https://m.youtube.com/watch?v=biCKHVefIe8 How to show distance in location based ar.js in JavaScript like this? I build a-image and I want to show something lik

Module "pretty-format" has no exported member 'CompareKeys'

import type { CompareKeys } from 'pretty-format'; ../node_modules/jest-matcher-utils/node_modules/jest-diff/build/types.d.ts:7:15 - error TS2305: Module '"prett

JS How can I increase the performance of this Max/Min coding challenge?

I'm trying to solve some 'hackerrank.com' coding challenges. I'm stuck on this one: You will be given an array of integers arr and a single integer k. You must

Prompt login via saved google account

I know how to integrate "Login via google account" in any website. But in some website like zomato always prompt "login via google" account while opening. It sh

How to detect if a variable is a pure javascript object

I have a function I need to pass an object to. I use typeof operator to make a check before processing. But looking at this link, it appears that many javascrip

Is it possible to extend the borders of table data <td> to align with content that has been moved via negative margins?

I have a collapsible table, which opens and closes when clicking on Accounting. It requires a unique layout. I have added a checkbox to my collapsible rows, w

How to get rid of the CORS error when sending email with attachments with Gmail API?

I know there are plenty of articles on the topic but none of them helped me solve this issue. I have a website where users can connect their Gmail account and m

How to get indexOf proper className of targeted element? [closed]

I have an target element which is a SVG which has two properties baseVal and aniVal, So I'm trying to get the proper indexOf the className fro

Jest: TypeError: replaceAll is not a function

String.prototype.replaceAll() is a useful method and while building and executing everything works fine. However, all Jest-tests fail with the following error:

Getting table name from cell selection in Apple Numbers using Javascript for Automation (JXA)

I'm trying to convert this Applescript to Javascript for Automation. Is there anyone who can help to write the line bellow in Javascript for Automation? set thi

Some instances of a ReactJS component won't update

I'm developing a VOD app for TV and I'm having an issue with updating an element inside of a slide component. Basically, when a costumer focuses on any of the s