尝试使用客户端jQuery和Ajax来更新Facebook的开放图谱的meta标签 [英] Trying to update Facebook Open Graph meta tags using client side jquery and ajax

查看:184
本文介绍了尝试使用客户端jQuery和Ajax来更新Facebook的开放图谱的meta标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Ajax来呈现内容页与Facebook的Like按钮插件在里面。

现在的问题是,当用户CLICS一样,Facebook将提取的元信息,但我不知道如何与阿贾克斯分配元。

我试着用追加到头部INT FB.init但似乎不起作用,并且更新不会反映在用户喜欢在Facebook上的页面

$(头)追加(<元属性=OG:标题CONTENT =岩石/>');

解决方案
  

现在的问题是,Facebook的喜欢将提取的元信息,但我不知道如何与阿贾克斯分配元。

     

我试图用追加领导INT FB.init但似乎不起作用。

当然这不工作,因为Facebook的刮板请求您的网址从您的服务器的 - 而且不关心什么DOM可能目前看起来像任何用户的浏览器的。

您的不能添加的Open Graph元数据的客户端。

I use ajax to render a content page with a Facebook Like Button plugin in it.

The problem is that when the user clics Like, Facebook will extract meta info but I don't know how to assign the meta with ajax.

I tried using append to head int FB.init but it seems to not work and the update isn't reflected when users like the page on Facebook

$('head').append("<meta property="og:title" content="The Rock"/>');

解决方案

The problem is that facebook like will extract meta info but I don't know how to assign the meta with ajax.

I tried use append to head int FB.init but it seems not work.

Of course this does not work, because Facebook’s scraper requests your URLs from your server – and does not care about what the DOM might currently look like in any user’s browser.

You can not add Open Graph meta data client-side.

这篇关于尝试使用客户端jQuery和Ajax来更新Facebook的开放图谱的meta标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆