JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<a href='javascript:void(0);' id='tumblr'><img src='http://platform.tumblr.com/v1/share_1.png'/></a>
JavaScript
var strPostUrl = "http://google.com";
var strPostTitle = 'Google';
var strNewUrl = strPostUrl.replace("http://","");
var strNewTitle = strPostTitle.replace(/"/g, '"');
jQuery(document).ready(function(){
jQuery('#tumblr').click(function(){
var width = 775,
height = 500,
left = ($(window).width() - width) / 2,
top = ($(window).height() - height) / 2,
opts = 'status=1' +
',width=' + width +
',height=' + height +
',top=' + top +
',left=' + left;
var url = "http://www.tumblr.com/share/link?url="+strNewUrl+"&name="+strNewTitle;
window.open(url , 'tumblr', opts);
});
});