[英]How to add an Internet Explorer Behaviour file (.htc) from a different domain?
I'm redesigning my Tumblr blog and I use CSS3 Pie to add some eye-candy to Internet Explorer. 我正在重新设计Tumblr博客,并使用CSS3 Pie向Internet Explorer添加了一些吸引人的东西。 The problem with this is that CSS3 Pie uses Internet Explorer specific files (.htc) that can only be served from the same domain as the HTML file, which is something I can't do on Tumblr. 问题是CSS3 Pie使用Internet Explorer专用文件(.htc),该文件只能从与HTML文件相同的域中提供,这是我在Tumblr上无法做到的。
The thing is that without that file the website breaks on IE6 & IE7 (I'm using HTML5 syntax and apparently these browsers don't really like it even with some help from Modernizr). 问题是,如果没有该文件,该网站将无法在IE6和IE7上运行(我使用的是HTML5语法,而且即使在Modernizr的帮助下,这些浏览器显然也不喜欢它)。
So, do you know any ways of adding such files from another domain than the one that serves the HTML? 那么,您是否知道从提供HTML的域之外的其他域添加此类文件的任何方法? No matter how hacky it is. 不管它多么hacky。
I would suggest using conditional comments for IE to gracefully alert users their browsers are not supported, or to reformat the content for IE users. 我建议对IE使用条件注释来优雅地警告用户其浏览器不受支持,或为IE用户重新格式化内容。
<!--[if IE 6]><link rel="stylesheet" type="text/css" href="includes/styleIE6.css" /><![endif]-->
<!--[if IE 7]><link rel="stylesheet" type="text/css" href="includes/styleIE7.css" /><![endif]-->
<!--[if IE 8]><link rel="stylesheet" type="text/css" href="includes/styleIE8.css" /><![endif]-->
Another alternative, which I'm guessing is easier than the ".htc" hack you are suggesting. 我猜,另一种选择比您建议的“ .htc”黑客更容易。 Is to use a basic java-script redirect. 是使用基本的Java脚本重定向。 If the user is using IE (less than IE9) redirect them to a simplified, IE only, web page. 如果用户使用的是IE(低于IE9),则将其重定向到简化的,仅IE的网页。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.