Currently, we are facing a challenge in loading an ad after an ajax load more. The ad call response contains document.write, which redirects to the ad itself once the call is made. Unfortunately, there is no straightforward method to only get the ad html and append it without dealing with document.write in the ajax success function. I have come across something related to using iframes but unsure about how to implement it.
$.ajax({
.
.
.
success: function( response ) {
var loadedAd = ad call here; -- however, it redirects due to document.write in the ad response.
Any guidance on this issue would be greatly appreciated. Thank you.