Category "javascript"

MUI: The `styles` argument provided is invalid after upgrading from material v4 to v5

I recently upgraded from Material V4 to V5 and I'm now getting the following error: MUI: The `styles` argument provided is invalid. You are providing a function

Javascript Datatable limit amount of characters shown in a cell

I am creating a DataTable in Javascript, which has the following properties: var dtable = $('.ssdatatable').DataTable({ "lengthMenu": [[10, 25, 50, 100, 50

How to get hour and minute as numeric values (not string) in local timezone from Javascript Date object?

I have a Date in UTC format, and want to get the hour and minute but in the local time zone the browser is running in - and without me specifying the timezone e

Access Django variable from JavaScript variable

First of all, I will like to say this is my first question here! (pardon me if this is redundant or duplicated) I am having some problems with calling JS script

Swiper Slider - Infinite loop with multi-row slides

I'm using the Swiper by iDangero.us and I'm having difficulty creating an infinite loop of multi-row slides. I have 30 images which I need to group into 3 rows

Correct way to apply global styles into Shadow DOM

This questions is similar to some other on StackOverflow, but I couldn't find any answer describing applicable to my situation and non-deprecated method (and I'

select2 and axios: success is not a function

I am new to javascript, callback functions and select2. Thanks in advance for your help :) I am looking at implementing select2 to search against an API but I

One ipcMain.on() works in the same file while the other doesn't work?

I am developing an app using Electron and vue. I use this solution to communicate between main and render, so I have three files, preload.js , main and renderer

Customize code folding for .js and .jsx files in vscode to achieve folding of className='...'

I am looking to fold the className attribute in my react app, as I am using tailwindcss and thus the classNames get quite long, cluttering my files. I've come a

Does Spread Syntax create a shallow copy or a deep copy?

I am extremely confused for days now regarding the true definition of a shallow copy and a deep copy. When I read the mdn docs (https://developer.mozilla.org/en

Problems with parsing a JSON array objects into an object

first question i post here. I'm learning js and trying to do some APIs for a college project. I have the body of the API that passes a JSON object like that:

How do I update the items async in a b-table from Bootstrap-Vue reusing the items provider function?

I am using Bootstrap-Vue v2.0.0-rc.11 and I just cannot get my head around how to update the table content. I am sure it is trivial. I am pulling my content fr

Javascript video pause is not a function

So I'm having a little trouble with videos, i have a website and there i have the same video displayed in 3 different pages. The videos are all paused until th

How to dynamically add escape character for any character in javascript?

I have got p element with some text. In this text in HTML code I use some "escape" characters like \n, \?, \t, etc. When I get the string in JS code, it is trea

Get a list of Sundays for next three months

I need to get a list of Sundays for the next three months. I wrote a function which worked up until today. Three months from today is January, which is 0 so my

Firebase secrets not defined in process.env

I'm writing a Firebase function with Cloud Storage trigger. Like this const functions = require('firebase-functions') const doSomethingWithSecrets = require('./

ReactJs this.setState is not a function

I'm trying to change the value of a this.state.id with an <input> tag value, when I click on a <a> tag as follows: {this.state.json[1].map(i =>

Google Maps data scraping using Puppeteer JS NODE JS error issue

I am trying to scrape data from Google Maps. I have written a Puppeteer JS code and run it with NODE JS. I am receiving this error. Recieved an error, attemptin

Reactjs build failed attempted import error: 'widget' is not exported

I created a new React project with Typescript and I copy and paste old file from another project which is just .jsx file. This file is importing a class called

Plot a Line chart using Chart.js with CSV Data

I need to plot a simple line chart using the chart.js library from CSV data, which is in the following format: data.csv "year","rate" 1952-53,3.00% 1953-54,3.00