首页 > 代码库 > JQ 无刷新评论

JQ 无刷新评论

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>

<script src="http://www.mamicode.com/Scripts/jquery-1.4.1.js" type="text/javascript"></script>
<script type ="text/javascript" >
$(function() {
$("#btnOk").click(function() {
var title = $("#title").val();
var tbBody = $("#tbBody").val();
var tb = $("<tr><td>" + title + "</td><td>" + tbBody + "</td></tr>");
$("#tbContent").append(tb);
$("#title").val("");
$("#tbBody").val("");
});
});
</script>
</head>
<body>
<p id="tbContent">
第一个帖子:随碟附送地方</p>
<table >
<tr>
<td>
<input type="text" id="title" />
</td>
<td >
<input type ="text" id ="tbBody" /><input type ="button" id ="btnOk" value ="http://www.mamicode.com/确定" />
</td>
</tr>
</table>
</body>
</html>