您的位置:首页 > 其它

分享到QQ空间、新浪微博、腾讯微博和人人网

2016-08-04 14:00 295 查看

function shareys(type, url, title, img, content)
{

switch (type) {
case "sina":
url = "http://service.weibo.com/share/share.php?title=" + encodeURIComponent(content + '「' + title + '」' + ' 点这里' + url) + '&pic=' + img;
window.open(url);
break;
case "tqq":
url = "http://v.t.qq.com/share/share.php?url=" + encodeURIComponent(url) + '&title=' + encodeURIComponent(title) + '&pic=' + img;
window.open(url);
break;
case "qzone":
url = 'http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=' + encodeURIComponent(url + '#-39yst-1-001') + '&title=' + encodeURIComponent(title) + '&site=&pics=' + encodeURIComponent(img) + '&desc=' + encodeURIComponent(content) +'&summary=' + encodeURIComponent(content);

window.open(url);
break;
case "ren":
url = 'http://widget.renren.com/dialog/share?resourceUrl=' + encodeURIComponent(url) + '&srcUrl=' + img + '&title=' + encodeURIComponent(title);
+'&description=' + content;
window.open(url);
break;
default:
break;
}
}

 

<script type="text/javascript">
function postsShare(pType)
{
var pTitle = "{:$seo_title:}";
var pImage = "";
var pContent = "{:$seo_desc:}";
var pUrl = window.location.href;
shareys(pType, pUrl, pTitle, "", pContent);
}
</script>

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐