469,323 Members | 1,238 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,323 developers. It's quick & easy.

Testing for page load error

2
I'm trying to writing a javascript function/webpage that is accessed over a local network.

What I want to know is there any way I can test if the server machine (windows box running apache 2) is live before refreshing the page

or to trap an error message that the server timed out etc, while trying to access the page, using javascript.

Basically I want to prevent the page displaying an error message and hanging, but to be able to trap the error and then try again later.


Robert
Aug 17 '07 #1
4 1423
acoder
16,027 Expert Mod 8TB
Make an AJAX request and check the status. If you don't get back 200 (OK), then you can deal with each status in the appropriate way. See example (see section on "Does a url exist?").
Aug 17 '07 #2
jx2
228 100+
Make an AJAX request and check the status. If you don't get back 200 (OK), then you can deal with each status in the appropriate way. See example (see section on "Does a url exist?").
thanks - great staff
just remember to make it cross browser...

regards jx2
Aug 17 '07 #3
bobdew
2
Make an AJAX request and check the status. If you don't get back 200 (OK), then you can deal with each status in the appropriate way. See example (see section on "Does a url exist?").
Thanks for pointing me in the right direction.

That works great

Robert
Aug 18 '07 #4
acoder
16,027 Expert Mod 8TB
You're welcome. Glad you got it working.
Aug 18 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by Shabam | last post: by
2 posts views Thread by Curtis Justus | last post: by
reply views Thread by Cooper Blake | last post: by
4 posts views Thread by =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?= | last post: by
2 posts views Thread by Chris | last post: by
2 posts views Thread by Lloyd Sheen | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Gurmeet2796 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.