zoukankan      html  css  js  c++  java
  • JS兼容所有浏览器的一段加入收藏代码,设置为首页

    <script language="javascript" type="text/javascript">
     function addfavorite(obj,url,title) { 
      !url ? url = location.href : null;
      !title ? title = document.title : null;
      try{   
       window.external.addFavorite(url, title); 
       return false;
      }catch(e){   
       try{   
        window.sidebar.addPanel(title, url, ""); 
        return false;  
       }catch(e){   
        alert("加入收藏失败,请使用Ctrl+D进行添加"); 
        if(location.href.toLowerCase().indexOf(obj.href.toLowerCase(),0)>=0){return false;} 
       }   
      }   
     }
    </script>
    <a href="http://dreamdesign.csrjgzs.com/" onclick="return addfavorite(this,'http://dreamdesign.csrjgzs.com/','阿里西西,最多最全的网页特效集锦!');">收藏阿里西西!</a>
    设置为首页 

    var
    strHref=window.location.href;this.style.behavior='url(#default#homepage)'; this.setHomePage('http://www.dotneteye.com.cn');
  • 相关阅读:
    参考__JAVA
    债券价格和通胀率
    C++ 面试题
    欧式和美式期权
    explicit
    smart pointer
    const pointer
    manacher-马拉车算法
    输入有空格的字符串的2种方法
    bind()与connect()——计网中socket的使用
  • 原文地址:https://www.cnblogs.com/zhangs1986/p/3642607.html
Copyright © 2011-2022 走看看