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:
You can use a regular expression: window.location.href.match(/^[^\#\?]+/)[0]
window.location.href.match(/^[^\#\?]+/)[0]