title: Why does the Pinterest code change the page (URL) displayed in the browser?
body: <p>So I have spent a long time trying to find a Pinterest Pin It button that has both a counter AND allows me to choose any image from the page when I click on it.</p>
  
  <p>The Pinterest code supplied by Pinterest requires you to specify a specific image to be shared, but it has a count.</p>
  
  <p>The Pinterest browser button can be adopted to use on a page and will bring up a javascript window allowing the user to choose any suitable image on the page, but it has no count.</p>
  
  <p>I've been playing around and searching and am very close. I have this code which is some of my own and some I've found on other sites:</p>
  
  <pre><code>&lt;a class='pin-it-button' count-layout='horizontal' href='http://pinterest.com/pin/create/button/?url={Encoded URL of Current Page}'&gt;Pin It&lt;/a&gt;
  &lt;a href='javascript:void(run_pinmarklet())' style='margin-left:-93px; width:43px; height:20px; display:inline-block;'/&gt;&lt;/a&gt;
  &lt;script src='http://assets.pinterest.com/js/pinit.js' type='text/javascript'/&gt;
  &lt;script type='text/javascript'&gt;
  function run_pinmarklet() {
  var e=document.createElement('script');
  e.setAttribute('type','text/javascript');
  e.setAttribute('charset','UTF-8');
  e.setAttribute('src','http://assets.pinterest.com/js/pinmarklet.js?r=' + Math.random()*99999999);
  document.body.appendChild(e);
  }
  &lt;/script&gt; 
  </code></pre>
  
  <p>What this is doing is basically cheating by having the count button but then putting the code that lets a user choose an image an an element directly on top of the original button. A user thinks he is clicking on the Pin It button but is clicking on an  that runs the javascript run_pinkarklet().</p>
  
  <p>This works, however after I get the pop-over to choose an image, and I do choose the image, it then gets inserted into a pop-up window to complete the pinning, which works- but in the mean time the main page in the browser reloads. It doesn't reload the original page but it reloads the main URL of the current folder.</p>
  
  <p>Example- suppose the page I am pinning is:
      <a href="http://www.example.com/folder1/page1.php" rel="nofollow">http://www.example.com/folder1/page1.php</a></p>
  
  <p>It reloads to-
      <a href="http://www.example.com/folder1/" rel="nofollow">http://www.example.com/folder1/</a></p>
  
  <p>I can't find any way to stop this reloading or to get it to at least reload the source page.</p>
  
  <p>I've confirmed this behavior on latest Chrome and Firefox.</p>
  
  <p>Any ideas?</p>