Ste*_*hab 2 cross-domain tumblr media-queries responsive-design
我的网站响应迅速.该博客节使用指向的tumblr的子域,但Respond.js的跨域版本无法正常工作.我这样做:
<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>
Run Code Online (Sandbox Code Playgroud)
我假设问题是response.proxy.gif和respond.proxy.js不在blog.stevechab.com上......但是这不是打败了具有跨域版本的Respond.js的目的吗?我的假设是正确的,还是我错过了什么?有没有解决这个问题?
注意:我试过http://www.tumblr.com/themes/upload_static_file ...没有骰子.
@Steve Chab,
有两个原因,response.js和respond.proxy.js不适合你.
您在原始域中有respond-proxy.html文件,而该文件应该是从您的子域(blog.stevechab.com)或任何其他外部域提供的.
当链接到具有相对URL的css文件时,似乎有response.js/respond.proxy.js的错误.要修复它,请使用绝对URL.您的主站点使用css样式表的相对URL,并且您的博客是绝对URL.
请在下面找到重新查看的工作标记,以获得在您的网站上工作的respond.js和respond.proxy.js.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="http://www.stevechab.com/styles/styles.css">
<!--[if (lt IE 9) & (!IEMobile 7)]>
<link href="//blog.stevechab.com/scripts/respond-proxy.html" id="respond-proxy" rel="respond-proxy">
<link href="//www.stevechab.com/scripts/respond.proxy.gif" id="respond-redirect" rel="respond-redirect">
<![endif]-->
</head>
<body>
<!-- Your content goes here. -->
<!--[if (lt IE 9) & (!IEMobile 7)]>
<script src="//www.stevechab.com/scripts/respond.min.js"></script>
<script src="//www.stevechab.com/scripts/respond.proxy.js"></script>
<![endif]-->
</body>
</html>
Run Code Online (Sandbox Code Playgroud)