473,598 Members | 2,978 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Testing for page load error

2 New Member
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 1581
acoder
16,027 Recognized Expert Moderator MVP
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 New Member
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 New Member
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 Recognized Expert Moderator MVP
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
1330
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 minutes and right the ASP page returns: Microsoft OLE DB Provider for SQL Server error '80004005' SQL Server does not exist or access denied.
6
3243
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 erroring out. I see two different errors. One is a "Object reference not set to an instance of an object." error, which appears to always contain the same information, and the other is a "There is no row at position X.", where X is a number. Is this...
2
9734
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 a load on my application? In the past, we would write our class and then come up with some logic in a console or win app to test it. I have since found NUnit which seems to be pretty cool. BTW: if anybody has some XSLTs that provide...
0
1549
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 to an Oracle database. NUnit is our unit testing framework, and I want to test the creation of a user in the database. NUnit loads the web.config file just fine, and can connect to the database using configuration settings. I can...
4
1721
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 it on IIS on Win 2003. But even on subsequent page requests, there can be a good 1/4 - 1/2 second before the page comes up. And this is with web browser and server on the same LAN and nothing else happening on either computer. I can't believe...
2
1449
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 seems to be more for load testing. What I would like is something similar, where you can record a variety of scenarios and play them back to see if the right information is going into databases and looks right on the screen, doesn't throw error etc....
2
1208
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 dynamically loaded controls on the page. So what I did was first create a page with two buttons. First button will load a Label control into a placeholder. After execution and clicking the button the label shows in the page.
18
2376
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 that great. One of the cons of ASP & Javascript is that they're both interpreted, which means one has twice the amount of work to do interms of syntax checking & semantic/runtime checking. Another bad thing is that ASP & Javascript doesn't have...
11
2349
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 realized that despite suggestions to use DHTML-based modal dialogs are very common? there is not a single fully functional reliable copyright-free cross-browser alternative to say MsgBox (VBScript) or showModalDialog (IE). This way such suggestions up to...
0
7981
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
0
7894
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8284
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8392
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8046
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8262
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5437
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3938
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1500
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.