Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.