Skip to content

Instantly share code, notes, and snippets.

View petersvedman's full-sized avatar

Peter Svedman petersvedman

View GitHub Profile
@BryanBarrera
BryanBarrera / twitter-share.js
Last active May 22, 2016 13:39 — forked from guillaumepiot/gist:5442196
Twitter Social Share
// We bind a new event to our link
$('a.tweet').click(function(e){
//We tell our browser not to follow that link
e.preventDefault();
// 1. We get the URL of the link
//or 2. URL of the page
// 1. var loc = $(this).attr('href');
var loc = $(location).attr('href'); // 2