Re: Iconize weather info and something else
Brought to you by:
iridium
From: Ray v. B. <r_v...@ho...> - 2002-02-10 08:48:49
|
Kristian, I've started doing some experiments with Javascript and php, but then I realized that I did things in the wrong order. It is important to know that php is executed first on the server, that results in a page that is 'executed' in the browser. I think that this construction is of no use: the page loads only in the browser when the php script has received the metar data. I reread Kristians suggestion and I think you mean this: It should be possible to have a webpage (nr-1) that contains: - a text 'Retrieving data...' with some id/name (dhtml-tag) in that part. - 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. - some other javascript that cyclicly tests metar-variable. Once set, it updates the 'Retrieving data...' text via the id/name tag and closes the nr-2 page. This same script can check for timeouts: When the page nr-2 does not come (while the php does not execute, or the noaa server cannot be found, or whatever), the nr-1 page cyclic javascript can terminate the second page and display something like 'Metar data not found...'. I think that is what Martin meant. Some Javascript questions though: - is it possible to have two webpages (one started by the other) from which a Javascript can access data from the other? - If inter-webpage communication via Javascript is not possible, maybe the same could be accomplished by frames in stead of pages? I am willing to try this, but let me know if the above is correct... Greetz, Ray _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. |