404 detection in JavaScript
- by Vadim
In my JavaScript I'm trying to redirect to third party page. It can open a page either in a new window or inside a frame depends on a user settings. Something like this:
if (newWindow)
{
window.open(url, targer);
}
else
{
theFrame = url;
}
What I want to do is to display my custom page in case a third party site is down or page is unavailable. Basically in case of 404 error.
What's the best way to solve this problem?