Backbone.history:深URL不支持下跌正确的IE浏览器 [英] Backbone.history: deep urls are not falling backing properly in IE

查看:217
本文介绍了Backbone.history:深URL不支持下跌正确的IE浏览器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的单页骨干的应用程序,我无法让我长的URL正确路由在IE中。该嵌套多个级别的任何URL,直接加载它们时,没有收到正确的哈希fallbak。

In my single-page backbone app, I'm having trouble getting my longer urls to route properly in IE. Any urls that are nested more than one level, don't receive the proper hash fallbak when loading them directly.

顶级网址,做工精细...

when I load: domain.com/resource
in IE I get: domain.com/#resource (as expected)

导航(在应用程序)工作正常...

when I click on a link to: domain.com/resource/12345
IE sends me to: domain.com/#resource/12345 (as expected)

但更深层次的访问的URL直接打破了页

when I load: domain.com/resource/12345
in IE I get: domain.com/resource/12345 !! this is incorrect, and the page doesn't load

更新:

这是IE9

推荐答案

我不知道,如果你已经在过去3小时你的升级改变任何东西,但我观察问题都涉及到这个问题

I'm not sure if you've changed anything on your staging in the last 3 hours, but the problems I'm observing are related to this problem

<一个href=\"http://stackoverflow.com/questions/6541721/ie-doesnt-support-relative-paths-in-the-base-element-when-referencing-css-files\">IE引用CSS文件

当您的页面请求 http://stage.change4cancer.org/profile/647955793 ,它得到实际的HTML页面。现在,无论它是否是应该重定向到#资料/ 647955793又是另一回事(为什么你要做到这一点你已经加载的内容后,我不知道),但让我解释一下。

When your page requests http://stage.change4cancer.org/profile/647955793, it gets actual html for the page. Now whether or not it's supposed to redirect to #profile/647955793 is another matter (why you'd want to do that after you've already loaded the content, I'm not sure), but let me explain.

在通过 http://stage.change4cancer.org/profile/647955793该HTML 你有以下标签:

<base href="/" />

但IE9不会尊重标记,除非它有一个完整的URI。因此,所有的JS,CSS等的路径是错误的。而不是

But IE9 will not respect that tag unless it has a full URI. Therefore, all the paths to the JS, CSS, etc are wrong. Instead of

http://stage.change4cancer.org/js/库/骨干网0.9.2.min.js

它的请求

http://stage.change4cancer.org/简介/ JS /库/骨干网0.9.2.min.js

由于没有任何的外部JS被加载,当然事情会出错。

Since none of of your external JS is loading, of course things are going to go wrong.

这篇关于Backbone.history:深URL不支持下跌正确的IE浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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