Skip to content

Instantly share code, notes, and snippets.

@Sigmus
Created November 13, 2012 22:26
Show Gist options
  • Save Sigmus/4068860 to your computer and use it in GitHub Desktop.
Save Sigmus/4068860 to your computer and use it in GitHub Desktop.
Share Facebook
function shareFacebook(title, summary, image, url) {
url = url || 'http://dev.digitalbox.cc/clientes/id-pernambucanas-natal2012/';
window.open('http://www.facebook.com/sharer.php?s=100&p[images][0]=' + image + '&p[url]=' + url + '&p[title]=' + title +' &p[summary]=' + summary);
}
$(function(){
$('[data-summary]').on('click', function(e){
e.preventDefault();
var $this = $(this),
data = $this.data();
shareFacebook(data.title, data.summary, data.image);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment