반응형
카카오톡, 페이스북 공유를 할 시간이다.
카카오톡 공유
아래 링크에서 보는게 더 좋을 듯 하다.
kakao.init을 한번 해 주고, 하고싶은 메서드를 실행하면 된다.
https://developers.kakao.com/docs/latest/ko/message/js#link-without-button
Kakao Developers
카카오 API를 활용하여 다양한 어플리케이션을 개발해보세요. 카카오 로그인, 메시지 보내기, 친구 API, 인공지능 API 등을 제공합니다.
developers.kakao.com
페이스북 공유
Get current page URL and append it to Facebook Share link (with javascript)
I've been trying really hard to make the Facebook share button work, but no luck. I'd like to have the same code on ALL my pages, so I need to be able to dynamically get the current page url and ap...
stackoverflow.com
위 질문에서 발견했다.
아주 간단하게 공유할 수 있어서 좋다.
코드는 아래와 같다.
<a href="" onclick="window.open('http://www.facebook.com/share.php?u=' + encodeURIComponent(location.href))">Share this page</a>
'웹 프로그래밍' 카테고리의 다른 글
[Firebase] React 프로젝트 배포하기. firebase deploy (0) | 2020.07.28 |
---|---|
[JS] JSON 값으로 검색하기 (Array, filter) (1) | 2020.07.28 |
[WEB] IP, 도메인, 네임서버란? (0) | 2020.07.23 |
[JS] 안드로이드, 아이폰, PC 구분하는 방법 (0) | 2020.07.23 |
[JS] 문자 공유하기 (0) | 2020.07.16 |
댓글