js get OR take current url OR uri code example
Example 1: javascript get current url
var currentUrl = window.location.href;
Example 2: get actual url in variable
var currentLocation = window.location;
var currentUrl = window.location.href;
var currentLocation = window.location;