js设置页面锚点

var hash; 
hash=(!window.location.hash)?"#tab_1":window.location.hash; 
window.location.hash=hash;
原文地址:https://www.cnblogs.com/godehi/p/9140230.html