Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
- <script>
- //alert(check_permisssions());
- </script>
- </head>
- <body>
- <script type="text/javascript">
- var publish;
- var dfd = $.Deferred();
- window.fbAsyncInit = function() {
- FB.init({
- appId : 'xxxxxxxxxxxx',
- xfbml : true,
- version : 'v2.1'
- });
- FB.getLoginStatus(function(response) {
- FB.api(
- "/me/permissions",
- function (response) {
- if(response && !response.error) {
- var publish = '1';
- dfd.resolve(publish);
- }
- else {
- var publish = '0';
- dfd.reject(publish);
- }
- }
- );
- });
- };
- (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'));
- dfd.always(function(result) {
- alert(publish);
- })
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment