If I use:
alert(window.location.href);
I get everything including query strings. Is there a way to just get the main url part, for example:
This is possible, but you'll have to build it manually from the location object:
location.protocol + '//' + location.host + location.pathname