我有一个页面jQuery的 - 获取URL哈希
- 最新
- 过期
- 待定
当每个标签被激活,哈希被添加到URL在三个选项卡:
http://example.com/com/#latest
我试图在每个选项卡上添加分页。所以我想这样做是这样的:
http://example.com/com/#latest?p=5
但我不知道如何通过自身获得的哈希值。使用$(location).attr('hash')
回报#latest?p=5
if($(location).attr('hash')) {
var tab = $(location).attr('hash');
}else{
var tab = "#latest";
}
嗨。如果我直接访问'http:// example.com/com /#latest',我只会得到一个'#' – Ciprian 2015-04-03 09:21:51
更新我的答案 – user3896501 2015-04-03 11:04:07