javascript get the current url path code example
Example 1: get actual url in variable
var currentLocation = window.location;
Example 2: javascript get domain
window.location.hostname
var currentLocation = window.location;
window.location.hostname