i\'d like to change the URL to like of an FB:Like button dynamically using javascript.
right now i\'ve only been able to change the href attribute o
another solutions :
instead of your fb:like object, write a FB iframe in your html like this :
and now you can change with javascript with this function :
function setUrl(url)
{
sUrl = url;
url = "http://www.facebook.com/plugins/like.php?href="+sUrl+"&layout=button_count&show_faces=false&width=400&action=like&font=arial&colorscheme=light";
document.getElementById('face').setAttribute('src', url);
//alert("url : "+url);
}
when you change the src, the FB iframe is updated.