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

  • SEARCH
  • Home
  • 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 7793447
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:29:27+00:00 2026-06-01T22:29:27+00:00

SOLVED Mailcheck uses the on method, which isn’t available in the outdated version of

  • 0

SOLVED

Mailcheck uses the “on” method, which isn’t available in the outdated version of JQuery that I was using. THANK YOU TO KUFI AND MARTIN.

I’m a beginner at Javascript/Jquery, and I am stuck trying to get this to work.

I have a working form on my website, where I would like to add this client-side spell-check for popular email domains. The id of the text field for the email address is simply “Email”, so I have made this little change (capital E).

So my code looks like this… with some test statements.

<script>
document.write("test0");
document.getElementById('testspan').innerHTML = 'test3';

var domains = ['hotmail.com', 'gmail.com', 'aol.com'];
$('#Email').on('blur', function() {
  $(this).mailcheck({
    domains: domains,   // optional

    suggested: function(element, suggestion) {
      // callback code
      document.getElementById('testspan').innerHTML = 'test4';
      document.write("test1");
    },

    empty: function(element) {
      // callback code
      document.write("test2");
    }

  });
});
</script>

The text “test0test3” does appear as expected, similar to what would happen if I did a PHP echo.

But nothing visibly happens when focus leaves the my email textbox.

I don’t know if I have given enough detail for someone to identify where I’ve gone wrong…

I don’t really understand what I am supposed to write in the place marked “//callback code”. Do I need to manually provide the code that would make the “Did you mean …” text appear as in their screenshot? enter image description here

Thank you, Kufi and Martin.
I have followed Kufi’s code, and also inserted

<span id="suggestedEmail"></span> 

after the email text input element. But nothing happens. Could someone suggest a suitable test statement I can write inside the callback function to definitively find out whether the code path is being exercised or not. I have a feeling it isn’t.

UPDATE 3

Thank you again Kufi and Martin,

I have not been able to get it to work, even after making a minimal .HTML file for testing… I feel that now, someone would be able to spot the error I have made.
Here is the entirety of my test file.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Testing mailcheck</title>
<script type="text/javascript" src="js/jquery-1.3.2.js"></script>
<script type="text/javascript" src="js/jquery.mailcheck.js"></script>
</head>

<body>

<form id="form1" name="form1" method="post" action="contactus_mail.php">
 Name: <input name="name" type="text" id="name" size="30"  /> </br>
 Email: <input name="email" type="text" id="email" size="30" />  <span id="suggestedEmail"></span> </br>
 Subject: <input name="subject" type="text" id="subject" size="72" value="" /> </br>
 <input name="Submit" type="submit" value="Submit"/>
</form>

</br>
<span id="testspan1"></span>
</br>
<span id="testspan2"></span>
</br>

<script type="text/javascript">
$("#testspan1").html("test1");
$(function() {
var domains = ['hotmail.com', 'gmail.com', 'live.com', 'yahoo.com'];
 $("#email").on('blur', function() {
  $(this).mailcheck({
    domains: domains,   // optional
    suggested: function(element, suggestion) {
      // callback code
      $("#suggestedEmail").html("Did you mean " + suggestion.full);
    },
    empty: function(element) {
      // callback code
      document.write("empty was called");
    }
  });
 });
});
$("#testspan2").html("test2");
</script>

</body>
</html>

Is there anything I have to check besides the reachability of the two external JS files? Jquery versions?

SOLVED!

I was getting:

Uncaught TypeError: Object #<Object> has no method 'on'

at the line that looks like:

$("#email").on('blur', function() {

This went away when I switched from using JQuery 1.3.2 to the current 1.7.2.

  • 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. Editorial Team
    Editorial Team
    2026-06-01T22:29:29+00:00Added an answer on June 1, 2026 at 10:29 pm

    As I see it you have to write your own visual feedback as it is stated in their documentation:

    “You can use the callbacks to display the appropriate visual feedback to the user.” (Chapter “Usage” at the bottom).

    So you need something like this to show the suggested email:

    suggested: function(element, suggestion) {
        $("#suggestedEmail").html("Did you mean " + suggestion.full);
    }
    

    Edit:
    To your updated question. Here is a working jsfiddle. If the posted javascriptcode is the actually used code you need to surround it with $(function() { //your code here });

    This code should work:

    $(function() {
        var domains = ['hotmail.com', 'gmail.com', 'aol.com'];
        $('#Email').on('blur', function() {
          $(this).mailcheck({
            domains: domains,   // optional
    
            suggested: function(element, suggestion) {
                $("#suggestedEmail").html("Did you mean " + suggestion.full);
            },
            empty: function(element) {
              document.write("test2");
            }
          });
        });
    });
    

    The $(function() { ... }); needs to be used so that the code inside is is executed after the whole page has been loaded.

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

Sidebar

Related Questions

SOLVED: Im was using the method 'clear_helpers' in ApplicationController, so it was blocking Devise
Solved: I'm using WCF to transfer files by streaming. The client calls a method
SOLVED: As it turns out, my problem was rooted in the fact that I
SOLVED! Used this example from php.net post method handling multiple uploads, with the knowledge
SOLVED VERSION Ok so here it is. I am not even sure how to
SOLVED: See my solution below! using aspx with C# code behind. I have the
- Solved - I Know they exist, but I haven't found a slider that
SOLVED - see Bish below I've got a list of checkboxes that all dump
SOLVED: See my answer below I'm experiencing the same issue that Austin Hyde experienced
SOLVED: There was a stupid mistake which caused this problem. In header.php i wrote

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.