Попробуйте
var urlString=window.location.href; var url=urlString.split("#")[0]; window.location.href = url + "#mypara";