Category "javascript"

Typescript interface for a nested array of objects

I'm new to Typescript and I have to build an interface for the following props type: const myProps = [ { name: 'name1', on: true, children: [

How to change the range based on dropdown menu selection

I have a Google Sheet where I am tracking baseball stats for my High School Baseball team. I have the script setup for every time a Hit Error or Run is recorded

detect whether ES Module is run from command line in Node

When using CommonJS modules in Node, you can detect whether a script is being run from the command line using require.main === module. What is an equivalent wa

React causing: Can't perform a React state update on an unmounted component

My situation: After login I try to get username and save it to redux store after this redirect from login to home page(in this page I display list of tasks) and

How do I get smooth scroll and scroll snap to work together in React while also persisting user scroll position on refresh?

I have a custom hook that persists the user's scroll position on page refresh. I also want to implement smooth scrolling for my navigation links (site is a sing

How to Replace Copied Text from A wordpress website to Custom text

I have a wordpress website. I try to come up with solutions to protect my website from being copied. I try to know, is it possible to Replace Copied Text from A

Open Bootstrap dialog window from Spring MVC BE

I have a Spring MVC controller and bootstrap page. When I submit the form and send some payload to this endpoint if some condition is not met I would like to di

How to use delete request with axios in react project and Firebase?

I need to delete the element but don't know how to get that specific element! This is the structure of data on Firebase And this is the code: import React, {us

Upload a empty folder with js or jquery

hello there I am building a folder upload system with js and PHP but I got an issue I'm not able to upload a folder that not contains any files I use <in

Validation does not work with Partial<DTO> - NestJS

I want to apply server-side validation on my CRUD API. The entity in question is called Employee. I am using an employee.dto (shown below) for the create and up

How to use React Keycloak?

Did according to examples, but I get an error: http://localhost:3000/#error=login_required&state=19004288-e312-4782-ac23-9dc038cd7bb0 Here is my code: keyc

After Java update to the version 1.8.0_301 JavaFX WebView with Leaflet.Draw.Circle, Leaflet.Edit.Circle does not work as well as OSM is not draggable

I am using JavaFX Webview with Leaflet library to render OSM tiles. I am running into issues with Circles and Polygons, Marker and with some functions as Editt

websocket conecttion closed (on mobile browsers) when screen looks

I have a connection to WebSocket which sends me data every second, but when I lock the screen of my phone, after 5 min (approximately), the WebSocket connection

Lambda function not exiting

I am using the serverless framework to create a lambda function. I am running into an issue where the function won't exit when I invoke it locally. I am not sur

render partial view based on user permissions

My Task is to create a permission system that is not pre-defined by roles. E.g the system does not define the roles which an admin can assign to other users. In

Validation does not work with Partial<DTO> - NestJS

I want to apply server-side validation on my CRUD API. The entity in question is called Employee. I am using an employee.dto (shown below) for the create and up

What does this app.directive snippet do in Angular?

I have the following snippet of code app.directive('widthSetter',function($timeout){ return { restrict: 'A', link: function (scope, element,

What is the difference between client-side and server-side programming?

I have this code: <script type="text/javascript"> var foo = 'bar'; <?php file_put_contents('foo.txt', ' + foo + '); ?> var

HackerRank - Birthday Cake Candles

I was just practising Javascript from Hackerrank. The question that I am working on is as follows: Colleen is turning n years old! Therefore, she has n candles

proper usage of flatpickr and laravel

Hello all I am trying to get Flatpickr working with Laravel v8. I've done the following: npm install flatpickr then I added to the resources/app.js: const flat