473,385 Members | 1,901 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 1574
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

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

Similar topics

1
by: ccg | last post by:
In ASP (vbscript) is there a way to check to see if a SQL server is online before trying to open a connection? I have a situation where we have a SQL server that may be offline for a couple...
6
by: Shabam | last post by:
A web application of mine developed using C# + MS SQL runs fine normally. However when I stress test it with a load testing software (using about 60 simultaneous users) some instances start...
2
by: Curtis Justus | last post by:
Hi, I've been searching for solutions to two issues that are undoubtedly common to everybody. The first is how do my team and I adequately perform unit testing. The second is how can I measure...
0
by: Cooper Blake | last post by:
Hello, I'm trying to unit test an asp.net application. We are using the .net 2..0 authentication / loginView, etc. web controls, with a customized MembershipProvider (MP) class to connect...
4
by: =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?= | last post by:
Hi; We need to loadtest our ASP.NET app. So two questions: 1) With just one user, it is slow. Especially the first time we hit a page. This is pre-compiled and we use web deploy and then put...
2
by: Chris | last post by:
I am looking for web testing software. Can anyone recommend something, preferably not expensive. It also has to be useful for classic ASP as well as .net. I looked at ANTS, which I liked but it...
2
by: Lloyd Sheen | last post by:
Ok I have created a small testbed site for testing and I am have a problem with the terms Usercontrol, Webcontrol, etc. What I need to do in the long run is have a page using AJAX and having...
18
by: Andrew Wan | last post by:
I have been developing web applications with ASP & Javascript for a long time. I have been using Visual Studio 2003.NET. While VS2003 is okay for intellisense of ASP & Javascript, it's still not...
11
by: VK | last post by:
In the continuation of the discussion at "Making Site Opaque -- This Strategy Feasible?" and my comment at http://groups.google.com/group/comp.lang.javascript/msg/b515a4408680e8e2 I have...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.