码迷,mamicode.com
首页 > 编程语言 > 详细

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

时间:2016-03-26 23:51:12      阅读:222      评论:0      收藏:0      [点我收藏+]

标签:

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

<!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空间、人人网

标签:

原文地址:http://www.cnblogs.com/yingu/p/5324473.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!