var obj = window.document.location;var BASE_PATH = obj.href.substring(0, obj.href.indexOf(obj.pathname));console.log(BASE_PATH);