davidz
davidz

Reputation: 277

Attaching text to the twitter sharing link

I'm trying to figure out how I can output the string of text Try this recipe at the beginning of this twitter sharing function. So when you click the button to share it will say "Try this recipe" then have the url etc. Thank you.

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');
}

Upvotes: 2

Views: 1290

Answers (1)

The Alpha
The Alpha

Reputation: 146219

It's very simple, just add this text=Try this recipe& at first, i.e.

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.

Upvotes: 2

Related Questions