Respond.js在子域使用Tumblr [英] Respond.js on Subdomain using Tumblr

查看:172
本文介绍了Respond.js在子域使用Tumblr的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网站具有回应功能。 博客部分使用指向Tumblr的子域名,但跨域版本的Respond.js无法正常工作。我这样做:

My website is responsive. The blog section uses a subdomain pointing to Tumblr, but the cross-domain version of Respond.js isn't working. I'm doing this:

<script src="http://www.stevechab.com/scripts/respond.min.js"></script>
<link href="http://www.stevechab.com/scripts/respond-proxy.html" id="respond-proxy" rel="respond-proxy">
<link href="http://www.stevechab.com/scripts/respond.proxy.gif" id="respond-redirect" rel="respond-redirect">
<script src="http://www.stevechab.com/scripts/respond.proxy.js"></script>



我假设问题是respond.proxy.gif和respond.proxy.js不在blog.stevechab.com ...但是,这不是失败了有一个跨域版本的Respond.js的目的?我的假设是正确的,还是我错过了什么?有没有这方面的工作?

I assume the problem is that respond.proxy.gif and respond.proxy.js aren't on blog.stevechab.com ... but doesn't that defeat the purpose of having a cross-domain version of Respond.js? Is my assumption right, or am I missing something? Is there a work around for this?

注意:我试过 http://www.tumblr.com/themes/upload_static_file ...没有骰子。

Note: I tried http://www.tumblr.com/themes/upload_static_file ... no dice.

推荐答案

引用 respond.js 自述文件:


Respond.js通过请求因此如果您在CDN(或子域)上托管您的样式表,则需要上传代理页面以启用跨域通信。

Respond.js works by requesting a pristine copy of your CSS via AJAX, so if you host your stylesheets on a CDN (or a subdomain), you'll need to upload a proxy page to enable cross-domain communication.

- 我强调。跨域版本旨在使您能够处理从 respond.js 正在处理的另一个域加载的样式表。但是,在Tumblr的情况下,您已将第三个​​域添加到组合: static.tumblr.com ,其中您的代理脚本和gif已着陆。这不能,也不会,工作。

– my emphasis. The cross-domain version is meant to enable you to process stylesheets loaded from another domain than the one respond.js is working on. In the case of Tumblr, however, you have a third domain added to the mix: static.tumblr.com, where your proxy script and gif have landed. That cannot, and will not, work.

这篇关于Respond.js在子域使用Tumblr的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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