// this gives you just the URL without params var currentUrlWithoutParams = window.location.href.split("?")[0];