Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 177135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T14:00:02+00:00 2026-05-11T14:00:02+00:00

Just trying to crate a simple comment form on a blog. I want to

  • 0

Just trying to crate a simple comment form on a blog. I want to load the user’s gravatar (using jQuery) when he/she writes this in the email box.

How can I do that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T14:00:03+00:00Added an answer on May 11, 2026 at 2:00 pm

    The gravatar url looks like this:

    http://www.gravatar.com/avatar/<md5hashofemail> 

    Here are the rest of the options for the URL.

    So all you’re going to have to do is include a function called md5 that returns the md5 hash of the user’s email. There are many online that do this, but I believe https://github.com/blueimp/JavaScript-MD5/blob/master/README.md works well. After that, just do:

    // get the email var email = $('#email').val(); // -- maybe validate the email?   // create a new image with the src pointing to the user's gravatar var gravatar = $('<img>').attr({src: 'http://www.gravatar.com/avatar/' + md5(email)}); // append this new image to some div, or whatever $('#my_whatever').append(gravatar);  // OR, simply modify the source of an image already on the page $('#image').attr('src', 'http://www.gravatar.com/avatar/' + md5(email)); 

    I thought this was obvious, but I will add it for posterity’s sake:

    If user emails are private and you’re showing this ala-stackoverflow in a listing, you are probably better off encoding the email on the server so that user emails are not publicly visible if you look at the source.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create a simple ajax chat using JQuery and ASP.NET. My
I'm trying to create a very simple REST server. I just have a test
This is just a simple question. I was trying to create a new object
I'm trying using ElasticSearch with Codeigniter framework. What i did is just install ElasticSearch
I am just trying to create the XML use XML::Simple; my %element = (
I have just started learning Qt and I am trying to create a simple
I am trying to create a simple user maintenance page for a school project.
I'm trying just to create a simple gradient with a label on it that
I'm just trying to create a simple menu. So when you click a link,
I'm just trying to create a simple broadcast in Androids activity but its not

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.