<div id="test1"><div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1">
</script>
<fb:comments href="http://www.jewelryfresh.com/" num_posts="10" width="739"></fb:comments></div>
Above is the code for facebook comments box. I want to dynamically change the href value to the page on which it is. How can i do it.I do not want the static href value to the page on which it is. How can i do it.I do not want the static href value as it is now. Please help.
You can use
divand then dynamically create its contents with theinnerHTMLmethod in JavaScriptwhere it will be your
fb:commentstag. You can get the current page withdocument.location.href.After you create the
fb:commentstag dynamically and render it inside thediv, you need to reparse its contents so the XFBML is interpreted. You can do it with theFB.XFBML.parse(YOUR_DIV)method.Hope this helps.