我可以强制 IE 用户安装 Google Chrome 内嵌框架插件吗
我正在使用谷歌可视化图表,它在 IE8 中渲染得不太好,在 IE6 中根本不起作用。
我添加了谷歌浏览器框架,如果用户安装插件谷歌可视化可以完美地工作。
有没有办法强制 IE 用户安装 GFC?现在它是可选的。我阅读了文档,似乎没有办法通过 GFCInstall.check() 函数调用来配置它。
这是我当前的代码:
<!--[if IE]>
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js"></script>
<style>
.chromeFrameInstallDefaultStyle {
border: 5px solid blue;
top:55%;
}
</style>
<script>
// The conditional ensures that this code will only execute in IE,
// Therefore we can use the IE-specific attachEvent without worry
window.attachEvent("onload", function() {
CFInstall.check({
mode: "inline"
});
});
</script>
<![endif]-->
I am using google visualization for charts, which doesn't render very well in IE8, and doesn't work at all in IE6.
I added google chrome frame, and if the user installs the plug-in google visualization works flawlessly.
Is there a way that I can force IE users to install GFC? Right now it is optional. I read the documentation, and there does not seem to be a way to configure this through the GFCInstall.check() function call.
Here is my current code:
<!--[if IE]>
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js"></script>
<style>
.chromeFrameInstallDefaultStyle {
border: 5px solid blue;
top:55%;
}
</style>
<script>
// The conditional ensures that this code will only execute in IE,
// Therefore we can use the IE-specific attachEvent without worry
window.attachEvent("onload", function() {
CFInstall.check({
mode: "inline"
});
});
</script>
<![endif]-->
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
几乎可以肯定,通过能力嗅探来做到这一点会更好。假设获得良好可视化效果所需的功能是
支持,请嗅探该功能而不是特定的浏览器:
It would almost certainly be better to do this via capability-sniffing. Assuming that the feature you need to get nice visualisations is
<canvas>
support, sniff for that rather than a specific browser:不,你不能强迫用户 - 你的最佳选择来自 Google Chrome 浏览器内嵌框架常见问题解答:
No you cannot force the user - your best options from the Google Chrome Frame FAQ: