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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:21:02+00:00 2026-05-26T05:21:02+00:00

I just finished a small website 100% based on ajax.But i have a problem

  • 0

I just finished a small website 100% based on ajax.But i have a problem in updating the links of the facebook Like buttons.

I used simply the facebook generated code and i included the graph meta tags. when the users presses a button it loads a new youtube video, i update the meta tag

<meta property="og:url" content="http://www.mySite.com/"/>

using jQuery this way :

$("meta[property=og:url]").attr("content", nUrl);

nUrl is the new page url that contains the new randomly selected video.

 When i hit “Like” it simply grab hit “Like” it simply grab the original og:url meta tag content and now the new on set by ajax.
 How to update with javascript the like button url ? What is wrong in what i did ?
Thank you

  • 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-26T05:21:03+00:00Added an answer on May 26, 2026 at 5:21 am

    So here’s what i did to solve my problem for other people who have the same:
    Add this to your site :

    <html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:og="http://ogp.me/ns#"
      xmlns:fb="http://www.facebook.com/2008/fbml" >
    

    This will add the fbml to your site. Then use the FBML version of the like button (or comment system, or whatever), for like i used this :

    <span id="fbLike"><fb:like href="http://www.your-site.com?v=1" send="false" layout="button_count" width="80" show_faces="true"></fb:like></span>
    

    Now to have a new facebook like button each time the user make an Ajax action, just add this jquery code to where ever you handle this action in your client-side code:

    var nUrl = "http://www.your-site.com?v="+toPlayId.substring(1);
    $( '#fbLike' ).html('<fb:like href="'+nUrl+'" send="false" layout="button_count" width="80" show_faces="true" />');
            if (typeof FB  != "undefined"){
            FB.XFBML.parse(document.getElementById('fbLike'));} 
    

    You basically just replace the where your button is with a new one.
    nUrl is the new link you want your new button to point to.
    You don’t need a real new URL just add a parameter to the url so that your ajax knows what to display when he finds the parameter.
    That’s all.

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

Sidebar

Related Questions

I'm relatively new to Windows development, but have just finished a small project. I
I just finished a small project where changes were required to a pre-compiled, but
I'm making an online tile based game and I have just finished scripting the
I've just finished designing a small android app and have now come to a
Just finished reading Crockford's JavaScript: The Good Parts and I have a question concerning
I just finished reading this post: https://developer.yahoo.com/performance/rules.html#flush and have already implemented a flush after
I have just started working with a new company in a very small IT
I just finished learning assembly language. But I couldn't understand what could I implement
I just finished debugging a problem, where our program crashed on a production server,
I just finished a small task for school in Flash and I'm wondering about

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.