https://www.virendrachandak.com/techtalk/get-various-parts-url-using-javascript/
Get various parts of URL using JavaScript