/* sns공유기능 js파일 (2022.02.15) */ $(document).ready(function(){ var snsDiv = $(".sns_share_box").html(); $(".sub_title").after("
" + snsDiv + "
"); /* 무조건 sub_title 다음에 sns form이 오도록 설정*/ }) function openShare(baseURI, type){ var full='http://'+ location.host; var titleText = document.getElementsByClassName("sub_title")[0].innerHTML; var title = encodeURI(titleText); var href = $('#hrefId').val(); var url = ''; var shareUrl = encodeURI(encodeURIComponent(full + baseURI + href)); if(type=='facebook') { // 페이스북 url = "http://www.facebook.com/sharer/sharer.php?u="+ encodeURIComponent(full + baseURI + href); }else if(type=='kakaoStory') { // 카카오스토리 url = 'https://story.kakao.com/share?url='+ encodeURIComponent(full + baseURI + href); }else if(type=='naverBand') { // 네이버밴드 url = "http://www.band.us/plugin/share?body="+ encodeURIComponent(titleText) + " : " + encodeURIComponent(full + baseURI + href)+"&route="+encodeURIComponent(titleText); }else if(type=='naverBlog') { // 네이버블로그 url = "https://share.naver.com/web/shareView?url=" + shareUrl + "&title=" + title; } if ( url != '') { void(window.open(url,type,width=200,height=200)); } if (href != "") { $('#hrefId').val(""); } } function copy_trackback(trb){ var full = "http://" + location.host; var href = $('#hrefId').val(); var copyText = document.getElementById("full"); copyText.value = full + trb + href; copyText.select(); document.execCommand("Copy"); alert("주소가 복사되었습니다."); }