Questions tagged [javascript]
For questions about programming in ECMAScript (JavaScript/JS) and its different dialects/implementations (except for ActionScript). Note that JavaScript is NOT Java. Include all tags that are relevant to your question: e.g., [node.js], [jQuery], [JSON], [ReactJS], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
javascript
2,530,146
questions
0
votes
0
answers
5
views
Memory issue when using toCmds method in canvaskit-wasm library
I'm developing a 2D graphics rendering application in a web page using the canvaskit library (https://www.npmjs.com/package/canvaskit-wasm). I've encountered a confusing issue when creating path ...
0
votes
0
answers
3
views
React Theme Switching Not Updating Components
I'm encountering an issue with theme switching in my React application. The application supports two themes, which I'll refer to as Theme One and Theme Two. I've implemented lazy loading to ...
1
vote
0
answers
9
views
Set value of a selectOneMenu in a dataTable row based on an outputText column value in the same row, without backing bean
The following is a dataTable that has a selectOneMenu dropdown in the last column of each row.
I need to have the dropdown in each row set to "IN REVIEW" if idMatch.assignedTo in the same ...
0
votes
1
answer
9
views
How do I create a unique index on multiple JSONB fields in Prisma?
I can create a unique index on a Postgresql Json column with this:
@@unique([car])
But, I need to create a unique index based on the year, model and color:
@@unique([car->>'year', car->>'...
0
votes
0
answers
9
views
Donut Wheel | Click to expand for Details
I am trying to make a donut wheel that when a user clicks on one of the section it expands and shows a text field describing what that specific position in grater details. The donut wheel specifically ...
-1
votes
2
answers
25
views
Why I can not stop aditional renders with useMemo()?
I have a function based component. I fetch data on redux toolkit with useAppSelector() but as a result I wrote ine clg within component to check what happens. When page renders again still clg renders ...
-1
votes
1
answer
19
views
If statement - How to not set Item into localStorage if its invalid
useEffect(() => {
validateForm();
}, [task, tyPe, desc]);
const validateForm = () => {
let errors = {};
if (!task) {
errors.task = 'Title is required.';
}
...
0
votes
0
answers
5
views
How to intercept requests and replace different cookies in a Google Chrome extension?
I use onBeforeSendHeaders to intercept requests, and I define cookies for different users. In the method, I iterate through them to replace the original request's cookies, then use the sendRequest ...
-1
votes
0
answers
9
views
What can return else the "content" attribute of template element
I asked this question in whatwg repo, but issue was closed almost instantly with reason like: "this sort of question for SO". Let's test SO for knowing of whatwg spec :)
Whatwg spec says the ...
0
votes
0
answers
8
views
JavaScript Form Validation and Submission Issue
Description:
I'm encountering an issue with my JavaScript code for form validation and submission. Here's the breakdown of what I'm trying to achieve and the problems I'm facing:
Goals:
Allow users ...
1
vote
1
answer
16
views
Import images vs include them inline NextJS
In NextJS, what is the difference between importing an image and including it directly when using next/image?
import logo from './logo.png';
<Image src={logo} />
/* versus */
<Image src={'/...
-2
votes
0
answers
16
views
The best way to write ES module having both default and non-default export
I want to make my ES module importable in both following styles:
import * as mylib from "./mylib.mjs";
import mylib from "./mylib.mjs";
Then I wrote mylib.mjs in following style:
...
-1
votes
0
answers
14
views
Node.js Express res.sendFile not doing anything when called in app.post
When I call res.sendFile inside of app.post, nothing happens. Status code of the request is 200. Any ideas?
Here's the code for my app.
import express from "express";
import Boggle from &...
0
votes
0
answers
11
views
Google map polygons overlapping part background color
enter image description here
I used the data layer
https://developers.google.com/maps/documentation/javascript/examples/layer-data-polygon?_gl=1*1sasjdx*_up*MQ..*_ga*MTQ3MDE1MzgwMi4xNzE1MDQxNDUz*...
1
vote
1
answer
12
views
Find Which Object is in Collision In Phaser
I have multiple objects in my static group and need to know which one I am colliding with when my player hits one of the objects. My code looks like this:
//Create Function
signs = this.physics.add....

