Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

194
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!