Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

175
Vistas
How can I catch a browser timeout and execute my own error message?

I have a web page (classic asp) with a link to a local IP address, as follows:

<a href="http://192.168.1.89">Link</a>

If the local IP address is unavailable the web browser eventually times out and displays its own error message.

What I want to do is: catch the timeout before the browser displays its default error page and display an error on the same web page, next to the "Link".

e.g. <a href="http://192.168.1.89">Well Pump</a><div id="timeoutmsg">offline</div>

I am guessing I need some JavaScript and the timeout function, but I don't know where to begin.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Found this awesome workaround using pure javascript, no JScript, no ajax, no external libraries.
Works at treat:
Just need to upload a "test.gif" file to the local site(s).

var url = 'http://192.168.1.89';
var img = new Image();
img.src = url + '/test.gif';
img.onload = function() {
    document.getElementById("msg").innerHTML = "";
    window.location.href = url;
}
img.onerror = function() {
    document.getElementById("msg").innerHTML = "offline";
}
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda