jquery中用$.ajax实现注册(html、jquery、php、接口文档)、ajax验证用户提交数据

网络上有很多用ajax实现前后台调用数据的例子,但是好多没有后台文件,这样让初学者学习的时候感觉很无助,不知道后台文件是什么样的,更不会写后台文件,所以今天整理一份前端html(jquery)、php文件及接口文档的例子

html文件需要放到服务器(WWW)下,register.php和registerCode.php文件只需要和html文件同级目录即可,接口文档即后台人员给前端人员的参考文档

主要用到jquery中的$.ajax()方法,验证的内容比较简单,大神们勿喷,仅帮助初学者更深刻的了解ajax使用方法

<!doctype html>

<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        ul{
            list-style: none;
        }
        ul li{
            line-height: 40px;
        }
        .tips{
            margin-top: 30px;
        }
        .tips>p{
            width: 300px;
            background: red;
            text-align: center;
            line-height: 40px;
            color:#fff;
            display: none;
        }
        #verity,#submit{
            width: 120px;
            line-height: 40px;
            background: red;
            color: #fff;
            border: none;
            border-radius: 5px;
        }
        input{
            outline: none;
        }
        input.disabled{
            background: #ccc !important;
        }
    </style>
</head>
<body>
<div class="register">
    <ul>
        <li>
            <label for="username">用户名:</label>
            <input type="text" id="username" />
        </li>
        <li>
            <label for="pass">密码:</label>
            <input type="password" id="pass"/>
        </li>
        <li>
            <label for="repass">确认密码:</label>
            <input type="password" id="repass"/>
        </li>
        <li>
            <label for="mobile">手机号:</label>
            <input type="text" id="mobile"/>
        </li>
        <li>
            <label for="code">验证码:</label>
            <input type="text" id="code"/>
            <input type="button" value="获取验证码" id&
  • 2
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值