Skip to content

Commit

Permalink
#2 提交实验代码
Browse files Browse the repository at this point in the history
  • Loading branch information
HurricanGod committed Oct 8, 2016
1 parent 1eab470 commit 13aae92
Show file tree
Hide file tree
Showing 3 changed files with 299 additions and 0 deletions.
109 changes: 109 additions & 0 deletions labs/1414080902225/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>欢迎登录</title>

<!-- 新 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.0/css/bootstrap.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>
<style type="text/css">
/*#main:target{animation:slide 3s;}
@keyframes slide{
0%{
transform:translateZ(300px) ratateZ(120deg);
}
50%{
transform:translateZ(-300px) ratateZ(120deg);

}
100%{
transform:translateZ(0px) ratateZ(120deg);
border-radius: 10%;
}
}*/
</style>
</head>


<body>
<nav class="navbar navbar-inverse" role="navigation">
</nav>

<div class="container-fluid" id="main">
<div class="col-md-2 "></div>
<div class="col-md-8 bg-success" >
<br>
<br>
<br>
<form class="form-horizontal " role="form" method="post" action="message.html" >
<div class="form-group">
<label class="col-md-2 control-label" for="userName">UserName:</label>
<div class="col-md-4">
<input type="text" id="userName" class="form-control" placeholder="Hurrican">
</div>
</div>


<div class="form-group">
<label class="col-md-2 control-label" for="pwd">Password:</label>
<div class="col-md-4">
<input type="password" id="pwd" class="form-control" placeholder="*********">
</div>
</div>


<div class="form-group">
<div class="col-md-offset-4 col-md-8" >
<div class="checkbox">
<label>
<input type="checkbox" >Remember me
</label>
</div>
</div>
</div>


<div class="col-md-offset-4">
<div class="btn-group">
<input type="button" class="btn btn-success" value="Register" id="login" onclick="return chkform()">
<input type="reset" class="btn btn-warning" value="Reset" >
</div>
</div>
</form>
</div>
<div class="col-md-2 "></div>
<div class="col-md-12 "></div>
</div>

<script type="text/javascript">

var checkUserName=document.getElementById("userName");
var checkUserPwd=document.getElementById("pwd");
var submit=document.getElementById("login");

function chkform()
{
if(checkUserName.value=="")
{
alert("用户名不能为空!");
return false;
}

if(checkUserPwd.value=="")
{
alert("密码不能为空!");
return false;
}
self.location='message.html';

};
</script>

</body>
</html>
179 changes: 179 additions & 0 deletions labs/1414080902225/message.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>成绩填写</title>
<script src="js/jquery-1.7.1.min.js"></script>

<link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.0/css/bootstrap.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>

</head>
<body>

<nav class="navbar navbar-inverse" role="navigation">
<div class="container-fluid">
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="active"><a href="#">首页</a></li>

<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">详情 <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="#">精神文明</a></li>
<li><a href="#">技术水平</a></li>
<li><a href="#">社会实践</a></li>
<li class="divider"></li>
<li><a href="#">帮助</a></li>
<li class="divider"></li>
<li><a href="#">关于我们</a></li>
</ul>
</li>
</ul>
</div>
</div>
</nav>

<ol class="breadcrumb">
<li><a href="#">主页</a></li>
<li><a href="#">个人</a></li>
<li class="active">成绩</li>
</ol>

<div class="container-fluid">
<div class="col-md-2 "></div>
<div class="col-md-8 bg-success">
<h2><span class="label label-primary col-md-offset-5">成绩</span></h2>
<hr>
<form class="form-horizontal" role="form" method="post" action="">

<div class="form-group">
<label for="subject4" class="col-md-4 control-label">离散数学</label>
<div class="col-md-4">
<input type="text" class="form-control" id="subject4" >
</div>
</div>


<div class="form-group">
<label for="subject6" class="col-md-4 control-label">汇编语言</label>
<div class="col-md-4">
<input type="text" class="form-control" id="subject6" >
</div>
</div>

<div class="form-group">
<label for="subject2" class="col-md-4 control-label">大学英语4</label>
<div class="col-md-4">
<input type="text" class="form-control" id="subject2" >
</div>
</div>

<div class="form-group">
<label for="subject3" class="col-md-4 control-label">公共体育4</label>
<div class="col-md-4">
<input type="text" class="form-control" id="subject3" >
</div>
</div>

<div class="form-group">
<label for="subject8" class="col-md-4 control-label">数据库系统概论</label>
<div class="col-md-4">
<input type="text" class="form-control" id="subject8" >
</div>
</div>

<div class="form-group">
<label for="subject5" class="col-md-4 control-label">计算机组成原理</label>
<div class="col-md-4">
<input type="text" class="form-control" id="subject5" >
</div>
</div>

<div class="form-group">
<label for="subject7" class="col-md-4 control-label">马克思主义基本原理</label>
<div class="col-md-4">
<input type="text" class="form-control" id="subject7" >
</div>
</div>

<div class="form-group">
<label for="subject1" class="col-md-4 control-label">数据库系统课程设计</label>
<div class="col-md-4">
<input type="text" class="form-control" id="subject1" >
</div>
</div>

<div class="form-group" id="s">

<div class="col-md-offset-7" id="sub">
<input type="button" class="btn btn-success" value="完成" id="subm">
</div>
</div>
</form>
</div>
<div class="col-md-2 "></div>
<div class="col-md-12 "></div>
</div>

<script>
$(document).ready(function() {

var data={};
$("#subm").click(function(){

if($("#subject1").val()!="" && $("#subject2").val()!="" && $("#subject3").val()!="" && $("#subject4").val()!="" && $("#subject5").val()!="" && $("#subject5").val()!="" && $("#subject7").val()!="" && $("#subject8").val()!="")
{
var result="保存成绩:\n"+"离散数学:"+$("#subject4").val()+"\n汇编语言:"+$("#subject6").val()+
"\n大学英语4:"+$("#subject2").val()+"\n公共体育4:"+$("#subject3").val()+
"\n数据库系统概论:"+$("#subject8").val()+"\n计算机组成原理:"+$("#subject5").val()+
"\n马克思主义基本原理:"+$("#subject7").val()+"\n数据库系统课程设计:"+$("#subject1").val();
alert(result);
}

else
{
alert("成绩不允许有空!");

}




})
});


$.ajax(
{
type: "POST",
url: "success.json",
data: {name:"John", location: "Boston"}

}).done(function( subject1 )
{
$("#subject4").val(String (subject1["subject1"]));
$("#subject6").val(String (subject1["subject2"]));
$("#subject2").val(String (subject1["subject3"]));
$("#subject3").val(String (subject1["subject4"]));
$("#subject8").val(String (subject1["subject5"]));
$("#subject5").val(String (subject1["subject6"]));
$("#subject7").val(String (subject1["subject7"]));
$("#subject1").val(String (subject1["subject8"]));

alert( "保存成绩:\n "+
"离散数学:"+subject1["subject1"]+"\n汇编语言:"+subject1["subject2"]+
"\n大学英语4:"+subject1["subject3"]+"\n公共体育4:"+subject1["subject4"]+
"\n数据库系统概论:"+subject1["subject5"]+"\n计算机组成原理:"+subject1["subject6"]+
"\n马克思主义基本原理:"+subject1["subject7"]+"\n数据库系统课程设计:"+subject1["subject8"]
);
});
</script>

</body>
</html>
11 changes: 11 additions & 0 deletions labs/1414080902225/success.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"subject1":"80",
"subject2":"90",
"subject3":"70",
"subject4":"88",
"subject5":"86",
"subject6":"87",
"subject7":"90",
"subject8":"86"

}

0 comments on commit 13aae92

Please sign in to comment.