variable get in url code example
Example 1: get actual url in variable
var currentLocation = window.location;
Example 2: js get url variables
const postID = (new URLSearchParams(window.location.search)).get('post');
var currentLocation = window.location;
const postID = (new URLSearchParams(window.location.search)).get('post');