<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; }