I have a simple question, but being a JavaScript newbie, I have no idea how to implement my findings.
I found a little snippit that uses JavaScript to pull in the current URL, and load that value to a variable:
<script type="text/javascript" language="javascript">
window.onload = function () {
var currentUrl = window.location.href;
}
</script>
so the value of currentUrl holds the current page's URL.
What I need to know is how to use that value within my page's HTML. The application I am attempting to use this for is the facebook comments plugin.
<div class="fb-comments" data-href="**currentUrl**" data-width="470" data-num-posts="2"></div>