Skip to content

Instantly share code, notes, and snippets.

@jgraffin
Created December 16, 2015 20:00
Show Gist options
  • Save jgraffin/fd9b2a5435176617b60e to your computer and use it in GitHub Desktop.
Save jgraffin/fd9b2a5435176617b60e to your computer and use it in GitHub Desktop.
API Facebook - Autorizando botão para download
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '1217349928306957',
xfbml : true,
version : 'v2.5'
});
};
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
$(document).ready(function() {
$('.download').hide();
$('#botao').click(function(){
FB.ui({
method: 'share',
href: 'http://dev.agenciawow.com.br/pneufree/facelift/front/teste/page-teste.html',
}, function(response){
$('#botao').hide('slow');
$('.download').show('slow');
});
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment