SNS 내보내기. 공유. 페이스북, 트위터, 밴드, 카카오스토리 SNS 에 글 공유 / 내보내기
제목 : SNS 내보내기. 공유. 페이스북, 트위터, 밴드, 카카오스토리 SNS 에 글 공유 / 내보내기
소스 :
<script type="text/javascript">
<!--
//SNS 등 sharer 처리
function unescapeXml(str){
str = str.replaceAll("&", "&");
str = str.replaceAll("<", "<");
str = str.replaceAll(">", ">");
str = str.replaceAll("'", "'");
str = str.replaceAll(""", "\"");
str = str.replaceAll("'", "'");
return str;
}
function twitter_share(){
var text = "<%=strShareTitle%>";
var url = "<%=strShareURI%>";
var snsUrl = "http://twitter.com/home?status="+encodeURIComponent(text)+" "+ url;
var popup = window.open(snsUrl, "_snsPopupWindow", "width=500, height=500");
popup.focus();
}
function facebook_share(){
var text = "<%=strShareTitle%>";
var url = "<%=strShareURI%>";
var image = "<%=strShareImg%>"
var summary = "<%=strShareSubject%>"
var snsUrl = "http://www.facebook.com/sharer.php?u="+encodeURIComponent(url)+"&t="+encodeURIComponent(text)+"&i="+encodeURIComponent(image);
var popup= window.open(snsUrl, "_snsPopupWindow", "width=500, height=500");
popup.focus();
}
function kakaostory_share(){
var title = "<%=strShareTitle%>";
title = title.substring(0,100);
title = unescapeXml(title);
title = title.replace(/\&(amp;)?/ig, ""); // 카스인경우 & 등록시 글자 짤림
var url = "<%=strShareURI%>";
var snsUrl = "https://story.kakao.com/share?url="+encodeURIComponent(url);
var popup= window.open(snsUrl, "_snsPopupWindow", "width=500, height=500");
popup.focus();
}
function band_share(){
var title = "<%=strShareTitle%>";
var url = "<%=strShareURI%>";
var snsUrl = "http://www.band.us/plugin/share?body="+encodeURIComponent(title)+"&route="+encodeURIComponent(url);
var popup= window.open(snsUrl, "_snsPopupWindow", "width=500, height=500");
popup.focus();
}
//-->
</script>
내용 :
출처 :