2,524,485 questions
-3
votes
3
answers
55
views
How do I get the `setTimeout` function to work with negative values? [closed]
In JavasScript, it's easy to make an action happen 3 seconds after a user presses a button by using setTimeout(..., 3000), like so:
document.getElementById("btn").onclick = () => {
setTimeout(() =...
0
votes
0
answers
58
views
How can I allow pointer events beneath an element that needs to detect mouse hover? (dHTML)
Overview
In html, css, and js I made a sidebar that can be hidden with a click. I have tried to make users able to hover their mouse over where the sidebar used to be, and showing a button that could ...
Advice
0
votes
2
replies
57
views
How to pause and play video using JavaScript in React web project?
How can I pause and play a video using JavaScript in my React web project? I'm developing it in VS Code.
-3
votes
0
answers
33
views
how to create a express api that can trigger a deep learning model [closed]
I am new to Python and backend integration. i have knowledge about express backend.
I have a trained Convolutional Neural Network (CNN) model saved as a .keras file, which predicts plant leaf diseases ...
0
votes
1
answer
29
views
How to implement CSP without 'unsafe-inline' in WordPress (Elementor) without breaking site?
I am working on securing a WordPress website that uses Elementor and several plugins.
I have implemented a Content Security Policy (CSP) via .htaccess like this:
Header always set Content-Security-...
-1
votes
0
answers
24
views
Web audio API strange behavior across browsers
There are 2 checkpoints about which I will be writing, wrt the user experience of my app
Checkpoint 1: after uploading of an audio track and pressing play, and
Checkpoint 2: clicking the button which ...
-4
votes
0
answers
67
views
Trying to make a prompt calculator for my class but it doesn't alert the result [closed]
let a = Number(prompt("type number a"));
let b = Number(prompt("type number b"));
var o = String(prompt("type operator. Add=addition. Sub=subtraction. Mult=multiplication. Div=division.")....
-3
votes
0
answers
51
views
Problem with Electron app and Docker container on localhost
I have an ongoing problem with a project I'm working on. I made an ElectronJS app that I'm going to be installing in the users desktop. This electron app will communicate with an MCP server via Axios. ...
3
votes
1
answer
82
views
How to sync UI state between a page and a fetched sidebar component in Vanilla JS?
I am building a multi-page application using Vanilla JavaScript (no frameworks). To avoid code duplication, I fetch a shared sidebar (sidebar.html) and inject it into a placeholder on every page (e.g.,...
-4
votes
0
answers
79
views
Check for an empty string from a multiline block [closed]
I need to check for an empty string, however the regex doesn't seem to be doing what I think it should.
var ele = document.getElementById('theId');
console.log("Length of ele is " + ele.innerText....
Best practices
2
votes
10
replies
156
views
Code Review on using two useEffects in a single component
In the following code I have a header, which is being used in a Route Layout called RootLayout.tsx which is a parent root to my whole application. First I implemented the scroll hiding mechanics, and ...
Advice
0
votes
3
replies
72
views
Object Look-up in JS Doesn't Work with WebGL2RenderingContext API Constants
For debug purposes in JS I decided to create a set of integer->string look-up tables which would allow me to re-interpret WebGL system constants back with their symbolic names. I used the "...
-1
votes
0
answers
34
views
Enumeration warning when using VS Code debug console in a Vue project
I have a minimal Vue 3 application created using npm create vue@latest. The application contains a simple App.vue file with the following contents:
<script>
export default {
data: function(...
-1
votes
0
answers
39
views
Why is my app applying a BiquadFilter without being prompted? [closed]
Im using JavaScript Web audio API.
The good news is that the filter I created works as expected.
The bad news is that my app applies the filter without being prompted.
The flow is like this: user ...
Tooling
1
vote
1
replies
110
views
Why does npm install most of the time corrupted?
When I run npm install, most of the time it is corrupted, missing dependencies, and critical files. Is there any way to bypass this and install without errors?