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
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!