简体   繁体   English

Respond.js CDN / X域设置

[英]Respond.js CDN/X-Domain Setup

I'm trying to get respond.js working with their CDN/X-Domain instructions but falling short. 我正在尝试使response.js使用其CDN / X-Domain指令,但没有达到要求。 In IE8 no media queries are loaded still. 在IE8中,不会继续加载任何媒体查询。

I even uploaded the example cross-domain folder to test and adjusted the paths to the files 我什至上载了示例cross-domain文件夹来测试和调整文件的路径

In my <head> I have: 在我的<head>我有:

<link href="http://mywebsite.wpengine.netdna-cdn.com/respond-proxy.html" id="respond-proxy" rel="respond-proxy" />
<link href="http://mywebsite.com/respond.proxy.gif" id="respond-redirect" rel="respond-redirect" />
<script src="http://mywebsite.com/respond.proxy.js"></script>
  • I'm linking to the respond.js itself just before the files above 我在上面的文件之前链接到response.js本身
  • media queries work in ie8 when the CDN is turned off CDN关闭时,媒体查询在ie8中工作
  • There are no errors being outputted by IE8 IE8没有输出错误
  • I'm hosted with WPEngine and they have added the respond-proxy.html to the CDN on their end. 我托管在WPEngine上,他们在其末尾将response-proxy.html添加到CDN。 - I've double checked the files and they all exist. -我仔细检查了文件,它们都存在。

This is how I got it working, remote refers to a remote-url and local to a local asset. 这就是我的工作方式,远程是指远程URL,本地是指本地资产。 Make sure to link to your stylesheets before calling respond.js. 在调用response.js之前,请确保链接到您的样式表。

<!--[if lt IE 9]>
  <script src='//remote/respond.min.js'></script>
  <link href="//remote/respond-proxy.html" id="respond-proxy" rel="respond-proxy" />
  <link href="/local/respond.proxy.gif" id="respond-redirect" rel="respond-redirect" />
  <script src="/local/respond.proxy.js"></script>
<![endif]-->

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM