我有下面的代碼,其在一定按下按鈕,應驗證一個電子郵件地址(這個功能已經工作),然後應該嘗試發佈自己的狀態,如果它返回「錯誤」,它應該顯示一個錯誤。我想我在某處混合了PHP和JS。找不到這個jQuery代碼的bug
$('#recoverSub').live('click',function() {
$("#recoverPost").validate({
rules: {
recoverField: {
email: true
}
},
messages:{
recoverField: {
email: "Not a valid email."
}
}
});
if($("#recoverPost").valid())
{
$.post('php/recoverPost.php', $('#recoverPost').serialize(), function(){
function(data) {
if(data != "Error")
{
$('#recoverPost').hide();
$('#success').show();
}
else
{
echo "This email is not in our records.";
}
}
});
}
});
那麼哪部分不工作? – BrokenGlass 2011-03-26 20:26:29