history.length
In this chapter you will learn:
Length of history
history.length
tells how many items are in the history stack.
By testing for this value, it's possible to determine if the user's start point was your page:
<!DOCTYPE HTML> <!-- j a va2 s .c o m-->
<html>
<body>
<script>
if (history.length == 0){
document.writeln("0")
} else{
document.writeln("more than 0")
}
</script>
</body>
</html>
Next chapter...
What you will learn in the next chapter:
Home » Javascript Tutorial » History