Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

http error code handling.

Status
Not open for further replies.

chebbi

Programmer
Feb 6, 2002
98
IN
Hi

Is there a way in javascript to handle http errors. Like once the page loads at the start of the page can i have a script tyo detect a particular http code generated by the page and take actions accordingly like redirecting to a different page or something.

Typically i would like to handle http error code of 500.

Thanks

Badrinath Chebbi
 
i would say no:

1. the http status codes are in the header. js has no access to header info.
2. js is client side - the browser or server is going to send you to its own error page first before the requested (non-existent in the case of 404) page is loaded.

if you want to set up your own custom error pages, this is typically done on the webserver.


=========================================================
-jeff
try { succeed(); } catch(E) { tryAgain(); }
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top