javascript current page url without query string code example Example: get url without query string window.location.href.split('?')[0]