Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8280561
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T09:43:18+00:00 2026-06-08T09:43:18+00:00

To explain, I’d like for a link to only become available for clicking once

  • 0

To explain, I’d like for a link to only become available for clicking once visitors have ‘Liked’ my website (not my Facebook page – the actual website). I’ve been trying to do it using this code:

<script>
  FB.Event.subscribe('edge.create', //FB.event.subscribe attaches a handler to an event and invokes your callback when the event fires.
    function(response) { //This is where the response function is inserted, I used document.write for this example
    document.write(';<a href="#">This is the HTML I want to display</a>');
    }
  );
</script>

But even after I like my website the link doesn’t display. I hope I’ve been as clear as possible, any help would be greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T09:43:20+00:00Added an answer on June 8, 2026 at 9:43 am

    I managed to get it working after some thinking and playing around:

    <!-- FB Javascript SDK -->
    <div id="fb-root"></div>
    <script>
    window.fbAsyncInit = function() {
    FB.init({
        appId: 'APP-ID',
        channelUrl : '//WWW.WBESITE.COM/channel.html', // Channel File
        status: true,
        cookie: true,
        xfbml: true,
        oauth: true,
    });
    
    // Additional initialization code here
        FB.Event.subscribe('edge.create', function() {
        window.location.href = "http://WEBSITE.COM/";
    }); 
    };
    
    // Load the SDK Asynchronously
    (function(d){
     var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
     if (d.getElementById(id)) {return;}
     js = d.createElement('script'); js.id = id; js.async = true;
     js.src = "//connect.facebook.net/en_US/all.js";
     ref.parentNode.insertBefore(js, ref);
     }(document));
    </script>
    
    <!-- More FB Javascript SDK (Like Button) -->
    <div id="fb-root"></div>
    <script>
    (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/all.js#xfbml=1&appId=APP-ID";
    fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));</script>
    
    <script src="//connect.facebook.net/en_US/all.js#xfbml=1">
    </script>
    

    The FB.Event.subscribe needed to be placed within the window.fbAsyncInit function. I then made it so that instead of having the HTML appear after the ‘Like’ button had been pressed it simply redirected it using the window.location.href = “http://WEBSITE.COM/”; to a page that has the new link included on it. The document.write function wasn’t working because it would get rid of all the HTML on the page other than what was included in the function.

    The code above needs to be placed just after the opening tag and then you can place the code for the ‘Like’ button:

    <div class="fb-like" data-href="http://WEBSITE.COM" data-send="send" data-layout="button_count" data-width="450" data-show-faces="true"></div>
    

    Anywhere that you would like on the page!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i explain better my question: i have a table like: |ID|DATE|DAYS| users in my
To explain my question: Class : Toy Trait1: Speak like Male Trait2: Speak like
To explain my question I have created this http://jsfiddle.net/Jams/XNVB2/ here I want when div1
EXPLAIN SELECT * FROM content_link link STRAIGHT_JOIN content ON link.content_id = content.id WHERE link.content_id
To explain my problem, an example is better. I have an ASP.NET MVC 3
EXPLAIN SELECT * FROM ( `phppos_items` ) WHERE ( name LIKE 'AB10LA2%' OR item_number
Please explain working in each case. Why both cases have same output? Case I:
Before explain my problem, I have to say that my GWT version is 2.2.0
To explain the domain... I have a bunch (1,000,000) of items, each of a
I explain better my question : when my app start, some xml have been

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.