Jason
Jason

Reputation: 7682

facebook opengraph

Question,

Can I leave the open graph url blank, but dynamically pass the url to the button and have it function properly?

The url is dyanamic and updated by ajax from user interactions on the page. So if I put a value in the og meta, it will be different than the actual page url (after user interactions).

thanks.

or by using FBML - is there any issue updating the fb:like button dynamically like:

<script>
var fb_ps_page = window.location.href;
document.write('<fb:like href=" '+ fb_ps_page +'" send="false" layout="button_count" width="450" show_faces="false"></fb:like>');
</script>

Upvotes: 0

Views: 336

Answers (1)

DMCS
DMCS

Reputation: 31880

No, you cannot dynamically update the link for the like button. You will have to remove it from the DOM and reinsert it. Then call FB.XFBML.parse() to get facebook to render their iframe with the new url.

Upvotes: 1

Related Questions