JS 领英分享功能

 

 

<button onclick="ShareToLinkedin()" style="cursor:pointer">分享领英</button>

 

function ShareToLinkedin() {
    var _href = "https://www.linkedin.com/shareArticle?mini=true";
    _href += "&title=" + document.title;//标题
    _href += "&url=" + Escape(window.location.href);//链接
    window.open(_href);
}
function Escape(url) {
    url = url.replace(/\=/g, "%3D");//"""转义
    url = url.replace(/\&/g, "%26");//"&"转义
    return url;
}

 

原文:https://blog.csdn.net/lllomh/article/details/86762194

posted @ 2020-03-12 21:26  雨殇丶  阅读(858)  评论(0编辑  收藏  举报