简体   繁体   English

CSS3媒体查询的Respond.js

[英]Respond.js for CSS3 Media Queries

I am trying to use Respond.js for CSS3 Media Queries on older IE versions https://github.com/scottjehl/Respond 我正在尝试在旧版IE版本上对CSS3媒体查询使用Respond.js进行https://github.com/scottjehl/Respond

I am getting some Access denied message in Javascript. 我收到一些Java拒绝访问的消息。

I have tried similar to http://scottjehl.github.com/Respond/cross-domain/example.html 我已经尝试过类似于http://scottjehl.github.com/Respond/cross-domain/example.html

I think there are some cross-domain setup to be done...But I am not sure why that is needed. 我认为有一些跨域设置需要完成...但是我不确定为什么需要这样做。 I just need to test everything locally as of now. 到目前为止,我只需要在本地测试所有内容即可。 So I have all the files locally...Please help me fix this issue. 因此,我在本地拥有所有文件...请帮助我解决此问题。

Any other suggestions for similar easy-to-use library would also be fine.. 对于类似的易于使用的库,任何其他建议也都可以。

you state that you're running the test on your local hard disk. 您声明正在本地硬盘上运行测试。

According to the Repond.js documentation , you will have issues with this: 根据Repond.js文档 ,您将遇到以下问题:

Due to security restrictions, some browsers may not allow this script to work on file:// urls (because it uses xmlHttpRequest). 由于安全限制,某些浏览器可能不允许此脚本在file:// url上运行(因为它使用xmlHttpRequest)。 Run it on a web server. 在Web服务器上运行它。

So if you're just loading pages from your C: drive, you will need to install a localhost web server to get it working. 因此,如果您只是从C:驱动器加载页面,则需要安装localhost Web服务器才能使其正常运行。

Additionally, even if you are running on a web server, if the respond.js file is on a different domain (or subdomain) from your main page, then you will need to do some cross-domain setup. 此外,即使您正在Web服务器上运行,如果response.js文件与主页位于不同的域(或子域),那么您将需要进行一些跨域设置。

Again, this is documented; 同样,这已被记录在案; see the section in the documentation entitled "CDN/X-Domain Setup". 请参阅文档标题为“ CDN / X域设置”的部分。 It includes examples, and references an example file available with the source. 它包括示例,并引用了源中提供的示例文件。

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

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