Skip to content

Commit

Permalink
hzuapps#2 提交实验代码
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown committed Oct 7, 2016
1 parent b06b27d commit c011ea4
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
39 changes: 39 additions & 0 deletions labs/1414080902210/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!DOCTYPE html>
<html>
<link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.0/css/bootstrap.min.css">

<script src="http://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script>

<script src="http://cdn.bootcss.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>

<script type="index.js"></script>
<head>
<title>表单</title>
<meta charset = "utf-8">

</head>
<body>
<form role="form">
<div class="form-group">
<label for="exampleInputEmail1" >Email address</label>
<input type="email" class="form-control" id="exampleInputEmail1" placeholder="Enter email">
</div>
<div class="form-group">
<label for="exampleInputPassword1" >Password</label>
<input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password">
</div>
<div class="form-group">
<label for="exampleInputFile" >File input</label>
<input type="file" id="exampleInputFile">
<p class="help-block">Example block-level help text here.</p>
</div>
<div class="checkbox">
<label >
<input type="checkbox"> Check me out
</label>
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>

</body>
</html>
13 changes: 13 additions & 0 deletions labs/1414080902210/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
$( "#target" ).submit(function( event ) {
alert( "Handler for .submit() called." );
event.preventDefault();
});

$.ajax({
url: "success.json"
}).done(function(data) {
if ( console && console.log ) {
console.dir(data);
alert(data.msg);
}
});
3 changes: 3 additions & 0 deletions labs/1414080902210/success.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"msg": "保存成功!"
}

0 comments on commit c011ea4

Please sign in to comment.