使用 - window.history.pushState 更新页面/URL
我有兴趣让我的应用程序更新而不刷新页面,并且 URL 中没有 # 哈希。
我见过使用散列的 jQuery BBQ,但是最近 github 上关于 PushState 的博客文章看起来很棒。
https://gist.github.com/730603
有谁知道有任何教程展示如何使用它吗?或者也许可以提供一个示例,说明如何实现此操作以将 PushState 与 Web 应用程序上的某些链接一起使用?
谢谢
I'm interested in having my app update w/o page refresh and without a # hash in a URL.
I've seen jQuery BBQ which uses the hash but then came github's recent blog post about pushState which looks great.
https://gist.github.com/730603
Does anyone know of any tutorials showing how to use it? Or perhaps can provide an example of how to implement this to use pushState with certain links on the web app?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
编辑:(我知道你提到了 GitHub,但我不确定你是否知道 Gist 的实际帖子)
GitHub 最近在博客上介绍了它: https://github.com/blog/760-the-tree -滑块
编辑:
还有一个很棒的 RailsCasts 剧集: http://railscasts.com/episodes/246- ajax 历史状态
Edit: (I know you mentioned GitHub but I wasn't sure if you were aware of the actual post of just the Gist)
GitHub recently blogged about it: https://github.com/blog/760-the-tree-slider
Edit:
There's also a great RailsCasts episode on it: http://railscasts.com/episodes/246-ajax-history-state