我正在尝试让媒体查询在IE8中工作,我已经让Respond.js在开发中工作得很好。然而,当我将它部署到我的生产环境中时,Respond.js并没有发挥它的魔力。我已经按照GitHub上的说明设置了一个CDN (我们使用S3 & Cloudfront),并且我已经确保所有的javascript和respond proxy.html文件在我指定的URL上都是可用的。
WARNING Wed, 03 Oct 2012 15:22:13 +0000 base xxx xxxxxxx Not Found: /https://dxxxxxxxxxxxx.cloudfront.net/j/r/respond-proxy.html它似乎正在尝试在本地服务器上查找/https://d...。该行在每个页面请求中出现多次。
代码如下:
<link rel="stylesheet" type="text/css" media="screen" href="https://dxxxxxxxxxx.cloudfront.net/static/css/style.css" />
<script type="text/javascript" src="/static/js/respond.src.js"></script>
<link href="https://dxxxxxxxxxx.cloudfront.net/static/js/respond-proxy.html" id="respond-proxy" rel="respond-proxy" />
<link href="/static/js/respond.proxy.gif" id="respond-redirect" rel="respond-redirect" />
<script type="text/javascript" src="/static/js/respond.proxy.js"></script>请注意,我的CSS是使用django- compressed压缩的,就像我的其他JS一样。以上代码位于{% COMPRESS%}块之外。
发布于 2012-10-05 06:53:33
原来我需要破解respond.proxy.js才能让它工作。我注释掉了checkBaseUrl()中的第74行:
// href = bref + href;请注意,这可能是由我的页面上运行的其他JS造成的,也可能不是(可能不是?)respond.proxy.js中的错误。
https://stackoverflow.com/questions/12715903
复制相似问题