title: change the url of facebook comments box according to the page?
body: <p>On my website I have more than 100 pages, and now I want to add facebook comments box to each page. After inserting the page Url to facebook it gave me this code to add to my page, but I do not want to copy and past to each page then change the Url according to the webpage name. In the second code there is the acctual URL to the webpage can I replace it with</p>
  
  <pre><code>location.href
  </code></pre>
  
  <p>So that I do not have to change the URL. Is that even possible? How can I do that?</p>
  
  <pre><code>  Include the JavaScript SDK on your page once, ideally right after the opening &lt;body&gt; tag.
  
  
  
  
  
  &lt;div id="fb-root"&gt;&lt;/div&gt;
      &lt;script&gt;(function(d, s, id) {
      var js, fjs = d.getElementsByTagName(s)[0];
      if (d.getElementById(id)) return;
      js = d.createElement(s); js.id = id;
      js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&amp;appId=324524777119";
      fjs.parentNode.insertBefore(js, fjs);
      }(document, 'script', 'facebook-jssdk'));&lt;/script&gt;
  </code></pre>
  
  <p>2.Place the code for your plugin wherever you want the plugin to appear on your page.</p>
  
  <pre><code>&lt;div class="fb-comments" data-href="http://damnthisfunny.site40.net/1.html" data-num-posts="25" data-width="470"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>I tried this but its not working :</p>
  
  <pre><code>&lt;body&gt;
  &lt;div id="fb-root"&gt;&lt;/div&gt;
  &lt;script&gt;(function(d, s, id) {
    var js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) return;
    js = d.createElement(s); js.id = id;
    js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&amp;appId=324524777119";
    fjs.parentNode.insertBefore(js, fjs);
  }(document, 'script', 'facebook-jssdk'));&lt;/script&gt;
  
  &lt;div class="fb-comments" data-href="+location.href+" data-num-posts="25" data-width="470"&gt;&lt;/div&gt;
  
  &lt;/body&gt;
  </code></pre>