Category "javascript"

How can I display an random quote from an Javascript Array in html?

im trying to make random quotes that are listed in an array appear on my website on reload however I cant quite get it to work Javascript: function textOfToday

Angular Material table filtering out all results when input is initially blank, will work after typing into input Only

So my table works really well, except that it shows no data until either a row is clicked or the filter is used. I am unsure as to what is going on here, not su

How to call render functions in Vue 3 composition api?

Back in vue 2 i used to call render() like that: export default { mounted(){ ... }, render(){ ... }, methods(){ ...

MockServerWorker is not handling responses when using fetch in react

I'm doing test driven development in react course - I'm trying to development test for post request. Below is by react code. import React from "react"; import a

How do I target all elements with the same class with getElementByClassName instead of just the first element with that class

I'm very new to JS, and really don't understand a lot of it. Trying to learn as I go. I'm trying to add some new divs to buttons to style them to look like the

get InputName of div element using js, no jquery please

I have a variable that consists of an HTML tag as below: let customDiv = '<div class="MuiAutocomplete-root" name="ApplyTo">Hello</div>'; I want to

ChartJs bar chart bar value displaying lower then Y axis value in pdf?

I have a created a bar chart by chart js , Below is my code version : 2.9.4 var xValues = ["Italy", "France", "Spain", "USA", "Argentina"]; var yValues = [3, 5,

Traverse from one cube room to another cube in three.js

I am trying to make series of 3D rooms with cubes. We can move from one room to another room. Please find the room designs spanshot. User should be able to mov

Size of divs in HTML

I want to reduce the size of these divs so that every row contain 3 cards at most. As I change the measurements in the CSS, it gets smaller and smaller. PS I'm

how can i validate data in dd-mm-yyyy format

I have the following date "13-05-2022" if (!validateDate(this.formGeral.value.data.singleDate?.formatted)) { this.errors.push('Data com formato inváli

VSCode API: Editor.edit editbuilder.replace fails without reason (possibly due to formatting?)

In my extension I want to edit the document on a few specific document edits. My actual use case is a bit complicated so I have created a minimal example. The c

Sync issue with iframe in Chrome and Edge

the following script is used to load in a IFRAME a web application. function openCashier(destination) { postIsAnonymous(function (data

Electron Remote process with user input width and height not working

I am having a problem with using remote windows in electron I am trying to process user input ans use that input to create a new window with a certain width and

Getting a NodeList of the HTML tags in Mithril

Is there a way of having a NodeList of the HTML tags in Mithril? I need to get the width of the blocks. Something like that on vanilla js: const blocks = Array.

Dinamically created cell does not add the event listener correctly

Am I doing it incorrectly here? According to the devtools the cells have no event listener attached. function functionName(numRow) { for (let i = 0; i &

Is adding a scroll eventlistener bad for performance?

Is it true that adding an event listener on scroll like the bellow example is going to fire 1000s events and is bad for performance? window.addEventListener('s

video.js and video-youtube.js throwing "Cannot read properties of undefined (reading 'videojs')" when loading page

I'm trying to play a Youtube video using videojs and videojs-youtube. I've installed the latest versions with npm (videojs 7.18.1, videoojs-youtube 2.6.1). I'

How to render blocks of data from Fetch resource whitout re-render what is already in the screen?

I'm consuming an API, and it returns an array whit length of 370. I want to start rendering only 15, and then, when the user scroll down, render more 15, and so

Inserting a JavaScript variable as part of an HTML src tag in Django

I thought this would be easier, but clearly I haven't touched JavaScript/HTML in a long time. I am closer with the following code to getting this to work, yet i

near-api-js Failing to connect to near

Was making a svelte implementation of a near app. We have a button that connects to the testnet network. It will open wallet to sign in. When successful, it wil