12,514 questions
Best practices
0
votes
9
replies
153
views
Where to place window.addEventListener('online'
In a Sveltekit app, I'm listening for window.addEventListener('online') and window.addEventListener('offline') so as to warn the user. I only need to add the event listener at app start.
Add to app....
Score of 0
2 answers
67 views
In beforeinput, how are ranges determined for deleteWordForward and deleteWordBackward?
When handling the beforeinput event, how do I determine the range affected by an inputType of "deleteWordForward" or "deleteWordBackward"? These occur when the user does ctrl+...
Advice
1
vote
3
replies
101
views
Where Professor Prebid stores its data
I'm working on my own extension based on professor prebid. Idea is to collect data from professor, group it in one big, structurized object, remake it as string, and send at openAI API for "...
Score of 0
0 answers
51 views
Why range.startContainer gets different results when I click inside or outside the img?
class Editor {
docContainer
text
constructor(posContainer) {
this.posContainer = posContainer
this.genComponets()
this.listen()
}
genComponets() {
...
Score of 4
3 answers
399 views
HTML link does not get focus outline on receiving focus unless textarea has been focussed explicitly
Example 1 - No focus outline for link
I have a keydown handler for a <textarea>. When the handler gets invoked, I want a link (<a> tag) to receive focus. If you run the example below, ...
Score of 0
0 answers
249 views
Error: System.InvalidOperationException: JavaScript interop calls cannot be issued at this time
I am getting an intermittent exception in the console from the DOM:
Uncaught (in promise) Error: System.InvalidOperationException:
JavaScript interop calls cannot be issued at this time. This is
...
Score of 0
2 answers
202 views
visibilitychange event not working on chromeos, when laptop is turned on from sleep mode
when user turns on his laptop, I am trying to check user's last activity time on mounted in vuejs3, i am using below code for it:
document.addEventListener('visibilitychange', () => {
if (...
Score of 0
2 answers
158 views
How do I change the innerHTML of a newly created element watched by a Mutual Observer, WITHOUT causing memory leaks and freezes?
Imagine a website that has infinite scrolling, where a link saying download, appears underneath every post. I would like to change from a word to something else of anything else. (In my case a 24x24 ...
Score of 1
1 answer
192 views
How to show BeforeUnload alert from SPA?
I am using AngularJS SPA and trying to alert users when they are about to navigate away from active form.
There are 2 parts for this:
User closes active tab
User clicks internal link to navigate
So ...
Score of -2
1 answer
86 views
I want to create a node list with the values from my buttons to get all values, but it returns undefined [duplicate]
This is my HTML code.
<div class="buttons-div">
<button class="modulo-button" id="btn" value="%">%</button>
<button class="division&...
Score of 0
1 answer
198 views
how to capture double click and hold event in angular/typescript?
I am trying to create random shaped polygons inside svg. I want to implement the functionality to drag the polygons within the svg. To do this, I want to capture double click and hold event, similar ...
Score of 1
1 answer
123 views
Does onBlur see the latest state updated in onChange in React?
I'm using a React input element that has both onChange and onBlur handlers. In the onChange, I'm updating a state. Then, in onBlur, I need to use the updated value of that state.
I want to make sure ...
Score of 1
1 answer
262 views
Why did my Blazor EventCallback stopped working
This might be my own stupidity, but I have been struggling with this problem for the last day or so and I am not sure how to troubleshoot it anymore.
Short Version
I have the following Code in Blazor
&...
Score of 0
2 answers
134 views
AddEventListener acting weird
I have just started learning JavaScript. I am creating a ToDo app. Whenever I click on Add Task button the myFunction which I created is not working as it is supposed to. Whenever the button is ...
Score of 0
2 answers
95 views
CSS transform: Pan overshoots when scale is below 0.5 but works fine above 0.5
I'm implementing a pan-zoom functionality in JavaScript where users can pan and zoom an iframe. The implementation works well when the zoom level is above 0.5 (50%), but when zooming out below 0.5, ...