SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Dec 2005
    Posts
    381
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Real Time update total count results number

    Please help!
    Can anyone tell me how to get a number to update realtime on a site?
    What I'm looking for is used on the following website:

    New & Used Cars For Sale - Arnold Clark

    The number with the top vehicle search update when a user makes any of the selections in the form.

    I think I know how to get the number to update via php and mysql queries on the db but how can I get the effect where the number rolls to the newly updated total?

    Any help very much appreciated, I'm in a bit of a fix with this one!!

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,717
    Mentioned
    103 Post(s)
    Tagged
    4 Thread(s)
    You would use setInterval to occasionally run an ajax to request of a php page that provides the number, and on successful completion of the request you would then update that part of the page.

    The Bulletproof Ajax book is the best resource I've found for learning how to do that.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


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
  •