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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T01:18:50+00:00 2026-06-06T01:18:50+00:00

i get my pagedata from an xml and i want this data to be

  • 0

i get my pagedata from an xml and i want this data to be shown when shared, below is my code:

$.ajax({
            type: "GET",
            url: "data/artikels.xml",
            dataType: "xml",
            success: function(xml){
                oArticle = $(xml).find('article:eq('+id+')');
                var regExp = /.*(?:youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=)([^#\&\?]*).*/;
                var match = oArticle.find('youtube').text().match(regExp);  
                $('head').append('<meta property="og:title" content="'+oArticle.find('title').text()+'" />'
                    +'<meta property="og:description" content="'+oArticle.find('shortcontent').text().replace(/&/g, '&amp;').replace(/>/g, '&gt;').replace(/</g, '&lt;').replace(/"/g, '&quot;')+'" />'
                    +'<meta property="og:image" content="'+oArticle.find('image').text()+'" />').trigger('create');  
                $('#container').append('<div id="title_article">'+oArticle.find('title').text()+'</div>'
                    +'<div id="date_article">'+oArticle.find('date').text()+'</div>'
                    +'<iframe width="600" height="315" src='+'"'+'http://www.youtube.com/embed/'+match[1]
                    +'<div id="content_article">'+oArticle.find('fullcontent').text()+'</div>').trigger('create');

            }
        })

When i enter my url in facebook debugger other images/titles/descriptions are taken, the same happens when i just share. Is there any way to solve this?

Kind regards

Toon

  • 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-06T01:18:52+00:00Added an answer on June 6, 2026 at 1:18 am

    Facebook generates the meta content of the link by fetching your plain HTML page. It won’t run your JavaScript code.

    You are better off handling this in your back-end script and serving the meta tags when the page loads instead of loading it with AJAX. In general, if you have an AJAX request in your site that takes no input from the user, you are doing something wrong, as this could have been generated by the server before serving the HTML to the user. (thus reducing the amount of requests the user’s browser has to make)

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

Sidebar

Related Questions

I have this code below. I randomly ran across that it will work if
I have an XML file named PageData.xml in my App_Data folder. I want to
I am trying to parse FB comments JSON, which I get from var url
I am using JQuery, FLXHR for getting the data from Cross Browser. Below is
i have need webpage-content. I need to get some data from it. It looks
I have the code below loading into a jquery mobile page data-role. Two strange
I have a problem, into my project i'm trying to get data from my
Get class from div inside an li and add to the same li. The
I get Compiler Error C2248 when i try to compile the following code: #include
Here is peace of the XAML code from my page: <ComboBox Grid.Row=2 Grid.Column=1 Name=Player2

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.