Hi,
I have a simple problem here but i have no idea how i can do it with javascript.
I have a php script which will grab data from database from time to time (Server Sent Events) and i use ajax to display those data without refreshing the page.
I also use ajax to write it to a div container but the problem is, when there is 1 new data inserted into the db, the javascript will print
data1 : this is data 1
and when there is another data came in after few seconds, it will display it like this :
data1 : this is data 1
data2 : this is data 2
what i want is to show the data2 first and then follow up by data 1. I want the new data to shwo first, is like how we do in sql ORDER BY something DESC
Is this posible?
Thanks in advance! If wanna see my code, do ask me as i will provide it here. Thanks again. :)