0

Here's the thing.
Recently I've tried to add FB like button to some website I'm administrating and that was easy, but now I have a request I don't know how to handle.
The thing is, when you like some website, on your FB wall is posted a link (and some other stuff maybe) to that website, its by default and I know I can change that.

What I need is this, on my page I have a (html)div that is loaded dinamycally with some important data and I need to post that particular data on my FB wall.

I tried using javascript and open graph meta tags but it seems to me that these meta tags cannot be changed dinamycally.

If anyone has an idea how to do this, feedback is more than welcome.

Sincerely, Milos

4

2 に答える 2

1

いいえ、技術的にこれを行うことはできません。Facebook でリンクを共有すると、Facebook サーバーは共有時に指定された URL にアクセスし、META 情報を収集して表示します。

ただし、Javascript はコンテンツがロードされた後、ブラウザー上で実行されます。Facebook サーバーが META 情報を取得する前に JavaScript を実行するとは思いません。

したがって、Open Graph のメタ タグを動的に変更しても、FB は古いタグ (最初のページの読み込み時に設定される) を引き続き使用します。

HTML をクライアントに送信する前に、コンテンツを設定する方法を理解する必要があります。

于 2012-06-21T11:23:56.633 に答える
0

この問題の解決策を見つけました。これは、iframe を使用して FB のようなボタンを統合することで実行できます。これを行うために必要な情報は、ここにあります。FBのようなボタンが表示され、メタタグを台無しにすることなくURLを追加できます

于 2012-06-21T14:15:29.110 に答える