There is a one-page site where js-image slider works. When you click on the sharing button, you should fumble the page with the picture that is currently on the slider, but unfortunately it does not work. when changing pictures on the slider, I change data in order

meta name="title" property="og:title" meta name="desc" property="og:description" meta name="img" property="og:image" 

but still I don’t fumble a page with a specific picture, I think this is due to the fact that I’m changing their javascript and they are no longer visible for the sharinga script. If anyone has encountered such a problem, please tell me what I am doing wrong. Thank you in advance.

  • github.com/dimsemenov/PhotoSwipe/issues/749 - you need to try, each social network has its own subtleties, each slider also. - labris
  • I need to somehow dynamically update the data, so that the share script would see these changes. - Taron
  • what script what social network? they are all different - labris
  • creaking - I'm talking about sharinga. social network - facebook, vk, G +, - Taron
  • Yandex Share means the script. - labris

1 answer 1

Social network, I will not say about everything, but facebook is accurate, it caches data for the page, so how many do not change the meta tags in js, the result will not change. Perhaps it is worth adding another hashtag to the url, so that it would be different. The slider can also be sharpened, so that if you have a hashtag immediately make this or that item active in the slider. Something like mysite.ru # slide2

  • You are right about caching, but about the hash, the server cannot read it ... stackoverflow.com/questions/5256114/ ... Here is the answer, the cache is manually cleaned on each page. - Oleg Reym
  • 1. which server cannot read it and why read it? 2. You can manually clean it, but the author is not satisfied with that. - Maksym Tymofeiev
  • There is a unique URL, which is indexed from social networks and search engines, server requests go: example.com/blog and example.com/blog#123 will be read as example.com/blog. If you don’t believe it, try php, for example read the hash. Only js can do this. - Oleg Reym
  • And if parameters are entered, for example, example.com?slider=123 - Maksym Tymofeiev
  • Parameters - yes, hash - no (I mean read, I don’t know about uniqueness, honestly). I'm talking about the hash, I'm not trying to argue, I just recently tried to get a token with VK and encountered a similar problem that they return a hash that the server cannot read, so I decided to clarify. Do not take it personally - your idea is good, just need a little refinement :) - Oleg Reym