XML.com: XML From the Inside Out

XML.comWebServices.XML.comO'Reilly Networkoreilly.com
  Articles | Weblogs | Newsletter | Safari Bookshelf
advertisement

Article:
 Very Dynamic Web Interfaces
Subject: Data the other way round
Date: 2005-04-30 22:56:19
From: Mahsood
Response to: Data the other way round

for example i want to have the stock market feed on my website..........

Previous Message Previous Message Move up to Parent Message Up Next Message No Next Message


Titles Only Titles Only Newest First
  • Data the other way round
    2005-05-03 09:55:58 sunnyO5 [Reply]

    Well, you can use polling: contact the server at regular intervals, say 1 minute, assuming some other process updates the stock information. If the server detects that there is a change (elaboration below), then it sends a new information in response; otherwise, old one stays on the user's screen.


    One way the server could detect a change is if you also send a time stamp (hidden input field could store this) when the user first browses the web page. The time stamp would have the time when the server information was last changed. So when you refresh stock information after a specified amount of interval, the time stamp is sent to the server, which compares it to the time stamp that it (server) has. If the server version is newer, then new stock is sent; else nothing.


    I haven't implemented this in practice, but this should work.

Sponsored By:


Contact Us | Our Mission | Privacy Policy | Advertise With Us | | Submissions Guidelines
Copyright © 2008 O'Reilly Media, Inc. | (707) 827-7000 / (800) 998-9938