I have an application that uses a mobile ad provider; the way ad provider works is that I make a request on the server side, the provider returns me the mark-up and I include that on my site.
In order to make the load page faster (which is a requirement that I don't control), I have an AJAX call to my server which then makes the call to the server side, returns the markup and I include the markup on my mobile view.
Most of the time, the markup I receive is a <img>
or something similar.
However, when I receive a ad markup with <script>
that make another call dynamically to receive the ad, the markup I receive from the dynamically loaded <script>
ends up replacing the entire view; leaving with me just the ad.
I have tried a few things around it but haven't been successful so far. Is there anything I can do make sure the dynamically received markup doesn't end up replacing the entire page contents?