php - JavaScript HTTP Client that maintains session -


i have written little php scoreboard monitors mysql table realtime sports scores in it. users use loading page, reloads every 5 seconds. last-loaded scoreboard stored in session , compared current-loaded scoreboard. if player has changed ranking php script adds javascript page shows red or green highlight effect player depending on if lost or gained rank.

what i'm looking way write javascript script can host on site remote includable on other sites maintain session server, loading scoreboard every 5 seconds , displaying results, including highlighting of changed rank players.

basically guess need http client implemented in javascript can this. i've googled around there's lot of jargon parse. prefer not use jquery or whatever other library since these may present on remote sites , don't want cause conflicts. pure javascript solution ideal think.

there 2 approaches can think of when dealing scoreboard application: 1) using php + ajax + mysql great if application , database on same server, , amount of information returned ajax app small.

2) using websocket app such socket.io (http://socket.io/) or ratchet (http://socketo.me/) update information on scoreboard when there update.

i prefer using websocket method when dealing scoreboards because allows me custom alerts when there update.


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -