Answer the question
In order to leave comments, you need to log in
Changing a table dynamically
We have applications from players to start the game. For example, the game of checkers can be played by 2 people.
The user creates an offer to play and waits for the opponent, when the opponent joins, the user starts the game.
So for example we have a table:
<table id="proposal">
<thead>
<tr>
<th>№</th>
<th>Игрок</th>
<th>Опции</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Пользователь/или ожидание</td>
<td>Действия</td>
</tr>
<tr>
<td>2</td>
<td>Пользователь/или ожидание</td>
<td>Действия</td>
</tr>
</tbody>
</table>
['users'] = array(
'user' => 'avatar',
'sort' => 0,
'root' => 1,
),
array(
'user' => 'avatar',
'sort' => 1,
'root' => 0,
)
Answer the question
In order to leave comments, you need to log in
use something like this .
Its meaning is that such code, when executed by the client in the browser, periodically sends special requests to the server, receives the necessary data from it and changes the content on the page on the fly.
You may need to change the application paradigm to an event-driven one.
Then you won't need to update the views on a timer and create excessive load on the server.
This means that you may have to dig towards long polling, Ratchet, or even go radical and switch to node.js
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question