Facebook "Like" Button Dynamic URL Load using Javascript
I have a asp.net page where i'm loading specific Facebook Url page from
hiddenfield in the same page. What i want to do is to generate a like
button using this specific url .
i tried this but it doesn't work , the like button keeps the default
href(which is coca cola) :
<div id="fb-root"></div>
<div id="fb-like" class="fb-like"
href="https://www.facebook.com/cocacola" data-width="450"
data-show-faces="true" data-send="false"></div>
<script>
var sUrl = document.getElementById('AdresseLike').value;
document.getElementById('fb-like').setAttribute('href', sUrl);
FB.XFBML.parse(document.getElementById("fb-like"));
No comments:
Post a Comment