// 공유 URL 생성
function getShareUrl() {
var currentUrl = window.location.href;
// URL 파라미터 정리 - 공유할 때 불필요한 파라미터 제거
return currentUrl.split('?')[0] + '?bo_table=Reviews&wr_id=1';
}
// 페이스북 공유
function shareFacebook() {
var shareUrl = encodeURIComponent(getShareUrl());
var url = 'https://www.facebook.com/sharer/sharer.php?u=' + shareUrl;
window.open(url, 'facebook-share-dialog', 'width=626,height=436');
}
// 트위터 공유
function shareTwitter() {
var shareUrl = encodeURIComponent(getShareUrl());
var title = encodeURIComponent('xcvcx');
var url = 'https://twitter.com/intent/tweet?text=' + title + '&url=' + shareUrl;
window.open(url, 'twitter-share-dialog', 'width=626,height=436');
}
// 카카오톡 공유
function shareKakao() {
// KAKAO_JS_API_KEY 가 정의되지 않은 경우
alert('카카오톡 공유 기능을 사용하려면 관리자에게 문의하세요.');
}
// 링크 복사 기능
function copyLink() {
var shareUrl = getShareUrl();
var tempInput = document.createElement('input');
document.body.appendChild(tempInput);
tempInput.value = shareUrl;
tempInput.select();
document.execCommand('copy');
document.body.removeChild(tempInput);
// 알림 표시
Swal.fire({
title: '링크가 복사되었습니다.',
text: '친구나 지인에게 공유해보세요!',
icon: 'success',
confirmButtonColor: '#3085d6',
confirmButtonText: '확인'
});
}
댓글목록0
댓글 포인트 안내