分享邀请码功能

分享主要的三个参数:
==title==
==url==
==picurl==

title:

即分享到其他平台显示的标题

url:

即分享到其他平台的连接

picurl:

在其他平台显示的图片

分享到新浪微博

1
2
3
4
5
6
//分享到新浪微博  
ShareTip.prototype.sharetosina=function(title,url,picurl)
{
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=400,width=400,top=100,left=100');
}

分享到QQ空间

1
2
3
4
5
6
//分享到QQ空间  
ShareTip.prototype.sharetoqqzone=function(title,url,picurl)
{
var shareqqzonestring='http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?summary='+title+'&url='+url+'&pics='+picurl+'&title=123456';
window.open(shareqqzonestring,'newwindow','height=400,width=400,top=100,left=100');
}

分享到QQ

1
2
3
4
5
//分享到QQ
ShareTip.prototype.sharetoqq=function (title,url,picurl) {
var shareqqstring = 'http://connect.qq.com/widget/shareqq/index.html?url='+ url +'&pics='+ picurl +'&site=qiubite&title=' + title;
window.open(shareqqstring,'newwindow','height=500,width=1000,top=100,left=100');
}
复制邀请码
  1. 选中文本框中的字

    1
    $(codeInput).select();
  2. 复制

    1
    2
    document.execCommand("Copy");
    alert("复制成功!");