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