返回 验证邮箱是否合...... 登陆

验证邮箱是否合法

文昌 2019-03-05 17:43:43 264
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Ajax-注册验证</title>
</head>
<body>
<p>邮箱: <input type="text"></p>
<p>密码: <input type="password"></p>
<p><button>提交</button></p>
</body>
<script type="text/javascript" src="js/jquery-3.3.1.js"></script>
<script type="text/javascript">
//当失去焦点时进行验证
$(':input').blur(function() {
$.ajax({
//请求
url: 'regsever.php',
//请求类型
type: 'GET',
//转化为json格式
data: $('form:first').serializeArray(),
//回调
success: function(msg, status, xhr) {
// console.log(msg)
$('p span').empty()
$('p').append($(msg)).css('font-size', '1.5em')
}
})
})
$('button:first').click(function() {
alert("恭喜您:注册成功!")
})
</script>
</html>


最新手记推荐

• 用composer安装thinkphp框架的步骤 • 省市区接口说明 • 用thinkphp,后台新增栏目 • 管理员添加编辑删除 • 管理员添加编辑删除

全部回复(0)我要回复

暂无评论~
  • 取消 回复 发送
  • PHP中文网