I am wondering if you can check if a page exists and if it doesn't to handle for that.
for example. I want to know if the woowho.htm page is in the secure folder. so maybe I check
if(secure/woowho.htm exists) {
location.href woowho.htm
}else{
location.href = oops.htm
}
I guess I want to know if I get a error 404 from going to the woowho.htm page.
Thanks.
Michael
joh6nn
11-22-2004, 10:42 PM
this might be possible on newer browsers. but before i start giving you the code that MIGHT work on newer machines, let me ask more specifically what you're trying to do. this is just a piece of the project, it sounds like. what's the whole project? in what context are you trying to use this?
this might be possible on newer browsers.
it might? don't see how, unless you're gonna use XML over Http to ask a serverside script to check, and then return a yay or nay.
joh6nn
11-23-2004, 07:07 PM
that's what i was thinkin' of alright, but since i've never had need of that method, i'm not sure how it will react to a 404. on the other hand, depending on what he's trying to do, there might be simpler ways to go about this.
glenngv
11-24-2004, 05:36 AM
You can use XMLHTTP in javascript to check the returned HTTP status of the request.
But as joh6nn said, there might be simpler ways to do this, specifically without any scripting involved. For instance, you can set custom 404 page in the server, so any request for non-existing pages, the custom 404 page will be displayed.
i got the impression he was wanting to check for the existence of external pages, and would needed to have pinged the third party's server. hence using JS to call Perl or PHP.