ETC/Script | Posted by 아키텍처 2012. 4. 25. 08:41

SNS연동 - 자바스크립트로 간단히 처리

 
 

function sns_twitter(msg,url)
 {
  var twitterUrl = "http://twitter.com/home?status=" + encodeURIComponent(msg) + " " + encodeURIComponent(url);
  var result = window.open(twitterUrl, 'twitter', '');
  if (result)
  {
   result.focus();
  }
 }
 function sns_me2day(msg,url,tag)
 {
  var wp = window.open("http://me2day.net/posts/new?new_post[body]=" + encodeURIComponent(msg) + " " + encodeURIComponent(url) + "&new_post[tags]=" + encodeURIComponent(tag), 'me2Day', '');
  if ( wp )
  {
   wp.focus();
  }
 }
 function sns_yozm(msg,url)
 {
  var yozmUrl = "http://yozm.daum.net/api/popup/prePost?sourceid=41&link=" + encodeURIComponent(url) + "&prefix=" + encodeURIComponent(msg);
  var result = window.open(yozmUrl, 'yozm', '');
  if (result)
  {
   result.focus();
  }
 }
 function sns_facebook(msg,url) {
  var wp = window.open("http://www.facebook.com/sharer.php?u=" + url + "&t=" + encodeURIComponent(msg), 'facebook', '');
  if ( wp )
  {
   wp.focus();
  }
 }

Posted by 김준홍 (http://www.Juuun.com)