在 IE 中模拟/polyfill history.pushstate() [英] Emulate/polyfill history.pushstate() in IE

查看:31
本文介绍了在 IE 中模拟/polyfill history.pushstate()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

history.pushstate().有没有另一种方法可以在 IE 中实现这一点?

history.pushstate() is not supported in IE. Is there another way to achieve this in IE?

推荐答案

考虑使用或改编 History.js 来自 GitHub.根据描述:

Consider using or adapting History.js from GitHub. As per the description:

History.js 优雅地支持HTML5 历史/状态 API(pushState、replaceState, onPopState) 总共浏览器.包括持续支持用于数据、标题、replaceState.支持 jQuery、MooTools 和原型.对于 HTML5 浏览器,这个意味着您可以修改网址直接使用,无需使用散列了.对于 HTML4 浏览器将恢复使用旧的onhashchange 功能.

History.js gracefully supports the HTML5 History/State APIs (pushState, replaceState, onPopState) in all browsers. Including continued support for data, titles, replaceState. Supports jQuery, MooTools and Prototype. For HTML5 browsers this means that you can modify the URL directly, without needing to use hashes anymore. For HTML4 browsers it will revert back to using the old onhashchange functionality.

IE(最多包括 9 个),不支持 pushstate().IE 10 支持它.

IE (upto and including 9), does not support pushstate(). IE 10 supports it.

http://caniuse.com/#search=pushstate

这篇关于在 IE 中模拟/polyfill history.pushstate()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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