IE how to detect page not found

  • Thread starter Thread starter Richard Bell
  • Start date Start date
R

Richard Bell

In IE when a page does not load it displays one of several error
messages. Sometimes it's "Error 404", other times it's "We can't find
....".Is there a way to detect this event without examining the page
text.
 
Web servers by standard conventions, are to return Error 404, File Not
Found.

Web Administrators have the option to change the message that is displayed
through a custom error message. However, the code returned must still be a
404.

There are various references on the Net to the HTTP standards and codes that
are returned by web servers. They indicate what each code means. There are
error codes in the range of 100's, 200's, 400's and 500's that are the most
common.

The 400 range specifies errors such as 404 File Not Found, or even other
errors related to authentication failure.

At any rate, they all return the same erro number for file not found,
regardless of the custom error message. These errors are communicated
outside of the page text.

Hope that helps.
 
Thanks Gerry, it does. I've not been able to find the HTTP return
code in the IE object. For the moment I'm catching the NavigateError
event - it seems to work. Are you aware of where in the
SHDocVW.InternetExplorer object I can check the return codes?

Thanks
 
Thanks Gerry. Of course on actually reading the code I discovered
that the StatusCode comes through as part of the navigate error event
.... connect brain before typing. Somewhat to my surprise, I'm unable
to find it in IE's data structure. Am I missing something?

Richard
 
Back
Top