$.post系统登录校验
AJAX方式:$.post系统登录校验
https://blog.csdn.net/woshisangsang/article/details/66560238?utm_source=blogxgwz5
<script type="text/javascript">
function login(){
var userId=$("#userId").val();
var userPassword=$("#userPassword").val();
if(userId===""||userPassword===""){
$.messager.alert('提示','员工编号及密码不能为空!','info');
return false;
}
$.post("/BankStatistics/LoginServlet?ran='+Math.random()",
{userId:userId,userPassword:userPassword},
function(data){
var result = eval('('+data+')');
if (result.success===true){
window.location.href="main.jsp";
return true;
}
else{
$.messager.alert('提示','员工号或密码有误,请核准!','info');
return false;
}
}//function(data)
);//$.post
}//login()
</script>
随机推荐
- 【LeetCode】组合总和
[问题]给定一个无重复元素的数组 candidates 和一个目标数 target ,找出 candidates 中所有可以使数字和为 target 的组合. candidates 中的数字可以无限制 ...
- Sql server 表表达式
1.表表达式概述 (1)表表达式(table expression) 是一个命名的查询表达式.代表一个有效的关系表 (2)在DML 中,使用表表达式和使用其他表非常类似 (3)sqlserver 支持 ...
- ansible简单部署前端
pipeline{ agent any parameters { choice(name: 'server_name', choices: ['xx','xx'], description: 'ser ...
- Mybatis之配置文件
Mybatis_config.xml <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE conf ...
- [BJDCTF2020]Easy MD5
0x00 知识点 password='".md5($pass,true)."' 链接: https://www.jianshu.com/p/12125291f50d ffifdy ...
- mybatis+mysql 通过sql脚本生成mapper的部分内容
SQL mysql SELECT concat('<if test="', COLUMN_NAME, ' != null"> ', COLUMN_NAME, ',< ...
- Tensorflow学习教程------Fetch and Feed
#coding:utf-8 import tensorflow as tf #Fetch input1 = tf.constant(3.0) input2 = tf.constant(1.0) inp ...
- Spring Cloud Alibaba 教程 | 前世今生
Spring Cloud Alibaba是什么 先来看一下官方是怎么定义Spring Cloud Alibaba的: Spring Cloud Alibaba 致力于提供微服务开发的一站式解决方案.此 ...
- nodejs(16)使用express.static快速托管静态资源
const express = require('express') const app = express() // 步骤的拆解 const result = express.static('./v ...
- 通过实例说明在scrapy中 yield的作用
源https://www.jianshu.com/p/7c1a084853d8 开始前的准备工作: 1.MySQL下载:点我2.python MySQL驱动下载:pymysql(pyMySql,直接用 ...