SyntaxFix
Write A Post
Hire A Developer
Questions
Just one more alternative using URL
var theUrl = new URL(window.location.href); theUrl.search = ""; //Remove any params theUrl //as URL object theUrl.href //as a string