I have an AJAX XMLHttpRequest grid. I output it by innerHTML. I have a refresh function which triggers every 60 seconds retrieving fresh data. The problem is I use innerHTML += , which doesn’t work the way I want it, it adds the fresh data to the bottom. And i want it to put it to the top.
What is the best way to do that?
Try this:
Essentially, we’re getting the current text and putting the new content before it.