jQuery 历史记录插件可以在 Chrome 中使用吗?
jQuery 历史记录插件 (http://www.mikage.to/jquery/jquery_history.html) 据说可以与 Chrome 一起使用:
http://github.com/tkyk/jquery-history-plugin
支持的浏览器IE6、IE7、IE8、 火狐3、Safari4、Safari5、Chrome4、 和Chrome5
,但是当我转到上面提到的顶部链接时,如果我单击加载 1、加载 2,然后加载 3,后退按钮会将 URL 的哈希部分更改为 #2
,但是“加载的 html:”部分仍然显示“3”......有人知道为什么吗?
The jQuery History Plugin (http://www.mikage.to/jquery/jquery_history.html) is said to work with Chrome:
http://github.com/tkyk/jquery-history-plugin
Supported Browsers IE6, IE7, IE8,
Firefox3, Safari4, Safari5, Chrome4,
and Chrome5
but then when i go to the top link mentioned above, if I click on load 1, load 2, and then load 3, the back button will change the URL's hash portion to #2
, but the "Loaded html:" section still shows "3"… anybody know why?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
请转到此处获取当前示例页面:http:// www.serpere.info/jquery-history-plugin/samples/
它在 Chrome 中工作;)作为 Pointy ,好吧,指出,该页面上的代码不是最新的,有几个 此后 GitHub 中的更改/修复。您可以在此处获取最新源代码。
请注意,自旧页面以来,API 发生了变化(我认为是为了更好),例如:
$.historyInit
现在是$.history.init
$.historyLoad
现在是$.history.load
Go here for a current sample page: http://www.serpere.info/jquery-history-plugin/samples/
It works in Chrome ;) As Pointy, well, points out, the code on that page isn't current, there are several changes/fixes in GitHub since then. You can get the latest source here.
Note that the API changed (for the better I think) since that old page, for example:
$.historyInit
is now$.history.init
$.historyLoad
is now$.history.load
该演示页面使用的版本与 github 版本不同。
The version used by that demo page is not the same as the github version.
也许试试这个 jQuery History 插件:
http://www.balupton.com/sandbox/jquery-history/demo/< /a>
它提供跨浏览器支持、绑定到哈希、重载哈希等等。
它还有一个 Ajax 扩展,可以轻松地将您的网页升级为适当的 Ajax 应用程序:
http://www.balupton.com/sandbox/jquery-ajaxy/demo/< /a>
这是 http://wbhomes.com.au/ 等网站选择的解决方案http://gatesonline.com.au/stage/public/
总体而言,它有详细记录,支持且功能丰富。它还在这里赢得了赏金问题 如何在 URL 中显示 Ajax 请求?
Perhaps try this jQuery History plugin:
http://www.balupton.com/sandbox/jquery-history/demo/
It provides cross browser support, binding to hashes, overloading hashes, all the rest.
There is also a Ajax extension for it, allowing it to easily upgrade your webpage into a proper Ajax application:
http://www.balupton.com/sandbox/jquery-ajaxy/demo/
This is the solution chosen by such sites as http://wbhomes.com.au/ and http://gatesonline.com.au/stage/public/
Overall it is well documented, supported and feature rich. It's also won a bounty question here How to show Ajax requests in URL?