-
-
Save TastyToast/2770863 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; | |
$('#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