ie 谷歌插件Chrome Frame[通俗易懂]

ie 谷歌插件Chrome Frame[通俗易懂]弄了很久的东西,记录一下。记得要放到服务上才有效果

大家好,又见面了,我是你们的朋友全栈君。

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

   在线版很多,自己搜一下

   离线版地址:http://download.csdn.net/detail/wd4java/8284975

  ie 谷歌插件Chrome Frame[通俗易懂]

安装成功后如上图

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.proxy.ustclug.org/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.proxy.ustclug.org/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

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/160279.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • java swing开发窗体程序开发(一)GUI编程[通俗易懂]

    java swing开发窗体程序开发(一)GUI编程[通俗易懂]JavaSWing就是java提供的一个类库专门用于开发窗体程序的,相对于C#的winform,javaswing的开发要比C#更加麻烦,他不像C#拥有可视化的界面编辑工具而是需要像QT一样纯代码式GUI编程。java的好处就是通用性强,跨平台,这个java窗体程序做好之后,哪都可以用。然而C#的winform只能运行在有.net框架上的平台,然而.net支持最好的,也就只有windows…

    2022年8月23日
    5
  • centos7 yum安装MongoDB[通俗易懂]

    centos7 yum安装MongoDB[通俗易懂]原文博客地址http://xgs888.top/post/view?id=64centos7yum安装mongodb;1:创建仓库vi/etc/yum.repos.d/mongodb-org-3.4.repo2:把下面的内容复制到文件中保存退出[mongodb-org-3.4]name=MongoDBRepositorybaseurl

    2022年5月24日
    34
  • 精进Quartz之路—Quartz备忘录

    官网: http://www.quartz-scheduler.org/Quartz任务调度快速入门 http://sishuok.com/forum/posts/list/405.html深入解读Quartz的原理 http://lavasoft.blog.51cto.com/62575/181907/Quartz2之入门示例 http://liuzidong.iteye.com/blog

    2022年2月25日
    63
  • MSSQL 的QUOTENAME函数「建议收藏」

    MSSQL 的QUOTENAME函数「建议收藏」–功能:返回带有分隔符的Unicode字符串,分隔符的加入可使输入的字符串成为有效的MSSQL分隔标识符。–语法QUOTENAME(‘character_string'[,’quote_character’]) –SQL语句中的字段名,表名为关键字时,用QUOTENAME添加有效分隔符() –在动态查询中,对表名参数QUOTENAME处理,避免表名为

    2022年7月25日
    12
  • Unable to AUTH to MASTER: -ERR Client sent AUTH, but no password is set「建议收藏」

    Unable to AUTH to MASTER: -ERR Client sent AUTH, but no password is set「建议收藏」问题描述:redis主从复制时,想要增加密码认证功能。初学了解不多,修改了master的redis_6379.conf,增加”masterauth 123456″,同时修改slave的redis_6380.conf,增加”masterauth 123456″。认为主从配置的认证密码的参数都是masterauth。重新启动后用redis-cli连接slave,输入info replicati…

    2022年6月13日
    60
  • 微信小程序轮播图(详细)「建议收藏」

    微信小程序轮播图(详细)「建议收藏」微信小程序轮播图效果图wxml:<swiperindicator-dots=”{{indicatorDots}}”autoplay=”{{autoplay}}”interval=”{{interval}}”duration=”{{duration}}”><blockwx:for=”{{imgUrls}}”><swiper-item><imagesrc=”{{item}}”class=”slide-image”/></sw

    2022年5月22日
    42

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号