A Browser History Count : history « Javascript Objects « JavaScript DHTML






A Browser History Count

   
<html> 

<head> 
<title>History Object</title> 
<script type="text/javascript"> 
function showCount() { 
    var histCount = window.history.length; 
    if (histCount > 2) { 
        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
2.History.go(-2)
3.Hsitory.forward()
4.History length
5.Navigating to an Item in History