Created
May 15, 2012 14:36
-
-
Save andershaig/2702260 to your computer and use it in GitHub Desktop.
Sharing Popup using Facebook's Share Method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
$(document).ready( function () { | |
var url = encodeURIComponent('https://www.youtube.com/watch?v=ya7OVaIu7Yg'); | |
var title = encodeURIComponent('This is my super awesome title'); | |
var full_url = 'http://www.facebook.com/sharer.php?u=' + url + '&t=' + title; | |
$('#fb_share').click( function (e) { | |
e.preventDefault(); | |
window.open(full_url); | |
}); | |
}); | |
</script> | |
<button id="fb_share">Click to Share</button> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% plugin rawtext url %} | |
{% plugin rawtext title %} | |
<button id="fb_share" onclick="window.open('http://www.facebook.com/sharer.php?u={{ url | json }}&t={{ title | json }}','_blank','height=440,width=625,scrollbars=no');">Share on Facebook</button> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment