Internet Explorer 8,9使用客户端路由器重新加载循环(Page.js + history.js)

时间:2017-01-20 19:05:20

标签: internet-explorer history.js html5-history page.js

我在一个项目上工作并使用使用History API的page.js客户端路由器(Project在所有浏览器中运行得非常好,IE 10+)。但它在IE 8,9上不起作用。当我试图在IE lt9中打开我的Web应用程序基本路径时,我得到无限重定向循环。我正在使用HTML5-History-API polyfill(在P.S中观看链接)。

这是我的router.js文件。我将page.js和history.js包含在index.html的头部

//callbacks modules
var index = require("./router callbacks/index");
var contacts = require("./router callbacks/contacts");
var notFound = require("./router callbacks/notFound");

//history redirect for IE lt9
history.redirect("/", "/content-library/app/");

page.base('/content-library/app');
page('/', index);
page('/contacts',contacts);
page('*', notFound);
page();

Redirect loop when I am trying to launch first page

Returns html markup but doesn`t initiate callback function to render full page

我知道历史API不支持IE10-,但就我遵循page.js中的所有说明而言,他们说它应该可以正常使用HTML5-History-API polyfill。所以现在我在想是否有任何解决方案,或者我应该将路由器更改为哈希。

就我在网上研究而言,它可能与history.redirect有关,但正如我正在研究图书馆它应该可以正常工作。

P.S。 由于声誉不佳,无法添加超过2个链接: page.js - visionmedia.github.io/page.js/ HTML5-History-API - github.com/devote/HTML5-History-API

谢谢!

0 个答案:

没有答案