嗨,我正在使用 jquery 表单帖子。当我发布表单时,它在 IE 中运行良好,但不适用于 Chrome。我把代码放在这里:
$(document).ready(function(){
$('#signup').submit(function(){
var username = $('#username').val();
var password = $('#password').val();
var cpassword = $('#cpassword').val();
var email = $('#email').val();
if(password != cpassword){
alert("Passwords are not equal");
$('#cpassword').css('border','1px solid red');
}else{
$.ajax({
type :'post',
url :'http://localhost/tmc/includes/ajax-signup.php',
data :({password:password,username:username,email:email}),
success : function(msg){
alert(msg);
},
});
}
//$("#submit").hide();
});
});