2012-09-06 2 views
1

나는이 트위터 공유 기능의 시작 부분에 어떻게 텍스트 문자열 Try this recipe을 출력 할 수 있는지 알아 내려고하고있다. 그래서 당신이 그것을 공유하는 버튼을 클릭하면 "이 조리법을 시도하십시오"라고 말할 것입니다 등 고마워요.트위터 공유 링크에 텍스트 첨부하기

function load_twitter() { 
    var load = window.open('http://twitter.com/share?url='+ window.location.href +'&via=atsbyvermouth','','scrollbars=no,menubar=no,height=450,width=650,resizable=yes,toolbar=no,location=no,status=no'); 
} 

답변

1

그것은 매우 간단합니다, 그냥 처음에 즉

function load_twitter() { 
    window.open('http://twitter.com/share?text=Try this recipe&url='+ window.location.href +'&via=atsbyvermouth','','scrollbars=no,menubar=no,height=450,width=650,resizable=yes,toolbar=no,location=no,status=no'); 
} 

DEMO을이 text=Try this recipe&를 추가합니다.

+0

감사합니다. 나는 아직 자바에 익숙하지 않다. – davidz

+0

당신은 환영합니다. 그러나 변수'text'는 여기에 get 매개 변수입니다. :-) –

관련 문제