The location property of the window object references the location(url address) of a document, as well as serving as a redirect mechanism.
This first code example will show how to simply reference the value of this property to access what page the user is on.
Javascript CODE EXAMPLE
<script type="text/javascript">
alert(window.location);
</script>
This second example shows how to redirect users to any page that you specify.
Javascript CODE EXAMPLE
<script type="text/javascript">
function relocateTo(url){
window.location = url;
}
</script>
<button onclick="relocateTo('http://www.worldofwebcraft.com')">World of Webcraft</button>
<button onclick="relocateTo('http://www.developphp.com')">DevelopPHP</button>