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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T13:04:22+00:00 2026-06-07T13:04:22+00:00

All the content on a site I am building is loaded dynamically using ajax

  • 0

All the content on a site I am building is loaded dynamically using ajax so the URL never changes. Now the client would like to add a facebook ‘like’ button. In order to do that, I am planning to use $_GET requests to ensure the proper content gets loaded when another user clicks on the liked link. However, I can’t figure out how to add these urls manually to the facebook like button. The like button just grabs the current URL, which never changes.

<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";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

The like button code:

<div class="fb-like" data-send="false" data-layout="button_count" data-width="100" data-show-faces="true" data-font="arial"></div>

Im a little new to JS but it seems like there must be a really easy way to change the url which gets sent to facebook. Any ideas?

  • 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-07T13:04:23+00:00Added an answer on June 7, 2026 at 1:04 pm

    Add data-href to the button:

    <div class="fb-like" data-href="http://www.example.com" data-send="false" data-width="450" data-show-faces="true"></div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building a site for a client that is comprised all of static content,
I would like to know how to copy all content of a file (server.log)
The title asks it all. The content on the site I'm building wont change
All, I am building a small site using PHP. In the site, I receive
Building an MVC 2.0 web site and using Content Delivery Network (CDN) in my
I am building an AJAX deep-linked site. I want PHP to load all the
I'm buiding an HTML/jQuery site where almost all the content comes from remote JSON
I'd like all my content to flow around an image. To do this, I
I have all my content pre-escaped, so rather than using the triple stash everywhere
I'm building a content-managed site with a homegrown API built by several developers I

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.