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






A Browser History Count

<HTML>
<HEAD>
<TITLE>History Object</TITLE>
<SCRIPT LANGUAGE="JavaScript">
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.")
    }
}
</SCRIPT>
</HEAD>
<BODY>
<FORM>
<INPUT TYPE="button" NAME="activity" VALUE="My Activity" onClick="showCount()">
</FORM>
</BODY>
</HTML>

           
       








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