I am building an Expense Tracking app using Node.js where all the Income and Costs should get saved in a database. My idea is to create a new collection for each registered user and save all their income/cost actions in that collection. The things i would like to consider before writing it are: how do i name …
how do I pass a variable from js file to laravel controller to make a query based on the variable taken from an element clicked
this is code in laravel controller this is the js file im trying to receive the variable from to pass it to the query Answer The Front end will need to send data to the backend via a HTTP request. This can be done via AJAX. There are good libraries that you can use to do this such as AXIOS
Snowflake/javascript datetime format changes during iteration
Javascript converts above date into something like this ‘Tue Dec 07 2021 14:52:12 GMT-0800 (Pacific Standard Time)’ Here is the javascript code Above code between ** … ** is modifying the timestamp however i need to get same datetime stamp(2021-12-07 15:17:04.673 -0800) and NOT ‘Tue De…
Sort by multiple strings in Array using Javascript
I am trying to sort an array by multiple strings but coming up short. Is this possible or is writing something below the only to achieve this? Doesn’t work: This works, but can get very lengthy the more conditions… Answer
Fetching data in loop next js
I am attempting to use the data from 1 endpoint to call another endpoint that is filtered by id. I am planning on fetching both calls using getServerSideProps and passing the data to another component. The first call will return an array of categories which then I am attempting to loop and fetch articles that…
How to make a pop-up if multiple conditions are satisfied
Is there a way for a pop-up to appear when all divs got ‘onmouseovered’? I basically have 12 circles that pop when you move your mouse over them, is there a way to make a pop-up that says “There is no circles left!” after I hover over the 12th circle? Answer Add a class to the element …
Select and match the same property names/values from list of objects in a json object
Given the following json object I’m trying to match up all of the values in “left” and “right” with each other, for each individual object in the list. There could be more properties (prop4 for example) but the “left” and “right” for a given object will al…
Changing HTML text based on a value entered into an input box
I am creating a website and would like to make a tool using JavaScript to choose someone’s skateboard size depending on their shoe size. This is the code I am using: No matter what I type into the text box there is always a “?” that shows up on my website. What can I do/ change to fix this. …
Javascript – find highest value in an object of arrays of objects
I have an object containing arrays of objects. I’m trying to find the highest value of an object property, ‘sortOrder’ without manually iterating through the arrays and objects. So my variable looks like this following: So I’d be trying to iterate through this to eventually find, in th…
Animate two items moving away from each other until hitting container outline
For an intro animation, I want to animate two elements away from each other based on the outer container width to make it work responsive. Absolute positioning didn’t worked for me because initialy the two items has to touch each other or have a constant, fixed distance between them. Here is a represent…