js加入收藏夹与增加书签代码

function externalLinks() {
if (!document.getElementsByTagName) return;
var anchors = document.getElementsByTagName("a");
for (var i=0; i<anchors.length; i++) {
var anchor = anchors[i];
if (anchor.getAttribute("href") &&
anchor.getAttribute("rel") == "external")
anchor.target = "_blank";
}
}
window.onload = externalLinks;
function selectTag(showContent,selfObj){
 var tag = document.getElementById("tags").getElementsByTagName("a");
 var taglength = tag.length;
 for(i=0; i<taglength; i++){
  tag[i].className = "";
 }
 selfObj.className = "focu";
 for(i=0; j=document.getElementById("baidu"+i); i++){
  j.style.display = "none";
 }
 document.getElementById(showContent).style.display = "block";
}
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;
    }
}

时间: 2024-07-31 12:08:23

js加入收藏夹与增加书签代码的相关文章

js 整理收藏夹 另存网页代码

  <整理收藏夹html> <head> <title>显示"整理收藏夹"</title> </head> <body> <a href="网页特效:external.showbrowserui('organizefavorites',null)"> 点此"整理收藏夹"</a> </body> </html> 另存网页 html

JS 加入收藏夹的代码(主流浏览器通用)_javascript技巧

所有浏览器通用的js添加收藏夹代码 复制代码 代码如下: <script> function addfavorite() { if (document.all) { window.external.addFavorite('http://www.XXX.com','XXX'); } else if (window.sidebar) { window.sidebar.addPanel('XXX', 'http://www.XXX.com', ""); } } </scr

js加入收藏夹代码(兼容ie/ff/op)_javascript技巧

复制代码 代码如下: var www_jb51_net = function (obj, url, title) {    var e = window.event || arguments.callee.caller.arguments[0];    var B = {        IE : /MSIE/.test(window.navigator.userAgent) && !window.opera        , FF : /Firefox/.test(window.navig

js Firefox 加入收藏夹功能代码 兼容Firefox 和 IE_javascript技巧

完整代码如下:chrome下也有提示,说实话一般这类代码一般都是IE下使用,其它浏览器也只是给个提示了. <script type="text/javascript"> //设为首页 www.jb51.net function SetHome(obj,url){ try{ obj.style.behavior='url(#default#homepage)'; obj.setHomePage(url); }catch(e){ if(window.netscape){ try

原生JS实现加入收藏夹的代码_javascript技巧

复制代码 代码如下: <html><head><title>JS加入收藏夹</title></head><script>function addfavorite(){   if (document.all)   {      window.external.addFavorite('http://www.baidu.com','收藏夹');   }   else if (window.sidebar)   {      window.

虫虫营销助手网络收藏夹书签使用方法

中介交易 http://www.aliyun.com/zixun/aggregation/6858.html">SEO诊断 淘宝客 云主机 技术大厅 虫虫营销助手在Build 0240版本中增加了对百度搜藏.Stylehive等一批高PR的中英文网络收藏夹和书签资源的支持,这无疑对所有用户都是一个福音,收藏夹是非常有用外链,所有SEOER都明白它的重要性. 网络收藏夹对于增加网站的外链是一种收录比较快的方法,利用网络收藏夹首先要找好你所要找的网站,可以在搜索引擎里搜索网络收藏夹,会搜索到很

设置首页和添加到收藏夹代码大全

<HTML>    <HEAD>        <title>添加到收藏夹和设置首页代码大全</title>        <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">        <meta name="CODE_LANGUAGE" Content="C#">   

自定义地址栏与收藏夹中的图标

关于Favicon favicon 在英文中有几个别名,叫做 shortcut icon,website icon,tab icon,URL icon,bookmark icon,对应中文来说也叫作网页小图标.网站缩略图或收藏夹图标.书签图标.这实际上就是与某个网站或地址关联的图标文件.如果网站上传了这个图标文件,用户使用浏览器(仅限于支持这个功能的浏览器)浏览时,就可以把图标显示在浏览器的地址栏中(有时也会显示在历史记录中),如果添加了收藏则收藏夹中也可以看到图标.现在支持标签页的浏览器,会将

Firefox收藏夹位置在哪里?

今天想保存一下firefox的收藏夹.习惯性地打开了书签收藏夹,却发现,这不是IE哦.(因为我把IE的收藏夹转到了D盘,防止日后重装系统时忘了备份导致掉失),研究一下,firefox的原理原来和chrome的差不多. 注意:先打开我的电脑,然后点击工具,选择文件夹选项.然后设置隐藏文件可见,同时 要注意打开系统默认隐藏的文件夹哦.这样才可以发现我们的firefox收藏夹. firefox收藏夹位置在:C:/Documents and Settings/您的电脑用户名/Application Da