<meta property="og:url" content="http://www.example.com/test/index.php" />
<meta property="og:type" content="website" />
<meta property="og:title" content="My title" />
<meta property="og:description" content="Some description" />
<meta property="og:image" content="http://www.example.com/test/images/fb_952_498.jpg" />
在另一页:
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '123456789',
xfbml : false,
version : 'v2.10'
});
};
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/ro_RO/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
<script type="text/javascript">
function Post_Imagine(){
FB.ui({
method: 'feed',
link: 'http://www.example.com/test/index.php',
caption: 'Some text',
}, function(response){});
}
答案 0 :(得分:0)
我去了调试器,结果发现Facebook没有刷新缓存。我坚持4-5次,最后它起作用了。所以,那些感兴趣的人,代码可行。 :)