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)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • Linux中修改文件权限方法「建议收藏」

    Linux中修改文件权限方法「建议收藏」​一、文件类型在Linux操作系统中,一切皆文件,Linux不以扩展名来区分文件类型,而是在文件属性中有一列专门记录文件类型。普通文件:.c.cpp.h.txt.pdf用’-‘表示目录文件(文件夹):用’d‘表示管道文件(用于进程间通信的一种文件):用’p’表示链接文件(相当于Windows上的快捷方式):用’l’表示设备文件:字符设备文件(c)块设备文件(b)套接字(s)用ls-l查看文件属性信息

    2022年9月3日
    3
  • ReverseFind的用法 ; 查找字符中最后一个字符

    ReverseFind的用法 ; 查找字符中最后一个字符ReverseFindCString::ReverseFind  ReverseFind在一个较大的字符串中从末端开始查找某个字符  CString::ReverseFind  intReverseFind(TCHARch)const;  返回值:  返回此CString对象中与要求的字符匹配的最后一个字

    2022年6月29日
    40
  • vue的table表格_vue elementui表格

    vue的table表格_vue elementui表格新入职的公司让我学习下Vue,以前没怎么学过,最近开始学习,记录下每天学习的内容,借鉴了很多前辈们的资料,如有冒犯,还请原谅。开始我做的是动态表格,但是发现不会调整宽度,于是就改成了下面的样子,用着更舒服一些。先记录下来,免的以后想用找不到。先看下效果图。本人比较懒,就写了一行,下面上代码。<template> <el-table:data=”tableDa…

    2022年9月20日
    0
  • 行为树

    行为树行为树常被用来实现游戏中的AI。每次执行AI,都会从根节点遍历整个树,父节点执行子节点,子节点执行完后将结果返回父节点。下面是基本的四个节点:1*顺序节点(Sequence):属于组合节点,顺序执行

    2022年8月1日
    4
  • vue动态图片地址

    vue动态图片地址

    2020年11月9日
    187
  • HeadFirstJava

    HeadFirstJavajava执行过程的来龙去脉源代码——编译器——输出——java虚拟机扩展名为.java——扩展名为.class不要直接用类名点变量来改变属性值,一般都用get、set方法。封装的基本原则:将你

    2022年7月2日
    22

发表回复

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

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