HTML5的历史APi [英] HTML5 history APi

查看:90
本文介绍了HTML5的历史APi的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何使用HTML5历史API。我的确经历了 https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history。这使我困惑。我想要的只是更改ajax调用的url,以便当用户点击后退按钮时,他会获得以前的状态。

我也知道这个坑有什么变化。何时使用以及何时不使用。如何最好地使用jquery

解决方案

以下是我遇到的最佳资源(包括您已经提到的资源,和一个工作代码示例):



关于陷阱,给出智能状态处理链接一个很好的阅读。关于向后兼容性, History.js 修复了浏览器错误,并提供了可选的HTML4哈希倒退。

How do i use HTML5 history api. I did go through the https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history. That confused me. All that i want is to change the url on ajax calls so that when user hits the back button he gets the previous state.

Also i wnat to know of any pit falls of this . When to use and when not to use. How best to use with jquery

解决方案

Here are the best resources which I've come across (including the one you already mentioned, and a working code example):

In regards to pitfalls give the "Intelligent State Handling" link a good read. In regards to backwards compatibility there is History.js which fixes the browsers bugs and provides an optional HTML4 hash fallback.

这篇关于HTML5的历史APi的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆