title: is there a way to add document.url inside location.replace (in Javascript)
body: <p>This is what I am trying to accomplish</p>
  
  <pre><code>location.replace('http://localhost:8888/test/index.php?site=' + document.URL);
  </code></pre>
  
  <p>So I need the current url to be send as a string of the 'site' variable. Though the document.URL is not working, is there a way to get that working?</p>
  
  <p>The idea is when I go to index.php the 'site' is inserted into a database. I would like the above link to work as a bookmarklet, <strong>(second part of the question)</strong> is there a way to execute that code but to still remain in the same page?</p>
  
  <p>basically if I am at google.com and click on the bookmarklet to execute the code above, Is there a way to remain at google.com but for the ..index.php to run in the background</p>
  
  <p>At the moment I really need help with the first part of the question - but maybe you have any tips on how to achieve the second part - Thanks a lot</p>