Created
December 16, 2015 20:00
-
-
Save jgraffin/fd9b2a5435176617b60e to your computer and use it in GitHub Desktop.
API Facebook - Autorizando botão para download
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> | |
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