请你能帮我我有下面的javascript代码一切正常电子邮件验证工作正常但是当访问者在那里输入电子邮件地址并单击注册按钮时,确认消息“您将收到我们最新活动的通知!” 没有出现。
$(document).ready(function(){
//Bind JavaScript event on SignUp Button
$('#submitbtn').click(function(){
signUp($('#email').val());
});
var signUp = function(inputEmail)
{
var isValid = true;
var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
if(!emailReg.test(inputEmail)){
isValid = false;
alert('Your email is not in valid format');
}
if(isValid){
var params = {
'action' : 'SignUp',
'email' : inputEmail
};
$.ajax({
type: "POST",
url: "scripts/mail.php",
data: params,
success: function(response){
if(response){
var responseObj = jQuery.parseJSON(response);
if(responseObj.ResponseData)
{
$('#submitbtn').val('');
showMessage('You will be notified with our latest events!');
}
}
}
});
}
};
var mousedownHappened = false;
$("#submitbtn").mousedown(function() {
mousedownHappened = true;
});
$("#email").focus(function(){
$(this).animate({
opacity: 1.0,
width: '250px'
}, 300, function(){
// callback method empty
});
// display submit button
$("#submitbtn").fadeIn(300);
});
$("#email").blur(function(){
if(mousedownHappened) {
// reset mousedown and cancel fading effect
mousedownHappened = false;
} else {
$("#email").animate({
opacity: 0.75,
width: '250px'
}, 500, function(){
// callback method empty
});
// hide submit button
$("#submitbtn").fadeOut(400);
}
});
});