How to display recently viewed products without reload the page?

Next task: remove and display the viewed products in category page, product card, in the section on the page of the catalog.
Viewed products introduced in the appropriate sections similar to the proposed https://wp-kama.ru/question/plagin-prosmotrennyih-...
Now, each viewed item is displayed in the block next open the item card. And if you go back to the tab previously open the item card, the block viewed products is displayed exactly as seen products how it was viewed at the time of opening this card, but not as much as open at this moment (appear until after page reload).

I want to make a previously open card display the current number of viewed items to the user navigating to a previously open tab with the card, could see it as many viewed items as opened at the moment. (Same thing for the block in the catalog).

I want to understand how it is feasible in principle?
And if feasible, how?
Can examples, links?
March 23rd 20 at 18:50
1 answer
March 23rd 20 at 18:52
Solution
There is an event of switching to the current tab window.onfocus. You can at this event to download the actual goods with the help of ajax.

Find more questions by tags WordPress