This commit is contained in:
William 2022-04-04 16:08:39 +00:00
parent b0e23a9d61
commit e69aaeb720
2 changed files with 10 additions and 5 deletions

View File

@ -1,8 +1,12 @@
<h1>Live resultater</h1> <h1>Live resultater</h1>
<br> <br>
<div id="ranking-table"> <noscript>
Denne siden krever JavaScript
</noscript>
<div id="ranking-table">
Laster inn...
</div> </div>
<script> <script>
@ -44,12 +48,14 @@ async function updateTable()
table_html += "<tr>"; table_html += "<tr>";
table_html += "<td>" + element.name + "</td>"; table_html += "<td>" + element.name + "</td>";
table_html += "<td>" + element.rounds + "</td>"; table_html += "<td>" + element.rounds + "</td>";
table_html += "<td>" + element.bestTime + "</td>"; table_html += "<td>" + element.date + "</td>";
table_html += "</tr>"; table_html += "</tr>";
}); });
table_html += "<table>"; table_html += "<table>";
console.log(data);
document.getElementById("ranking-table").innerHTML = table_html; document.getElementById("ranking-table").innerHTML = table_html;
} }

View File

@ -26,8 +26,7 @@ foreach ($times as $time)
$row = [ $row = [
"name" => $team->name, "name" => $team->name,
"rounds" => $team->rounds, "date" => $time->date
"bestTime" => $team->bestTime
]; ];
array_push($data, $row); array_push($data, $row);