SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Mar 2007
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How ajax chess Work ?

    I try multi player ajax Chess from http://www.linuxuser.at/chess

    When i play the game, if i move the king then in my opponent board, the move that i make will be immediately update. Can anybody explain hot it work ? If this using setTimeout ?
    Last edited by 2mk; May 13, 2008 at 18:12. Reason: incomplete

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,705
    Mentioned
    102 Post(s)
    Tagged
    4 Thread(s)
    On your side it may look like it's updated immediately, but on the other side it could take some time to update, and you're assumption is right, a timeout of about five seconds could check the server for any updates without hogging things too greatly.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Member
    Join Date
    Mar 2007
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So if we create multi player game like Ajax chess, we must use setTimeout to update the board. I just wondering, if the board only update when the player make move.

  4. #4
    SitePoint Wizard Pepejeria's Avatar
    Join Date
    Jan 2005
    Location
    Too far up north
    Posts
    1,566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Using timers is one solution, the other solution is to use a server that supports Comet.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •