Category "javascript"

Typescript: Type 'Promise<void>' is not assignable to type 'void | Destructor'

The editor is showing Type 'Promise' is not assignable to type 'void | Destructor'. for the checkUserLoggedIn() call in useEffect. I can get rid of it by doin

Populate dropdown2 from onChange event of dropdown1

I need to write a code where i need to populate a dropdown1 from mysql table based on the selection of another dropdown which also where in need to give values

JSON parse a property of an object inside an object?

I'm trying to JSON.parse(nodeInfluxSeries) a property that is in an object, that is also in an object and in an array. Like so: Array [ Object { "id": 1,

TypeScript Disallow Unecessary optional chain expression

Is there an es lint rule or typescript config to disallow the following ? let s: string; s = 'a'; s?.toLocaleLowerCase(); In my opinion, s is not nullable so n

How to add style in Vue js 3 on a cdn based app

I'm learning Vue js. I created a Vue JS app with cdn link and I want to know, how to add element style to it. I can write template as template: <div>Vue j

populate convas.js multi series spline chart with data from database?

I have a dataset, for which I have to build a multi series spline chart. Here I have used canvas.js. But I cannot populate this graph with data from database. I

Bundle JS and CSS into single file with Vite

I'm having a devil of a time figuring out how to build a single .js file from Vite in my Svelte project that includes all of the built javascript and CSS from m

Why prettier put a comma ',' at the last element of the object

In Visual studio code, When I am using chart.js in my app, prettier always put a comma at the end of the last data of the object 'label'. I think, it's create a

sending selected field to another react component

I am receiving my API data in react. I am sending same data to another component to download the excel file. const [data,setData] = useState([]); const fetc

Adding video captions tracks dynamically puts them in the wrong order

When I try and add video text tracks to videoJs player, it adds them in the wrong order where the new track appears above the previous track. I have created a j

I am Unable to display the graph on button click

There is this project where I have to display a dynamic graph which updates automatically without refreshing the page. I was able to do this and I am currently

Google pay option is not coming in stripe

backend @app.route('/create-payment-intent', methods=['POST']) def create_payment(): try: data = json.loads(request.data)

how to insert data into firebase database

how to insert data into Firebase database | when i try to inset it , ncaught TypeError: firebase.database is not a function at HTMLButtonElement.document.getEle

Angular federated module can not be loaded when route would be activated

I am trying to achieve a very simple module federation with shell (host) and travel (remote). Whenever I try do dynamically load the AbcModule from travel I get

How to resolve AWS Cognito SDK error: "Client <XYZ> is configured for secret but secret was not received?"

I'm asking this question because I was surprised how little information I could find from Googling. However, I was able to track down what I think is the root c

How to use Exec / ExecFile on Javascript to run a java file and get the result

Running this JS file on the server side of my website so when the user presses a button, it executes this command with my API: exports.runAlgorithm = async (req

Escaping double quotation in javascript

I am getting an error when parsing what seems like valid json. The JSON string contains an escaped double-quote character inside of a string. I've condensed the

React-Router: Force reload in browser

We have a monolithic react SPA deployed with AWS Cloudfront. We are trying out microsite architecture where each route/path in the react app will be built and d

How to convert seconds to minutes in MVC?

I get the input as a second from the user and I want to show it as minutes and second in the Grid. I know I have to use a method but I don't know how. **Seizure

how do i fix 400 (Bad Request) error about admin-ajax.php

I want to deliver html value through JS to PHP handling, but I still got error, 400 (Bad Request) . This is HTML: </div> <form class="row g