javascript redirect partial url code example Example: js redirect to relative url window.location.href = '/path'; //relative to domain