in Education by
I've set up a simple app to run in a page tab. After authorizing the use of the app, just for basic info, it checks if the user likes the page. If they don't it asks for you to like the page before proceeding - but if you click the LIKE button at that point it's not refreshing the page so I don't see the change in my app. The user is left hanging and has to click the page tab again to proceed, at which point it lets you in. If you like the page before starting, everything works fine and the LIKE button refreshes the page as normal. Is there a reason for this? Or am I missing a trick - should I add my own LIKE button or something? Help appreciated as I'm really new to facebook apps. EDIT - I'm using Asp.Net C# if that makes a difference. I found it very hard to find any good documentation so I've pieced this together as best I can, so excuse the messiness. Here's the HTML page code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> FB.init({ appId: '9999999999', status: true, // check login status cookie: true, // enable cookies to allow the server to access the session xfbml: true // parse XFBML }); window.fbAsyncInit = function () { FB.Canvas.setSize({ width: 520, height: 1300 }); } // Do things that will sometimes call sizeChangeCallback() function sizeChangeCallback() { FB.Canvas.setSize({ width: 520, height: 1300 }); }
Enter our competition

You must LIKE our page before you can enter the competition
Q1 Q2 Q3
Q4 Q5 Q6
You have already entered this week's competition.
window.fbAsyncInit = function () { FB.init({ appId: '9999999999', status: true, cookie: true, xfbml: true, oauth: false }); // If like button pressed, refresh page FB.Event.subscribe('edge.create', function (response) { top.location = 'http://www.facebook.com/pages/MY_PAGE_NAME/PAGE_ID?sk=app_9999999999'; }); }; (function () { var e = document.createElement('script'); e.async = true; e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js'; document.getElementById('fb-root').appendChild(e); } ()); JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
You have to listen Facebook JS API actions and do a callback to refresh page. Try to add this code block at the end of your site. window.fbAsyncInit = function() { FB.init({appId: '', status: true, cookie: true, xfbml: true, oauth: false }); // If like button pressed, refresh page FB.Event.subscribe('edge.create', function(response) { top.location = ''; } ); }; (function() { var e = document.createElement('script'); e.async = true; e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js'; document.getElementById('fb-root').appendChild(e); }());

Related questions

0 votes
    I have a Facebook Like button implementation which is rendering fine in all browsers desktop and mobile. But ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    I have set all my meta properties in the way I understand they should be. Currently when I 'like' ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 11, 2022 in Education by JackTerrance
0 votes
    I want to make a button Go To Cart visible after adding a product into cart. But when page gets ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 3, 2022 in Education by JackTerrance
0 votes
    point Which option is not available in the page background group of the design tab? * O Watermark Header Page border Select the correct answer from above options...
asked Dec 19, 2021 in Education by JackTerrance
0 votes
    point Which option is not available in the page background group of the design tab? * O Watermark Header Page border Select the correct answer from above options...
asked Dec 18, 2021 in Education by JackTerrance
0 votes
    In my web application, I have tabs and if any of the tab is clicked, the corresponding page will ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 18, 2022 in Education by JackTerrance
0 votes
    In my web application, I have tabs and if any of the tab is clicked, the corresponding page will ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 18, 2022 in Education by JackTerrance
0 votes
    In my web application, I have tabs and if any of the tab is clicked, the corresponding page will ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 18, 2022 in Education by JackTerrance
0 votes
    name the tool bar present next to the file tab by default which button or present on this tool bar Select the correct answer from above options...
asked Dec 24, 2021 in Education by JackTerrance
0 votes
    what happens when you click on the following in costume tab:edit button, copy button, x button Select the correct answer from above options...
asked Nov 26, 2021 in Education by JackTerrance
0 votes
    what happens when you click on the following in costume tab:edit button, copy button, x button Select the correct answer from above options...
asked Nov 25, 2021 in Education by JackTerrance
0 votes
    what happens when you click on the following in costume tab:edit button, copy button, x button Select the correct answer from above options...
asked Nov 25, 2021 in Education by JackTerrance
0 votes
    Click on the ________ tab to add chart details like titles, labels, legend etc. Design Layout Format Select the correct answer from above options...
asked Nov 26, 2021 in Education by JackTerrance
0 votes
    How can I use Viewpager Adapter Button into MainActivity? I am developing a quiz app and I am comparing ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    I have some website which requires a logon and shows sensitive information. The person goes to the page, is ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 24, 2022 in Education by JackTerrance
...