A Browser History Count : History « Window Browser « JavaScript DHTML

A Browser History Count

<TITLE>History Object</TITLE>
function showCount() {
    var histCount = window.history.length;
    if (histCount > 5) {
        alert("You have visited " + histCount + " pages so far.");
    } else {
        alert("You have been to " + histCount + " Web pages this session.")
<INPUT TYPE="button" NAME="activity" VALUE="My Activity" onClick="showCount()">


Related examples in the same category

1.History 'back()' Example
2.History 'forward()' Example
3.Use history back button
4.Go Back to previous Page
5.Go Back to some step
6.Go Back to previous Page using number
7.Methods and Properties of the History Object