How to use queries to customize twitter share button


#1

I want to set “tweet to share” button in my website and customize it,
using JavaScript method “window.open”.

But I wonder 2 things.
1, the query “lang” seems not to work.
2, Although I don’t use the query “related”, “following suggestion” occurs after tweet. ( I don’t want to suggest to follow! )

// Using jQuery
$("#tweet_to_share").on('click',function(e){
  option = "width=720,height=280,left=" + e.clientX + ",top=" + e.clientY;
  share_url = encodeURIComponent("http://SOME_DYNAMIC_URL");
  window.open('https://twitter.com/share?lang=en&via=otiai10s_website&url=' + share_url ,"",option);
});

#2

If you want to control the opening of the window, you shouldn’t use the Tweet Button – you’ll need to use the tweet web intent instead (see [node:183]). The Tweet Button is meant to be used as-is Javascript-wise.


#3

@episod Thank you so much!! I will try that, and report the result. It will go well, I guess. :slight_smile:


#4

#5