【发布时间】:2018-12-14 15:44:38
【问题描述】:
每当执行此行时,我都需要调用一个函数
window.location.hash = "#globalSearchView";
目前我正在使用哈希更改功能
$(window).on("hashchange",function(e) {
var hash = window.location.hash;
switchtabs(hash);
});
它仅在哈希更改时有效,但在哈希相同时无效。我想在这一行时调用一个函数 switchtabs
window.location.hash = "#whatever";
无论哈希相同或不同,都会执行。谢谢
【问题讨论】:
标签: jquery hash tabs hashchange