forked from YvetteLau/Blog
-
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
4 changed files
with
80 additions
and
12 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
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
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,60 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | ||
<link rel="stylesheet" href="/node_modules/bootstrap/dist/css/bootstrap.min.css" /> | ||
<title>Document</title> | ||
</head> | ||
|
||
<body> | ||
<div class="container"> | ||
<div class="row"> | ||
<div class="col-md-12 col-lg-12"> | ||
<div class="col-md-6 col-md-offset-3 col-lg-6 col-lg-offset-3"> | ||
<div class="panel panel-info" style="margin-top:50px;"> | ||
<div class="panel-heading"> | ||
<h3>评论列表</h3> | ||
</div> | ||
<div class="panel-body"> | ||
<form onsubmit="return false"> | ||
<div class="form-group"> | ||
<label for="comments">输入评论</label> | ||
<input class="form-control" type="text" id="comments" /> | ||
</div> | ||
<div class="form-group"> | ||
<input class="btn btn-danger" type="button" id="attck" value="会被攻击" /> | ||
<input class="btn btn-primary" type="button" id="security" value="我很安全" /> | ||
</div> | ||
</form> | ||
<ul class="list-group"> | ||
|
||
</ul> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</body> | ||
<script src="/node_modules/jquery/dist/jquery.js"></script> | ||
<script> | ||
$('#attck').click(function() { | ||
let commend = $('#comments').val(); | ||
//没有对输入内容进行过滤 | ||
if($.trim(commend)) { | ||
$('.list-group').text(`<li class="list-group-item">${commend}</li>`); | ||
} | ||
}); | ||
|
||
$('#security').click(function() { | ||
let commend = $('#comments').val(); | ||
//对输入内容进行转义 | ||
if($.trim(commend)) { | ||
$('.list-group').append(`<li class="list-group-item">${commend}</li>`); | ||
} | ||
}); | ||
</script> | ||
</html> |
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