Category "javascript"

Query to get most popular musician with an aggregated field sum

I have the following database schema: model Music { id Int @id @default(autoincrement()) createdAt DateTime @default(now()) updatedAt DateTime

Horizontal click and drag scroller for multiple sections help, works for only one

So I have a horizontal scrolling feature which works great in JS but only for one section with the classname, any other section that shares the same classname i

How to make the slider work in a BS collapse element?

So I am using Bootstrap to create my collapsable elements. I am also using a range selector cdn, and I'm thinking there might be some styles from the BS CSS, sp

What are the options for 'Date.toLocaleString()'?

According to the MDN documentation for Date.toLocaleString(), the second parameter is an options parameter: toLocaleString(locales, options) Which they use in

What is the equivalent of 'beforeselect' event for combobox in the ExtJs modern toolkit?

I am converting an 7.2 ExtJs application from classic to modern. In the conversion there is a classic combobox that has a 'beforeselect' event listener and it i

How to make a Post Request with XML using Axios?

I have a Network error with Axios, using the following code : const getXMLNS = (number) => { return ( '<soapen

How can I keep the text highlighted with JS?

I'm working on a conceptual project. Text reaveal on selection with highlight. I have to keep the text highlighted once it is selected. <div class="reveal" i

TypeORM error when trying to create migration in CLI

I'm trying to use the TypeORM CLI to create a migration. I followed their guide but when I run yarn run typeorm migration:generate I get the error: $ typeorm-ts

Sorting object property by values

If I have a JavaScript object such as: var list = { "you": 100, "me": 75, "foo": 116, "bar": 15 }; Is there a way to sort the properties based on

D3.js Heatmap colors based on variable value instead of value for the whole table

I want to create a heatmap which shows the heat/color based on the value of one variable over all groups but not over all variables. Currently I have the follow

Can't disable controls in a youtube video

I am running a content.js on a youtube page and i want it to disable the controls of the youtube video. I am getting the video by video=document.querySelector('

How to access a property inside an object and use in another method? javascript

I need to create a method to return a customers name and bank account value like so: *bank.printAccount('Sheldon'); // this should print 'Sheldon account is 0'*

How to get the contents of a file as a String

I am new to Typescript and node. I have this function sftp.connect(config) //CONNECT TO STFP .then(() => { sftp.list(remoteFilePath) //LIST THE FILES IN

How to use class component without extending React.Component

I have been given in built ui kit which has class based component without extending React.Component. Now i need to use those UI components for building UserInte

How can I send JSON data from local storage to controller in Laravel?

I want to send the json data from view to controller using ajax. How can I achieve that? The data in local storage is [{"productId":2,"productCost":"630","produ

cant access state, react redux

I have a page with notes for a specific user, the problem is when i'm trying to access the state of 'my notes' i get 'undefined' on console, in postman, everyth

How to check whether all number elements in an array are even numbers with recursion?

I'm currently learning as much as I can about recursion but I'm really stuck on how to use it to check whether all the number elements in an array are even numb

Make persistent changes to HTML file using JavaScript [duplicate]

The code below saves the contents of a <textarea> to the DOM when the Save button is clicked. function save() { // Create the new el

How to throw an exception with a status code?

How can throw an error with options or a status code and then catch them? From the syntax here, it seems we can through the error with additional info: new Erro

Why does my Selenium script work only every other time?

I think I should start off by mentioning I have Mac OS and am using Safari browser. This script is a web-scraper that is supposed to search for a given type of