Search code examples
google-plusgoogle-plus-one

How to open the link in new window of Google Plus Badge?


I have in my website the code of Google Plus Badge and Google +1 Button
I need that the link to Google+ page (generate by Badge) open in new Window.

If you have other way, I need:

  • Link to Google+ Page.
  • Add function for add to circles.
  • +1 Button with the count.

All in a line.

My code look as:

<table>
<tr>
<td style="padding-top:2px; vertical-align:top;"><div style="width:180px; height:30px;     overflow:hidden;">
<div style="margin-top:-15px; margin-left:0px;" title="International Studies Google         Plus">
                <style type="text/css">
                             #___plusone_0, #___plusone_0         iframe{
                                 width:66px !important;
                             }
                            </style>
                <div class="g-plus" data-href="https://plus.google.com/118182458881247471225?rel=publisher" data-width="170" data-height="69" data-theme="light"></div>
              </div>
            </div></td>
              <td style="padding-top:6px; padding-left:5px;"><g:plusone></g:plusone>    </td>
</tr>
</table>

Solution

  • You can't do this.

    The badge does not provide any flag that allows you to open the link in a new window. It's also the only feature that provides the 'Add to circles' functionality that you require.

    The closest that you can get would be to use a static badge and a +1 button:

    <div>
      <a href="https://plus.google.com/118182458881247471225?prsrc=3" rel="publisher" style="text-decoration:none;" target="_blank">
      <img src="//ssl.gstatic.com/images/icons/gplus-32.png" alt="Google+" style="border:0;width:32px;height:32px;"/></a>
    
      <div class="g-plusone" data-annotation="inline" data-width="300"></div>
    </div>
    

    Also, it looks like there's a feature request for this functionality. If you star this feature request, you'll be notified about updates.