Tutucu2016-04-06 21:58:27
Tutucu, 2016-04-06 21:58:27

Ajax and social meta tags networks (open graph). How to organize?

There is a pop-up window with content and the ability to scroll (next / previous post), only in this window posts are shown, as well as social network buttons (share). Everything works, everything is fine, but when I click on the social buttons. networks (Vkontakte), the title of the page is added to the entry with the announcement of all posts and that's it, using ajax, I began to substitute values ​​in the meta tags:

<meta property="og:title" content="Фото 1" />  
<meta property="og:description" 
         content="Пример описания фото" />  
<meta property="og:type" content="article" />  
<meta property="og:image" 
content="http://demo.local/demo-photo.png" />

And nothing has changed. The values ​​in the tags change, the html code of the page changes, nothing changes when the button is pressed, and nothing happens when the first post is opened. What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Alexey Babak, 2016-04-07

Social the network does not load ajax, the page description is received by clicking on the link.
Therefore, different descriptions require different links and, depending on the link, substitute open graph tags.
Or you can implement it using js - VK.Share.button

noparse - If this parameter is set to true, then the VKontakte server will not make an additional request to download the missing information from the published page. If the value is false, then the request will always be sent.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question