1 <form onsubmit="return check_login()" style="text-align: center;margin-top:50px"> 2<input value="登 录" class="btn_submit" id="btn_submit" type="submit"> 3 </form>
1 .btn_submit {
2background-color: #e31436;
3color: #fff;
4cursor: pointer;
5display: inline-block;
6font-size: 18px;
7height: 44px;
8line-height: 44px;
9text-align: center;
10width: 200px;
11border-radius: 2px;
12border:none
13 }
14 .disabled{opacity: 0.5;cursor:default} 1 function check_login() {
2if ($("#btn_submit").hasClass("disabled"));//避免重复提交 3return false;
4$("#btn_submit").addClass("disabled").val("正在提交");
5$.post("login.php", {id: 1}, function(data) {
6 $("#btn_submit").removeClass("disabled").val("登 录");
7 location.href = "http://HdhCmsTestsucaihuo测试数据/php/2747.html";
8}, "json");
9return false;
10 }相关教程:PHP视频教程
以上就是怎样用php+ajax实现用户登录按钮加载的详细内容,更多请关注Gxl网其它相关文章!
查看更多关于怎样用php+ajax实现用户登录按钮加载的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://www.haodehen.cn/did62786