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
970
questions
0
votes
0
answers
33
views
Inserting unique attribute to HML tag element in loop
I have a supersite that uses all kinds of js, including backbone.js and underscore.js. On one of my pages, I have the piece of code below:
<#loop:main_tlds_price_add#>
<tr>
<td ...
-2
votes
1
answer
15
views
Multiple markers in a loop in the Google-Maps API (JS)
I try to put multiple markers (the new 2024 API) with a loop, on Google Maps, but only the last is shown.
My code :
let map;
async function initMap(center, pk, partner) {
const ...
0
votes
0
answers
18
views
Static import of JSON object specifying the type
I have a small javascript web-application that I develop on my laptop and is later bundled with webpack for publishing.
In some files, some JSON-data is imported right in the "header" of the ...
1
vote
3
answers
55
views
Skip arguments in JS [duplicate]
I have a function example(arg1,arg2,arg3,arg4) and the function uses arg4 for something. Is there a way for me to skip the other arguments instead of having them as unused variables.
I tried example(,,...
-1
votes
0
answers
15
views
Screenshotting of SVG D3 diagram with wrong rounding edges
I'm trying to take a screenshot of SVG of my Sankey diagram generated by D3.js in React app. Every time I try to capture it using different libraries and methods, the edges of the links become rounded....
0
votes
1
answer
20
views
Can't use variable field of mongodb in javascript
I have retrieved one document from mongodb, in that I have one array and I want to loop through that array but I can't do that. If I loop through that it consider whole array as one element, this is ...
-3
votes
0
answers
28
views
Invalid Client or invalid client credentials [closed]
{
"error": "invalid_client",
"error_description": "Invalid client or Invalid client credentials"
}
I have put everything correct for the basic ...
1
vote
0
answers
12
views
e.nativeEvent.offsetX is 0 on mouseMove inside setState function
I have the following code that gets the cursor position on a canvas element. The code works fine in Chrome, but in Firefox, the e.nativeEvent.offsetX is 0 inside the set state function and outside is ...
0
votes
0
answers
9
views
WKWebView accessibility tree not updated after DOM change
I have a simple UIKit app that pushes a view containing a WKWebView. If VoiceOver is enabled, when the view is pushed the OS sets the accessibility focus in the back button of the navigation bar. The ...
0
votes
0
answers
14
views
Zod allow all keys matching regex
I'm using zod to validate some data, and I want to allow certain attributes, as well as any attribute with key matching /metadata_hash_.*/.
I cannot simply use a record because I am using mixed types, ...
0
votes
0
answers
13
views
How to debug scroll event fired a lot later than the pointermove event?
With Chrome's 20x slowdown + device emulation, you can see that the first scroll event occurs 230ms after the first mousemove event:
On Android (a flagship 2023 phone), without any artificial ...
0
votes
2
answers
44
views
How can I use concat to convert a dom NodeList to a array?
I found the statement [].concat(anotherArray) is not completely same to the [...anotherArray].Especially when we use it to convert NodeList.
I want to iterate a NodeList in Vue template, like this:
&...
-2
votes
0
answers
22
views
Why res.clearCookie() is not working after deploying to vercel?
First of all, everything works fine when running on localhost.
However, after deploying the app to Vercel when the user tries to log out it should clear cookies with res.clearCookie() but it doesn't ...
-2
votes
0
answers
23
views
Why "Favor composition over inheritance" and not "Favor aggreggation over inheritance"?
I have read many different articles on "Favor composition over inheritance" over the years and despite reading so many, actually finding clear concise code examples has been difficult.
I ...
-1
votes
0
answers
21
views
Generate editable PDF from html content having forms using angular
With below html content, using jspdf lib, i was able to generate pdf, but when i try to edit it(using adobe acrobat), it was unable to read this checkbox, it is rendered as image post conversion.
<...