Category "javascript"

Is there a way to pause and restart the webworker?

I have a problem with my webworker and hope that somebody can help me.. I have a browser side with two buttons - one starts my worker (numbers are getting incre

pdf.js text layer position accuracy

I'm using pdf.js and RecogitoJS to build a PDF annotation interface. This seems to work fairly ok. Except there's a small offset between the rendered canvas ima

Chrome's subpixel rendering affecting fixed/absolute positioned elements

I have a electron based application that provides a CAD like experience for mining engineers. This software includes a crosshair cursor: wide cursor that is st

Mini-Max Sum In JavaScript - How to Get the Minimum Sum And Maximum Sum of 4 Elements in a 5-Element Array

Link to HackerRank Challenge My idea is to loop through the array and sum all elements in the array except for one element each time, then find the smallest su

Webpack: 404 image not found

If I set image src in my html file, I am able to get the image. But when I use my script file to set the image src, the console keeps saying image not found(404

How can I add two each row sum depending on a button click?

So, I'm trying to add two to each row sum depending on whether or not the button is clicked. HTML: <table> <tr> <td> <input type="checkbox"

Firebase Functions) Can I exclude certain files when importing them from the Storage bucket?

I'm going to delete old images using the schedule function. Before deleting these images, I have created thumbnail images, and I want to delete only the origina

How to use conditionals in While loop to replace numbers with strings? (JS)

The instructions of my challenge say this: "Using a WHILE loop, write a function imAboutToExplodeWithExcitement which prints a countdown from n. When the countd

How to make a marquee animation which never leave the view blank ? With images

I am trying to make a marquee animation, but i can't manage to make it perfect. As you can see when a logo goes out of the page it do not get back from the othe

NestJs: Unable to read env variables in module files but able in service files?

I have an .env file at the root of my NestJs project with some env variables in it. The strange thing is that I am able to read the variables in service files

Deploying React app to production returns "You need to enable JavaScript to run this app"

Problem I have an axios call at "/artists", that gets a list of artists returned as an array of JSON. It works in development. However, in production it outputs

NestJs: Unable to read env variables in module files but able in service files?

I have an .env file at the root of my NestJs project with some env variables in it. The strange thing is that I am able to read the variables in service files

How to store data in angular [closed]

I am writing an application using angular. Once the server authentication is done I may have to store few details in the client side. e.g user

How to customize csv data in amcharts3 export function in Angular

I have 2 columns 1 with id and the other with a count. Now I want to add a column to display the percentage in the CSV and a heading for the file. data: [ { 0:

How to scratch reveal an image with Javascript canvas element

I created a canvas element where I can draw paths. There, I draw transparent paths and I "scratch" reveal the foreground. It works on both mobile and desktop.

How do I check if an array includes a value in JavaScript?

What is the most concise and efficient way to find out if a JavaScript array contains a value? This is the only way I know to do it: function contains(a, obj) {

isLucky task - CodeSignal; keeps running true even with if else statement defaulting to false

I'm doing the isLucky task on CodeSignal and my code keeps returning true. What can I do to fix this? Task: A ticket number is considered lucky if the sum of t

How to delay updating React state in react-swipeable-list?

I'm trying to use react-swipeable-list to enable swiping in a pair of lists (the first is a list of items I might shop for, the second list is the list of stuff

Updating the useState values automatically in react js?

I have a usestate array object called mo, which gets the data from an rest api from get request. I use useEffect for getting the data. const [mo, UpdateMO] = u

React Component's inline style is not working

I created Carousel component, it returns a collection of carousel boxes, before returning it I am applying style property to every returning div, but the style