<script type="text/javascript">
// 트위터
function sendTwitter(msg, url){
var href = "http://twitter.com/home?status=" + encodeURIComponent(msg) + " " + encodeURIComponent(url);
var a = window.open(href, 'twitter', '');
if( a ){
a.focus();
}
}
// 페이스북
function sendFaceBook(msg, url){
var href = "http://www.facebook.com/sharer.php?u=" + url + "&t=" + encodeURIComponent(msg);
var a = window.open(href, 'facebook', '');
if( a ){
a.focus();
}
}
// 미투데이
function sendMe2Day(msg, url, tag){
var href = "http://me2day.net/posts/new?new_post[body]=" + encodeURIComponent(msg) + " " + encodeURIComponent(url) + "&new_post[tags]=" + encodeURIComponent(tag);
var a = window.open(href, 'me2Day', '');
if( a ){
a.focus();
}
}
// 요즘
function sendYozmDaum(link, prefix, parameter){
var href = "http://yozm.daum.net/api/popup/prePost?sourceid=54&link=" + encodeURIComponent(link) + "&prefix=" + encodeURIComponent(prefix) + "¶meter=" + encodeURIComponent(parameter);
var a = window.open(href, 'yozm', 'width=466, height=356');
if( a ){
a.focus();
}
}
// C로그
function sendClog(link, title, thumbnail, summary, writer){
var href = "http://csp.cyworld.com/bi/bi_recommend_pop.php?url=" + encodeURIComponent(link) + "&thumbnail=" + encodeURIComponent(thumbnail) + "&summary=" + encodeURIComponent(summary) + "&writer=" + encodeURIComponent(writer);
var a = window.open(href, 'clog', 'width=400, height=364, scrollbars=no, resizable=no');
if( a ){
a.focus();
}
}
</script>
<a href="#" onclick="sendTwitter('표시메시지', '게시글 url');return false;">트위터</a>
<a href="#" onclick="sendFaceBook('표시메시지', '게시글 url');return false;">페이스북</a>
<a href="#" onclick="sendMe2Day('표시메시지', '게시글 url', '태그1,태그2,태그3');return false;">미투데이</a>
<a href="#" onclick="sendYozmDaum('게시글 url','표시메시지','표시메시지');return false;">요즘</a>
<a href="#" onclick="sendClog('게시글 url', '게시글 제목', '썸네일 url', '글요약', '글쓴이');return false;">C로그</a>
// 트위터
function sendTwitter(msg, url){
var href = "http://twitter.com/home?status=" + encodeURIComponent(msg) + " " + encodeURIComponent(url);
var a = window.open(href, 'twitter', '');
if( a ){
a.focus();
}
}
// 페이스북
function sendFaceBook(msg, url){
var href = "http://www.facebook.com/sharer.php?u=" + url + "&t=" + encodeURIComponent(msg);
var a = window.open(href, 'facebook', '');
if( a ){
a.focus();
}
}
// 미투데이
function sendMe2Day(msg, url, tag){
var href = "http://me2day.net/posts/new?new_post[body]=" + encodeURIComponent(msg) + " " + encodeURIComponent(url) + "&new_post[tags]=" + encodeURIComponent(tag);
var a = window.open(href, 'me2Day', '');
if( a ){
a.focus();
}
}
// 요즘
function sendYozmDaum(link, prefix, parameter){
var href = "http://yozm.daum.net/api/popup/prePost?sourceid=54&link=" + encodeURIComponent(link) + "&prefix=" + encodeURIComponent(prefix) + "¶meter=" + encodeURIComponent(parameter);
var a = window.open(href, 'yozm', 'width=466, height=356');
if( a ){
a.focus();
}
}
// C로그
function sendClog(link, title, thumbnail, summary, writer){
var href = "http://csp.cyworld.com/bi/bi_recommend_pop.php?url=" + encodeURIComponent(link) + "&thumbnail=" + encodeURIComponent(thumbnail) + "&summary=" + encodeURIComponent(summary) + "&writer=" + encodeURIComponent(writer);
var a = window.open(href, 'clog', 'width=400, height=364, scrollbars=no, resizable=no');
if( a ){
a.focus();
}
}
</script>
<a href="#" onclick="sendTwitter('표시메시지', '게시글 url');return false;">트위터</a>
<a href="#" onclick="sendFaceBook('표시메시지', '게시글 url');return false;">페이스북</a>
<a href="#" onclick="sendMe2Day('표시메시지', '게시글 url', '태그1,태그2,태그3');return false;">미투데이</a>
<a href="#" onclick="sendYozmDaum('게시글 url','표시메시지','표시메시지');return false;">요즘</a>
<a href="#" onclick="sendClog('게시글 url', '게시글 제목', '썸네일 url', '글요약', '글쓴이');return false;">C로그</a>
[ 출처 ] http://jungmina.com/501
'JavaScript' 카테고리의 다른 글
[JavaScript] 클로저(Closure) (0) | 2012.08.30 |
---|---|
[JavaScript] 네이버 지도 API 연동 (0) | 2012.08.14 |
[JavaScript] 숫자 3자리수마다 콤마 표시 (0) | 2012.05.07 |
[JavaScript] Math 올림,반올림,버림 (0) | 2012.04.10 |
[JavaScript] 동적 Table tr/td 추가 (0) | 2012.03.22 |