zoukankan      html  css  js  c++  java
  • ASP.NET中怎样将页面设为首页,加入收藏

    1、文字js脚本事件:<span onClick="var strHref=window.location.href;this.style.behavior=’url(#default#homepage)’;this.setHomePage(‘http://www.unvs.cn’);" style="CURSOR: hand">

    2、文字链接事件:<a href="#" onClick="window.external.addFavorite(‘http://blog.unvs.cn’,'Unvs博客’)"title=Unvs博客’ >

    <input type=button value=导入收藏夹 onclick=window.external.ImportExportFavorites(true,"http://www.unvs.cn/");> 
    <input type=button value=导出收藏夹 onclick=window.external.ImportExportFavorites(false,"http://www.unvs.cn/");> 
    <input type=button value=整理收藏夹 onclick="window.external.ShowBrowserUI(‘OrganizeFavorites’, null)"> 
    <input type=button value=查看源文件 onclick="window.location = ‘view-source:’+ window.location.href"> 
    <input type=button value=语言设置 onclick="window.external.ShowBrowserUI(‘LanguageDialog’, null)"> 
    <input type=button value=加入收藏夹 onclick="window.external.AddFavorite(‘http://www.fsing.net/’, ‘风信子网络’)"> 
    <input type=button value=加入到频道 onclick="window.external.addChannel(‘http://www.fsing.net/’)"> 
    <input type=button value=设成主页 onclick="this.style.behavior=’url(#default#homepage)’;this.setHomePage(‘http://www..****..com/’)">

    3、给一个网站上设置"设为主页"和"加入收藏夹"的代码应该怎么写?(在一个小图片上面加)
    <A href="#" onmouseover="window.external.addFavorite(‘http://www.****.com/’,'e时区特色论坛’)" target="_self" >收藏本页</A> 
    <a href="#" onmouseover="this.style.behavior=’url(#default#homepage)’;this.setHomePage(‘http://www.****.com/’);" target="_self">设为主页</a>

    4、用javascript来实现,写在控件的onclick中
    网上查的javascript例子(onclick中是具体的实现)<table align="center">
    <tr>
        <td onclick="window.location.href;this.style.behavior=’url(#default#homepage)’;this.setHomePage(‘http://blog.unvs.cn/‘);" style="CURSOR:Hand"><font color=black>设为首页  </font></td>
        <td onclick="window.external.AddFavorite(location.href,document.title);" style="CURSOR:Hand"><font color=black>加入收藏</font></td>
    </tr>
    </table>
    设为主页 
    <A href=# onclick="this.style.behavior=’url(#default#homepage)’;this.setHomePage(‘http://www.baidu.com’);">图片</A> 
    —————————————– 
    加如收藏 
    <A href="javascript:window.external.AddFavorite(‘http://www.baidu.com’,'百度’)">图片</A>

    加入收藏 
    <a href="javascript:window.external.AddFavorite(‘http://www.baidu.com’,'百度’)">加入收藏</a> 
    首页 
    <span onclick="var strHref=window.location.href;this.style.behavior=’url(#default#homepage)’;this.setHomePage(‘http://www.baidu.com’);" style="CURSOR: hand"><br>设为首页</br></span>

    <a href=# onClick="this.style.behavior=’url(#default#homepage)’;this.setHomePage 
    (‘http://www……/’);">设为首页</a> <IMG height=11 
    src="images/dot.gif" width=12 border=0> <a href=# onClick="window.external.addFavorite(‘http://www……/’,'****’);return(false)">收藏本站</a>

    将其中"www……"换成你的网页地址 
    "****"换成你的网站名字

  • 相关阅读:
    六类人最适合做程序员!不善于撩妹的人竟然当选...哈哈
    20170926-构建之法:现代软件工程-阅读笔记
    Android Studio新建类头部注释和添加函数注释模板及快捷键
    android AysncTask使用
    Android Studio配置git,实现项目在github上的版本同步
    avloadingindicatorview 使用解析
    retrofit 基础使用
    retrofit 使用解析
    关于HTTP
    单例模式
  • 原文地址:https://www.cnblogs.com/qinge/p/4280917.html
Copyright © 2011-2022 走看看