Устанавливать код внутри тега <head></head> в HTML-код страницы.
<script type="text/javascript" src="//xml.ip-games.ru/jsApi/1,2,3,4,5" charset="utf-8"></script>
1,2,3,4,5 - ID серверов в системе ip-games.ru
Устанавливать код внутри тега <body></body> в HTML-код страницы.
<strong>Название:</strong> <script>document.write(gm_SERVER_ID.hostname);</script><br/>
<strong>IP адрес:</strong> <script>document.write(gm_SERVER_ID.address);</script><br/>
<strong>Онлайн:</strong> <script>document.write(gm_SERVER_ID.players);</script> / <script>document.write(gm_SERVER_ID.maxplayers);</script><br/>
<strong>Игра:</strong> <script>document.write(gm_SERVER_ID.game);</script><br/>
<strong>Карта:</strong> <script>document.write(gm_SERVER_ID.map);</script><br/>
<strong>Ping:</strong> <script>document.write(gm_SERVER_ID.ping);</script> ms<br/>
<strong>Аптайм:</strong> <script>document.write(gm_SERVER_ID_.uptime);</script><br/>
<strong>Статус:</strong> <script>if (gm_SERVER_ID.status == 1){document.write("<font style='color: green;'>Онлайн</font>");} else {document.write("<font style='color: red;'>Оффлайн</font>");}</script>
http://xml.ip-games.ru/jsApi/SERVER_ID,SERVER_ID,SERVER_ID
Готовый пример: http://xml.ip-games.ru/mon.html
Разбор параметров JS:
Типы ошибок:
Смотрите также: