zoukankan      html  css  js  c++  java
  • 来源为搜索时,提示并收藏

    var referer = document.referrer;
    if(referer.indexOf("google")>0)
    {if(confirm('感谢您使用 Google 搜索引擎服务,点击\'确认\'进入该网站并收藏您找到的重要信息.')){addToFavorite();}}
    if(referer.indexOf("sina")>0)
    {if(confirm('感谢您使用 新浪 搜索引擎服务,点击\'确认\'进入该网站并收藏您找到的重要信息.')){addToFavorite();}}
    if(referer.indexOf("baidu")>0)
    {if(confirm('感谢您使用 百度 搜索引擎服务,点击\'确认\'进入该网站并收藏您找到的重要信息.')){addToFavorite();}}
    if(referer.indexOf("3721")>0)
    {if(confirm('感谢您使用 3721 搜索引擎服务,点击\'确认\'进入该网站并收藏您找到的重要信息.')){addToFavorite();}}
    if(referer.indexOf("114")>0)
    {if(confirm('感谢您使用 114 搜索引擎服务,点击\'确认\'进入该网站并收藏您找到的重要信息.')){addToFavorite();}}
    if(referer.indexOf("sogou")>0)
    {if(confirm('感谢您使用 搜狗 搜索引擎服务,点击\'确认\'进入该网站并收藏您找到的重要信息.')){addToFavorite();}}
    if(referer.indexOf("sohu")>0)
    {if(confirm('感谢您使用 搜狐 搜索引擎服务,点击\'确认\'进入该网站并收藏您找到的重要信息.')){addToFavorite();}}
    if(referer.indexOf("163")>0)
    {if(confirm('感谢您使用 网易 搜索引擎服务,点击\'确认\'进入该网站并收藏您找到的重要信息.')){addToFavorite();}}
    if(referer.indexOf("yahoo")>0)
    {if(confirm('感谢您使用 雅虎 搜索引擎服务,点击\'确认\'进入该网站并收藏您找到的重要信息.')){addToFavorite();}}
    function addToFavorite(){
      if ((navigator.appVersion.indexOf("MSIE") > 0) && (parseInt(navigator.appVersion) >= 4)) {
        window.external.AddFavorite("http://www.f996.com", unescape('重要信息'));
  • 相关阅读:
    Redis命令
    Linux命令
    SQL语句
    Redis集群
    Redis主主复制、主从复制
    关于Java乱码
    组合, 封装, 访问限制机制, property装饰器, 多态
    继承
    小练习
    面向过程与面向对象, 类和对象
  • 原文地址:https://www.cnblogs.com/MaxIE/p/669437.html
Copyright © 2011-2022 走看看