Category "javascript"

Grabbing Nx root package version into workspace package.json

Besides hardcoding, is there a way/shortcut to programmatically get a matching package & version from the root level package.json? I’m creating a gene

Deploying Out folder in NextJS 12.1.0

Before the new version 12.1.0 of NextJS when i ran the command run build && export i would get this Out folder, which I could upload to any host, for e

Why browser is not setting the cookie sent from my node js backend?

I'm trying to set a cookie from the backend server running at "api.mydomain.com" like this to the frontend running at "mydomain.com". res.cookie('auth', tok

How to scroll down intro element view with selenium+javascript

Im just new in javascript. I used to work with selenium+java. Now I want to perform scroll using JavaScriptExecutor. How do I make it in javascript code instead

How to trigger animejs on a specific Swiper slide?

You can see my code using this sandbox: https://codesandbox.io/s/strange-shtern-e98gvu?file=/src/App.js Basically, what I want to do is play the animejs animati

Mousedown event not added

I'm adding an event listener but listener didn't added and i have no errors. I'm going to make a word game. And the problem is so weird const alphabets = ["

how to set labeloffset dynamically in chart Js

I am using Chart.js, I have to generate stack bar chart based on fromMonth to toMonth selection. My bar chart option is: { "chartCanvasHeight": "200", "char

Angular MIME issues in Edge

I'm running into an issue with Angular where if I ng serve and deploy on localhost, the page loads fine. However if I use ng build and deploy remotely, I then g

Swap 3 divs and make the selection div go to the center

I have three divs and I want that every single time I click on any div, it will be swapped with a second div which is meant to be at the center. I have tried li

Why does a class have a "constructor" field in JavaScript?

A class is supposed to have a prototype field that supplies default fields. For example, prototype.constructor defaults to the constructor function (i.e., the c

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