10534

Show recently visited html pages by any visitor

I want to know how to show a recently visited pages' list with only html and javascript code.

I have a website. It has 100 html files and one html (index.html) for the home page, the others (1.html, 2.html ... 99.html) are sub pages. I want to show a <strong>recently visited pages</strong> block on my home page. I am trying to not to use php, asp or any other server side languages. Is there any way to do it? Thanks.

<strong>Edit1</strong>: Thank you for your replies. But it seems I did not make myself clear.

I want all visitors see the list, and the list will not only show pages that he/she has just visited, but all the recent pages that have been visited by any visitor.

Answer1:

I would look into using HTML5 Local Storage

It's essentially a DBMS stored right on the user's browser. Of course, it's not supported in IE < 8, so if universal cross-browser support is a requirement, this might not work for you.

Answer2:

Save a cookie on the user's computer. Generally, you have something like this (pseudocode):

    <li>read cookie</li> <li>parse cookie</li> <li>add current page to list (and probably delete old items)</li> <li>save cookie</li> <li>create list from data</li> </ul>

    Answer3:

    Its possible to use javascript local storage or css a:visited if you want to create that list for just one user: the viewing user.

    You cant share the list with other users.

    Answer4:

    Try tjis with the javascript history object. Check the link below. With the history object you can access the recently viewed pages and manipulate them. But if the user clears the cache then the data is lost.
    http://www.javascriptkit.com/jsref/history.shtml

    Answer5:

    You could use cookies to store which pages a user has visited already.

    http://jquery-howto.blogspot.com/2010/09/jquery-cookies-getsetdelete-plugin.html

Recommend

  • how to convert english into arabic dynamically
  • Javascript Mp3 Player, NONE FLASH
  • The file size of jQuery
  • Remember position and size in a cookie
  • Is it possible to use JavaScript to track how many page views in past 24 hours?
  • Code Addition is Slowing Page Down
  • What kind of data model models function parameters and results?
  • Is it possible to post windows form Hit info to Google analytics(track id) using Gdata API C#
  • How to Unit Test GetNewValues() which contains EntityFunctions.AddDays function
  • Google Analytics API - Filtering via .NET - So Close!
  • Pandas Inconsistent date-time format
  • How to project IR image on a 2D plane using OpenCV and PCL
  • use parameter from method argument inside linq contains
  • Is it better to have a method's datatype be as specific as possible or more general?
  • Calculating Unique events in Google-Bigquery
  • iphone/ipad web video only plays over 3g not Wifi
  • PHP: I get a completely blank page, I don't know how to debug this in PHP
  • Serializable transactions not protecting me from double inserts
  • Is there any way to center certain columns in table?
  • How to distinguish field that requires null=True when blank=True is set in Django models?
  • No projects found to import
  • What is the best data type to store boolean values in a database
  • Why are the debugger memory windows not available in VS 2015?
  • TEdit Input Validation on C++ Builder XE8
  • Read stdin in chunks in Bash pipe
  • How to read JSON-LD data from HTML in Objective-C?
  • Need a consistent TimePicker gizmo for mobile web site
  • Quick Question About Get and Set
  • Find VMID for running instance
  • Getting unread count in Sent Folder using Google Apps Script - GMail
  • hide missing dates from x-axis ggplot2
  • Clarification on min distance on LocationManager.requestLocationUpdates method, min Distance paramet
  • ADO and msqli connections very slow
  • Assign variable to the value in HTML
  • How to use carriage return with multiple line?
  • PHP buffered output depending on server setting?
  • DirectX11 ClearRenderTargetViewback with transparent buffer?
  • Perl system calls when running as another user using sudo
  • Are Kotlin's Float, Int etc optimised to built-in types in the JVM? [duplicate]
  • costura.fody for a dll that references another dll