AngularJS如何使用途径去除IE9#符号 [英] AngularJS How to remove # symbol in IE9 by using route

查看:138
本文介绍了AngularJS如何使用途径去除IE9#符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法删除IE9#符号。我搜索了一个答案,但没找到一个解决。

I can't remove the # symbol in IE9. I searched for an answer but didn't find a fix.

这总是重定向到

http://myhost.com:8080/#/website/

和展示这样的描述:

The requested resource is not available.

locationprovider.html5mode(真)不工作。
同样的路线是工作在FireFox和演出

locationprovider.html5mode(true) is not working. The same route is working in FireFox and shows

http://myhost.com:8080/website/

我怎样才能纠正这种?

How can I rectify this?

推荐答案

$位置文档

请参阅Hashband和HTML5模式

See "Hashband and HTML5 modes"

基本上,HTML5模式使用历史API ​​当浏览器支持它,并回落到hashbang()当它不支持。

Basically, html5 mode uses History API when the browser supports it, and falls back to hashbang(#) when it is not supported.

您不能只在没有历史API的浏览器删除#。因为当你更改URL,浏览器会再尝试强制重装,打破了流量。

You cannot "just" remove "#" in a browser without History API. Because when you change the url, the browser would then try to force a reload, breaking the flow.

这篇关于AngularJS如何使用途径去除IE9#符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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