1、首先,打开html编辑器,新建html文件,例如:index.html。
2、在index.html中的<script>标签,输入js代码:window.external.addFavorite(location.href, '我的网站')。
3、浏览器运行index.html页面,此时会d出添加到收藏夹的面巧扰板,点击闷码完成即可。孝罩旦
<script language=javascript><!--
function Addme(){
url = "http://www.this.net"你自己的主页地址
title = "Your Site Name"//你自己的主页名称
window.external.AddFavorite(url,title)
-->
</script>
<a href="javascript:Addme()">将本站添入收藏夹</a>
以下代码同时姿空宽适用于IE和迹亮亏昌firefox的js脚本<script type="text/javascript">
function addBookmark(title,url) {
if (window.sidebar) {
window.sidebar.addPanel(title, url,"")
} else if( document.all ) {
window.external.AddFavorite( url, title)
} else if( window.opera &&window.print ) {
return true
}
}
</script>页面使用:<a href=javascript:addBookmark('我的网站','http://www.this.net/')>添加到收藏</a>
<script language="javascript"森轮>罩春缓var s="close"function window.onunload(){if(s=="fresh")如果 这样物模就可以了
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)