ingenious / jquery-history
balupton/jquery-history 的 Composer 分支
dev-master
2015-09-25 19:53 UTC
This package is auto-updated.
Last update: 2024-08-29 03:41:57 UTC
README
由 github.com/balupton/history.js 取代 - jQuery History 允许您通过跟踪 URL Hashes 简单地跟踪页面状态的变化。支持由书签和前后导航按钮触发的更改,以及跨浏览器支持。
用法
查询字符串
如果您想在哈希中包含查询字符串并获取其内容。例如,我们有
https:///page/#subpage?a=true&b=false
我们想提取 b。然后我们可以这样做
var hashData = hash.queryStringToJSON();
console.log(hashData); // {a:true,b:false}
console.log(hashData.a); // true
console.log(hashData.b); // false
但首先,您需要从这里下载 queryStringToJSON 函数
https://github.com/balupton/jquery-sparkle/blob/master/scripts/resources/core.string.js
并将其放入您自己的代码中。它默认不包括在 jQuery History 中,因为它不是必需的。
历史
您可以在History.md文件中找到历史记录
许可协议
许可协议为 MIT 许可协议
版权 © 2008-2010 Benjamin Arthur Lupton