How to get the URL for current document in Javascript
Document URL
document.URL
property returns the URL of the current document.
This is the URL that the browser used to load the document.
Example
<!DOCTYPE HTML>
<html>
<body>
<script>
document.writeln(document.URL);
</script>
</body>
</html><!-- ww w . ja v a2 s . c o m-->