wow
This commit is contained in:
+38
@@ -0,0 +1,38 @@
|
||||
<html>
|
||||
<head>
|
||||
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
|
||||
<script src="../src/mailcheck.js"></script>
|
||||
<title>Mailcheck</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Mailcheck</h1>
|
||||
<p>For a demo, enter [email protected] or [email protected] in the field below:</p>
|
||||
<input id="email" name="email" type="email" />
|
||||
<input name="Submit" type="submit" />
|
||||
<p id="suggestion"></p>
|
||||
|
||||
<script>
|
||||
var domains = ['hotmail.com', 'gmail.com', 'aol.com'];
|
||||
var topLevelDomains = ["com", "net", "org"];
|
||||
|
||||
$('#email').on('blur', function(event) {
|
||||
console.log("event ", event);
|
||||
console.log("this ", $(this));
|
||||
$(this).mailcheck({
|
||||
domains: domains, // optional
|
||||
topLevelDomains: topLevelDomains, // optional
|
||||
suggested: function(element, suggestion) {
|
||||
// callback code
|
||||
console.log("suggestion ", suggestion.full);
|
||||
$('#suggestion').html("Did you mean <b><i>" + suggestion.full + "</b></i>?");
|
||||
},
|
||||
empty: function(element) {
|
||||
// callback code
|
||||
$('#suggestion').html('No Suggestions :(');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user