I am trying to make a jQuery function dynamically decide which array gets run through it based on a button click. Ideally, this is how it would work: User clicks one of the “View More …” buttons. The program loads the next 3 images of that specific category (Sports, Concerts, etc.). Below is…
Tag: javascript
DId firebase createUserWithEmailAndPassword() change the return value?
I have been using this code for a year now: However I had complaints over the last 2 days of new users having trouble creating a new login. I checked the “user” variable in this code and it looked like this: Which means that I now have to refer to uid by using user.user.uid instead of user.uid. I …
JQuery – Adding random numbers to an array and then checking if there are repetitions before printing array
I’m trying to write a “for” loop that will go through a list of 30 songs in an array and then print a list of 20 random items in that array with no repetitions. Answer If I only focus on the question title. Adding random numbers to an array and then checking if there are repetitions before p…
Dragging not working for react-use-gesture
For some reason, I just cannot get the most basic example of react-use-gesture to work. What I am trying to do is just have a square follow my mouse location when you drag it. I copy-pasted the example from their documentation multiple times (https://github.com/pmndrs/react-use-gesture) and still cannot get i…
How to pass a state to a Parent component if I have a button triggering the state in the 2nd Child in React
Hi there, The issue that I faced recently is the next: I have a parent component MainPage, that has child components ModalJoin (is not shown by default) and ExploreProjects in it. This ExploreProjects component has its own child component ProjectCard which has a button that is supposed to change a state so Mo…
Php file won’t load ajax request
I try query my database from javascript, using ajax request to my php file. This is my code: So I included jquery file into my folder, so that I can access it as shown above. Now my trainPassFrequency.js look like this: where trainfrequency.php only returns (echo) output of the sql query. When I run this code…
‘Range not found’ when trying to input value into first empty cell
Google Script/Spreadsheet issue, here. Am trying to copy data from one cell and put it into the first empty cell in column E. When I perform the following, I get ‘Range not found’ on line 15: I’ve tried replacing report.getRange(lastRow).setValue(row[1]); with something like report.getRange(…
How do I keep incrementing the Elapsed time variable while its in the while loop instead of starting from 0 seconds everytime
I have a while loop where I look for two attributes in the array, if they’re not there, then I invoke the sleep function for 10 seconds and look for those attributes again. I want there to be an Elapsed time there so that the user can see how long we’ve been looking for those attributes. Expected …
How can I count in Firebase the collections in a document
I know how to count how many Documents are in a collection in Firebase but how does it work the other way around. I have several collections in a document and I need to find out how many. (In my example it would be 2) My Setup: I tried the following but it does not work: Does anybody know how
Translate JS into math (multiple variables defined)
I have this code I am trying to translate into maths My basic problem is that the var ‘top’ is declared 3 times, so I don’t know how to reflect it mathematically. var bottom is also declared twice, which value will be the final? the first variable or the second? Answer JavaScript is imperati…