Skip to content

Instantly share code, notes, and snippets.

@barlas
Last active August 29, 2015 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barlas/43cc8fb62f8788bc8dae to your computer and use it in GitHub Desktop.
Save barlas/43cc8fb62f8788bc8dae to your computer and use it in GitHub Desktop.
jQuery - Facebook and Twitter share functions compatible with utf-8 charset.
$('.fb_share').click(function() {
fbShare('www.google.com','Baslik');
return false;
});
$('.twt_share').click(function() {
twtShare('Aciklama');
});
function twtShare(a){
window.open('http://twitter.com/home?status='+encodeURIComponent(a),'twitter','toolbar=0,status=0,width=650,height=436');
return false
};
function fbShare(u, t){
window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment