forked from hzuapps/java-web
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
82 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%> | ||
<% | ||
String path = request.getContextPath(); | ||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; | ||
%> | ||
|
||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> | ||
<html> | ||
<head> | ||
<base href="<%=basePath%>"> | ||
|
||
<title>My JSP 'index.jsp' starting page</title> | ||
<meta http-equiv="pragma" content="no-cache"> | ||
<meta http-equiv="cache-control" content="no-cache"> | ||
<meta http-equiv="expires" content="0"> | ||
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> | ||
<meta http-equiv="description" content="This is my page"> | ||
<!-- | ||
<link rel="stylesheet" type="text/css" href="styles.css"> | ||
--> | ||
|
||
<!-- 新 Bootstrap 核心 CSS 文件 --> | ||
<link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.0/css/bootstrap.min.css"> | ||
|
||
<!-- 可选的Bootstrap主题文件(一般不用引入) --> | ||
<link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.0/css/bootstrap-theme.min.css"> | ||
|
||
<!-- jQuery文件。务必在bootstrap.min.js 之前引入 --> | ||
<script src="http://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script> | ||
|
||
<!-- 最新的 Bootstrap 核心 JavaScript 文件 --> | ||
<script src="http://cdn.bootcss.com/bootstrap/3.3.0/js/bootstrap.min.js"></script> | ||
|
||
<script> | ||
function submitClick(){ | ||
var xuehao =$("#xuehao").val(); | ||
var password =$("#password").val() | ||
if(xuehao==null||xuehao==undefined||xuehao==''){ | ||
alert("account is't null"); | ||
return ; | ||
} | ||
if(password==null||password==undefined||password==''){ | ||
alert("password is't null"); | ||
return ; | ||
} | ||
$.getJSON('success.json', function(data){ | ||
alert(data.msg); | ||
$("#myModal").hide(); | ||
}); | ||
} | ||
</script> | ||
</head> | ||
|
||
<body> | ||
|
||
<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal"> | ||
login in | ||
</button> | ||
|
||
<!-- Modal --> | ||
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> | ||
<div class="modal-dialog"> | ||
<div class="modal-content"> | ||
<div class="modal-header"> | ||
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> | ||
<h4 class="modal-title" id="myModalLabel">Modal title</h4> | ||
</div> | ||
<div class="modal-body"> | ||
account:<input type="text" id="xuehao" name="xuehao" /> | ||
password:<input type="password" id="password" name=""password"" /> | ||
</div> | ||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button> | ||
<button type="button" id="submit1" onclick="submitClick()" class="btn btn-primary">login</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |