IE 9不支持$ locationProvider.html5Mode [英] IE 9 not supporting $locationProvider.html5Mode

查看:585
本文介绍了IE 9不支持$ locationProvider.html5Mode的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建一个angularjs应用程序。我做了$ locationProvider.html5Mode为真。现在我越来越pretty URL,而不#。它工作在Chrome和Firefox的罚款。但是,当我试着在IE 9中打开它,它是不断重新加载。

Hi I am creating an angularjs app . I made $locationProvider.html5Mode as true. Now I am getting pretty url without # . It is working fine in chrome and firefox. But when I tried to open it in IE 9 , it is reloading continuously.

推荐答案

坏消息。 IE9不支持HTML5历史API。这就是角html5Mode使用。如果你需要你的应用程序上运行的IE9你需要切换回或添加code来检测,如果历史API可使用的或默认哈希

Bad news. IE9 do not support HTML5 History API. That is what angular html5Mode uses. If you need your app to run on IE9 you need to switch back or add code to detect if History API is available the use is or default to the hash

function supports_history_api() {
  return !!(window.history && history.pushState);
}

我知道了。愚蠢的IE浏览器。它应该死于痛苦死了。

I know. Stupid IE. It should die a painful dead.

这篇关于IE 9不支持$ locationProvider.html5Mode的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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