简体   繁体   English

如何从其他域添加Internet Explorer行为文件(.htc)?

[英]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.

相关问题 使用 Internet Explorer 6 和 8 打开文件行为 - Open File behaviour with Internet Explorer 6 and 8 如何在不同域名下的 Internet Explorer 中使用 javascript 删除 cookie 文件 - How to delete cookie file using javascript in Internet explorer which is under a different domain name 如何停止 .jsp 和 html 文件从 Internet Explorer &amp; jquery 和 javascript 无法在 Internet Explorer 上下载 - how to stop .jsp and html file to download from internet explorer & jquery and javascript not working on internet explorer 如何从其他域添加iframe - how to add iframe from different domain 如何在Internet Explorer中打开远程HTML文件? - How to open remote html file in internet explorer? 如何在 Internet Explorer 中开始自动下载文件? - How to start automatic download of a file in Internet Explorer? 如何将相对路径添加到PIE.htc文件? - How can I to add relative path to PIE.htc file? 以管理员身份运行Internet Explorer 11时的不同window.open(…)行为 - Different window.open(…) behaviour when running Internet Explorer 11 as Administrator 如何防止null在Internet Explorer中显示? - How to keep null from displaying in internet explorer? Internet Explorer 7下拉列表的奇怪行为 - Internet Explorer 7 strange behaviour for drop down list
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM