Div refresh .load () метод. Ошибка не найдена - PullRequest
0 голосов
/ 26 февраля 2019

У меня проблема с обновлением Div.Идк, где моя проблема.и говорит, что проблема не найдена1004 *

<!DOCTYPE html>
{% load static %}
<html>
    <head>
        <meta charset="utf-8">
        <title>{% block title %}kobby chat {% endblock %}</title>
        <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/emojionearea/3.4.1/emojionearea.css">
        <script
  src="https://code.jquery.com/jquery-2.2.4.js"
  integrity="sha256-iT6Q9iMJYuQiMWNd9lDyBUStIq/8PuOW33aOqmvFpqI="
  crossorigin="anonymous"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/emojionearea/3.4.1/emojionearea.js"></script>
        <Link rel="stylesheet" href="{% static 'chat/style.css'%}">
    </head>
    <body>
        {% include 'chat/navbar.html' %}   
        <div id="refresh" class="container-fluid">
                
            {% block content %}
            {% endblock %}
        </div> 
    
        <script type="text/javascript">
        $(document).ready(function(event){
          $("#text").emojioneArea({
                pickerPosition:"bottom "
            })
            $('#auto').load('chat.html');
            refresh();
            });
 
            function refresh()
            {
            	setTimeout( function() {
	              $('#auto').fadeOut('slow').load('chat.html').fadeIn('slow');
	                 refresh();
                	}, 5000);
            }
          
    
       
        </script>
        
        <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
        <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
    </body>
</html>

и следующая часть для этого

{% extends 'chat/base.html' %}
{% block title %}{{post.title}} | {{block.super}}{% endblock %}

{% block content %}

<h3>
    {{post.title}}
</h3>
<small>Chat created by Kobby</small>
<p>{{post.body}}</p>



<form method="post">
    {% csrf_token %}
    
    <textarea id="text"  name="content" cols="40" rows="10" maxlength="160" required="" id="id_content" style="margin-top: 0px; margin-bottom: 0px; height: 35px;"></textarea>
    {% if request.user.is_authenticated %}
    <input type="submit" value="Sumbit" class="btn btn-outline-success" />
    {% else %}
        <input type="submit" value="Sumbit" class="btn btn-outline-success" disabled/>
    {% endif %}
</form>
<div id="auto" class="main-comment-section">
    
    {% include 'chat/chat.html' %}
</div>

{% endblock %}

Тогда окончательно

{{comments.count}} Chat message{{comments|pluralize}}
    {% for comment in comments %}
    
    <blockquote class="blockquote">
        <p class="mb-0">{{comment.content}}</p>
        
        {% if comment.user.is_staff  %}
        <footer class="blockquote-footer">by <cite title="Source Title" style="color:red;">{{comment.user|capfirst}}</cite></footer>
        {% else %}
        <footer class="blockquote-footer">by <cite title="Source Title">{{comment.user|capfirst}}</cite></footer>
        {% endif %}
    </blockquote>
    {% endfor %}

Я думаю, у меня проблема с URL-адресами, такими как метод .load (), я пробовал разные URL-адреса, но тот же результат.Может быть, мне нужен какой-то другой metaof для обновления HTML-кода

...