‘);
$(‘.status’).css(‘display’, ‘flex’);
var registeringemail = $(‘#email_address’).val();
if (registeringemail == ”) {
$(‘.form-messages’).html(“Please enter your email address.”);
setTimeout(function() {
$(‘.status’).css(‘display’, ‘none’);
}, 2000);
} else {
if( Inc.Utilities.isValidEmailAddress(registeringemail) ) {
$.ajax({
type: “POST”,
data:{“formType”: “HomepageNews”, “email”: registeringemail, “country”:pageInfo.geo.countryname},
url:”/rest/newhomenewsletters”,
success:function(params) {
if(params.overallstatus == “OK”){
$(‘.form-messages’).html(“Thank you for signing up for Inc. Must Reads!”);
setTimeout(function() {
$(‘.status’).css(‘display’, ‘none’);
$(‘#newsletter-flyin’).removeClass(‘show’);
document.cookie = “incNewsletterFlyinCompleted=true; expires=Fri, 1 Jan 2100 00:00:00 UTC; path=/”;
}, 2000);
} else {
$(‘.form-messages’).html(“Something went wrong…”);
setTimeout(function() {
$(‘.status’).css(‘display’, ‘none’);
}, 2000);
}
}
});
} else {
$(‘.form-messages’).html(“Please enter a valid email address”);
setTimeout(function() {
$(‘.status’).css(‘display’, ‘none’);
}, 2000);
}
}
return false;
});
});