$(document).ready(function() {
  var title = $( 'title' ).html();
  title = encodeURI(title);
  var pathname = window.location.pathname;
  pathname = encodeURI(pathname);
  
  before = $('#tweet-button').attr('href');
  after = before.replace(/twitterersetztext/, title);
  after = after.replace(/twitterersetzeurl/, pathname);
  
  $('#tweet-button').attr('href', after);
});

