Skip to content

Instantly share code, notes, and snippets.

@TastyToast
Forked from andershaig/sharing.liquid
Created May 22, 2012 18:45
Show Gist options
  • Save TastyToast/2770863 to your computer and use it in GitHub Desktop.
Save TastyToast/2770863 to your computer and use it in GitHub Desktop.
Sharing Popup using Facebook's Share Method
<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;
$('#method1').click( function (e) {
e.preventDefault();
window.open(full_url);
});
});
</script>
<button id="method1">Click to Share</button>
{% plugin rawtext url %}
{% plugin rawtext title %}
<button id="method2" onclick="window.open('http://www.facebook.com/sharer.php?u={{ url }}&t={{ title }}','_blank','height=440,width=625,scrollbars=no');">Click to Share Using Facebook Sharing Features</button>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment