美文网首页
分享功能

分享功能

作者: 不羁夜猫咪 | 来源:发表于2022-07-11 16:56 被阅读0次

    1、 新浪微博
    // 分享到新浪微博
    share_weibo (event) {
    event.preventDefault()
    // shareUrl是微博的分享地址,(有资料说需要真实的appkey,必选参数,这里我没用appkey也可以正常分享)
    var _shareUrl = 'http://service.weibo.com/share/share.php?'
    _shareUrl += 'url=' + encodeURIComponent(this.url) //参数url设置分享的内容链接
    _shareUrl += '&title=' + encodeURIComponent(this.titleCon) //参数title设置分享的标题
    // 保留当前页面,打开一个非tab页面(按需求来,可以新开标签页,也可以在当前页新开页面)
    window.open(
    _shareUrl,
    '_blank',
    'height=100, width=400',
    'scrollbars=yes,resizable=1,modal=false,alwaysRaised=yes'
    )
    },

    2、QQ空间分享

    分享到QQ空间接口:https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=你的网址&sharesource=qzone&title=你的分享标题&pics=你的分享图片&summary=你的分享描述信息

    3

    相关文章

      网友评论

          本文标题:分享功能

          本文链接:https://www.haomeiwen.com/subject/xnmnbrtx.html