zoukankan      html  css  js  c++  java
  • 设为首页 和 收藏本页

    <a href="#" onclick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.xxxxxx.com');"  class="xxxxx">设为首页</a>

    (特别注意:要把’这个符号换成无任何输入法状态中输入的’这个符号,否则程序无法运行)   
    1.文字型:    
    <a onclick="this.style.behavior=’url(#default#homepage)’;this.setHomePage(’http://www.dafacai.net’);" href="http://www.dafacai.net">设为首页</a>    

    2.按钮型:    
    <input TYPE="button" VALUE=" 设为首页 " onclick="this.style.behavior=’url(#default#homepage)’;this.setHomePage(’http://www.dafacai.net’);" href="http://www.dafacai.net">    

    3.离开时自动提示设为首页:    
    <body onunload="BASEBody.style.behavior=’url(#default#homepage)’;if(!(BASEBody.isHomePage(’http://www.1.com’)))BASEBody.setHomePage(’http://www.dafacai.net’);">  

    4.打开网页就提示是否设为主页: 
    <script language="javascript">  
    function myhomepage(){  
    this.homepage.style.behavior=’url(#default#homepage)’;this.homepage.sethomepage(’http://www.dafacai.net’);  
    }  
    </script>  
    <p align="center"><a href="http:www.dafacai.net" name="homepage"  
    onclick="myhomepage();"></a>  

    再将下面代码加入<body>内:  
    onload="myhomepage();"  
    即:<body onload="myhomepage();"> 

    <a href="#" onclick="window.external.AddFavorite(location.href,document.title);" class="xxxx">收藏网站</a></li>

  • 相关阅读:
    MySQL存储过程和函数
    MySQL数据类型
    MySQL—基础(SQL语句)
    如何将一串字符串按照某个特定的字符分割后倒叙输出,如:www.baidu.com输出为com.baidu.www
    JAVA WEB数据中文编码问题
    如何用一条SQL语句从登录日志表中查询统计出每个人登录的次数
    JAVA WEB tomcat启动关闭问题
    thinkphp知识点
    smarty模板内容
    smarty基础
  • 原文地址:https://www.cnblogs.com/tomkillua/p/1439534.html
Copyright © 2011-2022 走看看