In my shop page, for each product I have cart quantities that the user can change without add to cart button (it’s with display none and activated by js). my problem is that if a user changed item quantity in single product page and navigated back into shop page it show the wrong quantity from cache. Right now i’m reloadin
Tag: javascript
JQuery with AJAX need to create accordion with multidimensional array
I have an AJAX which returns this array: Array Preview in Console.Log In my HTML I have an accordion: In the AJAX success function, I’m getting the array. I need to append that array in the accordion which should be something like this: In my AJAX success function I can loop through, but I do not know a way how
how to access specific elements from a promise
in php I return to javascript the following: in my js file I have: this writes out to the console: how do I access the value ‘FOUND’ associated with the key ’email’? I’ve tried response[’email’], response.email and response[0][’email’] Answer The title is very misleading because the problem is completely unrelated to promises. The backend doesn’t provide pure JSON but HTML
CRUD table with Ajax + Datatables does not work
I’m creating a CRUD table with Ajax + Datatables, but for any reason, my code does not work. I can get my json response with my data from my database, but I don’t know why, it can’t be printed on my table. Im using 2 files: 1.- main.php: 2.- crud.php: Just to clarify some things … I’m working under a
AJAX Post is sending only partial rows PHP
AJAX Post is sending only partial rows PHP. This is my code: excelRows contains 39 rows, but I am getting only 25 rows to PHP. Here is my PHP script – Answer UPDATE Here is a sample AJAX-call with the data you provided. So far everything works OK. Maybe you should try it out again with your original data and
Dropdown with Search Box using Bootstrap Selectpicker not working
I’m trying to search for supplier from the database using the bootstrap-select picker on the dropdown. What I want is while typing in a letter, the dropdown shows the relevant name from the database. …
JS Regex named groups with replace()
In JS, I’m trying to build an object from the below code. However I’m stuck at getting regex named groups with the below replace function. NOTE: What I’m trying to do is, Select characters from str variable from “:” to “,” and replace it with formatters values. Then make the string an object. Answer Regex Demo
Can I make $date = date(“Y-m-d h:i:sa”); to a int value so that I can compare it to present date? [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed last year. Improve this question Example I have a date “2021-04-14 02:26:05am” and I want to select data that inserted after that date. Hope someone can answer my question. Answer use
Get href on click and redirect with shortcode
I’m working with this idea: get href onclick and redirect with link Because i need a link redirect to another page. My problem is that the second page is dinamic. For it, i use a shortcode. But im not know how i can do for it works. The var yourHTML is not working. Answer You should use event.preventDefault(); to cancel
2 foreach in 1 table is not work correctly
I’m try to loop 2 query inside one table . both query had 10 records . so i put my first foreach (or looping) before TR tag .. here is example of the table that i want to create : I don’t know how i can make my table like that with data from my database.. so i tried and