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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T06:58:50+00:00 2026-05-30T06:58:50+00:00

I’ve got a site that loads all ‘pages’ and ‘content’ using 100% AJAX. I’m

  • 0

I’ve got a site that loads all ‘pages’ and ‘content’ using 100% AJAX. I’m using jQuery to handle the AJAX loads.

The problem I’m having is that I want to include a FB share link for the individual project pages (see link below):

http://www.concrete.ca/#!/work_project.php?project_ID=32

So, the idea is that when each project is loaded in via AJAX I’ll then use jQuery (when the doc is .ready) to update the OG meta tags that reside in the index.php page. I’ve given each of the FB OG meta’s an ID that corresponds to it’s purpose (e.g. FB_title). So, here’s the OG meta’s that reside in the HEAD of index.php:

<meta id="FB_title" property="og:title" content="Concrete Design Communications" /> 
<meta id="FB_description" property="og:description" content="Internationally acclaimed Toronto-based brand design practice serving a variety of sectors including telecom, luxury retail, fashion, cosmetics, hospitality, publishing, as well as furniture and product design." /> 
<meta id="FB_image" property="og:image" content="http://www.concrete.ca/images/LOGO.png" />

And then when each of the project pages loads in via AJAX, I want to update the ‘content’
attribute of the meta tags. Along these lines:

$('#FB_title').attr('content', 'Concrete Design: <? print $GA_project_name; ?>');

The problem is that when I run that code I get a “Parse error.” Anyone else run into this? What is the best way to update FB OG meta’s when loading pages in via AJAX?

I’ve looked throught the FB dev docs but there doesn’t seem to be anything that address’ this.

Thanks in advance for any help.

  • 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-30T06:58:51+00:00Added an answer on May 30, 2026 at 6:58 am

    Facebook’s linter does not run any javascript. So you’ll have to be sure to serve off the correct content when facebook comes to grab it.

    Here’s what you’ll need to do. Two options. Either work and have been proved to work with other production websites. J

    • Specify the AJAX url in the Like plugin code. Have a special handler on your web server when it sees requests from Facebook’s linter. The user agent of the scraper is: "facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)". Then your server can parse the hash bang and serve the specific og meta tags for that content. This is called URL Rewriting and can be done via .htaccess.

    • Specify a canonical URL in the Like plugin code. That canonical URL is unique for each piece of content that can be displayed, maybe a direct call to http://www.concrete.ca/work_project.php?project_ID=32 (without the hash bang) that renders out the correct og: meta tags.

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I am using Paperclip to handle profile photo uploads in my app. They upload
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

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.