目前,我使用 Ben 的 Alman jquery-hashchange 插件在哈希中使用页码:
$(document).ready(function(){
$(window).hashchange( function(){
var hash = (location.hash) ? location.hash.slice(1) : 'page1';
$.ajax({
url: '/list/' + hash, // result url like page1, page2 etc.
现在我需要再添加一个值 - filter
. 我认为结果哈希 URL 看起来像
#page1&filter=1-1-0
#filter=1-1-0 (if page number is omitted)
#page1 (if filter is not defined)
如何解析?即如何理解 ifpage
已定义, iffilter
已定义(以及值是什么 -和1
-我分别需要它们)?1
0
我在考虑 Ben 的 Alman BBQ 插件,但是(1)对于这样简单的任务来说它看起来太复杂了,(2)不确定如何使用没有值的参数(page1、page2 等)。