var loc = document.location.toString().split('#')[0];
document.location = loc + '#' + anchor;
04-28 10:55