get actual url in variable

JavaScript
var currentLocation = window.location;
Source

Also in JavaScript: