现在的位置: 首页 > 综合 > 正文

以前写过的一个第三方分享按钮

2012年08月09日 ⁄ 综合 ⁄ 共 916字 ⁄ 字号 评论关闭
var Share = function(webSet,url,sourceImg){
    if(!sourceImg){sourceImg = ""}
    if(sourceImg!="") {
        sourceImg = "&pic=" + sourceImg;
    };    
    var text = "我喜欢 @悦淘街 的这个分享:",
    webText = url,
    con = text+webText;
        webSet == "sina" ? window.open("http://v.t.sina.com.cn/share/share.php?title=" +
    con + "&url=&appkey=4178876743" + sourceImg, "_blank", "width=615,height=505") : webSet == "tencent" ? window.open("http://v.t.qq.com/share/share.php?title=" + con + "&url=&appkey=100288919&site=www.yuetaojie.com" + sourceImg, "_blank", "width=615,height=505") : webSet == "qq" ? (webSet = "http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=" + encodeURIComponent("" + url + ""), window.open(webSet, "_blank", "width=615,height=505")) : webSet == "wangyi" && (webSet = "http://t.163.com/article/user/checkLogin.do?link=" + encodeURIComponent("http://www.yuetaojie.com/Album/" +
    con + "?iscatch=true") + "&sourceImg=" + encodeURIComponent("悦淘街") + "&info=" + con, window.open(webSet, "_blank", "width=615,height=505"));
};

 

抱歉!评论已关闭.