I'm trying to have the newest messages pulled into the page on top. Currently the newest messages are going underneath each time a new message comes in.
<script>
if(typeof(EventSource)!=="undefined")
{
var source=new EventSource("sse/lup.php?");
source.onmessage=function(event)
{
document.getElementById("lup").innerHTML+=event.data;
};
}
else
{
document.getElementById("lup").innerHTML="Sorry, your browser does not support server-sent events...";
}
</script>