I’m looking to include a small window that shows the last 5 pages they visited on a my site.
Primarily I’d like it to show the title of the page and the URL so I can link them to it. It would be great if I can filter these to a word or website since I’d like to be for my site only.
Would JavaScript be good for this and does it work cross browsers?
You can only look 1 page back which is document.referrer but I am not sure how to get the title.
If you are monitoring your own site you can use localStorage to store the last 5 pages but if you want to monitor other sites then no you cant do it in Javascript that will be a privacy concern if you can do it.
localStorage is HTML5 but its already supported by major browsers.