Re: Iconize weather info and something else
Brought to you by:
iridium
From: Martin G. <gim...@gi...> - 2002-02-10 09:55:26
|
"Ray van Beek" <r_v...@ho...> writes: > - some javascript. When this page has been loaded, the javascript > executes. The javascript should then generate a new 'page' (nr-2). > This nr-2 page contains php script that retrieves the metar data. > The nr-2 page comes to the browser only when the metar data has been > received and processed. The nr-2 page contains javascript (outputted > by the php) that sets a javascript metar-variable. I don't know very much about java(script), but I do know this: java(script) runs on the client and PHP runs at the server. The client will not be able to make a page nr-2 with come PHP code, as this code is executed only at the server. So I think the step above would fail. But I've seen several pages that redirect you to another page after 5-10 seconds. So we could make a page that says 'Retrieving data...', and then after 5 seconds the user is redirected to a page that displays the data. The first page should trigger the PHP code that retrieves the data, so that the data is ready 5 seconds later. It's just that this would impose a 5 seconds-penalty to every report shown, and it also makes the caching mechanisms useless. What we need is this: a way to update a page on the client at the moment data arrives. I don't know if java(script) can be run asynchronously in the background, so that the script could wait for data in the background (the same way as the browser waits for data in the foreground as it is now) and then update the right paragraph on the page when the data has arrived. > [...] -- Martin Geisler My GnuPG Key: 0xF7F6B57B See my homepage at http://www.gimpster.com/ for: PHP Weather => Shows the current weather on your webpage. PHP Shell => A telnet-connection (almost :-) in a PHP page. |