当前位置: 代码迷 >> Web前端 >> 分享设立
  详细解决方案

分享设立

热度:406   发布时间:2013-03-22 09:49:50.0
分享设置
<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>


  相关解决方案