title: change facebook share button url dynamically
body: <p>hi below is my code to change facebook share button dynamically </p>
  
  <pre><code>&lt;script&gt;
          function f1() {
              $(function () {
                  var id = location.href.replace(/.*pid=/, '');
                  $.galleriffic.gotoImage(id);
                  { window.open("https://www.facebook.com/sharer/sharer.php?u=" + escape(id) + "&amp;t=" + document.title, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=300,width=600'); return false; }
                 })
          };
      &lt;/script&gt;
  
  &lt;div onclick="f1()" id="sharenew" class="fb-share-button" data-href=""&gt;&lt;/div&gt;
  </code></pre>
  
  <p>in the given code facebook share button accept the url but i want to pass url with image id which get with # value so here my url become "<a href="http://writopedia.org/THCComment.aspx#2" rel="nofollow">http://writopedia.org/THCComment.aspx#2</a>" but it does not accept by facebook so help me.</p>