更好的添加到某某书签某某收藏的代码
2008-11-07 16:45
253 查看
前面写了一篇 添加到某某书签、某某收藏的代码
但是那一篇里面添加到某某收藏是跟网站编码相关的,
下面的代码可以无视编码进行添加。
先截图,后代码:
Code
<a href="javascript:u=location.href;t=document.title;c = %22%22 + (window.getSelection ? window.getSelection() : document.getSelection ? document.getSelection() : document.selection.createRange().text);var url=%22http://cang.baidu.com/do/add?it=%22+encodeURIComponent(t)+%22&iu=%22+encodeURIComponent(u)+%22&dc=%22+encodeURIComponent(c)+%22&fr=ien#nw=1%22;window.open(url,%22_blank%22,%22scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes%22); void 0" title="Baidu搜藏"><img src="../images/fav/baidu.gif" alt="Baidu搜藏" border="0"></a>
<a href="javascript:window.open('http://shuqian.qq.com/post?title='+encodeURIComponent(document.title)+'&uri='+encodeURIComponent(document.location.href)+'&jumpback=2&noui=1','favit','width=960,height=600,left=50,toolbar=no,menubar=no,location=no,scrollbars=yes,status=yes,resizable=yes');void(0)"><img src="../images/fav/qq.gif" alt="QQ书签" title="QQ书签" border="0"></a>
<a href="javascript:location.href='http://www.google.com/bookmarks/mark?op=add&bkmk='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)"><img src="../images/fav/google.gif" alt="Google书签" border="0"></a>
<a href="javascript:location.href='http://del.icio.us/post?&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)"><img src="../images/fav/delicious.gif" alt="Del.icio.us" title="Del.icio.us" border="0"></a>
<a href="javascript:d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(keyit=window.open('http://my.poco.cn/fav/storeIt.php?t='+escape(d.title)+'&u='+escape(d.location.href)+'&c='+escape(t)+'&img=http://www.h-strong.com/blog/logo.gif','keyit','scrollbars=no,width=475,height=575,status=no,resizable=yes'));keyit.focus();" title="POCO网摘"><img src="../images/fav/poco.gif" alt="POCO网摘" border="0"></a>
<a href="javascript:location.href='http://myweb2.search.yahoo.com/myresults/bookmarklet?u='+encodeURIComponent(location.href)+'&t='+encodeURIComponent(document.title)" title="Yahoo书签"><img src="../images/fav/yahoo.gif" alt="Yahoo书签" border="0"></a>
<a href="javascript:d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(vivi=window.open('http://vivi.sina.com.cn/collect/icollect.php?pid=28&title='+escape(d.title)+'&url='+escape(d.location.href)+'&desc='+escape(t),'vivi','scrollbars=no,width=480,height=480,left=75,top=20,status=no,resizable=yes'));vivi.focus();" title="新浪ViVi"><img src="../images/fav/vivi.gif" alt="新浪ViVi" border="0"></a>
<a href="javascript:d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(keyit=window.open('http://www.365key.com/storeit.aspx?t='+escape(d.title)+'&u='+escape(d.location.href)+'&c='+escape(t),'keyit','scrollbars=no,width=475,height=575,left=75,top=20,status=no,resizable=yes'));keyit.focus();" title="365Key网摘"><img src="../images/fav/365key.gif" alt="365Key网摘" border="0"></a>
<a href="javascript:d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(yesky=window.open('http://hot.yesky.com/dp.aspx?t='+escape(d.title)+'&u='+escape(d.location.href)+'&c='+escape(t)+'&st=2','yesky','scrollbars=no,width=400,height=480,left=75,top=20,status=no,resizable=yes'));yesky.focus();" title="天极网摘"><img src="../images/fav/yesky.gif" alt="天极网摘" border="0"></a>
<a href="javascript:t=document.title;u=location.href;e=document.selection?(document.selection.type!='None'?document.selection.createRange().text:''):(document.getSelection?document.getSelection():'');void(open('http://bookmark.hexun.com/post.aspx?title='+escape(t)+'&url='+escape(u)+'&excerpt='+escape(e),'HexunBookmark','scrollbars=no,width=600,height=450,left=80,top=80,status=no,resizable=yes'));" title="和讯网摘"><img src="../images/fav/hexun.gif" alt="和讯网摘" border="0"></a>
<a href="javascript:d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(live=window.open('https://favorites.live.com/quickadd.aspx?marklet=1&mkt=en-us&url='+escape(d.location.href)+'&title='+escape(d.title)+'&top=1','live','scrollbars=no,status=no,resizable=yes'));live.focus();"><img src="../images/fav/live.gif" alt="Windows Live" border="0"></a>
用到的图片资源:下载
但是那一篇里面添加到某某收藏是跟网站编码相关的,
下面的代码可以无视编码进行添加。
先截图,后代码:
Code
<a href="javascript:u=location.href;t=document.title;c = %22%22 + (window.getSelection ? window.getSelection() : document.getSelection ? document.getSelection() : document.selection.createRange().text);var url=%22http://cang.baidu.com/do/add?it=%22+encodeURIComponent(t)+%22&iu=%22+encodeURIComponent(u)+%22&dc=%22+encodeURIComponent(c)+%22&fr=ien#nw=1%22;window.open(url,%22_blank%22,%22scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes%22); void 0" title="Baidu搜藏"><img src="../images/fav/baidu.gif" alt="Baidu搜藏" border="0"></a>
<a href="javascript:window.open('http://shuqian.qq.com/post?title='+encodeURIComponent(document.title)+'&uri='+encodeURIComponent(document.location.href)+'&jumpback=2&noui=1','favit','width=960,height=600,left=50,toolbar=no,menubar=no,location=no,scrollbars=yes,status=yes,resizable=yes');void(0)"><img src="../images/fav/qq.gif" alt="QQ书签" title="QQ书签" border="0"></a>
<a href="javascript:location.href='http://www.google.com/bookmarks/mark?op=add&bkmk='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)"><img src="../images/fav/google.gif" alt="Google书签" border="0"></a>
<a href="javascript:location.href='http://del.icio.us/post?&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)"><img src="../images/fav/delicious.gif" alt="Del.icio.us" title="Del.icio.us" border="0"></a>
<a href="javascript:d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(keyit=window.open('http://my.poco.cn/fav/storeIt.php?t='+escape(d.title)+'&u='+escape(d.location.href)+'&c='+escape(t)+'&img=http://www.h-strong.com/blog/logo.gif','keyit','scrollbars=no,width=475,height=575,status=no,resizable=yes'));keyit.focus();" title="POCO网摘"><img src="../images/fav/poco.gif" alt="POCO网摘" border="0"></a>
<a href="javascript:location.href='http://myweb2.search.yahoo.com/myresults/bookmarklet?u='+encodeURIComponent(location.href)+'&t='+encodeURIComponent(document.title)" title="Yahoo书签"><img src="../images/fav/yahoo.gif" alt="Yahoo书签" border="0"></a>
<a href="javascript:d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(vivi=window.open('http://vivi.sina.com.cn/collect/icollect.php?pid=28&title='+escape(d.title)+'&url='+escape(d.location.href)+'&desc='+escape(t),'vivi','scrollbars=no,width=480,height=480,left=75,top=20,status=no,resizable=yes'));vivi.focus();" title="新浪ViVi"><img src="../images/fav/vivi.gif" alt="新浪ViVi" border="0"></a>
<a href="javascript:d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(keyit=window.open('http://www.365key.com/storeit.aspx?t='+escape(d.title)+'&u='+escape(d.location.href)+'&c='+escape(t),'keyit','scrollbars=no,width=475,height=575,left=75,top=20,status=no,resizable=yes'));keyit.focus();" title="365Key网摘"><img src="../images/fav/365key.gif" alt="365Key网摘" border="0"></a>
<a href="javascript:d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(yesky=window.open('http://hot.yesky.com/dp.aspx?t='+escape(d.title)+'&u='+escape(d.location.href)+'&c='+escape(t)+'&st=2','yesky','scrollbars=no,width=400,height=480,left=75,top=20,status=no,resizable=yes'));yesky.focus();" title="天极网摘"><img src="../images/fav/yesky.gif" alt="天极网摘" border="0"></a>
<a href="javascript:t=document.title;u=location.href;e=document.selection?(document.selection.type!='None'?document.selection.createRange().text:''):(document.getSelection?document.getSelection():'');void(open('http://bookmark.hexun.com/post.aspx?title='+escape(t)+'&url='+escape(u)+'&excerpt='+escape(e),'HexunBookmark','scrollbars=no,width=600,height=450,left=80,top=80,status=no,resizable=yes'));" title="和讯网摘"><img src="../images/fav/hexun.gif" alt="和讯网摘" border="0"></a>
<a href="javascript:d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(live=window.open('https://favorites.live.com/quickadd.aspx?marklet=1&mkt=en-us&url='+escape(d.location.href)+'&title='+escape(d.title)+'&top=1','live','scrollbars=no,status=no,resizable=yes'));live.focus();"><img src="../images/fav/live.gif" alt="Windows Live" border="0"></a>
用到的图片资源:下载
相关文章推荐
- 添加到某某书签、某某收藏的代码
- 给WordPress博客添加收藏书签,代码实现
- 完美兼容IE、Opera、Firefox、360、搜狗的“添加收藏”的最精简代码
- 添加"收藏到QQ书签"到博客/网页中的代码(精品)
- 网站里添加收藏和设为首页代码
- ASP+JavaScript动态添加表单代码收藏
- 【代码】Android开发收藏功能添加的实现 (2013-08-13 11:15:24)
- 收藏夹代码js添加收藏代码
- os x 代码方式添加文件夹到Finder收藏栏中
- 设为首页和添加收藏代码
- 代码(设为首页,添加收藏,流动文字)
- 网站建设怎样添加设为首页和加入收藏代码
- 添加到收藏的js代码
- springMVC:HandlerInterceptor拦截器添加系统日志(权限校验)代码收藏
- 添加到网摘书签代码大全
- Android中添加书签(浏览器的收藏)
- js添加收藏代码
- js添加收藏代码
- 添加收藏代码兼容火狐浏览器
- 设为首页+加入收藏兼容性代码+添加桌面快捷方式