ie 谷歌插件Chrome Frame

本文介绍了如何安装和配置ChromeFrame插件以实现在不同版本的IE浏览器中使用谷歌渲染引擎。提供了详细的步骤说明,包括如何检测插件的存在并引导用户安装。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.首先下载、安装Chrome Frame插件 (一定要发布到服务器上才起作用)

   在线版很多,自己搜一下

   离线版地址:http://download.youkuaiyun.com/detail/wd4java/8284975

  

安装成功后如上图

2.打开需要使用谷歌的页面

    1、所有版本ie都使用谷歌插件

  <meta http-equiv="X-UA-Compatible" content="chrome=1">
     2、指定版本

   <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=IE6">

    3、检测Google Chrome框架并提示安装

<html>
<body>
  <script type="text/javascript" 
   src="http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js"></script>

  <style>
   /* 
    CSS rules to use for styling the overlay:
      .chromeFrameOverlayContent
      .chromeFrameOverlayContent iframe
      .chromeFrameOverlayCloseBar
      .chromeFrameOverlayUnderlay
   */
  </style> 

  <script>
   // You may want to place these lines inside an onload handler
   CFInstall.check({
     mode: "overlay",
     destination: "http://www.waikiki.com"
   });
  </script>
</body>
</html>
4、CFInstall.check()

  • modeoptional
    How the user should be prompted when GCF is missing. Defaults to a value of inline that puts an iframe in the document that points to the value of url. If a value for node is specified this will control where the iframe is placed, else it will appear as the first child of the doucment's body element. If mode is set to overlay (recommended), an in-page dialog is displayed that floats over page content. If mode is popup, then url is opened in a new (popup) window. It's recommended that you only use a value of popup when calling check() from a user action, for instance the onclick handler of a buttonelement else popup blocking software may defeat the check.
  • urloptional
    Defaults to "http://google.com/chromeframe". Set this to change the URL that the prompt (either inline or in a popup) will navigate to. You might use this if you're using GCF on an intranet or closed environment and you want to prompt users to install from an alternate location.
  • destinationoptional
    The URL to navigate to once CFInstall detects that GCF has been installed.
  • nodeoptional
    The ID or reference to an element that will contain the iframe prompt. If no node is provided, the prompt iframe will be inserted at the top of the document.
  • onmissingoptional
    Function to be called when GCF is missing.
  • preventPromptoptional
    Boolean, defaults to false, which allows you to disable the default prompting mechanism. Use in conjunction with onmissing to implement your own prompt.
  • oninstalloptional
    Function that will be called when GCF is first detected after an install prompt is displayed.
  • preventInstallDetectionoptional
    Boolean, defaults to false. Set this to true to prevent CFInstall from checking whether GCF has been installed. Use this to prevent redirection.
  • cssTextoptional
    Style properties to apply to the prompt iframe when mode is inline.
  • classNameoptional
    CSS classes to apply to the prompt iframe when mode is inline.
5、CFInstall.check()例子

<html>
<body>
  <!--[if IE]>
    <script type="text/javascript" 
     src="http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js"></script>

    <style>
     .chromeFrameInstallDefaultStyle {
       width: 100%; /* default is 800px */
       border: 5px solid blue;
     }
    </style>

    <div id="prompt">
     <!-- if IE without GCF, prompt goes here -->
    </div>
 
    <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", // the default
         node: "prompt"
       });
     });
    </script>
  <![endif]-->
</body>
</html>

详情请参考:http://www.chromium.org/developers/how-tos/chrome-frame-getting-started




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

筱芙淘趣坊

为嗷嗷待哺的我助力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值