2,521,490 questions
Score of -7
0 answers
88 views
Counting unique visitors on a redirect link when the same person opens it on multiple devices [closed]
I made a small link tracker with Cloudflare Workers (JavaScript) and D1(SQLite). When someone opens a link, it redirects them to document and saves time, IP and user-agent.
Bots are already filtered ...
Score of 0
3 answers
137 views
Split and capture text ending with brackets and two letters [duplicate]
I have a textarea to write text in multiple language; for each language user has to end text with two brackets and two letters in it for each language.
For example:
L'aereo era in pista.[it]
The ...
Score of -7
0 answers
98 views
Playwright JavaScript: MakeMyTrip flight search shows NETWORK PROBLEM despite HTTP 200 responses [closed]
Problem description
I am automating the flight search functionality on the MakeMyTrip website using Playwright with JavaScript.
When I open MakeMyTrip manually in Chrome, enter the flight search ...
Score of 2
4 answers
182 views
Can setting/retrieving properties on any HTML element be a security risk?
When assigning properties to a HTMLElement directly (so [Element].someProperty), it looks like anything goes.
You would expect that invalid properties either throw some error or are weeded out ...
Score of -7
0 answers
108 views
Synchronous text file reading in browser [duplicate]
I am new to javascript so I might misunderstand some details.
Problem is that I have a javascript function for reading text files, in for nodejs it is implemenetd this way
function cat (path) {
...
Score of 0
1 answer
109 views
Tabulator with nested tables jumping to top when updating a sub-table
I have a very long non-paginated (deliberate) tabulator table designed to create a quotation price list. I don't want a scrollbar inside the table, so I have set the height to 100%. The main table ...
Score of -6
1 answer
128 views
Waiting for browser to repaint screen, using requestAnimationFrame. Works for the 1st try [duplicate]
Here's my full code: I expect "End of Test" to be the last message but it isn't. "back to yellow" is the last message. Tried on Edge and Firefox. What I get:
div goes yellow, ...
Score of -8
0 answers
103 views
CounterFactory Troubleshooting [closed]
I am being made to create a counter factory system in javascript for an assignment.
const counterFactory = (initialValue) => {
let counter = initialValue;
const increment = (incrementBy) => ...
Score of -5
0 answers
58 views
How can I prevent duplicate API requests in React when using useEffect? [duplicate]
I'm working on a React application that fetches data from a backend API using useEffect. Sometimes, the API request runs more than once, causing duplicate requests.
What is the correct way to prevent ...
Score of 1
1 answer
125 views
How do I create a native context menu with custom options? [duplicate]
When I search for code for a “custom context menu”, I get code for how to recreate a context menu with HTML elements, but that's not really what I want. The simple solutions forget about the context ...
Score of -2
1 answer
79 views
Does sinon.restore() also restore all mySandbox.stub()s?
Sinon has a sandbox concept to group stubs and restore them together. Documentation says that sinon itself is simply the default sandbox.
Does this mean that sinon and mySandbox are separate and do ...
Score of 2
1 answer
102 views
How to override styles of React component with vanilla extract?
How can I ensure style rules for extended component take precedence over style rules for the component I am extending using vanilla extract?
Assuming code like this:
// my-component.css.ts
import { ...
Score of 0
3 answers
162 views
Changing two images simultaneously with one button-onclick and querySelector
I'm trying to use onclick and querySelector to do the following: there's four buttons->each button is connected to two, overlapping images(i plan to put more images in between them, so they have to ...
Score of 2
1 answer
178 views
Why does changing an attribute in JavaScript not affect my CSS attribute selector?
I'm trying to dynamically create buttons in JavaScript, add them to a div, and then use CSS attribute selectors to change their colors, opacities, and positions
But the CSS part doesn't work, nothing ...
Score of -6
0 answers
141 views
Joomla 4: 403 Forbidden error when saving custom HTML module containing inline JavaScript
I am running Joomla 4.4 with the Helix Ultimate template.
I want to add a floating WhatsApp button to all pages. The button HTML and JavaScript work fine in local testing.
When I paste HTML + inline &...