javascript社交平台分享-新浪微博QQ微博QQ好友QQ空间人人网

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了javascript社交平台分享-新浪微博QQ微博QQ好友QQ空间人人网相关的知识,希望对你有一定的参考价值。

整理的五个社交平台的分享

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    <h2>分享</h2>
    <div id="sina">新浪微博</div>
    <div id="qqweibo">qq微博</div>
    <div id="qqConnect">qq好友</div>
    <div id="qqZone">qq空间</div>
    <div id="renren">人人网</div>
</body>
<script type="text/javascript">
    var sina = document.getElementById("sina");
    var qqweibo = document.getElementById("qqweibo");
    var qqConnect = document.getElementById("qqConnect");
    var qqZone = document.getElementById("qqZone");
    var renren = document.getElementById("renren");

    var url = "http://docs.angularjs.cn/api";
    var title = "angular.js";
    var content = "...shared content...";
    var picurl = "http://imga1.pic21.com/bizhi/140226/07916/s04.jpg";

    sina.onclick = function(){
        var sharesinastring=http://v.t.sina.com.cn/share/share.php?title=+title+&url=+url+&content=utf-8&sourceUrl=+url+&pic=+picurl;
        window.open(sharesinastring,newwindow,height=100,width=100,top=100,left=100);
    }
    qqweibo.onclick = function(){
        var shareqqstring=http://v.t.qq.com/share/share.php?title=+content+&url=+url+&pic=+picurl;  
         window.open(shareqqstring,newwindow,height=100,width=100,top=100,left=100);  
    }
    qqConnect.onclick = function(){
        var shareqqConnect = http://connect.qq.com/widget/shareqq/index.html?url= + url + &title= + title + &description= + ‘‘ + &charset=utf-8
        window.open(shareqqConnect,newwindow,height=100,width=100,top=100,left=100);
    }
    qqZone.onclick = function(){
        var shareqqzonestring=http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?site=www.tuan2.com&title= + ‘‘ + &desc= + title + &summary= + 分享分享 + &url= + url + pic + picurl;  
         window.open(shareqqzonestring,newwindow,height=400,width=400,top=100,left=100);
    }
    renren.onclick = function(){
        var sharerenrenstring=http://widget.renren.com/dialog/share?resourceUrl= + url +&title= + title + &description= + ‘‘ + &charset=utf-8;  
         window.open(sharerenrenstring,newwindow,height=400,width=400,top=100,left=100);
        
    }
</script>
</html>

其他的后边补充。。。。。。

以上是关于javascript社交平台分享-新浪微博QQ微博QQ好友QQ空间人人网的主要内容,如果未能解决你的问题,请参考以下文章

分享各大平台接口(空间,微博)

在Android中使App高速简单地支持新浪微博微信QQfacebook等十几个主流社交平台的分享功能

App分享之微信微博等各个社交平台的分享授权规则和常见问题

微博下载|微博app下载

QQ,微信,新浪原生分享

WordPress连接微博插件