Please tell me the example of this markup:

<div '.$title.' '.$bg.' > <!-- Message. Default to the left --> <div class="direct-chat-msg"> <div class="direct-chat-info clearfix"> <span class="direct-chat-name pull-left"> </span> <span class="direct-chat-timestamp pull-right"> <form method="post" action=""> <b> '.$p.' <i>'.$result['tema'].' </i></b> '.$sta.' '.$datetime.' </span> </form> </div> <!-- /.direct-chat-info --> <img class="direct-chat-img" src="/img/'.$result['foto'].'.jpg" alt="Message User Image"><!-- /.direct-chat-img --> <div class="direct-chat-text"> '.$result['mes'].' </div> <!-- /.direct-chat-text --> </div> <!-- /.direct-chat-msg --> </div> 

In the script, a div is specified for display, as I understand it, you need something like this:

  $("#dtr").append("указать div с id записи или как?"); 

If you specify html, it duplicates

  function show() { $.ajax({ url: "../../ajax/select/dialog.php", cache: true, success: function(html){ $("#dtr").append(html); } }); } $(document).ready(function(){ show(); setInterval('show()',3000); }); 

Thank)

  • write what you want to do - Igor
  • @Igor Displays messages every 3 seconds, so that not just everything is updated, namely the addition. Now I use $ ("# dtr"). Html (html); and in this situation the text is not highlighted, since everything is updated. - Victor Muravyov
  • why are you not satisfied with append ? - Igor
  • @Igor Here I look at function addParagraph (i) and what should I do with this function? Display "<p> test" + i + "</ p>"? I want that there was an output from dialog.php, and that probably does not suit me, I want to understand how to specify js so that it doesn’t update everything, but add something new from php, in fact, this question was - Victor Muravyov
  • what is not satisfied with the append that you now have in the code? - Igor

0