I have a link inside a div:
<div class="embed">
<a href="http://google.com/"></a>
</div>
So now I want to append Facebook comment system:
$('.embed a').append('<div class="fb-comments" data-href="' + this + '" data-num-posts="1" data-width="470"></div>');
As you can see I have ‘this’ for the href, it doesnt work for me. I would like to have the url of the link Im appending the comment system on. How do I find and implement this url?
Example: JsFiddle
If you have more than one
'.embed a', you need to operate on each of them and give the correct href :