//title为分享链接的标题,pic为图片,content为内容
function shareToSns(title,pic,content){
document.writeln("<!-- 添加sns -->");document.write("<a href=\"javascript:(function(){window.open('http://v.t.sina.com.cn/share/share.php?title="+title+"--源自科学视界(http://v.kepu.cn)%20&url='+encodeURIComponent(location.href)+'&pic="+pic+"','_blank','width=600,height=450');})()\" title=\"分享到新浪微博\"><img src='../images/nr_bfy_07.jpg' border='0' alt='新浪微博' title='分享到新浪微博'/></a>");
document.write(" <a href=\"javascript:(function(){window.open('http://v.t.qq.com/share/share.php?title="+title+"--源自科学视界(http://v.kepu.cn)%20&url='+encodeURIComponent(location.href)+'&pic="+pic+"','_blank','width=600,height=450');})()\" title=\"分享到QQ微博\"><img src='../images/nr_bfy_09.jpg' border='0' alt='腾讯微博' title='分享到腾讯微博'/></a>");
document.write(" <a href=\"javascript:(function(){window.open('http://t.sohu.com/third/post.jsp?title="+title+"--源自科学视界(http://v.kepu.cn)%20&url='+encodeURIComponent(location.href)+'&pic="+pic+"&content=utf-8','_blank','width=600,height=450');})()\" title=\"分享到搜狐微博\"><img src='../images/nr_bfy_11.jpg' border='0' alt='搜狐微博' title='分享到搜狐微博'/></a>");
document.write(" <a href=\"javascript:(function(){window.open('http://apps.hi.baidu.com/share/?title="+title+"--源自科学视界(http://v.kepu.cn)%20&url='+encodeURIComponent(location.href),'_blank','width=600,height=450');})()\" title=\"分享到百度空间\"><img src='http://www.baidu.com//favicon.ico' border='0' alt='百度空间' title='分享到百度空间'/></a>");
document.write(" <a href=\"javascript:(function(){window.open('http://www.kaixin001.com/rest/records.php?url='+encodeURIComponent(location.href)+'&pic="+pic+"&content="+title+"--源自科学视界(http://v.kepu.cn)%20"+content+"&starid=0&aid=0&style=11','_blank','width=600,height=450');})()\" title=\"分享到开心网\"><img src='../images/nr_bfy_14.jpg' border='0' alt='开心网' title='分享到开心网'/></a>");
document.write(" <a href=\"javascript:(function(){window.open('http://share.renren.com/share/buttonshare.do?title="+title+"--源自科学视界(http://v.kepu.cn)%20&link='+encodeURIComponent(location.href)+'&pic="+pic+"','_blank','width=600,height=450');})()\" title=\"分享到人人网\"><img src='../images/nr_bfy_06.jpg' border='0' alt='人人网' title='分享到人人网'/></a>");
document.write(" <a href=\"javascript:(function(){window.open('http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url='+encodeURIComponent(location.href)+'&title="+title+"--源自科学视界(http://v.kepu.cn)%20&pics="+pic+"','_blank','width=600,height=450');})()\" title=\"分享到QQ空间\"><img src='../images/nr_bfy_08.jpg' border='0' alt='QQ空间' title='分享到QQ空间'/></a>");
document.writeln("<!-- 添加sns结束 -->");
document.writeln("");
}
本文介绍了一个JavaScript函数,用于将包含标题、图片和内容的信息分享到社交网络。通过此函数,用户可以轻松地在sns平台上分享带有图片的内容。

被折叠的 条评论
为什么被折叠?



