跳转到页面的某个anchor var loc = document.location.toString().split('#')[0]; document.location = loc + '#' + anchor;