72 questions from the last 7 days
Advice
0
votes
5
replies
173
views
Javascript full stack
I have an assignment on my University to make a full stack project including bootstrap, backend, database and frontend, I am trying to make my image change depending based on how many xpAutoclicker ...
Best practices
3
votes
5
replies
130
views
How to avoid page rendering delays in PHP and JavaScript web development?
fellow developers!
I’ve been working on web development projects using PHP Native for backend and Vanilla JavaScript for frontend. Sometimes, I notice that my web pages take a noticeable time to ...
Advice
1
vote
4
replies
163
views
Confused which one to take: js or php for back end (Laravel or Node.js)
I am currently learning Laravel PHP, but I feel a bit confused. From what I see, there seems to be less demand for Laravel at the moment. On the other hand, I hear that JavaScript—especially Node.js ...
Advice
0
votes
9
replies
173
views
"hello chat" Door
I'm working on some projects in Python and JS.
Lately, I decided to speed up the creation process, only stopping to fix bugs.
I found an image in the root of my backend saying "hello chat" ...
4
votes
2
answers
143
views
Get multiple indexes of an array at once, for comparison
I am working on a Tic_Tac_Toe project. I have an object (gameBoard) that contains an array, then I have another object that i want to create a player from to play on the board, then I have a function ...
Best practices
2
votes
10
replies
153
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 ...
Best practices
1
vote
15
replies
113
views
Is there a better way to do this clunky function (maps, arrays, sets or none of them)?
For context: I'm new to coding and still learning.
What I want:
I recently started to play around with JavaScript, and was trying to make this function as "unrepetitive" as possible. I'd ...
0
votes
1
answer
124
views
I want to make a conditional component in React but didnt work, What am I doing wrong?
I have code like this, and it works:
{(users.length === 0) ? (<></>) : (
<Pagination
sx={{ mt: '1rem' }}
page={page}
count={pagination.last_page}
...
Tooling
0
votes
6
replies
75
views
Converter from Confusable Character to regular latin alphabet
I was looking for a way to convert most look-alike characters (latin alphabet) to the regular ones. To fix a problem with camuflaged spammy text like ΆℕṚố𝐛Εṧ and myriad of variations.
The more I dug, ...
Advice
1
vote
6
replies
123
views
How can I take a picture of an entire page of a website (desktop) using JavaScript?
I am coding from my phone.
I want to get a full screenshot of my project's main app to display an example on the front (landing) page.
I obviously can't do this from my phone, and I don't want to use ...
Advice
0
votes
6
replies
103
views
How can I convert mp3/wav/m4a to aac using only vanilla JavaScript?
How can I do this without using any third party frameworks or libraries?
Thanks in advance for any help, with even just one of these (mp3, wav, m4a)
I am somewhat familiar with the Web audio API. I ...
-1
votes
1
answer
119
views
Can a function be executed within the variable scope of another function?
Is it possible in JavaScript to pass a function to a function and execute it within the variable scope of the receiving function? Something like Tool Command Language's uplevel?
In this example, can ...
-1
votes
3
answers
160
views
Can I iterate over/get an iterable over multiple promises by order of their settlement?
In my code, I have a bunch of asynchronous tasks, which will be represented as Promises. Say, let those be:
let promises = myarr.map( (x) => myAsyncFn(x) );
I want to trigger some action after ...
1
vote
4
answers
113
views
:focus-visible not triggered on parent :has() selector when focus is applied programmatically
:has(:focus-visible) not matching on programmatic .focus()
When calling .focus() programmatically the :focus-visible selector doesn't apply on buttons like it does on inputs, but tabbing to the button ...
1
vote
1
answer
142
views
created_at (server time) is sometimes earlier than clicked_at (client time) — why?
I’m tracking button clicks on my website and storing both client-side click time and server-side insert time in my database.
Frontend (JavaScript)
I capture the click timestamp like this:
clicked_at: ...