分享设置

<script>
//分享设置
var shareUrl="http://www.demo.cn";
var shareDesc="内容";
var shareImg="http://images......";
var sinaAppkey="";
shareDesc=encodeURI(shareDesc);
function shareLink(type){
    var urlstr="";
    switch (type){
        case "sina":
            urlstr="http://v.t.sina.com.cn/share/share.php?=site="+shareUrl+"&url="+shareUrl+"&title="+shareDesc+"&appkey="+sinaAppkey+"&pic="+shareImg;
            window.open(urlstr);
        break;
        case "qq":
            urlstr="http://v.t.qq.com/share/share.php?title="+shareDesc+"&url="+shareUrl+"&appkey=&pic="+shareImg;window.open(urlstr);
        break;
        case "kaixin":
            urlstr="http://www.kaixin001.com/rest/records.php?content="+shareDesc+"&url="+shareUrl+"&starid=&aid=0&style=11&pic="+shareImg+"&site="+shareUrl;window.open(urlstr);
        break;
        case "renren":
            urlstr="http://widget.renren.com/dialog/share?resourceUrl="+shareUrl+"&pic="+shareImg+"&title="+shareDesc;window.open(urlstr);
        break;
        default:
            return false;
        break;
        
    }
}
</script>


你可能感兴趣的:(分享)