본문 바로가기
  • 그냥 하자
Web Programing

트위터, 페이스북에 링크 공유하기

by Mash 2011. 9. 2.
반응형
function sendTwitter(sTitle,sUrl){
var shref = "http://twitter.com/home?status="+encodeURIComponent(sTitle)+" "+encodeURIComponent(sUrl);
var sWindow = window.open(shref);
if(sWindow){
sWindow.focus();
}
}


function sendFacebook(sTitle,sUrl){
var shref = "http://wwww.facebook.com/share.php?u="+encodeURIComponent(sUrl)+"&t="+encodeURIComponent(sTitle);
var sWindow = window.open(shref);
if(sWindow){
sWindow.focus();
}
}
반응형