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

180
Vistas
Is there a way to know does Link to pdf will not work on click?

I have a.href link that triggers the URL which returns the PDF and displays it in a new tab.

Is there a way to know does that link will generate the pdf or will work?

I want to display an error message to the user if the URL does not work or a pdf is not generated.

Is that possible?

      <a
        href={URL}
        rel="noopener noreferrer"
        target="_blank"
        download
      >
        PDF DOCUMENT
      </a>
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can use fetch to send request and get the response and then check to see it is a valid response or not:

const requestOptions = {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({ id: 'fileId'})
    };
fetch('https://reqres.in/api/posts', requestOptions)
    .then(response => response.json())
    .then(data => {
         //here check to see data is valid or not
   });
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