2014-03-19 2 views
-1

내 웹 사이트에 대한 맞춤 사회 공유 버튼을 만들려고하고 있지만 현재 페이지 제목과 URL이 소셜 네트워크와 공유되도록 제대로 풀리지 않는 문제가 있습니다. .페이지 제목과 현재 URL을 가져 오는 코드

<a class="share-btn twitter-btn twitter-sharer-button" id="ref_tw" href="https://twitter.com/intent/tweet?title=<?php echo $title; ?>&amp;url=<?php echo urlencode($share_url);?>&amp;via=Udamonia" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=no,scrollbars=no,height=400,width=600');return false;"></a> 

어떤 도움이나 올바른 방향으로 지점이 크게 감사합니다 : 내 코드의

예처럼 보인다.

감사합니다.

답변

0

onclick 이벤트에서 Javascript를 사용하여 document.titledocument.location.href을 잡고 공유 URL에 추가 한 다음 새 URL을 설정하십시오.

onlick="javascript:window.open('http://twitter.com/intent?title='+encodeURIComponent(document.title)+';url='+encodeURIComponent(document.location.href);" 
:

그래서 당신의 온 클릭 속성은 같을 것이다
관련 문제