카카오톡 신버젼 응용질문 드립니다. 채택완료
</STRONG></P>
<DIV class="line number1 index0 alt2"><CODE class="jscript plain"><script src=</CODE><CODE class="jscript string">"<A class=_oembed href="<a href="https://developers.kakao.com/sdk/js/kakao.min.js" target="_blank" rel="noopener noreferrer">https://developers.kakao.com/sdk/js/kakao.min.js</a>"><a href="https://developers.kakao.com/sdk/js/kakao.min.js" target="_blank" rel="noopener noreferrer">https://developers.kakao.com/sdk/js/kakao.min.js</a></A>"</CODE><CODE class="jscript plain">></script> </CODE></DIV>
<DIV class="line number2 index1 alt1"><CODE class="jscript plain"><a id=</CODE><CODE class="jscript string">"kakao-link-btn"</CODE> <CODE class="jscript plain">href=</CODE><CODE class="jscript string">"javascript:;"</CODE><CODE class="jscript plain">> </CODE><CODE class="jscript plain"><img src=</CODE><CODE class="jscript string">"보내기 버튼 이미지 주소"</CODE> <CODE class="jscript plain">/></CODE><CODE class="jscript plain"></a> </CODE></DIV>
<DIV class="line number5 index4 alt2"><CODE class="jscript spaces"> </CODE> </DIV>
<DIV class="line number5 index4 alt2"><script></DIV>
<DIV class="line number8 index7 alt1"><CODE class="jscript spaces"> </CODE><CODE class="jscript plain">Kakao.init(</CODE><CODE class="jscript string">'애플리케이션 키'</CODE><CODE class="jscript plain">); </CODE></DIV>
<DIV class="line number10 index9 alt1"><CODE class="jscript spaces"> </CODE><CODE class="jscript plain">Kakao.Link.createTalkLinkButton({ </CODE></DIV>
<DIV class="line number11 index10 alt2"><CODE class="jscript spaces"> </CODE><CODE class="jscript plain">container: </CODE><CODE class="jscript string">'#kakao-link-btn'</CODE><CODE class="jscript plain">, </CODE></DIV>
<DIV class="line number12 index11 alt1"><CODE class="jscript spaces"> </CODE><CODE class="jscript plain">label: </CODE><CODE class="jscript string">'데모 텍스트'</CODE><CODE class="jscript plain">, </CODE></DIV>
<DIV class="line number14 index13 alt1"><CODE class="jscript spaces"> </CODE><CODE class="jscript plain">image: { </CODE></DIV>
<DIV class="line number20 index19 alt1"><CODE class="jscript spaces"> </CODE><CODE class="jscript plain">src: </CODE><CODE class="jscript string">'기본 썸네일 이미지 주소'</CODE><CODE class="jscript plain">, </CODE></DIV>
<DIV class="line number22 index21 alt1"><CODE class="jscript spaces"> </CODE><CODE class="jscript plain">width: </CODE><CODE class="jscript string">'300'</CODE><CODE class="jscript plain">, </CODE></DIV>
<DIV class="line number23 index22 alt2"><CODE class="jscript spaces"> </CODE><CODE class="jscript plain">height: </CODE><CODE class="jscript string">'200'</CODE></DIV>
<DIV class="line number25 index24 alt2"><CODE class="jscript spaces"> </CODE><CODE class="jscript plain">}, </CODE></DIV>
<DIV class="line number26 index25 alt1"><CODE class="jscript spaces"> </CODE><CODE class="jscript plain">webButton: {</CODE></DIV>
<DIV class="line number27 index26 alt2"><CODE class="jscript spaces"> </CODE><CODE class="jscript plain">text: </CODE><CODE class="jscript string">'홈페이지로 이동'</CODE><CODE class="jscript plain">,</CODE></DIV>
<DIV class="line number28 index27 alt1"><CODE class="jscript spaces"> </CODE><CODE class="jscript plain">url: </CODE><CODE class="jscript string">'테스트 도메인'</CODE></DIV>
<DIV class="line number29 index28 alt2">
<DIV class="line number30 index29 alt1"><CODE class="jscript comments"></CODE></DIV><CODE class="jscript spaces"> </CODE><CODE class="jscript plain">}</CODE></DIV>
<DIV class="line number32 index31 alt1"><CODE class="jscript spaces"> </CODE><CODE class="jscript plain">}); </CODE></DIV>
<DIV class="line number32 index31 alt1"><CODE class="jscript plain"></script></CODE></DIV>
<P><STRONG>
위가 카카오톡 링크의 웹 기본코딩 입니다만
문제는 label 과 url 을 동적으로 변화를 주고 싶은데요
자바스크립트로 가능 할까요?
이것저것 시도 해봤으나 먹히지 않네요.
함수로 만들어서 변수 전달 하고 싶은데요.
활용 해보신분 조언좀 부탁 드립니다.
감사 드립니다.
답변 1개
label: "<?php echo $view['subject'] ;?>",
url : "<?php echo 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; ?>" //자신의도메인 + 게시물주소
답변에 대한 댓글 1개
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인
라벨이나 url 을 동적으로 변동을 줘야 해서 문제지요
현제 보고 있는 페이지에서 동적으로 자바스크립트로 변동이 발생 시키려는 것 입니다.
관심 감사 드립니다.