I have a virtual store and a shopping basket. Also, I have in every page an info note about how many products one has in the basket and the total sum (my basket area).
The problem is that the basket uses jQuery to update and delete elements but the ‘my basket’ area on every page has behind a simple query in the database and it doesn’t update except at page refresh.
Is there any solution to synchronise the basket javascript logic with the ‘my basket area’?
The answer from alex was short but right to the point.
You could use XmlHttpRequest to make a GET request to a server side page in which you return a JSON string representing your basket products. Then you can use JQuery to create this elements in your page’s DOM.
I think JQuery itself has some sort of abstraction of XmlHttpRequest.