This is basic AJAX programming. There is A LOT of info on that on the
very wide web ;-)
Also the ajax-chat example shows exactly this.

An example piece of code is:

window.setInterval("updateChat()", 1000); // calls updateChat every second

function updateChat(ms) {
     var lm = document.getElementById("lastmsg");
    ajaxGet("getchat?lastmsg="+escape(lm.value), onReceiveChat);
}

Then in onReceiveChat you update the relevant parts of the page with
the data that you received from the server.

This stuff is not TNTNet specific. The client part is supported by the
javascript interpreter in your favourite browser, the server part is
just a basic HTTP GET request.

As for the cookies, they are not used to ensure that the other side is
still there. They are used to mantain state between client and server
sessions. Again this stuff is not TNTNet specific, it is standard HTTP
protocol implementation in your browser (the client) and in your
server (apache, TNTNet, etc). Read a bit about the HTTP standard, it
will help get a better grasp of what is happening.


On Wed, May 12, 2010 at 9:21 AM, Ralf M. <[email protected]> wrote:
> Hi,
> I need to periodically (say every 5 seconds) update the
> displayed web page (or just a form therein). How can this be done?
> I guess one first must ensure that the other side is still
> there (cookie request?), and if that's positive then send the updated 
> page/form?
> Would be great if someone (hi Tommi! :) could show me a basic example, TIA.
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Tntnet-general mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/tntnet-general
>

------------------------------------------------------------------------------

_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general

Reply via email to