Hello, I am trying to use dreamlo leaderboard for the first time:
Did not work before with those http request, so I am confused.
Basically, I create a table in index.html as suggested on their site, and I hide it with CSS at the beginning.
<table class="dreamloLBTable">
<tr>
<th>Name</th>
<th>Score</th>
</tr>
</table>
Adding new user/score in .js file:
var username = "username";
var score = 50;
const Http = new XMLHttpRequest();
const url=`http://dreamlo.com/lb/privatekey/**add-pipe**/${username}/${score}`;
Http.open("GET", url, true);
Http.send();
After running this code I can see new entries in database on dreamlo site.
Then I make a table visible
Http.onreadystatechange = function() {
// table is visible now
}
The problem is that the last entry is not shown in the table (“username, 50” in this case). I have to refresh the page to see the latest entry.
What would be the easiest way to show the last entry without refreshing a page?