- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
/**************************************************
BRITEVERIFY EMAIL VERIFICATION
***************************************************/
function verify_real_email(email, success_callback, failure_callback){
// make sure all parameters are used
if(!email || !success_callback || !failure_callback){
return;
}
// if request isn't found in 2 sec or less, move on without it
var max_wait_seconds = 2;
window.briteverify_timeout_finished_first = false;
window.briteverify_api_finished_first = false;
setTimeout(function(){
if(!window.briteverify_api_finished_first){
window.briteverify_timeout_finished_first = true;
success_callback && success_callback();
}
}, max_wait_seconds*1000);
// hit briteverify api (https://support.briteverify.com/javascript-api)
var data = {
username: 'pestes',
address: email
};
var url = 'https://bpi.briteverify.com/emails.json';
$.get(url, data, function (results) {
if(!window.briteverify_timeout_finished_first && results && results.status){
window.briteverify_api_finished_first = true;
if(results.status==='invalid'){
failure_callback && failure_callback();
}
else{
success_callback && success_callback();
}
}
},'jsonp');
}