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

196
Vistas
Listen/Wait for external XHR Response to load own function/script (Plain JS)

I try to find a simple way to wait for a certain xhr response until I call my function/script.

I'm working with Adobe Target and want to make sure that on a certain page a capability is fully loaded before I start my script. In this case I cannot listen to changes in the DOM, but need to make sure, that a response from a request, I do not activly trigger, is already in place.

Let's say I want to

  1. Wait for XHR Response from the url: /api/a
  2. Wait for fetch Response from the url: /api/a
  3. Wait for a XHR Response and make sure a certain file is loaded (url: /voucher.php)
  4. Wait for a fetch Response and make sure a certain file is loaded (url: /voucher.php)

I really can't find a solution on this. I read this article: https://dmitripavlutin.com/catch-the-xmlhttp-request-in-plain-javascript/

— But i simple do not understand how it works and how I define the specific request I would like to listen to.

I hope anyone can help. Thank you!

about 4 years ago · Juan Pablo Isaza
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