function copy_trackback() { var trb = document.location.href; var IE=(document.all)?true:false; if (IE) { if(confirm("이 글의 트랙백 주소를 클립보드에 복사하시겠습니까?")) window.clipboardData.setData("Text", trb); } else { temp = prompt("이 글의 트랙백 주소입니다. Ctrl+C를 눌러 클립보드로 복사하세요", trb); } } jQuery(function($){ var __snstitle = encodeURIComponent(document.title); var __snsurl = encodeURIComponent(document.location.href); //facebook $(".facebook", "#bhn1").on("click", function(e){ e.preventDefault(); var __fbwin = window.open('http://www.facebook.com/share.php?u=' + __snsurl + '&title=' + __snstitle, '', 'width=400,height=300'); __fbwin.focus(); }); //twitter -- pagecd파싱해서 shutten url 구현필요합니다. $(".twitter", "#bhn1").on("click", function(e){ e.preventDefault(); if ( $("#sns_bbs_title").length > 0 ) { __snstitle = $("#sns_bbs_title").html(); } var __twwin = window.open('https://twitter.com/intent/tweet?text=' + __snstitle + '&url='+ __snsurl, '', 'width=400,height=300'); __twwin.focus(); }); //google plus $(".google", "#bhn1").on("click", function(e){ e.preventDefault(); var __gowin = window.open('https://plus.google.com/share?url=' + __snsurl , '', 'width=500,height=600'); __gowin.focus(); }); //trackback. $(".copy", "#bhn1").on("click", function(e){ e.preventDefault();copy_trackback(); }); // 하단은 카카오 스토리 관련 항목입니다. Kakao.init('8cd834df9186d939db4521091f13a8d0'); $(".kakaost", "#bhn1").on("click", function(e){ e.preventDefault(); Kakao.Story.share({ //url : __snsurl //,text : __snstitle url : document.location.href ,text : document.title }) }); });