PDA

View Full Version : gracefully coding around network timeout


erdubya
08-06-2009, 06:14 PM
On my website I have a refreshing iframe (refreshes every 3-5 seconds). Every now and then after so many hours, the iframe will display a (ugly) generic page that shows the timeout... "network timeout" in firefox.

Is there a way to first tell if the page is accessible and if it is, display it normally. If the page is not, perform some sort of custom code to display a 'prettier' notice... i.e. "Server load is high, refreshing in a few moments"?

I'm attaching a screenshot from the latest network timeout error. The more I think about it, server side scripting might not be the best route to take, because if the server times out, nothing will be accessible. Maybe JavaScript/Ajax is the answer here.

Any ideas?

http://projectvibe.net/networktimeout2.jpg

erdubya
08-07-2009, 04:28 PM
Anyone?

I want to
1. see if the page is accessible.
2a. If it is, display it.
2b. If not, wait 30 seconds and repeat 1.