Category "javascript"

TypeScript how to call function with its name

I am new to typescript, when I type: (dialog is imported from a library) ipcMain.handle("openDialog", (event, method, config) => { return dialog[method](wi

Is there a way to make custom CSS properties in JavaScript?

Is there a way to create custom CSS properties in JavaScript? Example Note: this code won't work, it's just showing the sort of thing I'm looking for. I'm looki

Is there any way to add a pattern to the stroke of moveable line

Here is my code to add the pattern to the stroke of the moveable line. when I try to move the line, the pattern remains in the same position. It should move ins

Lazy load images in a modal with a slider

I have a website that I am trying to optimize and one of the things that keeps coming back is I need to lazy load my larger images that I have inside a modal, t

Limit incorrect guess attempts in Hangman Javascript

I'm trying to code a hangman game where a user only has three incorrect guess attempts. i.e. if they guess the correct letter they continue playing. If they gue

Hi all, add class on multiple button on each click

All, I got the requirement that on each button click, a class should be added in the dropdown menu, and on the button and outside click, the cancel button shoul

Preloading a large background image without rendering the website

I would like to make sure that my image preloads properly, as there's an svg effect, that only looks good when the background is loaded. function preloader() {

CSS : selecting multiple nth-child

Say I have this css : div div p:nth-child(1), div div p:nth-child(2), div div p:nth-child(3), div div p:nth-child(4), div div p:nth-child(5) { } This will sele

Display a list when i click next or previous button in VueJS

I would like to manage a case in js view. I have a list of employees who arrive in a department and also leave the department. My list returns me 3 objects (ent

Avoid URL parameter Manipulation

So in my case, after a user chooses a certain room, the number of nights he will stay and the number of guests, the price gets calculated (depending on certain

Retrieving images from json server and display with relevant question

I am building a trivia app. initially I just implemented plain text Q&A trivia but now I also want to add images with questions. I am getting data from my l

Color picking by coordinates

When using a colorpicker like from google, the luminosity at the top left is 100%, on the top right it is 50%. However on both corners on the bottom the luminos

Why is the method executed immediately when I use setTimeout?

I'm trying to write a simple code with a setTimeout, but the setTimeout just won't wait the time it's supposes to and the code execute immediately. What am I do

Typescript auto generated JS file: "Uncaught TypeError: Failed to resolve module specifier"

Currently working on a Blazor project where I want advanced mapping functionality, using the Leaflet.js library with typescript bindings. I have added leaflet a

How to use recaptcha v3 in chrome extension?

Is it possible to use reCaptcha V3 in chrome extension. If yes, than how to implement it? Currently I am implementing it and facing error Refused to load the sc

express-session unable to retrieve session variable

I am using express-session to store my sessions persistently on a MongoDB database. The project worked perfectly in a development environment but for some reaso

Best way to structure deep time-series data in MongoDB?

I'm migrated from MySQL to MongoDB and looking to optimize the storage of my time-series data. Each item in my database has an array of values for multiple loca

Echo from video recorder/player (On page load)

I have a video player and recorder that allows the user to record themselves, play back the video, and download. The code renders: • Two video players vert

Laravel livewire display session message with javascript

I am trying to submit a contact form using laravel livewire like: public $name; public $email; public $phone; public $message; public function submitForm() {

React Native Render Error: 'Target Container is not a DOM Element'

We are building a React Native application, sort of like a marketplace for different services and products. Our current problem is concerning using the BottomTa