Get URL and URL Parts in JavaScript

PHOTO EMBED

Fri May 01 2020 11:13:14 GMT+0000 (Coordinated Universal Time)

Saved by @FlowerFine #javascript

var newURL = window.location.protocol + "//" + window.location.host + "/" + window.location.pathname + window.location.search
                                
content_copyCOPY

The above code is used to get URL and also Parts of URL in JavaScript

https://css-tricks.com/snippets/javascript/get-url-and-url-parts-in-javascript/