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 8034333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:58:48+00:00 2026-06-05T01:58:48+00:00

I’d like to refresh dynamically a fb:like plugin into my page. For exemple, into

  • 0

I’d like to refresh dynamically a fb:like plugin into my page.

For exemple, into index.html, I have :

<fb:like id="fbtest" href="http://www.urltest.com" send="true" width="450" show_faces="true"></fb:like>

(Facebook is initialized, and all works perfectly.)

Then, I’l like to change dynamically the URL of this like button.
So, with jQuery, I do :

$('#fbtest').attr('href', 'http://www.urltest2.com').empty().off().removeData();
FB.XFBML.parse();

And it’s doesn’t work… It only work when I remove the fb:like tag, and recreate it (exactly the same DOM !).

As you can see here: Update FB:Like URL Dynamically using JavaScript ,
All methods described recreates the fb:like tag… I need to refresh an existing fb:like… not recreate it. Is it possible ?

EDIT : Here’s a fiddle for testing 🙂 : http://jsfiddle.net/nRTkS/

Thanks!

  • 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-05T01:58:50+00:00Added an answer on June 5, 2026 at 1:58 am

    No, I don’t think that it’s possible.
    The FB.XFBML.parse method, as it’s name implies, just parses:

    This function parses and renders XFBML markup in a document on the fly
    

    Once a plugin has already been rendered it won’t be re-rendered, otherwise the behavior could be a bit strange if for example you have more than one plugin on the same page, you change the url attribute in one like plugin and then call FB.XFBML.parse which will re-render the entire document and plugins in it.

    So yeah, you can make sure that you call the method while passing it the element to start with, or the sdk can just maintain a state for each plugin and re-render only if that changed, but all of that is more complicated then to just remove the plugin from the dom, enter the new fb:like tag and then call FB.XFBML.parse.

    Now, for what I believe is the real reason, but it’s just a guess.
    The sdk creates an iftame inside the plugin container which contains the actual plugin.
    In order to change the url for the like action there’s a need for cross domain communication which I think is possible (for the fb sdk) only in one direction which is from the plugin to the containing page (hence edge.create event).

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I have thousands of HTML files to process using Groovy/Java and I need to
I have some data like this: 1 2 3 4 5 9 2 6
I would like to count the length of a string with PHP. The string

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.