Good afternoon, there was a problem, there is a block in the admin panel, with live output of new messages from the history on jquery
The response from the server is formed as follows:
for ($i=0;$i<$c;$i++) { $msg .= $icq[$i]['uid'].'>> '. $icq[$i]['msg'].'<br>'; } echo $msg;
inserting a response into a block occurs every 3 seconds with the following code:
function go() { var count = document.getElementById("box"); if(count != null) $.ajax({ url: 'http://site.ru/api/', success: function(data) { $("#box").text(data); } });
setTimeout (go, 3000); }
var update = go ();
The problem is as follows: each new message from the history was planned to be output from a new line. To do this, at the end of each iteration of the loop, <br> is inserted into the response, but the messages are displayed as follows:
message 1
<br>
message 2<br>
message3<br>
Tell me how to remove <br>
and make a normal line break?
$("#box").html(data);
- zb '