get current url js

JavaScript
var currentUrl = window.location.href; document.getElementById("demo").innerHTML =
"Page location is " + window.location.href;

 
Source

Also in JavaScript: