I have to assign a thumbnail to the page:
<meta property="og:image" content="http://example.com/example.png" />
However, as the site is a WordPress site, the information of thumbnail is loaded when body is loaded (it is a WordPress page). Therefore, I use the following JS to add the tag (inspired by this question):
<script>
$('head').append('<meta property="og:image" content="http://example.com/example.png" />');
</script>
The tag is successfully added to <head>
, but the thumbnail does not display after I click Facebook Share button. Is it true that the Facebook button only evaluate the original source code, instead of the modified source code?
If Yes, what can I do to make Facebook Share button's thumbnail appearing ?
FYI, here is the Facebook share button code:
<fb:share-button type="button_count" href="http://example.com"></fb:share-button>