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

  • Home
  • SEARCH
  • 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 5938835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:44:30+00:00 2026-05-22T15:44:30+00:00

I am trying to use a Facebook Like button via an iFrame, like so:

  • 0

I am trying to use a Facebook Like button via an iFrame, like so:

<iframe id="test" src="http://www.facebook.com/plugins/like.php? 
       href=http://yoururl.com/&amp;
       layout=button_count&amp;
       show_faces=false&amp;
       width=50&amp;
       action=like&amp;
       colorscheme=light&amp;
       height=21" 
       scrolling="no" frameborder="0" 
       style="border:none; overflow:hidden; width:50px;  
              height:21px;" 
       allowTransparency="true">

After a user clicks “Like” for the first time, I want to execute some Javascript in my DOM content. How would I go about doing this?

  • 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-05-22T15:44:30+00:00Added an answer on May 22, 2026 at 3:44 pm

    You mean you want to execute some Javascript when you like something?

    You can use the Facebook Javascript SDK for that, especially the edge.create event.
    See

    1. http://developers.facebook.com/docs/reference/javascript/ (for general SDK doc)
    2. http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/ (for event doc)

    This should work with the IFrame-version too. If not, you have to switch to the XFBML-Like button. It definetly works with the XFBML version.

    Example:

    <!-- Load the SDK (or even better, load it asynchronously. See first link above -->
    <div id="fb-root"></div>
    <script src="http://connect.facebook.net/en_US/all.js"></script>
    <script>
    // initalize your Facebook App
      FB.init({
        appId  : 'YOUR APP ID',
        status : true, // check login status
        cookie : true, // enable cookies to allow the server to access the session
        xfbml  : true  // parse XFBML
      });
    // subscribe to the event
    FB.Event.subscribe('edge.create', function(response) {
      alert('you liked this');
    });
    FB.Event.subscribe('edge.remove', function(response) {
      alert('you unliked this');
    });
    </script>
    <!--
        The XFBML Like Button, if the iframe version doesn't work (not 100% sure)
        <fb:like></fb:like>
     -->
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use Facebook's registration tool for my website. I would like to
I've been trying to use SQLite with the PDO wrapper in PHP with mixed
I'm trying to use SQLBindParameter to prepare my driver for input via SQLPutData .
So I have been playing around with the facebook like button but I have
I'm trying to build in a facebook share button on a news section of
I'm trying to use the Facebook C# SDK to post to a Facebook page
I'm trying to use the Facebook Graph API to get all the events I'm
Trying to use an excpetion class which could provide location reference for XML parsing,
Trying to use a guid as a resource id in a rest url but
While trying to use LINQ to SQL I encountered several problems. I have table

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.