title: Issues with Facebook like button, XFBML, Dynamic URL?
body: <p>So i've been having trouble getting my facebook like buttons to work. I'm trying to put them on many pages without having to type in the url in the 'href' field in the snippet each time. I've tried using js to dynamically change the href parameter but when I click the 'like' button, it does not go through- aka doesn't post to my facebook. Here is the code:</p>
  
  <p></p>
  
  <pre><code>&lt;script&gt;
    window.fbAsyncInit = function() {
      // init the FB JS SDK
      FB.init({
        appId      : '456678891040542', // App ID from the App Dashboard
        channelUrl : '//WWW.UNICONUTRITION.COM/channel.html', // Channel File for x-domain communication
        status     : true, // check the login status upon init?
        cookie     : true, // set sessions cookies to allow your server to access the session?
        xfbml      : true  // parse XFBML tags on this page?
      });
  
      // Additional initialization code such as adding Event Listeners goes here
  
    };
  
    // Load the SDK's source Asynchronously
    (function(d){
       var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
       if (d.getElementById(id)) {return;}
       js = d.createElement('script'); js.id = id; js.async = true;
       js.src = "//connect.facebook.net/en_US/all.js";
       ref.parentNode.insertBefore(js, ref);
     }(document));
  &lt;/script&gt;
  
  
    &lt;li class="sloo"&gt;&lt;fb:like id="fb" href="www.asdf.com" layout="box_count"&gt;&lt;/fb:like&gt;
  
    &lt;/li&gt;
  
    &lt;script type="text/javascript"&gt;
  var sUrl = window.location;
  document.getElementById('fb').setAttribute('href', sUrl);
  &lt;/script&gt;
  </code></pre>