Category "javascript"

Opening up a PDF with Adobe Lightbox Embed API through clicking a link

I'm fairly new to website development and I would like to know how to get this script to run after clicking a link on a page. <script src="https://documentcl

How to autoplay YouTube video with sound enabled using YouTube IFrame Api

The title says it all: How to autoplay YouTube video with sound enabled using YouTube IFrame Api How can I do this with the YouTube IFrame Api?

How to import ".mjs" modules in Jest's xyz.test.js?

I want to use Import/export feature of ES6 modules (since my entire project uses that) with Jest 26.1.0. I have created a directory for my test cases called tes

How to insert a hubspot form in a react js app?

i have a react js website and i want to insert a hubspot form. Hubspot form: <script charset="utf-8" type="text/javascript" src="//js-eu1.hsforms.net/forms/s

Trouble fetching token from localstorage - React

I'm new with react and i'm trying to create a basic login function using local storage and tokens. I can see in my devtools that a token is actually stored but

Testing hover state hooks

I created this useHover hook: import { useRef, useState, useEffect } from 'react'; export const useHover = () => { const [value, setValue] = useState(fals

"TypeError: Failed to fetch dynamically imported module" on Vue/Vite vanilla setup

We have a vanilla Vue/Vite setup and I'm receiving TypeError: Failed to fetch dynamically imported module on sentry logs. It seems like the errors are correlate

Mixing strings and html links in react/typescript constants

Im trying to mix a string and a link, within an attribute of one variable : const News = [ { headline: 'some headline', text: "some text" + <

How to dynamically create a component tree in React based on an array that contains components?

I have a components array. const components = [ A, B, C, ] Then I want to render this components like this: return ( <A> <B> <

Make screenshot fit window size (full-screen)

I'm using react-webcam to take a photo (screenshot) and set that screenshot to the size of the window. With the code posted below, I'm able to make the screensh

Add class to amp-carousel-button

I have a carousel created with the amp-carousel component, the amp-carousel-button elements are created as part of the component. Is there a way to add some cla

How to save PDF from HTML with the same rendering in app script

I need to save an HTML webpage as a pdf in my google Drive. I am using app script. However, the PDF is rendered differently from the HTLM page. I need the PDF t

JavaScript Plotly.js How to create a 3D surface plot using x, y, and z coordinates?

I have read a few questions on this topic (although most were for the python version of this library) and none have worked for me. I want to create a 3D surface

How do I make GSAP find the "most optimal" rotation method?

I want my mesh to rotate at 90 degree angles in all directions, but make GSAP find the most "optimal rotation". So if I press 1 it'll be at this.meshName.rotati

Do something when a specified user react discord.js

Hello i have a marry command and i want to do a reaction verify, when the tagged person reacts with ✅ do the actions i add there. I can't find a solution,

Draw boxes around shapes on canvas

I've got an image like this: The little circles are not regular but they are all black. I'm looking for an algorithm to obtain an array made of all the rectang

How to select specific value in a Query in HTML <script>

I need to know how to select a specific value in a form of a query. Under the Content.join('');, I need to select like 2 values which is the Hello and Lorem ips

PayPal Checkout: Is it safe to receive a payment with only client-side code?

I'm using the PayPal API to put payment options to my website. In the tutorial they have, they are rendering the button and setting up the transaction entirely

How to call recognition.onresult to an API function in Javascript?

Im working on a voice recognition system where a voice command can pull up NASA's Astronomy Picture of the Day through their NASA API. I've made some simple cod

Monaco-Editor increase suggestion width using css or props

Is there any way to increase the suggestion width in the monaco editor. I try to find around for an option but I am unable to find it anyway. Is there a css fil