AngularJS如何使用途径去除IE9#符号 [英] AngularJS How to remove # symbol in IE9 by using route
问题描述
我无法删除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屋!