后台AJAX提交
$.post($("#registform").attr("action"), $("#registform").serialize(), function(result) {
if(result.success) {
layer.msg("注册成功!");
setInterval("window.location.href = '/';", 1000);
return ;
}
layer.msg("注册失败!", result.failedMessage);
});
本文介绍了一种利用AJAX技术实现用户注册功能的方法。通过使用jQuery库中的.post方法发送表单数据到服务器,并根据服务器返回的结果显示相应的消息。如果注册成功,则会提示并跳转至首页。
629

被折叠的 条评论
为什么被折叠?



