包括 VIVI | Younote | 365Key | Blogchina | Niula | Z365 | POCO | 人人 | Del.ico.us | IGOOI | 亿友 | 我摘 | 和讯 | 拇指 | 天极 的收藏代码
保存以下文件为 wangzhai.js
document.writeln("[ 收藏此页到 <A ");
document.writeln("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=http:\/\/www.newsunday.com&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();\"><FONT ");
document.writeln("color=red><B>VIVI<\/B><\/FONT><\/A> <B>|<\/B> <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.younote.com\/Noteit.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();\"><FONT ");
document.writeln("color=red><B>Younote<\/B><\/FONT><\/A> <B>|<\/B> <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();\"><FONT ");
document.writeln("color=red><B>365Key<\/B><\/FONT><\/A> <B>|<\/B> <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:\/\/blogmark.blogchina.com\/jsp\/key\/quickaddkey.jsp?k=\'+encodeURI(d.title)+\'&u=\'+encodeURI(d.location.href)+\'&c=\'+encodeURI(t),\'keyit\',\'scrollbars=no,width=500,height=430,status=no,resizable=yes\'));keyit.focus();\"><FONT ");
document.writeln("color=red><B>Blogchina<\/B><\/FONT><\/A> <B>|<\/B> <A ");
document.writeln("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.niu.la\/jsp\/key\/quickaddkey.jsp?k=\'+encodeURI(d.title)+\'&u=\'+encodeURI(d.location.href)+\'&c=\'+encodeURI(t),\'keyit\',\'scrollbars=no,width=510,height=500,status=no,resizable=yes\'));keyit.focus();\"><FONT ");
document.writeln("color=red><B>Niula<\/B><\/FONT><\/A> <B>|<\/B> <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.z365.cn\/saveZ.aspx?t=\'+escape(d.title)+\'&u=\'+escape(d.location.href)+\'&c=\'+escape(t),\'keyit\',\'scrollbars=no,width=450,height=510,left=75,top=20,status=no,resizable=yes\'));keyit.focus();\"><FONT color=red><B>Z365<\/B><\/FONT><\/A> <B>|<\/B> <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),\'keyit\',\'scrollbars=no,width=475,height=575,left=75,top=20,status=no,resizable=yes\'));keyit.focus();\"><FONT color=red><B>POCO<\/B><\/FONT><\/A> <B>|<\/B> <a href=\"javascript:d=document;t=d.selection?(d.selection.type!=\'None\'?d.selection.createRange().text:\'\'):(d.getSelection?d.getSelection():\'\');void(rrwz=window.open(\'http:\/\/rrwz.qihoo.com\/user\/AddWebSnip.aspx?t=\'+escape(d.title)+\'&u=\'+escape(d.location.href)+\'&c=\'+escape(t),\'keyit\',\'scrollbars=no,width=475,height=450,left=280,top=50,status=no,resizable=yes\'));keyit.focus();\"><FONT color=red><B>人人<\/B><\/FONT><\/A> <B>|<\/B> <a href=\"javascript:location.href=\'http:\/\/del.icio.us\/attagirl?v=2&url=\'+encodeURIComponent(location.href)+\'&title=\'+encodeURIComponent(document.title);\"><FONT color=red><B>Del.ico.us<\/B><\/FONT><\/A> <B>|<\/B> <a href=\"javascript:u=location.href;t=document.title;void(open(\'http:\/\/www.igooi.com\/addnewitem.aspx?noui=yes&jump=close&url=\'+escape(u)+\'&title=\'+escape(t)+\'&sel=\'+escape(window.getSelection()),\'igooi\',\'toolbar=no,width=400,height=480\'));\"\"><FONT color=red><B>IGOOI<\/B><\/FONT><\/A> <B>|<\/B> <a href=\"javascript:d=document;t=d.selection?(d.selection.type!=\'None\'?d.selection.createRange().text:\'\'):(d.getSelection?d.getSelection():\'\');void(websnip=window.open(\'http:\/\/x.yeeyoo.com\/MouseAdd.aspx?t=\'+escape(d.title)+\'&u=\'+escape(d.location.href)+\'&c=\'+escape(t),\'yeeyoo\',\'scrollbars=no,width=475,height=450,left=280,top=50,status=no,resizable=yes\'));websnip.focus();;\"><FONT color=red><B>亿友<\/B><\/FONT><\/A> <B>|<\/B> <a href=\"javascript:d=document;t=d.selection?(d.selection.type!=\'None\'?d.selection.createRange().text:\'\'):(d.getSelection?d.getSelection():\'\');void(wozhai=window.open(\'http:\/\/www.wozhai.com\/wozhai\/Cento.asp#t=\'+escape(d.title)+\'&u=\'+escape(d.location.href)+\'&c=\'+escape(t),\'wozhai\',\'scrollbars=no,width=475,height=575,left=75,top=20,status=no,resizable=yes\'));wozhai.focus();\"><FONT color=red><B>我摘<\/B><\/FONT><\/A> <B>|<\/B> <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\'));wozhai.focus();\"><FONT color=red><B>和讯<\/B><\/FONT><\/A> <B>|<\/B> <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.ok4545.com\/club\/myweb_add.asp?title=\'+escape(d.title)+\'&url=\'+escape(d.location.href)+\'&c=\'+escape(t),\'keyit\',\'scrollbars=no,width=800,height=575,left=75,top=20,status=no,resizable=yes\'));keyit.focus();\"><FONT color=red><B>拇指<\/B><\/FONT><\/A> <B>|<\/B> <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();\"><FONT color=red><B>天极<\/B><\/FONT><\/A> ]")
在你网页合适的地方插入以下代码:
这类网摘收藏代码主要解决什么问题?
主要解决网站内容“看过就走”的问题。把收藏入口放到页面里,用户能一键把当前页提交到收藏服务,同时带上标题、链接和选中文本,增加回访、传播和被再次访问的机会。
收藏代码里为什么要读取选中文本?
读取选中文本是为了让用户在收藏时顺手带上摘要或重点内容,提升收藏页的信息完整度。实现上通常通过 document.selection 或 getSelection 获取文本,再拼进弹窗参数里。
把这类代码放到网站上要注意什么?
要注意兼容性和可用性:不同浏览器对 selection、window.open 的支持不完全一致;同时要控制弹窗尺寸、避免影响主流程。实际部署前最好在目标页面测试标题、链接和选中文本是否能正确传递。







发表回复