Javascript SSE message notifications in reverse order

Viewed 40

I have a message notification section on my html page that receives notifications. How could I modify this code to have new modifications inserted in reverse order?

var ul = document.getElementById("out");
var eventSource = new EventSource("/stream_game_channel");
eventSource.onmessage = function(e) {
  ul.innerHTML += e.data + '<br>';
};
<ul id="out" cols="85" rows="14"></ul>
<br>
<br>

0 Answers
Related