get your Gravatar using MD5 and JQuery
Get your Gravatar using MD5 and JQuery - Andrew Pougher
HTML
<script src="http://crypto-js.googlecode.com/svn/tags/3.0.2/build/rollups/md5.js"></script>
<link rel="stylesheet" href="http://getbootstrap.com/2.3.2/assets/css/bootstrap.css">
<h2> Enter your email and press button</h2><input type="email" id="ps" placeholder="enter your email"/><br>
<img width="80" height="80" src="" alt="Gravatar" class="thumbnail" id="gravimg"/><br>
<p> Your Gravatar mdf email encoded is <strong></strong></p>
<div id="showme" class="btn">SHOW</div>
CSS
body{padding:50px;}
img{opacity:0}
JavaScript
$("#showme").click(function(){
var pss= $("#ps").val();
if(pss){
var passhash = CryptoJS.MD5(pss).toString();
$("#gravimg").attr("src", "http://www.gravatar.com/avatar.php?gravatar_id="+passhash +"&rating=G&size=80")
.fadeTo(1, 500);
$("p strong").html(passhash);
}else{
alert("enter your email address which is probably in Gravatar")
$("input").focus();
}
});