-
Notifications
You must be signed in to change notification settings - Fork 0
/
t_creatpaper.html
96 lines (93 loc) · 2.89 KB
/
t_creatpaper.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>创建题库</title>
<link href="css/mui.min.css" rel="stylesheet" />
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="stylesheet" href="css/mui.min.css">
<!--App自定义的css-->
<link rel="stylesheet" type="text/css" href="css/app.css"/>
<link href="css/iconfont.css" rel="stylesheet"/>
<script type="text/javascript" src="js/jquery-3.2.1.min.js"></script>
<script src="js/tool.js"></script>
<script src="js/mui.min.js"></script>
<style>
.mui-content {
margin-top: 25px;
}
.finish_btn{
margin-top: 20px;
text-align: center;
}
#creatPaper{
width:80%;
margin:0;
-webkit-border-radius:.3em;
-moz-border-radius: .3em;
border:#1263be solid 1px;
background-color: #29C4B5;
color:#FFF;
font-size:17px;
font-weight:bolder;
letter-spacing:1em;
}
</style>
</head>
<body>
<header class="mui-bar mui-bar-nav">
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
<h1 class="mui-title">创建题库</h1>
</header>
<div class="mui-content">
<form id='login-form' class="mui-input-group">
<div class="mui-input-row">
<label>标题</label>
<input id='title' type="text" class="mui-input-clear mui-input">
</div>
<div class="mui-input-row" style="height: 120px;">
<label>简介</label>
<textarea id="brief" rows="5" class="mui-input-clear mui-input"></textarea>
</div>
</form>
<div class="finish_btn">
<button id='creatPaper'>完成</button>
</div>
</div>
<script>
var userid = GetUseridCookie().get("userid");
if(userid=='undefined'){
alert("登录过期,请重新登录!");
javascript:window.location.href="login.html"
}
var title = document.getElementById("title");
var brief = document.getElementById("brief");
var creat = document.getElementById("creatPaper");
creat.onclick = function() {
mui.ajax('http://'+url+'/jizhibackend/servlet/CreateNewPaperServlet',{
data:
{
userid:userid,
title:title.value,
description:brief.value,
},
xhrFields: {
withCredentials: true
},
crossDomain: true,
dataType: 'json', //服务器返回json格式数据
type: 'post', //HTTP请求类型
timeout: 10000, //超时时间设置为10秒;
async: false,//同步
headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' },
success: function(data) {
alert("创建试卷成功!");
window.location.href="tiku.html";
}
});
}
</script>
</body>
</html>