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>

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

posted on 2016-03-26 23:13  银古酱  阅读(341)  评论(2编辑  收藏  举报

导航