tom*_*jok 8 hashbang angularjs
我有一个angularjs(v 1.2.19)应用程序,它由两个独立的html页面组成(或者实际上这些是两个单独的angularjs应用程序在一个文件夹中):
我在IE 8和9上有一些众所周知的兼容性问题(两者都不支持html5历史API).我的配置包含:$locationProvider.html5Mode(true).hashPrefix('!');
我在应用程序中没有任何路由 - index.html和edit.html可以看作是单独的angularjs应用程序 - 具有单独的angularjs初始化等.
问题看起来像这样:每当我打开链接:http://server/app或者http://server/app/index.html一切正常.
每当我打开链接时:http://server/app/edit.html从ng-click或直接在浏览器中,页面会自动重定向到http://server/#!app/edit.html
如何禁用"hashbang"重定向?Edit.html不是index.html的一部分,因此它应该直接加载,不需要任何index.html重定向和"哈希"路由.
我尝试了下面的代码,但它导致无限循环的重定向...
<!--[if lt IE 10]>
<script>
window.location = window.location.href.replace( /#.*/, "");
</script>
<![endif]-->
Run Code Online (Sandbox Code Playgroud)
任何帮助赞赏.
| 归档时间: |
|
| 查看次数: |
2605 次 |
| 最近记录: |