title: Google plus share button, current URL instead of Specified URL?
body: <p><strong>If clarification is needed, please let me know.  If it can't be done, please let me know this as well.  I am desperately trying to figure this out still</strong></p>
  
  <p>I was following Google's Dev guide to the Share button at the following site:</p>
  
  <p><a href="https://developers.google.com/+/web/share/" rel="nofollow">https://developers.google.com/+/web/share/</a></p>
  
  <p>and I can not seem to figure out how, if it's even possible, to use a custom icon AND use the current URL instead of having to specify a URL.</p>
  
  <p>I found this section of their site that specifies an anchor tag address:</p>
  
  <pre><code>"https://plus.google.com/share?url={URL}"
  </code></pre>
  
  <p>This would allow me to use a custom icon (and the only way I can use a custom icon as far as I can tell) and a few other custom parameters as well.  But it looks like this method requires a specified URL and, as far as I can tell, provides no method to dynamically create the link depending on the current page.</p>
  
  <p>If I use the code generator at the top, it will use the current page, but it calls on a Google hosted Java Script and in addition, it is a hover link that pops up when I hover over the icon.  And of course, I also can't use a custom icon with the generator either.</p>
  
  <p>I've been Googling every search term I could think of and searching this site as well and I haven't been able to find anyone else asking this question as of yet.  I figured after about 20-30 minutes of searching that I wasn't going to find my answer via searching, so i apologize if this has been answered.</p>
  
  <p>Just some background on my experience to give an idea of where I sit: I have a decent grasp of the workings of HTML and CSS.  Javascript, however, I understand very very basic theory and that's about it.  I definitely intend to learn, however, as it will prove a very valuable skill.</p>
  
  <p>Thank you very much!!</p>
  
  <p>I think I know what needs to be done, but...I don't know how to do it (or if it would even work) :|</p>
  
  <p>my share link needs to link to a script that looks at the current page's URL, and then takes that information, and creates a dynamic link from it that will take the user to the following link: <a href="https://plus.google.com/share?url=" rel="nofollow">https://plus.google.com/share?url=</a>{URL from query will be here}.</p>
  
  <p>I think that might work...it sounds like it would.  Any thoughts?  If so, any simple scripts around that would do just this?</p>
  
  <p>Double thanks!!</p>
  
  <p>--I finally found something that works, but it uses Javascript and I don't fully understand it, just enough to tweak it.  It took me forever to find this, but it works with Google Plus, Facebook, or Twitter! (and I'm sure it will work with any other website that supplies a Share Link that requires a specified URL)</p>
  
  <p>Here it is, I'm still looking for a better solution, but this does exactly what I was looking for:</p>
  
  <pre><code>&lt;a href="javascript:(
  function(){
  var w=480;var h=380;
  var x=Number((window.screen.width-w)/2);
  var y=Number((window.screen.height-h)/2);
  window.open('https://plus.google.com/share?url='+encodeURIComponent(location.href)+'
    &amp;title='+encodeURIComponent(document.title),'','width='+w+',height='+h+',left='+x+',top='+y    +',
    scrollbars=no');
  })();" style="background: url(/wp-content/themes/HTML5/images/googleplus.png) no-repeat  scroll left center transparent;"&gt;
  Share to Google+&lt;/a&gt;
  </code></pre>