私はDjangoサイトを使用しています。これは本体に含まれているスクリプトです
$(document).ready(function(){
$(".comment-reply-btn").click(function(event){
event.preventDefault();
$(this).parent().next(".comment-reply").fadeToggle();
})
})
これは私のHTMLで
<blockquote>
<p>{{ comment.content }}</p>
<footer>by {{ comment.user }} , {{ comment.timestamp | timesince }} ago |
{% if comment.children.count > 0 %}{{ comment.children.count }} Comment {% endif %}
{% if comment.children.count > 1 %}s {% endif %} |<a class="comment-reply-btn" href="#"> Reply </a></footer>
<div class="comment-reply">
{% for child_comment in comment.children %}
<blockquote>
<p>— {{ child_comment.content }}</p>
<footer>by {{ child_comment.user }} , {{ child_comment.timestamp | timesince }}ago</footer>
<br>
</blockquote>
{% endfor %}
<form method="post" action=".">{% csrf_token %}
{{ comment_form | crispy }}
<input type="hidden" name="parent_id" value="{{ comment.id }}" >
<input type="submit" value="Reply" class="btn btn-inverse" >
</form>
</div>
</blockquote>
これらは私のスクリプト(私は念のために2つを含む)は次のとおりです。
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script src="http://code.jquery.com/jquery-3.1.0.slim.min.js" integrity="sha256-cRpWjoSOw5KcyIOaZNo4i6fZ9tKPhYYb6i5T9RSVJG8=" crossorigin="anonymous"></script>
私はこのエラーを取得しています:
TypeError: $(...).parent(...).next(...).fadeToggle is not a function
私はビデオ
のいずれかを参照してください。また、スリムなファイル参照を削除します、あなたが '' –
私はグーグルしかし、まだ結果がありません。 –