How to get the document location in Javascript
Document location
document.location
gets the URL of the current document.
The return type is Location
.
Example
<!DOCTYPE HTML>
<html>
<body>
<script>
document.writeln(document.location);
</script>
</body>
</html><!--from www. j a va 2 s . co m-->