Comment.comment_init() 26 27 // ajax 提交评论实现方法 28 29 // 阻止默认事件 30 const form = document.getElementById('comment-form 31 form.addEventListener('submit', function (e) { 32 e.preventDefault(); 33 post_by_ajax(e, '#comment-form document.querySelector('#comment-form #author')) { 55 const text = commentForm.querySelector('#text
, "博主每天都有些折腾记录,欢迎前往他的小窝阅读~"], "custom": [ {"selector": ".comment-form", "
Cancel
当然上面最终的参数传递也可以自己手动评论并用抓包软件抓取,不过通过查看 commetn.js 文件也给我的自动化评论提供了方向,其中有一个 load_comment_form() 方法,是用来加载comment-form
>" id="comment-form" role="form"> <?php if($this->user->hasLogin()): ?
document.addEventListener('DOMContentLoaded', function() { // 添加评论功能 const commentForm = document.getElementById('comment-form
自动化 当然上面最终的参数传递也可以自己手动评论并用抓包软件抓取,不过通过查看 commetn.js 文件也给我的自动化评论提供了方向,其中有一个 load_comment_form() 方法,是用来加载comment-form
heading-3">Post a Comment
>" id="comment-form" role="form"> <?php if ($this->user->hasLogin()): ?
font-weight: 700; } .main .content { line-height: 1.5; } .main { .warning { font-weight: 700; } .comment-form
comment-list', comments = '.comment-num', comment_reply = '.comment-reply', comment_form = '#comment-form
删掉原来用于占位的 HTML 评论表单代码,即下面这段代码: <form action="#" method="post" class="<em>comment-form</em>"> <div class="row --> </form> 替换成如下的代码: <form action="{% url 'comments:post_comment' post.pk %}" method="post" class="<em>comment-form</em>
p> {% endfor %}
ease-in-out .15s; transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s; } .comment-form
删掉原来用于占位的 HTML 评论表单代码,即下面这段代码: <form action="#" method="post" class="<em>comment-form</em>"> <div class="row --> </form> 替换成如下的代码: <form action="{% url 'comments:post_comment' post.pk %}" method="post" class="<em>comment-form</em>
-- 评论表单 -->
obj.offsetLeft + 1 + 'px'; }, 30); } 灵感:写个Typecho评论框动画 var form = document.querySelector('#comment-form
删掉原来用于占位的 HTML 评论表单代码,即下面这段代码: <form action="#" method="post" class="<em>comment-form</em>"> <div class="row --> </form> 替换成如下的代码: <form action="{% url 'comments:post_comment' post.pk %}" method="post" class="<em>comment-form</em>
对于聊天室列表页面: {% if can_create %} <form action="{{ url_for('main.create_room') }}" method="POST" class="<em>comment-form</em>
--留言表单--><divclass="<em>comment-form</em>">