Skip to content

Commit

Permalink
Merge pull request #113 from wu-jj/wxshare
Browse files Browse the repository at this point in the history
[fix] fabook sharing function bug
  • Loading branch information
IRONICBo authored Feb 6, 2024
2 parents d719b66 + f373900 commit db3736e
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion cmd/gopcomm/yap/article_yap.html
Original file line number Diff line number Diff line change
Expand Up @@ -405,11 +405,26 @@ <h1 class="my-4 text-4xl font-extrabold leading-tight text-gray-900">
window.open(shareUrl, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);
};

editMetaUrl()
function editMetaUrl(){
// Get the URL of the current page
var currentUrl = window.location.href;

// Find the og: URL attribute in the<meta>tag
var ogUrlMeta = document.querySelector('meta[property="og:url"]');

// If the<meta>tag is found and the og: URL attribute exists
if (ogUrlMeta) {
// Set the content of the og: URL attribute to the URL of the current page
ogUrlMeta.setAttribute('content', currentUrl);
}
}

function shareToTwitter() {
// var url = encodeURIComponent('http://8.130.26.238/animation/fb.html');
// var text = encodeURIComponent('Linz');
var url = window.location.href;
var hashtags = "Test";
var hashtags = "GoplusComminty";
var intentUrl = "https://twitter.com/intent/tweet?url=" + encodeURIComponent(url)
+"&hashtags=" + encodeURIComponent(hashtags);
// var shareUrl = 'https://twitter.com/intent/tweet?text=' + text + '&url=' + url;
Expand Down

0 comments on commit db3736e

Please sign in to comment.