반응형
단순히 버튼이나 a태그에 사용할수있는 공유 스크립트
function fnShareFb(sMsg,sUrl) {
var href = "http://www.facebook.com/sharer.php?u=" + sUrl + "&t=" + encodeURIComponent(sMsg);
var a = window.open(href, 'facebook', 'width=800, height=500');
if ( a ) {
a.focus();
}
}
function fnShareTw(sUrl){
var sTxt = "텍스트";
var href = "http://twitter.com?status="+encodeURIComponent(sTxt)+" "+encodeURIComponent(sUrl);
var a = window.open(href, 'twitter', 'width=800, height=500');
if ( a ) {
a.focus();
}
}
function fnSharePin(sUrl){
var sImg = "이미지경로";
var sTxt = "텍스트";
var href = "http://www.pinterest.com/pin/create/button/?url="+encodeURIComponent(sUrl)+"&media="+encodeURIComponent(sImg)+"&description="+encodeURIComponent(sTxt);
var a = window.open(href, 'pinterest', 'width=800, height=500');
if ( a ) {
a.focus();
}
}
반응형
'페이스북' 카테고리의 다른 글
| 페이스북 페이지탭 스크롤 제어 (0) | 2016.08.09 |
|---|---|
| 웹페이지 페이스북 앱 만들기X로그인테스트 (0) | 2016.05.25 |
| 페이스북 사진 사이즈 가이드 / 2014 새로운 레이아웃 (0) | 2014.11.11 |
| 페이스북 페이지 공유시 메타태그 사용 (0) | 2014.11.05 |
| 웹페이지 페이스북 API 연동하기(3) (0) | 2014.10.22 |