I have a sidebar on my site. The sidebar contains filters (date and time, model, category, etc.). Each filter is made in the form of a drop-down list. I made the sidebar in such a way that the filters could save their state (selected value, open / closed) regardless of the screen size (that is, the selected v…
Tag: javascript
Datatables CRUD operations
I am developing a tasking application that tracks tasks with various metadata for the tasks. When the task is created, the options are saved to a related list. However, the metadata tags may change as the task progresses. I am using DataTables to display the options. The below code loads in the full list of o…
JSON POST and GET 404 (Not Found)
I am trying to create an API in Django but am receiving the following errors message in the JavaScript console. Does anyone know how to fix this problem? API url: path(“edit/<int:post_id>”, views.edit, name=”edit”) views.py JavaScript HTML I think something might be wrong in the …
JS merge Array of the Maps to a single Map
I have a structure of All keys are different there. I am trying find the common way to merge it in one Map. I know the way for two Maps: But for this solution I need more common way. Answer You are looking for flatMap:
Return URL from file uploaded to AWS S3
I have a function that makes an API request containing the URL of a new file I just uploaded to AWS S3. And I have one function that only upload the file to S3. I am having issues with returning this URL of the uploaded file. Here is my code: Here is the SDK doc with the upload example: https://docs.aws.amazo…
Problems at creating slider, I’m new in javascript
I’m trying to create an automatic slider, I can go through the images using the buttons to change them, but them don’t change automatically and I don’t know why, also the first end button doesn’t work properly at the beginning of the slider. This is the HTML code: This is the CSS code:…
JQuery increase wait time before it throws error in my code
I would like to be able to increase the waiting time before an error is displayed in my code of this script… but I don’t have much idea how to do it… It is assumed that when opening the modal sometimes it opens very quickly and the server shows an error… This opening modal is from a ga…
Calling array object in src does not work
I have an array : I am looping in it: This here does not work: src={icon} Correct way should be like this: If I replace the {icon} with string it works! Can someone tell me why? Thank you Answer The reason this doesn’t work is because <Icon src=”xxx” /> does not expect a string but an …
Handling complex query parameters Express.Js
I’m making REST APIS with Express.js I have the following express route: /api/customer I added multiple query params to the route like this: In my controllers I handle all of these with If and there are so many cases I feel that this method would not scale, is there a better way of handling this ? This …
Updating the localStorage is not in sync
When I toggle darkmode it doesn’t update in _app unless I have 2 tabs opened and trigger it in one tab, then the other tab gets updated and darkmode is toggled, but not the tab I pressed the toggle. I use useSettings in both index and _app. I recorded a video so it’s easier to see what’s goi…