Skip to content

Instantly share code, notes, and snippets.

@RalfAlbert
Created July 18, 2011 21:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RalfAlbert/1090650 to your computer and use it in GitHub Desktop.
Save RalfAlbert/1090650 to your computer and use it in GitHub Desktop.
Google+ Button Datenschutzkonform mit iFrame
$(document).ready( function(){
$('#gplus').click( function(){
var l = window.location;
var url = encodeURIComponent( l.href );
var parent = encodeURIComponent( l.href.replace( l.pathname, '' ) );
var gframe = '<iframe src="https://plusone.google.com/u/0/_/+1/button?'
+ 'url=' + url
+ '&amp;size=standard' +
+ '&amp;count=true' +
+ '&amp;hl=de-DE' +
+ '&amp;parent=' + parent
+ '" name="gFrame" id="gFrame"></iframe>';
$( gframe ).insertAfter( '#gplus' );
$('#gplus').remove();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment