如何防止用户发送垃圾邮件?比如,如果用户一次又一次地快速输入评论,如何防止他?
HTML:
<p>
<a href="javascript:void(0);" class="add_more">Add More</a>
</p>
<table border="0" width="500" cellspacing="0">
<tbody class="append_data"></tbody>
<tr>
<td>
<textarea name="description" id="description"></textarea>
</td>
</tr>
</table>
CSS:
#description{
width:400px;
}
.description_text{
border:#333333 solid 1px;
width:400px !important;
}
.append_data{
white-space: pre-wrap; /* CSS3 */
white-space: -moz-pre-wrap; /* Firefox */
white-space: -pre-wrap; /* Opera <7 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* IE */
}
jQuery:
$('.add_more').click(function(){
var description = $('#description').val();
$(".append_data").append('<div class="description_text">'+description+'</div><br><br>');
});