请你能帮助我我有下面的JavaScript代码一切正常,罚款电子邮件验证工作正常,但当访问者输入电子邮件地址并点击注册按钮确认消息'你会通知我们最新的活动!'没有出现。电子邮件提交按钮后的JavaScript/Php没有回应
$(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-\.][email protected]([\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);
}
});
});
你可以给我的代码请 –
也即时通讯仍然学习编码可以请给我的代码,它应该去哪里? –