Looking for a jquery recently viewed solution
I am coming up dry with my searches all morning for a starting place with this. I will throw out a very rough example of what I am looking to do.
I want a div populated with cumulative id elements from previously visited pages within the site. Think recently viewed products @amazon for instance.
So I want to grab 2 elements for each previously viewed page and throw them into a #div via an ajax request. I am a jquery cobbler and can do OK with some sort of starting place but I am coming up dry on starting places with this one.
So my recent #div will fetc开发者_如何学Ch #recent-title and #recent-image from say the last five visited pages.
Any direction is graciously appreciated.
This kind of feature is best implemented in the server side script.
In each page that you need to be tracked, put a code to store the page id
into the database.
In the page with recent visited div, fetch the database content that store recent visited page id
, use it to get the title and image contained in the actual pages, then put the result there. This can be done directly when page load, then updated in some time interval using ajax request.
You can put the URL to your code here and I will try to help you to tweak it.
精彩评论