2,524,877 questions
-1
votes
0
answers
12
views
How to use selectNodeById with a treeview library?
I have been trying to work out how to use Quercus.js, which is a JS treeview library.
I am stuck on something and wondered if I could ask for advice please?
I have this example tree code, on Codepen.
...
0
votes
1
answer
33
views
Using a regex lookahead after spaces
I am trying to write a simple script to process JSON5 — the idea is to convert to standard JSON and let JSON.parse() do the rest. I’m using regular expressions to do the conversion.
One part is to ...
-4
votes
1
answer
85
views
How to use CSS or HTML to specify a URL for use by a JavaScript script?
For my Neocities website, I have a Javascript script load up the header, footer, and the sidebars. I want to change the sidebars depending on the current HTML page that the user is on. Here is the ...
Best practices
0
votes
1
replies
47
views
What are best practices for unit testing with Jest in JavaScript?
I'm learning Jest and want to make sure I'm building good habits from the start. I've read the official docs but they don't really cover what's considered good practice in real projects. Specifically ...
-3
votes
0
answers
51
views
Using import.meta.glob() to import from dynamic folder URL [closed]
I have a product images folder containing sub-folders where the name of the sub-folder is equal to my product Id.
Using import.meta.glob() requires a static directory, but had tried to get around this ...
Advice
0
votes
1
replies
239
views
Do you support The Imagine project?
The Imagine project is looking for partners to promote The Second World Digital Strike on Feb 24 2027
We need 51% of humanity to join 2nd strike then wars stop
We need 51% of humanity to join 2nd ...
0
votes
2
answers
71
views
Firefox inserts random whitespace on position: sticky
I have an issue that occurs only in Firefox.
On my page there is a header and a product list. The header list has some sticky components to keep it in view on the page, as the user scrolls through the ...
0
votes
1
answer
41
views
Megajs 0.17.2 root property broken
Im using megaJS 0.17.2 in my nodeJS program, but it seems like the root object is not being added to the storage (megaDB) object as a property, as seen in the following code clip of my initMega() ...
1
vote
2
answers
151
views
Why does `Object.groupBy()` return an object where `hasOwnProperty` is not a function?
I've been diving into the JS Object API, trying to learn it a bit more, and I found something I did not really expect for how groupBy() functions. Here's a little example:
const people = [
{ name: ...
-4
votes
0
answers
64
views
create-react-app auto refresh page on code change in production [duplicate]
I have an issue where when I restart and update my production server, users need to refresh the page manually in order to make use of the code changes. This means users who do not know to do this are ...
-5
votes
2
answers
82
views
How can I get Javascript to run through a list of predefined responses, in order?
I'm trying to create a setup where a user can talk to a chatbot, and the chatbot will run through a predetermined list of responses in consecutive order. The bot will respond each time the user gives ...
Best practices
1
vote
3
replies
52
views
What is an example of a real and valid reason to create a circular dependency - javascript / other
There is a project at work, a complete rebuild of a codebase that had become very large and difficult... This is not about opinions on that topic.
So the new code base is ~1 years old. I am not the ...
0
votes
0
answers
57
views
The content on my second tab is not showing up (javascript) [closed]
I'm really new to coding and I'm trying to make tabs for showing two different galleries. The first tab is working just fine, but when I click the second one nothing shows up. We're "in it" ...
Advice
1
vote
22
replies
175
views
How can I deal with this javascript variables problem?
I have a quiz with 5 questions with a couple of answers you can choose from each, it's always single choice, so you will have 5 variables in the end, one per question q1="",q2="", ....
Advice
1
vote
18
replies
119
views
How should I share, save and combine JavaScript variables across HTML sites?
I am passionate about writing a personality/psychology/dating website. I know how to use variables a bit, but I don't know which is the best way to store them. There are cookies, sessionstorage and ...